Instructions to use PaddlePaddle/PP-LCNet_x1_0_doc_ori with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PaddleOCR
How to use PaddlePaddle/PP-LCNet_x1_0_doc_ori with PaddleOCR:
# 1. See https://www.paddlepaddle.org.cn/en/install to install paddlepaddle # 2. pip install paddleocr from paddleocr import DocImgOrientationClassification model = DocImgOrientationClassification(model_name="PP-LCNet_x1_0_doc_ori") output = model.predict(input="path/to/image.png", batch_size=1) for res in output: res.print() res.save_to_img(save_path="./output/") res.save_to_json(save_path="./output/res.json") - Notebooks
- Google Colab
- Kaggle
| { | |
| "Global": { | |
| "model_name": "PP-LCNet_x1_0_doc_ori" | |
| }, | |
| "Hpi": { | |
| "backend_configs": { | |
| "paddle_infer": { | |
| "trt_dynamic_shapes": { | |
| "x": [ | |
| [ | |
| 1, | |
| 3, | |
| 224, | |
| 224 | |
| ], | |
| [ | |
| 1, | |
| 3, | |
| 224, | |
| 224 | |
| ], | |
| [ | |
| 8, | |
| 3, | |
| 224, | |
| 224 | |
| ] | |
| ] | |
| } | |
| }, | |
| "tensorrt": { | |
| "dynamic_shapes": { | |
| "x": [ | |
| [ | |
| 1, | |
| 3, | |
| 224, | |
| 224 | |
| ], | |
| [ | |
| 1, | |
| 3, | |
| 224, | |
| 224 | |
| ], | |
| [ | |
| 8, | |
| 3, | |
| 224, | |
| 224 | |
| ] | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "PreProcess": { | |
| "transform_ops": [ | |
| { | |
| "ResizeImage": { | |
| "resize_short": 256 | |
| } | |
| }, | |
| { | |
| "CropImage": { | |
| "size": 224 | |
| } | |
| }, | |
| { | |
| "NormalizeImage": { | |
| "channel_num": 3, | |
| "mean": [ | |
| 0.485, | |
| 0.456, | |
| 0.406 | |
| ], | |
| "order": "", | |
| "scale": 0.00392156862745098, | |
| "std": [ | |
| 0.229, | |
| 0.224, | |
| 0.225 | |
| ] | |
| } | |
| }, | |
| { | |
| "ToCHWImage": null | |
| } | |
| ] | |
| }, | |
| "PostProcess": { | |
| "Topk": { | |
| "topk": 1, | |
| "label_list": [ | |
| "0", | |
| "90", | |
| "180", | |
| "270" | |
| ] | |
| } | |
| } | |
| } |