SAM 3 text-prompted segmentation via transformers Sam3Model
@tylerd▲ 1 net votes
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).