S2.64: SAM 2.1 Small, Base+ and Large, each checked against PyTorch

Hiera configs and size detection from the weights, registry entries pinned to
commits with verified SHA-256, the loader picks the size by checksum. The GPU
encoder submits once per block so Large fits in memory, and uploads no longer
panic on a lost device. Reference tests run per size on the CPU and GPU.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Kristian Myram
2026-10-30 08:43:31 +01:00
co-authored by Claude Sonnet 5.5
parent 066bb2d031
commit 2acd0ca1a8
14 changed files with 212 additions and 32 deletions
+1 -1
View File
@@ -336,7 +336,7 @@ fn load_file(path: &Path, id: &str) -> std::result::Result<Loaded, String> {
let bytes = std::fs::read(path).map_err(|e| format!("cannot read {}: {e}", path.display()))?;
// SAM 2 runs on candle and is native only; every other model loads through the registry.
#[cfg(not(target_arch = "wasm32"))]
if id == seg::SAM2_TINY.id {
if effectcraft_sam2::mask::SIZES.iter().any(|m| m.id == id) {
return effectcraft_sam2::mask::load(&bytes).map(|m| Loaded::Mask(m));
}
seg::load(id, &bytes)