cjf8899 / OCR_kor_en

:pencil2:Image text detection and Korean, English recognition model implementation in pytorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OCR_kor_en

This repo is an End to End code that detection language in images and recognition Korean and English.

Demo

ocr_demo ocr_demo2

memoryblock

ocr_demo3 ocr_demo4

Getting Started

Download models

Video2img

Crop the video frame by frame and apply a morphology operation for increase the recognition rate.

memoryblock


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
    ....

Requirements

  • PyTorch>=0.4.1
  • torchvision>=0.2.1
  • opencv-python>=3.4.2
  • ...
pip install -r requirements.txt

Run

python main.py --test_folder ./sample_img/

or

python main.py --test_folder ./sample_video/video_name

Referenced. Thank you all:+1:

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

About

:pencil2:Image text detection and Korean, English recognition model implementation in pytorch

License:MIT License


Languages

Language:Python 100.0%