Skip to content

sartaj0/TextRecognition-Pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TextRecognition-Pytorch

Onnx Model

From here you can download onnx converted model and use this file for inferencing with opencv.

Dependency

  • pytorch 1.8.1, CUDA 10.2
    pip3 install torch==1.8.1+cu102 torchvision==0.9.1+cu102
  • Requirements: Pillow, opencv-python, tqdm, matplotlib, nltk
    pip3 install Pillow opencv-python tqdm matplotlib nltk

Dataset

Download dataset from from here data.zip contain below data.
IIIT5k[1] ic17[2] ic03[3] IAM Handwriting Database[4]

Training and Inference

Dataset Format

folder
├── data.json
└── data
    ├── word_1.png
    ├── word_2.png
    ├── word_3.png

At this time, data.json should be {imagename: label, }
For example {word_1: label, ...}

1. Train

Set The Paramters

from train import *
data_path = "E:/dataset/TextRecognition/MixedAll/data"
jsonFilePath = data_path+".json"

model_save_directory = "check_points"
batch_size = 32
rnn_hidden_size = 256
cnn_output_channel = 512
num_epochs = 50
model_backbone = "resnet18"
imgSize = (50, 200)
# imgSize = (32, 100)
imgChannel = 1
lr = 0.000087
train(imgSize, imgChannel, data_path, jsonFilePath, model_backbone, model_save_directory, num_epochs, cnn_output_channel, rnn_hidden_size, batch_size, lr)

2. Validation

From training data it will use 20% images for validation

3. Inference

Once the training is completed it will use the best model for onnx conversion you can use inferenceWithOnnx.py for inferencing with opencv.


output: develop


output


dassmate date page the water cucle is thie palith that al watey follows as at moves asound eanth in dpfestent ptat liouid water hound in oceans o rivers akee and even under raround solid iee ie found is alaciers onow and at the nortr and south sboles water vadoy a aas do found in farlhs atmos here the sun heat causce alaceers and snow se te melt into liouid water this watey sanpe intt oceans lakes and streams watey foom ce melbino snow and pe rlkd aoes iito e tthe 50ic tiere at suddlie water st tos folants and the around waa ter that ce we drink worrmi uaterr na bouy siscs up throuan easltis atmuss ene as the watey vaour viscs hiaher and hiahea the cool air ot the itmos causes the waler vapoly to ttuyn back snte lrauid water creatina clouds this brocess i5 called condenstin uhen a cloud be fuu a lrouid usater it falle toom the skn as rain


@InProceedings{MishraBMVC12,
  author    = "Mishra, A. and Alahari, K. and Jawahar, C.~V.",
  title     = "Scene Text Recognition using Higher Order Language Priors",
  booktitle = "BMVC",
  year      = "2012",
}

References

Releases

No releases published

Packages

No packages published

Languages