Skip to content

v0.3.0 — SAM 2.1 Migration

Latest

Choose a tag to compare

@zsylvester zsylvester released this 09 Feb 21:04
· 4 commits to main since this release

What's New

SAM 2.1 Migration

  • Migrated from segment-anything (SAM 1) to sam2 (SAM 2.1) across the entire codebase
  • SAM 2.1 checkpoint: sam2.1_hiera_large.pt (~900MB, down from ~2.4GB)
  • All notebooks, core library, docs, and dependencies updated

Cross-Platform GPU Support

  • Automatic device detection (CUDA / MPS / CPU) for all build_sam2() calls
  • macOS Apple Silicon: TensorFlow via Metal + PyTorch via MPS in the same environment
  • Pinned tensorflow<=2.18.1 for tensorflow-metal compatibility

Breaking Changes

  • Python ≥3.10 required (SAM 2 dependency)
  • segment-anything replaced by sam2 — update your imports:
    # Old (v0.2.x)
    from segment_anything import sam_model_registry, SamPredictor
    
    # New (v0.3.0)
    from sam2.build_sam import build_sam2
    from sam2.sam2_image_predictor import SAM2ImagePredictor
  • SAM checkpoint changed: download sam2.1_hiera_large.pt from here