CoolFace
Modelpublic

madskills/mobilenet_v3_small_crop_orientation_arabic

sourceHugging Faceapache-2.0updated 6mo agoView on Hugging Face
0likes5downloads
Model Card

MobileNetV3 small crop orientation model for Arabic

Use with the DocTr.

Example usage:

python
>>> from doctr.io import DocumentFile
>>> from doctr.models import ocr_predictor, from_hub

>>> img = DocumentFile.from_images(['<image_path>'])

>>> # Load custom recognition model
>>> reco_model = from_hub("madskills/parseq_arabic_v1")

>>> # Load custom detection model for best performance
>>> det_model = from_hub("madskills/fast_base_arabic_v1")

>>> # Pass it to the predictor
>>> # If your model is a recognition model:
>>> predictor = ocr_predictor(det_arch=det_model,
>>>                           reco_arch=reco_model,
>>>                           pretrained=True
>>>                          )

>>> # custom crop and page orientation predictors
>>> page_orientation_model = from_hub("madskills/mobilenet_v3_small_page_orientation_arabic")
>>> crop_orientation_model = from_hub("madskills/mobilenet_v3_small_crop_orientation_arabic")

# set the custom orientation predictors
>>> predictor.crop_orientation_predictor = crop_orientation_predictor(
>>>     pretrained=False, arch=crop_orientation_model
>>> )
>>> predictor.page_orientation_predictor = page_orientation_predictor(
>>>     pretrained=False, arch=page_orientation_model
>>> )

>>> # Get your predictions
>>> res = predictor(img)