Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -32,7 +32,8 @@ Arabic are not covered.
|
|
| 32 |
| `ppocr_rec.yml` | Recognizer character dictionary |
|
| 33 |
| `ppocr_det_dynamic.onnx` | fp32 detection, CPU reference for accuracy checks |
|
| 34 |
| `ppocr_rec_dynamic.onnx` | fp32 recognition, CPU reference for accuracy checks |
|
| 35 |
-
| `samples/sample.
|
|
|
|
| 36 |
|
| 37 |
### Why four recognition models
|
| 38 |
|
|
@@ -49,15 +50,15 @@ python setup_demos.py ppocr
|
|
| 49 |
|
| 50 |
cd ppocr
|
| 51 |
python src/infer.py \
|
| 52 |
-
--image ../models/Synaptics/paddle-paddle-tiny/samples/sample.
|
| 53 |
--models ../models/Synaptics/paddle-paddle-tiny \
|
| 54 |
-
--tda cpu \
|
| 55 |
--save-image
|
| 56 |
```
|
| 57 |
|
| 58 |
-
>
|
| 59 |
-
>
|
| 60 |
-
> `
|
|
|
|
| 61 |
|
| 62 |
Either stage can be switched to ONNX Runtime with `--det-backend ort` /
|
| 63 |
`--rec-backend ort` (plus the matching `--det-onnx` / `--rec-onnx`) to compare
|
|
@@ -65,12 +66,34 @@ NPU output against a CPU reference.
|
|
| 65 |
|
| 66 |
## Measured on SL2619
|
| 67 |
|
| 68 |
-
Sample
|
|
|
|
|
|
|
|
|
|
| 69 |
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
-
|
| 76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
| `ppocr_rec.yml` | Recognizer character dictionary |
|
| 33 |
| `ppocr_det_dynamic.onnx` | fp32 detection, CPU reference for accuracy checks |
|
| 34 |
| `ppocr_rec_dynamic.onnx` | fp32 recognition, CPU reference for accuracy checks |
|
| 35 |
+
| `samples/sample.jpg` | Sample café menu card, 10 text lines |
|
| 36 |
+
| `samples/sample.png` | Sample document page, 99 text lines |
|
| 37 |
|
| 38 |
### Why four recognition models
|
| 39 |
|
|
|
|
| 50 |
|
| 51 |
cd ppocr
|
| 52 |
python src/infer.py \
|
| 53 |
+
--image ../models/Synaptics/paddle-paddle-tiny/samples/sample.jpg \
|
| 54 |
--models ../models/Synaptics/paddle-paddle-tiny \
|
|
|
|
| 55 |
--save-image
|
| 56 |
```
|
| 57 |
|
| 58 |
+
> The demo defaults to `--tda cpu`, the Torq runtime's own default allocator.
|
| 59 |
+
> Do not switch it to `dmabuf`: on current firmware the detection model fails
|
| 60 |
+
> there with `INTERNAL; failed to writeXram()`. This selects the allocator
|
| 61 |
+
> backing device buffers only — both stages run on the NPU either way.
|
| 62 |
|
| 63 |
Either stage can be switched to ONNX Runtime with `--det-backend ort` /
|
| 64 |
`--rec-backend ort` (plus the matching `--det-onnx` / `--rec-onnx`) to compare
|
|
|
|
| 66 |
|
| 67 |
## Measured on SL2619
|
| 68 |
|
| 69 |
+
| Sample | Lines | Detection | Recognition |
|
| 70 |
+
|---|---|---|---|
|
| 71 |
+
| `sample.jpg` (menu card, 912×1200) | 10 | ~0.52 s | ~1.2 s |
|
| 72 |
+
| `sample.png` (paper page, 1224×1584) | 99 | ~0.70 s | ~22.2 s |
|
| 73 |
|
| 74 |
+
Recognition scales with line count because each line is a separate invocation —
|
| 75 |
+
the bucket models are compiled with a static batch of 1.
|
| 76 |
+
|
| 77 |
+
### About `sample.jpg`
|
| 78 |
+
|
| 79 |
+
A 912×1200 café menu card, rendered synthetically in DejaVu Serif rather than
|
| 80 |
+
photographed, so it carries no third-party image licensing. Two properties of it
|
| 81 |
+
are worth copying if you make your own sample:
|
| 82 |
+
|
| 83 |
+
- **Aspect ratio 0.76** (912/1200), matching the detector's static 608×800
|
| 84 |
+
input. Preprocessing resizes straight to that shape without preserving
|
| 85 |
+
aspect, so an off-ratio image is fed to the model stretched.
|
| 86 |
+
- **Prices sit two spaces after the item name**, not right-aligned with a dot
|
| 87 |
+
leader. DBNet does not bridge a wide intra-line gap — with right-aligned
|
| 88 |
+
prices each row detects as two boxes (name and price separately), nearly
|
| 89 |
+
doubling the line count and the recognition time.
|
| 90 |
|
| 91 |
+
Recognized output, all ten lines at confidence ≥ 0.966:
|
| 92 |
+
|
| 93 |
+
```
|
| 94 |
+
1 [0.991] BLUE DOOR CAFE 6 [0.995] Smoked Salmon Bagel 9.75
|
| 95 |
+
2 [0.996] all day breakfast 7 [1.000] DRINKS
|
| 96 |
+
3 [0.999] BREAKFAST 8 [0.975] Espresso 2.75
|
| 97 |
+
4 [0.996] Avocado Toast 6.50 9 [0.966] Fresh Orange Juice 4.00
|
| 98 |
+
5 [0.996] Buttermilk Pancakes 7.00 10 [0.993] open 7am - 3pm daily
|
| 99 |
+
```
|