Comments (4)
哈哈我也想知道
from aster.
I am trying to do this myself, but I get a tf error:
self.aster_input_images = tf.placeholder(
dtype='uint8',
shape=[None, None, None, 3])
resized_image_tensors = tf.image.resize_images(
tf.to_float(self.aster_input_images),
[64, 256])
aster_model_config, _, _ = get_aster_configs()
aster = model_builder.build(aster_model_config, is_training=False)
predictions_dict = aster.predict(resized_image_tensors)
recognitions = aster.postprocess(predictions_dict)
The error is on this line:
predictions_dict = aster.predict(resized_image_tensors)
and as follows:
ValueError: The last dimension of the inputs to
Denseshould be defined. Found
None.
from aster.
@cbasavaraj I'm running into the same problem. Were you able to resolve it?
from aster.
Hi, sorry for the late response, was traveling. I haven't looked at this code in over eight months, but looks like I finally ran it one image at a time. Pasting the relevant code here. Hope it helps!
Defining:
`
graph_aster = tf.Graph()
with graph_aster.as_default():
print('Defining ASTER...')
self.aster_input_image = tf.placeholder(
dtype='uint8',
shape=[None, None, 3])
resized_image_tensor = tf.image.resize_images(
tf.to_float(self.aster_input_image),
[64, 256])
aster_model_config, _, _ = get_aster_configs()
aster = model_builder.build(aster_model_config, is_training=False)
predictions_dict = aster.predict(tf.expand_dims(resized_image_tensor, 0))
recognitions = aster.postprocess(predictions_dict)
recognition_text = recognitions['text'][0]
recognition_score = recognitions['scores'][0]
control_points = predictions_dict['control_points'],
rectified_images = predictions_dict['rectified_images']
self.aster_fetches = {
'recognition_text': recognition_text,
'recognition_score': recognition_score,
'control_points': control_points,
'rectified_images': rectified_images,
}
print('Loading ASTER from {}'.format(aster_model_path))
self.tf_session_aster = tf.Session(config=tf_config)
self.tf_session_aster.run([tf.global_variables_initializer(),
tf.local_variables_initializer(),
tf.tables_initializer()])
`
Inference:
`
for roi in rois:
aster_fetches = self.tf_session_aster.run(self.aster_fetches,
feed_dict={self.aster_input_image: roi})
word = aster_fetches['recognition_text'].decode('utf-8')
words.append(word)
prob = np.exp(aster_fetches['recognition_score'])
probs.append(prob)
roir = aster_fetches['rectified_images'][0]
roir = (128 * (roir + 1.)).astype(np.uint8)
roirs.append(roir)
`
from aster.
Related Issues (20)
- Error occered When i execute train.py: trainval.prototxt; No such file or directory HOT 1
- can not build the protobuf files HOT 2
- Testing speed is slow HOT 1
- cuda and cudnn HOT 1
- Disable the rectification network HOT 2
- tensorflow.python.framework.errors_impl.NotFoundError HOT 3
- ValueError: Unsupported input_reader_config: None
- Didn't manage to run eagerly
- Get character level confidence score HOT 2
- Migration to TF 2.0 HOT 2
- 说实话,demo真的烂 HOT 3
- does this work run on windows HOT 1
- ModuleNotFoundError: No module named 'aster' HOT 2
- cannot import name 'pipeline_pb2'
- make: *** No targets specified and no makefile found. Stop.
- which model has less inference time tensorflow or pytorch ? can any one share the inference time here .
- About pretrain model
- CANNOT EXECUTE demo.py HOT 2
- convert Aster to tensorflow serving? HOT 2
- 运行 train.py or demo.py 出现以下错误 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aster.