CrowdPersona CP
CrowdPersona CP

Reputation: 21

ocr implementation in tensorflow

My requirement is i need to read OCR text from the image(jpg) using tensorflow. I tried by downloading the below project and tried to execute the code.

https://github.com/tensorflow/models/tree/master/attention_ocr

I am able to execute the train.py but unable to test the complete flow. I want to train and test 100 sample images. Could anybody share detail insight how to take it further.

FYI: Earlier i used the pytesser API but the accuracy was very low. It was not able to read text of various sizes.

Upvotes: 1

Views: 2779

Answers (1)

Alexander Gorban
Alexander Gorban

Reputation: 1238

To test a model on the FSNS dataset run

python eval.py --dataset_name=fsns --split_name=test

it will run the evaluation for --num_batches (default 100) times --batch_size images (default 32).

if you want to test it on your own data you have three options:

  1. Convert it into the same format as FSNS and define mynewdatasetname.py by reusing fsns.py
  2. Don't convert the data, but write a custom dataset file similar to the fsns.py (see the get_split function
  3. Write a custom script to export the trained model and a custom eval script/app to do the evaluation. Here are some tips for that

Please note that the Attention OCR model trained on the FSNS will be able to transcribe street name signs in France, not just random text.

Upvotes: 2

Related Questions