Segment anything 2 support added in Ultralytics 8.2.70🎉

:blue_heart: Exciting news! You can now perform inference with Segment Anything-2 models using the Ultralytics package.

Both Python and CLI support are available. :point_down:

Perform inference with a SAM 2 model

from ultralytics import SAM

model = SAM("sam2_b.pt")  # Load a model
model("path/to/video.mp4")  # Run inference

A big thanks to Laughing-q for adding support for SAM2 in Ultralytics! :kissing_heart:

Visuals