Roboflow-maintained package for Meta's SAM 2 (Segment Anything Model 2) for image and video segmentation. Currently version 1.0.3, updated March 2025.
pip install rf-sam-2No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic image segmentation with a single point prompt.
Use 'from rf_sam_2 import SAM2' instead of 'from sam2 import SAM2'.
Replace 'sam_model_registry' with 'SAM2.from_pretrained()'.
os.environ['SAM2_DEVICE'] = 'cpu' before importing rf_sam_2.