tensorflow / tensorflow/models

Inference for AttentionOCR model

Open
#10,293 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

models:research type:support
Dominant language
Python
Stars
77.7k
Forks
44.8k
PR merge metrics
No merged PRs in 30d

Description

Hi there!
I am trying to understand Attention OCR repo and its inference.
I have seen its input/output details -
image

it says, it takes (32) as string. I don't get this. What does it mean?
In demo_inference.py, there is run method-

def run(checkpoint, batch_size, dataset_name, image_path_pattern): images_placeholder, endpoints = create_model(batch_size,dataset_name) images_data = load_images(image_path_pattern, batch_size,dataset_name) session_creator = monitored_session.ChiefSessionCreator(checkpoint_filename_with_path=checkpoint) with monitored_session.MonitoredSession(session_creator=session_creator) as sess: predictions = sess.run(endpoints.predicted_text,feed_dict={images_placeholder: images_data}) return [pr_bytes.decode('utf-8') for pr_bytes in predictions.tolist()]

Here, it takes images_data which --
image
as batch_size is 1.

Please help me to know this better.
@leandroschelb

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue points to demo_inference.py, including run(), create_model(), and load_images(), plus linked input/output details. Start by reading that inference path and determine what the stated (32) string and batch_size=1 represent; done means documenting the input shape and its relationship to images_data clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
documentation, machine-learning
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.