ruisv commited on
Commit
7138684
Β·
verified Β·
1 Parent(s): 96e5e97

Compiled BPU models for RDK S100/S100P

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ pidnet_s_nashm_1024x2048_nv12_v3.hbm filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ library_name: bcdl
4
+ tags:
5
+ - rdk-s100
6
+ - rdk-s100p
7
+ - d-robotics
8
+ - bpu
9
+ - hbm
10
+ - image-segmentation
11
+ - semantic-segmentation
12
+ ---
13
+
14
+ # PIDNet-S for RDK S100/S100P β€” real-time semantic segmentation
15
+
16
+ Compiled BPU models (`.hbm`) for the **D-Robotics RDK S100 / S100P**, ready to
17
+ load β€” no ONNX export, no calibration, no `hb_compile`. Built and measured with
18
+ [**BCDL**](https://github.com/ruisv/bcdl), a C++17 inference and media library
19
+ for the RDK S-series with Python bindings.
20
+
21
+ Upstream: [PIDNet](https://github.com/XuJiacong/PIDNet)-S, Cityscapes 19 classes
22
+
23
+ > [!WARNING]
24
+ > **Non-commercial.** These weights carry a restriction the upstream *code*
25
+ > licence never mentions β€” see [Licence](#licence) at the bottom. Redistribution
26
+ > is permitted; commercial use is not. If you need a commercial build, the
27
+ > recipe is public and you can retrain or substitute the backbone.
28
+
29
+ ## Files
30
+
31
+ | file | what it is |
32
+ |---|---|
33
+ | `pidnet_s_nashm_1024x2048_nv12_v3.hbm` | 2048x1024 NV12, 19 classes β€” 18.0 MB |
34
+
35
+ ## Measured on an S100P
36
+
37
+ | stage | latency | throughput |
38
+ |---|---|---|
39
+ | segmentation | 4.48 ms | 223 FPS |
40
+
41
+ `hrt_model_exec perf`, one thread, minimum of three runs, on a board first gated
42
+ against its own previously recorded numbers. **BPU time only** β€” CPU
43
+ pre/post-processing is on top and is listed per task in BCDL's
44
+ [benchmark results](https://github.com/ruisv/bcdl/blob/main/benchmarks/RESULTS.md).
45
+
46
+ ## Use it
47
+
48
+ ```bash
49
+ conda install -c https://mirrors.ruis.ai/conda -c conda-forge bcdl
50
+ ```
51
+
52
+ ```python
53
+ import bcdl
54
+ engine = bcdl.Engine("pidnet_s_nashm_1024x2048_nv12_v3.hbm")
55
+ print(engine.input_shape(0), engine.output_shape(0))
56
+ ```
57
+
58
+ Each task has a decoder in BCDL that turns those raw outputs into boxes,
59
+ keypoints, masks, disparity or text β€” see the
60
+ [Python API](https://github.com/ruisv/bcdl/blob/main/docs/API.md)
61
+ ([δΈ­ζ–‡](https://github.com/ruisv/bcdl/blob/main/docs/API.zh.md)).
62
+
63
+ ## What to know before deploying
64
+
65
+ **11x faster than the DeepLabV3+ build it replaces** (4.48 ms against 49.6 ms) at
66
+ half the model size, for a 0.9859 output cosine and 94.6% pixel agreement.
67
+
68
+ The output is at 1/8 resolution β€” `[1, 19, 128, 256]` β€” and the label map is
69
+ upsampled by the caller. Argmax costs 0.18 ms here, so folding it into the graph
70
+ would buy nothing.
71
+
72
+ **The `_v3` suffix is load-bearing.** Earlier builds were calibrated on data that
73
+ had not been pre-normalised. When `cal_data_type` is float32 the compiler's
74
+ `norm_type` does **not** apply to the calibration data, so the input thresholds
75
+ come out wrong β€” and the model still compiles without a warning and segments to
76
+ noise. If you rebuild this, check the input threshold in `quant_info.json`.
77
+
78
+ **Non-commercial.** See the licence note above.
79
+
80
+ ## Licence
81
+
82
+ MIT on the code, but the weights are trained on **Cityscapes**, whose terms permit distributing a trained model and bar commercial use of it in the same breath.
83
+
84
+ **BCDL itself is Apache-2.0 and is unrelated to these terms** β€” it is a
85
+ general-purpose runtime that loads any `.hbm`. The licence above constrains
86
+ *these weights and this compiled artefact*.
87
+
88
+ The conversion recipe β€” ONNX export, calibration, `hb_compile` config and the
89
+ acceptance numbers β€” is public in
90
+ [**bcdl-model-zoo**](https://github.com/ruisv/bcdl-model-zoo), so this build can
91
+ be reproduced or retargeted rather than taken on trust.
pidnet_s_nashm_1024x2048_nv12_v3.hbm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:377a8c74cd47a1cc68e3268492f1f0c8d83b27f795bcf83d4a14a579546f31ad
3
+ size 18914264