ROS-SAM - A ROS-service for Meta's Segment Anything Model

Hi ROS community,

@russel_robot and I wrote a ROS wrapper for Meta’s Segment Anything
model, which we used in our recent work.
This wrapper exposes the model’s different query options as a ROS
service so you can easily use it to segment images in a ROS context.
Aside from making the functionality available to other languages other
then Python, it can also be convenient to have the model loaded in
another process to speed up development, or, of course, to make its
functionality available on machines not powerful enough to run SAM.

As a special treat, @russell_robot offers an RQT tool built on top of
this service, which allows you to segment your images interactively.

Lastly, we also provide a Python client for our service which
automatically serializes numpy encoded queries into ROS messages for the
service and deserializes the results.

We hope this can be of use to you! In case you encounter any issues,
feel free to file them on GitHub.

Cheers!

5 Likes

Hi @aroefer , thanks for sharing this incredible work!

While we are working on merging the ROS 2 update, I thought I would take the time to already share it here with the community: GitHub - ros-ai/ros2_sam: ROS 2 wrapper for Meta's Segment-Anything model in the hopes that it will enable ROS 2 users.