This is the github repository for converting craft pretrained model to tflite version and to provide an inference code using the tflite model.
The CRAFT model is proposed in this paper.
The CRAFT model is a text detector that effectively detect text area by exploring each character region and affinity between characters. The bounding box of texts are obtained by simply finding minimum bounding rectangles on binary map after thresholding character region and affinity scores.
├── scripts
├── pytorch_to_onnx.py --> Converts pretrained pytorch model to onnx.
├── onnx_to_tflite.py --> Converts Onnx to TFLITE
├── tflite_inference.py --> Inference with converted tflite model.
├── craft_inference.py --> Inference with Pytorch Pretrained model.
Corresponding `ipynb` files are provided in `colabs` folder.
├── models
├── craft_mlt_25k.pth --> Model trained on SynthText, IC13, IC17
├── craft.tflite --> TFLite Model (Dynamic Quantization)
├── craft_float16.tflite --> TFLite Model(Float16 Quantization)
Pretrained model can be downloaded from here
Some portions of the code are taken from this repo
@inproceedings{baek2019character,
title={Character Region Awareness for Text Detection},
author={Baek, Youngmin and Lee, Bado and Han, Dongyoon and Yun, Sangdoo and Lee, Hwalsuk},
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
pages={9365--9374},
year={2019}
}
If you found this project helpful or you learned something consider starring the repo.