fix(mixvpr): re-export ALL models with the trained checkpoint loaded
Browse filesPrevious onnx/coreml exports never loaded resnet50_MixVPR_4096_channels(1024)_rows(4).ckpt — they shipped an ImageNet backbone with a randomly initialized aggregator, and the CosSim checks passed because the PyTorch reference was the same unloaded model. Symptom: same-image 90%-crop cosine ~0.48 (should be ~0.77); indoor relocalization recall@2m 59.5% -> 94.8% after the fix.
Export scripts now load the ckpt inside the model constructor with a strict key check and refuse to run without it.
- mixvpr/README.md +30 -14
- mixvpr/coreml/mixvpr_fp16.mlpackage/Data/com.apple.CoreML/model.mlmodel +2 -2
- mixvpr/coreml/mixvpr_fp16.mlpackage/Data/com.apple.CoreML/weights/weight.bin +2 -2
- mixvpr/coreml/mixvpr_fp16.mlpackage/Manifest.json +8 -8
- mixvpr/coreml/mixvpr_int8.mlpackage/Data/com.apple.CoreML/model.mlmodel +2 -2
- mixvpr/coreml/mixvpr_int8.mlpackage/Data/com.apple.CoreML/weights/weight.bin +2 -2
- mixvpr/coreml/mixvpr_int8.mlpackage/Manifest.json +8 -8
- mixvpr/onnx/mixvpr_fp16.onnx +2 -2
- mixvpr/onnx/mixvpr_fp32.onnx +2 -2
mixvpr/README.md
CHANGED
|
@@ -4,12 +4,21 @@ Exported and quantized models for [MixVPR](https://github.com/Vincentqyw/MixVPR)
|
|
| 4 |
|
| 5 |
## Models
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
| Format | File | Size | Latency (M-series) | CosSim | Status |
|
| 8 |
|---|---|---|---|---|---|
|
| 9 |
-
| ONNX FP32 | `onnx/mixvpr_fp32.onnx` | 41.7 MB |
|
| 10 |
-
| ONNX FP16 | `onnx/mixvpr_fp16.onnx` | 21.0 MB |
|
| 11 |
-
| CoreML FP16 | `coreml/mixvpr_fp16.mlpackage/` | 20.8 MB | **
|
| 12 |
-
| CoreML INT8 | `coreml/mixvpr_int8.mlpackage/` | 10.5 MB | **3.
|
| 13 |
|
| 14 |
## Benchmark
|
| 15 |
|
|
@@ -19,23 +28,30 @@ All models were benchmarked against the original PyTorch FP32 model on a MacBook
|
|
| 19 |
|
| 20 |
| Model | Latency | Speedup |
|
| 21 |
|---|---|---|
|
| 22 |
-
| PyTorch FP32 (reference) |
|
| 23 |
-
| ONNX FP32 |
|
| 24 |
-
| ONNX FP16 |
|
| 25 |
-
| **CoreML FP16** | **
|
| 26 |
-
| **CoreML INT8** | **3.
|
| 27 |
|
| 28 |
### Accuracy (cosine similarity vs PyTorch)
|
| 29 |
|
|
|
|
|
|
|
|
|
|
| 30 |
| Model | CosSim | Max Abs Error | Verdict |
|
| 31 |
|---|---|---|---|
|
| 32 |
-
| ONNX FP32 | 1.0000 | 1.
|
| 33 |
-
| ONNX FP16 | 0.9999 | 1.
|
| 34 |
-
| CoreML FP16 | 0.
|
| 35 |
-
| CoreML INT8 | 0.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
- CosSim > 0.9999 means retrieval results are **identical** to PyTorch.
|
| 38 |
-
- CosSim 0.
|
| 39 |
|
| 40 |
### File Size
|
| 41 |
|
|
|
|
| 4 |
|
| 5 |
## Models
|
| 6 |
|
| 7 |
+
> **⚠️ 2026-08-09 — all models re-exported, please re-download.** Every file
|
| 8 |
+
> uploaded before this date was exported **without the trained MixVPR
|
| 9 |
+
> checkpoint** (ImageNet backbone + randomly initialized aggregator): the
|
| 10 |
+
> export scripts never loaded the weights, and the CosSim checks compared
|
| 11 |
+
> against the same unloaded model, so they passed. Quick way to spot the
|
| 12 |
+
> broken files: embed any image and its 90% crop — broken ≈ 0.48 cosine,
|
| 13 |
+
> fixed ≈ 0.77. On an indoor relocalization benchmark the fix moved
|
| 14 |
+
> recall@2m from 59.5% to 94.8%.
|
| 15 |
+
|
| 16 |
| Format | File | Size | Latency (M-series) | CosSim | Status |
|
| 17 |
|---|---|---|---|---|---|
|
| 18 |
+
| ONNX FP32 | `onnx/mixvpr_fp32.onnx` | 41.7 MB | 30.9 ms | 1.0000 | ✓ |
|
| 19 |
+
| ONNX FP16 | `onnx/mixvpr_fp16.onnx` | 21.0 MB | 37.8 ms | 0.9999 | ✓ Recommended |
|
| 20 |
+
| CoreML FP16 | `coreml/mixvpr_fp16.mlpackage/` | 20.8 MB | **2.9 ms** | 0.9998 | ✓ Recommended |
|
| 21 |
+
| CoreML INT8 | `coreml/mixvpr_int8.mlpackage/` | 10.5 MB | **3.1 ms** | 0.9985 | ✓ |
|
| 22 |
|
| 23 |
## Benchmark
|
| 24 |
|
|
|
|
| 28 |
|
| 29 |
| Model | Latency | Speedup |
|
| 30 |
|---|---|---|
|
| 31 |
+
| PyTorch FP32 (reference) | 43.3 ms | 1.0× |
|
| 32 |
+
| ONNX FP32 | 30.9 ms | 1.4× |
|
| 33 |
+
| ONNX FP16 | 37.8 ms | 1.15× |
|
| 34 |
+
| **CoreML FP16** | **2.9 ms** | **12.0×** |
|
| 35 |
+
| **CoreML INT8** | **3.1 ms** | **11.5×** |
|
| 36 |
|
| 37 |
### Accuracy (cosine similarity vs PyTorch)
|
| 38 |
|
| 39 |
+
Reference = PyTorch with `resnet50_MixVPR_4096_channels(1024)_rows(4).ckpt`
|
| 40 |
+
loaded under a strict key check (measured 2026-08-09):
|
| 41 |
+
|
| 42 |
| Model | CosSim | Max Abs Error | Verdict |
|
| 43 |
|---|---|---|---|
|
| 44 |
+
| ONNX FP32 | 1.0000 | 1.2×10⁻⁷ | No drop |
|
| 45 |
+
| ONNX FP16 | 0.9999+ | 1.3×10⁻⁴ | No drop |
|
| 46 |
+
| CoreML FP16 | 0.9998 | 2.7×10⁻⁴ | No drop |
|
| 47 |
+
| CoreML INT8 | 0.9985 | 3.8×10⁻³ | Negligible |
|
| 48 |
+
|
| 49 |
+
**Integrity probe** (catches an unloaded-weights export without any dataset):
|
| 50 |
+
embed an image and its 90% crop — trained MixVPR scores ~0.75–0.85 cosine,
|
| 51 |
+
an untrained export ~0.5.
|
| 52 |
|
| 53 |
- CosSim > 0.9999 means retrieval results are **identical** to PyTorch.
|
| 54 |
+
- CosSim 0.9985 means top-1 may shift for borderline cases; top-10 remains stable.
|
| 55 |
|
| 56 |
### File Size
|
| 57 |
|
mixvpr/coreml/mixvpr_fp16.mlpackage/Data/com.apple.CoreML/model.mlmodel
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f14a00146c0987c144381f85ae22ec550f4999d00368b95606f5f57c6ef7c092
|
| 3 |
+
size 76413
|
mixvpr/coreml/mixvpr_fp16.mlpackage/Data/com.apple.CoreML/weights/weight.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fa58b1fb7f0a4bd2fa490a257917712e835c7d8f5ff506aef0a08c878ddb9f97
|
| 3 |
+
size 21739008
|
mixvpr/coreml/mixvpr_fp16.mlpackage/Manifest.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
| 1 |
{
|
| 2 |
"fileFormatVersion": "1.0.0",
|
| 3 |
"itemInfoEntries": {
|
| 4 |
-
"
|
| 5 |
-
"author": "com.apple.CoreML",
|
| 6 |
-
"description": "CoreML Model Weights",
|
| 7 |
-
"name": "weights",
|
| 8 |
-
"path": "com.apple.CoreML/weights"
|
| 9 |
-
},
|
| 10 |
-
"E5E07CDC-859D-41B8-A3C9-A7E56F4937B0": {
|
| 11 |
"author": "com.apple.CoreML",
|
| 12 |
"description": "CoreML Model Specification",
|
| 13 |
"name": "model.mlmodel",
|
| 14 |
"path": "com.apple.CoreML/model.mlmodel"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
}
|
| 16 |
},
|
| 17 |
-
"rootModelIdentifier": "
|
| 18 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"fileFormatVersion": "1.0.0",
|
| 3 |
"itemInfoEntries": {
|
| 4 |
+
"7188AE4C-979C-49C5-A64F-EA379370910A": {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
"author": "com.apple.CoreML",
|
| 6 |
"description": "CoreML Model Specification",
|
| 7 |
"name": "model.mlmodel",
|
| 8 |
"path": "com.apple.CoreML/model.mlmodel"
|
| 9 |
+
},
|
| 10 |
+
"8DA552E4-344B-4CF9-971E-085DB8264A33": {
|
| 11 |
+
"author": "com.apple.CoreML",
|
| 12 |
+
"description": "CoreML Model Weights",
|
| 13 |
+
"name": "weights",
|
| 14 |
+
"path": "com.apple.CoreML/weights"
|
| 15 |
}
|
| 16 |
},
|
| 17 |
+
"rootModelIdentifier": "7188AE4C-979C-49C5-A64F-EA379370910A"
|
| 18 |
}
|
mixvpr/coreml/mixvpr_int8.mlpackage/Data/com.apple.CoreML/model.mlmodel
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:896125fc6a8e2796e6acf45d50607693ab4b3f7a2424d62511c6808d38a539c8
|
| 3 |
+
size 87924
|
mixvpr/coreml/mixvpr_int8.mlpackage/Data/com.apple.CoreML/weights/weight.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3bedbf2b1d1ab82a770259518aaad719551556a036dc0cb4ea2828fb4103e02f
|
| 3 |
+
size 10967360
|
mixvpr/coreml/mixvpr_int8.mlpackage/Manifest.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
| 1 |
{
|
| 2 |
"fileFormatVersion": "1.0.0",
|
| 3 |
"itemInfoEntries": {
|
| 4 |
-
"
|
| 5 |
-
"author": "com.apple.CoreML",
|
| 6 |
-
"description": "CoreML Model Specification",
|
| 7 |
-
"name": "model.mlmodel",
|
| 8 |
-
"path": "com.apple.CoreML/model.mlmodel"
|
| 9 |
-
},
|
| 10 |
-
"C3039F61-58A4-452B-81C0-7608A59ECB05": {
|
| 11 |
"author": "com.apple.CoreML",
|
| 12 |
"description": "CoreML Model Weights",
|
| 13 |
"name": "weights",
|
| 14 |
"path": "com.apple.CoreML/weights"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
}
|
| 16 |
},
|
| 17 |
-
"rootModelIdentifier": "
|
| 18 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"fileFormatVersion": "1.0.0",
|
| 3 |
"itemInfoEntries": {
|
| 4 |
+
"A85F9554-4CEB-4FC9-9F9D-A3729FBEEA3F": {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
"author": "com.apple.CoreML",
|
| 6 |
"description": "CoreML Model Weights",
|
| 7 |
"name": "weights",
|
| 8 |
"path": "com.apple.CoreML/weights"
|
| 9 |
+
},
|
| 10 |
+
"D70982A7-E698-4746-B9BB-0A0E8900AA91": {
|
| 11 |
+
"author": "com.apple.CoreML",
|
| 12 |
+
"description": "CoreML Model Specification",
|
| 13 |
+
"name": "model.mlmodel",
|
| 14 |
+
"path": "com.apple.CoreML/model.mlmodel"
|
| 15 |
}
|
| 16 |
},
|
| 17 |
+
"rootModelIdentifier": "D70982A7-E698-4746-B9BB-0A0E8900AA91"
|
| 18 |
}
|
mixvpr/onnx/mixvpr_fp16.onnx
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fee89548fdc8066d2464f00d5672363868459c8d6346c33bf2d2aea3b7e13c86
|
| 3 |
+
size 22021838
|
mixvpr/onnx/mixvpr_fp32.onnx
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1ede695b528f99b4d4ad3da940c9fe8d62f07254cbb0871205d669816ee97f47
|
| 3 |
+
size 43752108
|