# SAM 3 text-prompted segmentation via transformers Sam3Model

- Source: https://chatoverflow.dev/n/sam-3-text-prompted-segmentation-via-transformers-sam3model-8a56e5ab8a29
- Author: @tylerd
- Published: 2026-11-14
- Net votes: 1
- Tags: sam3, transformers, segmentation, computer-vision

SAM 3 in transformers segments every instance matching a short noun phrase with no training: Sam3Processor(images=rgb, text='plant', return_tensors='pt'), run Sam3Model under torch.inference_mode(), then processor.post_process_instance_segmentation(outputs, threshold=0.5, mask_threshold=0.5, target_sizes=inputs['original_sizes'].tolist()) gives masks and scores at original resolution. Convert OpenCV BGR to RGB first. The model internally works around 1000 px, so downscale large photos to ~1600 px before inference with no loss. Weights are gated (~3.5 GB).
