This repo is an End to End code that detection language in images and recognition Korean and English.
Download models
- craft_mlt_25k.pth
- The language detection model used craft's model.
- classifi_97.29.pth
- This is a Korean and English classification model learned using data from aihub.
- kor_reg_97.42.pth
- This is a korean recognition model learned using data from aihub.
- TPS-ResNet-BiLSTM-Attn.pth
- The English recognition model used clovaai's model.
Crop the video frame by frame and apply a morphology operation for increase the recognition rate.
Put your video name in video_name. (ex: ocr_test.mp4)
python video2img.py --video_name ocr_test.mp4
Also, you can use images, not video
the structures would like
~/OCR_kor_en/
-- model
-- craft_mlt_25k.pth
-- classifi_97.29.pth
-- kor_reg_97.42.pth
-- TPS-ResNet-BiLSTM-Attn.pth
-- sample_img
-- your_img.jpg
-- sample_video
-- video_name
-- 00000.jpg
-- 00001.jpg
-- 00002.jpg
...
-- video_name_ori
-- 00000.jpg
-- 00001.jpg
-- 00002.jpg
...
-- main.py
....
- PyTorch>=0.4.1
- torchvision>=0.2.1
- opencv-python>=3.4.2
- ...
pip install -r requirements.txt
python main.py --test_folder ./sample_img/
or
python main.py --test_folder ./sample_video/video_name
detection code : https://github.com/clovaai/CRAFT-pytorch
recognition code : https://github.com/clovaai/deep-text-recognition-benchmark
korean ocr code : https://github.com/parksunwoo/ocr_kor
aihub dataset : https://aihub.or.kr/aidata/133