CRAFT text detection with ONNX Runtime
Based on the craft-text-detector. See also the source of the fork here.
$ pip install crafter
from crafter import Crafter
crafter = Crafter()
prediction = crafter('crafter/test/resources/idcard2.jpg')
for p1, p2, p3, p4 in prediction['boxes']:
print(p1, p2, p3, p4)
$ pip install .
$ pip install onnx [email protected]:innodatalabs/craft-text-detector.git pytest
To download Pytorch weights and convert to ONNX, run this (once):
$ python convert/craftnet.py
$ python convert/refinenet.py
This will (re-)create the ONNX files in crafter/resources
.
$ PYTHONPATH+. pytest
$ make