docs: add YAML config links & usage
Browse files
README.md
CHANGED
|
@@ -11,6 +11,37 @@ https://github.com/frotms/PaddleOCR2Pytorch
|
|
| 11 |
- ptocr_v5_server_det.pth — detection (server) weights
|
| 12 |
- ptocr_v5_server_rec.pth — recognition (server) weights
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
## Download (recommended)
|
| 15 |
|
| 16 |
Python (tracks downloads via huggingface_hub):
|
|
|
|
| 11 |
- ptocr_v5_server_det.pth — detection (server) weights
|
| 12 |
- ptocr_v5_server_rec.pth — recognition (server) weights
|
| 13 |
|
| 14 |
+
|
| 15 |
+
## Configs
|
| 16 |
+
|
| 17 |
+
- [PP-OCRv5_server_det.yml](https://huggingface.co/JoyCN/PaddleOCR-Pytorch/blob/main/PP-OCRv5_server_det.yml) — detection model config
|
| 18 |
+
- [PP-OCRv5_server_rec.yml](https://huggingface.co/JoyCN/PaddleOCR-Pytorch/blob/main/PP-OCRv5_server_rec.yml) — recognition model config
|
| 19 |
+
|
| 20 |
+
Download and load examples:
|
| 21 |
+
|
| 22 |
+
Python:
|
| 23 |
+
|
| 24 |
+
```python
|
| 25 |
+
from huggingface_hub import hf_hub_download
|
| 26 |
+
import yaml
|
| 27 |
+
|
| 28 |
+
# Detection config
|
| 29 |
+
cfg_det_path = hf_hub_download("JoyCN/PaddleOCR-Pytorch", filename="PP-OCRv5_server_det.yml")
|
| 30 |
+
with open(cfg_det_path, "r", encoding="utf-8") as f:
|
| 31 |
+
cfg_det = yaml.safe_load(f)
|
| 32 |
+
|
| 33 |
+
# Recognition config
|
| 34 |
+
cfg_rec_path = hf_hub_download("JoyCN/PaddleOCR-Pytorch", filename="PP-OCRv5_server_rec.yml")
|
| 35 |
+
with open(cfg_rec_path, "r", encoding="utf-8") as f:
|
| 36 |
+
cfg_rec = yaml.safe_load(f)
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
Direct links (not counted by default):
|
| 40 |
+
|
| 41 |
+
- https://huggingface.co/JoyCN/PaddleOCR-Pytorch/resolve/main/PP-OCRv5_server_det.yml?download=true
|
| 42 |
+
- https://huggingface.co/JoyCN/PaddleOCR-Pytorch/resolve/main/PP-OCRv5_server_rec.yml?download=true
|
| 43 |
+
|
| 44 |
+
|
| 45 |
## Download (recommended)
|
| 46 |
|
| 47 |
Python (tracks downloads via huggingface_hub):
|