Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
liangxhao 858e8f80ef | 11 months ago | |
---|---|---|
.. | ||
README.md | 11 months ago | |
README_CN.md | 11 months ago | |
convert.py | 11 months ago | |
ctw1500.py | 11 months ago | |
ic15.py | 11 months ago | |
mlt2017.py | 11 months ago | |
svt.py | 11 months ago | |
syntext150k.py | 11 months ago | |
synthtext.py | 11 months ago | |
td500.py | 11 months ago | |
totaltext.py | 11 months ago |
English | 中文
This document shows how to convert ocr annotation to the general format (not including LMDB) for model training.
You may also refer to convert_datasets.sh
which is a quick solution for converting annotation files of all datasets under a given directory.
To download and convert OCR datasets to the required data format, please refer to the following instructions: Chinese text recognition, CTW1500, ICDAR2015, MLT2017, SVT, Syntext 150k, TD500, Total Text, SynthText.
The format of the converted annotation file should follow:
img_61.jpg\t[{"transcription": "MASA", "points": [[310, 104], [416, 141], [418, 216], [312, 179]]}, {...}]
Taking ICDAR2015 (ic15) dataset as an example, to convert the ic15 dataset to the required format, please run
# convert training anotation
python tools/dataset_converters/convert.py \
--dataset_name ic15 \
--task det \
--image_dir /path/to/ic15/det/train/ch4_training_images \
--label_dir /path/to/ic15/det/train/ch4_training_localization_transcription_gt \
--output_path /path/to/ic15/det/train/det_gt.txt
# convert testing anotation
python tools/dataset_converters/convert.py \
--dataset_name ic15 \
--task det \
--image_dir /path/to/ic15/det/test/ch4_test_images \
--label_dir /path/to/ic15/det/test/ch4_test_localization_transcription_gt \
--output_path /path/to/ic15/det/test/det_gt.txt
The annotation format for text recognition dataset follows
word_7.png fusionopolis
word_8.png fusionopolis
word_9.png Reserve
word_10.png CAUTION
word_11.png citi
Note that image name and text label are seperated by \t.
To convert, please run:
# convert training anotation
python tools/dataset_converters/convert.py \
--dataset_name ic15 \
--task rec \
--label_dir /path/to/ic15/rec/ch4_training_word_images_gt/gt.txt
--output_path /path/to/ic15/rec/train/ch4_training_word_images_gt/rec_gt.txt
# convert testing anotation
python tools/dataset_converters/convert.py \
--dataset_name ic15 \
--task rec \
--label_dir /path/to/ic15/rec/ch4_test_word_images_gt/gt.txt
--output_path /path/to/ic15/rec/ch4_test_word_images_gt/rec_gt.txt
This is forked from https://github.com/mindspore-lab/mindocr
Jupyter Notebook Python
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》