ruisv commited on
Commit
42511d3
·
verified ·
1 Parent(s): 404a21b

XFeat for RDK S100/S100P — compiled BPU model

Browse files
Files changed (3) hide show
  1. .gitattributes +1 -0
  2. README.md +91 -0
  3. xfeat_nashm_640x480.hbm +3 -0
.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
+ xfeat_nashm_640x480.hbm filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ library_name: bcdl
4
+ tags:
5
+ - rdk-s100
6
+ - rdk-s100p
7
+ - d-robotics
8
+ - bpu
9
+ - hbm
10
+ - image-feature-extraction
11
+ - keypoint-detection
12
+ ---
13
+
14
+ # XFeat for RDK S100/S100P — sparse local features
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: [XFeat / accelerated_features](https://github.com/verlab/accelerated_features)
22
+
23
+ > [!TIP]
24
+ > **Redistributable, including commercially.** The licence chain was checked on
25
+ > the code, the pretrained weights it started from, and the data it was trained
26
+ > on — all three, because a permissive repository badge does not by itself say
27
+ > anything about the weights. See [Licence](#licence).
28
+
29
+ ## Files
30
+
31
+ | file | what it is |
32
+ |---|---|
33
+ | `xfeat_nashm_640x480.hbm` | backbone, 640x480, 3 outputs — 3.0 MB |
34
+
35
+ ## Measured on an S100P
36
+
37
+ | stage | latency | throughput |
38
+ |---|---|---|
39
+ | backbone | 0.99 ms | 1013 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("xfeat_nashm_640x480.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
+ **Only the convolutional backbone is compiled** — 3 MB of it. Keypoint NMS,
66
+ top-k selection and sparse descriptor sampling stay on the CPU, which is what
67
+ keeps the graph free of dynamic control flow. BCDL does that half for you.
68
+
69
+ Two rewrites were needed to export it at all, and both were checked numerically
70
+ before being trusted: the input `InstanceNorm` was lifted out of the graph into
71
+ CPU preprocessing, and `_unfold2d` became `pixel_unshuffle` (a single
72
+ `SpaceToDepth`), asserted equal to the original beforehand.
73
+
74
+ **The descriptor sampler is bicubic, not bilinear.** Upstream takes the default
75
+ mode of `InterpolateSparse2d`, which is bicubic, while the *reliability* map in
76
+ the same file uses bilinear. Getting that wrong leaves shapes, counts and
77
+ keypoints all correct and the descriptor cosine stuck at 0.9965 — which reads
78
+ like quantisation noise. It is not.
79
+
80
+ ## Licence
81
+
82
+ Apache-2.0, and the pretrained weights are committed inside that repository — so the same grant covers them.
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.
xfeat_nashm_640x480.hbm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:59c4a885609191fd98ac6fe895127f0b7e5a63fc6b36057abc7bcdb7b26e248f
3
+ size 3165376