Accepted in ICRA 2024 (Oral)
Please refer to the Installation section of AdelaiDet: README.md.
If you have not installed Detectron2, following the official guide: INSTALL.md.
After that, build this repository with
python setup.py build developPlease download TotalText, CTW1500, MLT, and CurvedSynText150k according to the guide provided by AdelaiDet: README.md.
ICDAR2015 dataset can be download via link.
Extract all the datasets and make sure you organize them as follows
The new Dataset is pushed into dataset folder download it, extract it, convert it and then just run it.
- datasets
| - CTW1500
| | - annotations
| | - ctwtest_text_image
| | - ctwtrain_text_image
| - totaltext (or icdar2015)
| | - test_images
| | - train_images
| | - test.json
| | - train.json
| - mlt2017 (or syntext1, syntext2)
| - annotations
| - images
After that, download polygonal annotations, along with evaluation files and extract them under datasets folder.
You can try to visualize the predictions of the network using the following command:
python demo/demo.py --config-file <PATH_TO_CONFIG_FILE> --input <FOLDER_TO_INTPUT_IMAGES> --output <OUTPUT_FOLDER> --opts MODEL.WEIGHTS <PATH_TO_MODEL_FILE> MODEL.TRANSFORMER.INFERENCE_TH_TEST 0.3You may want to adjust INFERENCE_TH_TEST to filter out predictions with lower scores.
You can train from scratch or finetune the model by putting pretrained weights in weights folder.
Example commands:
python tools/train_net.py --config-file <PATH_TO_CONFIG_FILE> --num-gpus 8All configuration files can be found in configs/TESTR, excluding those files named Base-xxxx.yaml.
TESTR_R_50.yaml is the config for TESTR-Bezier, while TESTR_R_50_Polygon.yaml is for TESTR-Polygon.
python tools/train_net.py --config-file <PATH_TO_CONFIG_FILE> --eval-only MODEL.WEIGHTS <PATH_TO_MODEL_FILE>