{"id":20725037,"url":"https://github.com/sartaj0/textrecognition-pytorch","last_synced_at":"2026-05-02T11:38:51.425Z","repository":{"id":255150251,"uuid":"423833003","full_name":"sartaj0/TextRecognition-Pytorch","owner":"sartaj0","description":"Text recognition with Pytorch(CRNN). Provided Onnx model.","archived":false,"fork":false,"pushed_at":"2022-02-01T10:14:32.000Z","size":28,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-17T23:28:08.157Z","etag":null,"topics":["crnn","dnn","ocr","onnx","opencv","opencv-dnn","pytorch","text-recognition"],"latest_commit_sha":null,"homepage":"https://cv-project-deployed.herokuapp.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sartaj0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-02T12:22:14.000Z","updated_at":"2024-08-15T14:04:33.000Z","dependencies_parsed_at":"2024-08-28T09:46:30.988Z","dependency_job_id":"1c35ac17-f145-4e3d-9cff-5c502399df15","html_url":"https://github.com/sartaj0/TextRecognition-Pytorch","commit_stats":null,"previous_names":["sartaj0/textrecognition-pytorch"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sartaj0%2FTextRecognition-Pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sartaj0%2FTextRecognition-Pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sartaj0%2FTextRecognition-Pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sartaj0%2FTextRecognition-Pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sartaj0","download_url":"https://codeload.github.com/sartaj0/TextRecognition-Pytorch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243004063,"owners_count":20220235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crnn","dnn","ocr","onnx","opencv","opencv-dnn","pytorch","text-recognition"],"created_at":"2024-11-17T04:17:03.665Z","updated_at":"2025-12-24T11:08:19.706Z","avatar_url":"https://github.com/sartaj0.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TextRecognition-Pytorch \n\n## Onnx Model\nFrom [here](https://drive.google.com/drive/folders/12S3AVgnK-hnjQvKHNyTiTIEIm_5MA7G3?usp=sharing) you can download onnx converted model and use this [file](https://github.com/sartaj0/TextRecognition-Pytorch/blob/main/inferenceWithOnnx.py) for inferencing with opencv. \n\n## Dependency \n- pytorch 1.8.1, CUDA 10.2 \u003cbr\u003e `pip3 install torch==1.8.1+cu102 torchvision==0.9.1+cu102` \n- Requirements: Pillow, opencv-python, tqdm, matplotlib, nltk \u003cbr\u003e `pip3 install Pillow opencv-python tqdm matplotlib nltk` \n\n\n## Dataset \nDownload dataset from from [here](https://drive.google.com/drive/folders/1SGNmiD6FvZFS3Qjk5DILIQFTFi_vSx0g?usp=sharing)\ndata.zip contain below data. \u003cbr\u003e \n[IIIT5k](http://cvit.iiit.ac.in/projects/SceneTextUnderstanding/IIIT5K.html)[1] [ic17](https://rrc.cvc.uab.es/?ch=8)[2] [ic03](http://www.iapr-tc11.org/mediawiki/index.php/ICDAR_2003_Robust_Reading_Competitions)[3] [IAM Handwriting Database](https://fki.tic.heia-fr.ch/databases/iam-handwriting-database)[4]\n\n\n## Training and Inference \n\n#### Dataset Format \n```\nfolder\n├── data.json\n└── data\n    ├── word_1.png\n    ├── word_2.png\n    ├── word_3.png\n```\n\nAt this time, `data.json` should be `{imagename: label, }` \u003cbr\u003e \nFor example `{word_1: label, ...}` \u003cbr\u003e\n#### 1. Train \n\nSet The Paramters \n```\nfrom train import *\ndata_path = \"E:/dataset/TextRecognition/MixedAll/data\"\njsonFilePath = data_path+\".json\"\n\nmodel_save_directory = \"check_points\"\nbatch_size = 32\nrnn_hidden_size = 256\ncnn_output_channel = 512\nnum_epochs = 50\nmodel_backbone = \"resnet18\"\nimgSize = (50, 200)\n# imgSize = (32, 100)\nimgChannel = 1\nlr = 0.000087\ntrain(imgSize, imgChannel, data_path, jsonFilePath, model_backbone, model_save_directory, num_epochs, cnn_output_channel, rnn_hidden_size, batch_size, lr)\n```\n\u003cbr\u003e\n\n#### 2. Validation \nFrom training data it will use 20% images for validation \u003cbr\u003e\n\n\n#### 3. Inference \nOnce the training is completed it will use the best model for onnx conversion\nyou can use [inferenceWithOnnx.py](https://github.com/sartaj0/TextRecognition-Pytorch/blob/main/inferenceWithOnnx.py) for inferencing with opencv. \n\n![](https://github.com/sartaj0/GIfs/blob/main/2.jpg) \u003cbr\u003e \noutput: `develop` \u003cbr\u003e \n\n\u003cimg src=\"https://github.com/sartaj0/GIfs/blob/main/q.jpg\" width=\"500\" title=\"failure cases\"\u003e \u003cbr\u003e\noutput \u003cbr\u003e\n\n***\ndassmate 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\n***\n```\n@InProceedings{MishraBMVC12,\n  author    = \"Mishra, A. and Alahari, K. and Jawahar, C.~V.\",\n  title     = \"Scene Text Recognition using Higher Order Language Priors\",\n  booktitle = \"BMVC\",\n  year      = \"2012\",\n}\n```\n## References\n\n- [zihaomu](https://github.com/zihaomu/deep-text-recognition-benchmark) \n- [gokul karthik](https://www.kaggle.com/gokulkarthik/captcha-text-recognition-using-crnn-in-pytorch) \n- [nanonets](https://nanonets.com/blog/deep-learning-ocr/) ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsartaj0%2Ftextrecognition-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsartaj0%2Ftextrecognition-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsartaj0%2Ftextrecognition-pytorch/lists"}