Skip to content

Varve optional AI models — SAM2 Object Selection

Choose a tag to compare

@K-Arthur K-Arthur released this 14 Sep 08:07
· 2962 commits to master since this release

Varve optional AI models — SAM2 Object Selection (verified mirror)

Pinned mirror of the SAM2.1 Hiera Tiny artifacts used by Varve's Object
Selection workflow. This release extends the varve-models-v1 model-hosting
series; it is not an application release.

Important: runtime downloads come from Hugging Face

GitHub release assets do not send Access-Control-Allow-Origin headers
(verified 2026-09-14 with ranged GET + Origin: neither the 302 from
github.com nor the 206 from release-assets.githubusercontent.com carries
the header). A browser fetch() from the app is therefore blocked by CORS, so
the in-app downloader continues to use the CORS-enabled upstream host
recorded in apps/desktop/public/models/manifest.json
(vietanhdev/segment-anything-2-onnx-models on Hugging Face). This release is
a verified archival mirror for manual or CI use:

gh release download varve-models-v2 --pattern 'sam2_hiera_tiny.*.onnx'
sha256sum -c <<'EOF'
4cc015ee18520e93f8c7ddfeaca7436039daaaaf19721b4b96a8810a805e82f7  sam2_hiera_tiny.encoder.onnx
f5a4bd656c143899fb7f52d64ed81e6f6aeb37d477a0b6da50146ac7cf2187bf  sam2_hiera_tiny.decoder.onnx
EOF

Artifacts

Asset Role Bytes SHA-256
sam2_hiera_tiny.encoder.onnx Image encoder (1024x1024) 134261315 4cc015ee18520e93f8c7ddfeaca7436039daaaaf19721b4b96a8810a805e82f7
sam2_hiera_tiny.decoder.onnx Prompt/mask decoder 20640886 f5a4bd656c143899fb7f52d64ed81e6f6aeb37d477a0b6da50146ac7cf2187bf

These are the upstream artifacts exactly as published by
vietanhdev/segment-anything-2-onnx-models
(Apache-2.0, ONNX export by Viet-Anh Nguyen), verified byte-for-byte against
the checksums pinned in apps/desktop/public/models/manifest.json. Weights:
SAM 2.1, Apache-2.0, (c) Meta Platforms, Inc.

Why the encoder is hosted unrepaired

The upstream encoder declares two metadata-only value_info entries with
empty shapes (/conv_s0/Conv_output_0, /conv_s1/Conv_output_0).
onnxruntime-node tolerates them, but onnxruntime-web's WASM shape inference
rejects the graph at session creation
([ShapeInferenceError] ... inferred=4 declared=0).

Varve therefore verifies the upstream checksum, applies the reproducible
repair (scripts/models/repair-sam2-graph.mjs, which removes only those two
entries), and verifies the repaired checksum before the artifact is stored:

  • repaired encoder SHA-256:
    b4cfd6c8bec2ef3674536419d731e61d15840367bd004d65095ae6a2b88b41cf
  • repaired size: 134261247 bytes (68 bytes smaller)

Hosting the upstream bytes keeps the verification chain (upstream checksum →
repair → repaired checksum) exactly as documented in
docs/quality/object-selection-parity.md. Inference parity of the repaired
graph against the upstream graph was verified with ort-node (encoder outputs
match to the last digit).

Client verification

  • Downloads are explicit, checksum-verified, and stored in the shared
    IndexedDB model store (browser) or the app-data model directory (native).
  • No image is uploaded by Object Selection; the models run locally.
  • The download URLs in manifest.json are public configuration, never
    secrets.