Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: facebook/dinov2-small
|
| 4 |
+
tags:
|
| 5 |
+
- vision
|
| 6 |
+
- onnx
|
| 7 |
+
- int8
|
| 8 |
+
- mobile
|
| 9 |
+
- flutter
|
| 10 |
+
- retrieval
|
| 11 |
+
- site-recognition
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# WakeUp DINOv2-Small INT8 (ONNX)
|
| 15 |
+
|
| 16 |
+
ONNX INT8 export of [`facebook/dinov2-small`](https://huggingface.co/facebook/dinov2-small) for the **WakeUp** Flutter alarm app's "Travel Mode" → Site Recognition feature.
|
| 17 |
+
|
| 18 |
+
## Why DINOv2?
|
| 19 |
+
|
| 20 |
+
DINOv2 is self-supervised and explicitly optimized for **instance-level retrieval** (the same object across viewpoints / lighting). It outperforms CLIP-style models on this task by a wide margin. Used here for the Site Recognition mode where the user captures 3-5 photos of a specific object as anchors.
|
| 21 |
+
|
| 22 |
+
## Files
|
| 23 |
+
|
| 24 |
+
| File | Size | Purpose |
|
| 25 |
+
|---|---|---|
|
| 26 |
+
| `dinov2_small_int8.onnx` | ~24 MB | Image feature extraction (CLS token) |
|
| 27 |
+
| `model_metadata.json` | — | Normalization params, embedding dim |
|
| 28 |
+
|
| 29 |
+
## Inference
|
| 30 |
+
|
| 31 |
+
```python
|
| 32 |
+
import onnxruntime as ort
|
| 33 |
+
|
| 34 |
+
sess = ort.InferenceSession("dinov2_small_int8.onnx")
|
| 35 |
+
# image: 1x3x224x224 normalized with DINOv2 ImageNet mean/std
|
| 36 |
+
embedding = sess.run(None, {"pixel_values": pixel_values})[0] # shape (1, 384), L2-normalized
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
Anchors and scan results are compared via plain cosine similarity (dot product, since both are unit-norm).
|
| 40 |
+
|
| 41 |
+
## License
|
| 42 |
+
|
| 43 |
+
Apache 2.0 (inherits from base model).
|