https://github.com/open-mmlab/mmocr
GitHub - open-mmlab/mmocr: OpenMMLab Text Detection, Recognition and Understanding Toolbox
OpenMMLab Text Detection, Recognition and Understanding Toolbox - GitHub - open-mmlab/mmocr: OpenMMLab Text Detection, Recognition and Understanding Toolbox
github.com
1 . 데이터 전환(준비)
기존 LMDB format 데이터 -> image + Label based txt 로 변환
[LMDB] lmdb file loading, reading
LMDB에 저장된 image id, label, image값 까지 받아서 image로 따로 저장하고, label과 path를 txt파일로 저장하는 코드 Image값은 PIL 내 decode 참고로 LMDB PATH는 해당 lmdb 파일이 있는 폴더의 이름을 써주면..
yjs-program.tistory.com
[LMDB] lmdb file loading , image-txt format / LMDB 형식 이미지 라벨 텍스트 변환 (멀티프로세스 방식)
LMDB 안에 image와 label이 있다는 가정하에 로딩, txt파일의 경우 다음과 같은 형식으로 생성됨(여기서 구분자는 \t 사용) import lmdb from tqdm import tqdm import six from PIL import Image import os from..
yjs-program.tistory.com
2 . VOC 전환
mmocr/mmocr/models/textrecog/convertors/base.py 내 신규 dict_type 추가(DICT90을 원하는 형식의 Vocab으로 변경)
3 . 학습/ 평가
Welcome to MMOCR’s documentation! — MMOCR 0.3.0 documentation
Docs > Welcome to MMOCR’s documentation! Edit on GitHub Shortcuts
mmocr.readthedocs.io
+) Inference 때 Visualize
한글 라벨링 깨지는 문제 -> OpenCV putText 한글 인코딩 문제 --> PIL 함수 변환 필요(이미 MMOCR에 있음)
mmocr/core/visualize.py 내 is_contain_chinese 함수에서 다음과 같이 return을 True로 반환하게끔 수정,
612번 라인 내 font_path를 한글 폰트로 변경
+) Tensorboard 사용
/mmocr/configs/_base_/default_runtime.py
visualize loss curve · Issue #514 · open-mmlab/mmocr
how to visualize loss curve?
github.com
'사소한 Tip . 오류 해결법' 카테고리의 다른 글
rm -r command with answer "yes to all" (0) | 2022.01.04 |
---|---|
[Git] git command (0) | 2021.12.29 |
[LMDB] lmdb file loading , image-txt format / LMDB 형식 이미지 라벨 텍스트 변환 (멀티프로세스 방식) (0) | 2021.12.14 |
[LMDB] lmdb file loading, reading (0) | 2021.12.08 |
[Tensorflow] Tensorflow v1 to Tensorflow v2 자동화 코드(.ipynb) (0) | 2021.12.07 |