Skip to content

laksh9950/Attention-Based-Ocr

Repository files navigation

Laxya Agarwal-IITB-Assignment

For running RestAPI webapp simply do https://laxyaattention.onrender.com

python app.py

This project builds an Attention-OCR Model by generating synthetic data and training it on aocr. Please check out my saved model it is givig 99% accuracy , File Structure: ./out showing the model performance on test data

./ loss graph showing the loss

loss graph

./ test results on real world data

test results

./Background_Images_and_Fonts
Consists of different background images and font list which are necessary while implementing text-renderer

./attention-ocr-master
It's a github repo by user "emedvedev" and can be located here : https://github.com/emedvedev/attention-ocr It's been modified according to the requirements and modifications are mentioned in the report as well as instructions.txt

./checkpoints
It has the generated checkpoints while training.

./datasets/synthetic
It contains sample images which I've used while training and validating. Keep in mind there were ~35K files but due to GitHub limitations I am only able to upload 1000 images. But the requirement can be satisfied by implementing commands from instructions.txt

./datasets
Alongwith synthetic folder, there are some files such as annotations, Jupyter Notebook to process them and tfrecords.

./exported-model
It contains different frozen graphs, but the one that I've used at the last is frozen_graph.pb. It's not been generated using built-in export from aocr, It's been generated using Exporting and Reusing Inference Graph AOCR.ipynb.

./static
It's just a reference folder for storing temporaring image files for our web-app.

./text-renderer-master
It's a github repo by user "Sanster" and can be located here : https://github.com/Sanster/text_renderer. Some preprocessing needs to be done to add corpus into the ./text-renderer-master/data/corpus which is not present currently in the repo due to upload limitations from GitHub. Steps to do that is mentioned in instructions.txt.

./App_Home_Page.png and ./App_Predicted_Page.png
It's an image of my Home Page and Predicted Page of the app. Referred from : https://cv-tricks.com/how-to/freeze-tensorflow-models/

./IITB-Assignment-Laxya Agarwal.pdf
Report for the assignment

./Procfile
For Heroku

./WEBAPP.ipynb
Jupyter Version of Web App

./aocr.log
Log of AOCR training, validating, predicting

./app.py
Web app, can be run using "python3 app.py" within the repo.

./instructions.txt
Step by Step instructions to run the project

./exported/frozen_graph.py
manually exported frozen graph

./my_run.sh TestImageFolderName OutputFileName
It executes by passing TestImageFolderName and OutputFileName. It might get an error so use

"aocr predict --dirpath TestImageFolderName --out_file_name OutputFileName --max-prediction 23 --max-height 48 --max-width 960 -"

./requirements.txt
For Heroku

./values1.txt
Example file after executing my_run.sh TestImageFolderName values1

About

OCR module from Scratch (Attention based OCR)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published