Mask Generation
sam2
swift-object-cutout
segment-anything
interactive-segmentation
background-removal
core-ai
apple-silicon
macos
Instructions to use arraypress/cutout-sam2-tiny with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sam2
How to use arraypress/cutout-sam2-tiny with sam2:
# Use SAM2 with images import torch from sam2.sam2_image_predictor import SAM2ImagePredictor predictor = SAM2ImagePredictor.from_pretrained("arraypress/cutout-sam2-tiny") with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16): predictor.set_image(<your_image>) masks, _, _ = predictor.predict(<input_prompts>)# Use SAM2 with videos import torch from sam2.sam2_video_predictor import SAM2VideoPredictor predictor = SAM2VideoPredictor.from_pretrained("arraypress/cutout-sam2-tiny") with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16): state = predictor.init_state(<your_video>) # add new prompts and instantly get the output on the same frame frame_idx, object_ids, masks = predictor.add_new_points(state, <your_prompts>) # propagate the prompts to get masklets throughout the video for frame_idx, object_ids, masks in predictor.propagate_in_video(state): ... - Notebooks
- Google Colab
- Kaggle
SAM 2.1 tiny as a Core AI .aimodel (float16, encode + decode), with README, licence and export script
a0b4f4d verified Download cutout-sam2-tiny-float16.aimodel/metadata.json from arraypress/cutout-sam2-tiny: direct link, hf CLI and curl.
- Browser
- Download file 618 Bytes
-
https://huggingface.co/arraypress/cutout-sam2-tiny/resolve/main/cutout-sam2-tiny-float16.aimodel/metadata.json
- Command line
-
hf download hf://arraypress/cutout-sam2-tiny/cutout-sam2-tiny-float16.aimodel/metadata.json
-
curl -L -o metadata.json https://huggingface.co/arraypress/cutout-sam2-tiny/resolve/main/cutout-sam2-tiny-float16.aimodel/metadata.json
618 Bytes
| { | |
| "assetVersion" : "2.0", | |
| "description" : "SAM 2.1 hiera tiny (facebook\/sam2.1-hiera-tiny@de431c4, code facebookresearch\/sam2@2b90b9f), float16. 'encode': image [1,3,1024,1024] float32 RGB 0…1 → image_embedding, feats_s0, feats_s1. 'decode': those + point [1,1,2] (pixels of the 1024² square) + label [1,1] → masks [1,3,256,256] logits, scores [1,3].", | |
| "author" : "Ravi, Gabeur, Hu, Hu, Ryali, Ma, Khedr, Rädle, Rolland, Gustafson, et al. (Meta) — SAM 2.1 tiny; Core AI export by ObjectCutout", | |
| "creationDate" : "20261017T062235Z", | |
| "license" : "Apache-2.0", | |
| "producer" : "coreai-core 1.0.0b3" | |
| } |