Tutorial for Segment Anything with Isaac Sim
Overview
This tutorial demonstrates how to:
Setup and stream images using Isaac Sim.
Segment objects using Isaac ROS Segment Anything.
Detect object bounding boxes using Isaac ROS YoloV8 object detection.
Tutorial Walkthrough
Complete the quickstart up until model preparation step.
Complete the Isaac ROS YoloV8 tutorial up until the build step.
Launch the Docker container using the
run_dev.sh
script:cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \ ./scripts/run_dev.sh
Install and launch Isaac Sim following the steps in the Isaac ROS Isaac Sim Setup Guide.
Press Play to start publishing data from the Isaac Sim.
Run the following launch files to start the inferencing:
ros2 launch isaac_ros_segment_anything isaac_ros_segment_anything_isaac_sim.launch.py model_file_path:=${ISAAC_ROS_WS}/isaac_ros_assets/models/yolov8/yolov8s.onnx engine_file_path:=${ISAAC_ROS_WS}/isaac_ros_assets/models/yolov8/yolov8s.plan confidence_threshold:=0.25 nms_threshold:=0.45 model_repository_paths:=[${ISAAC_ROS_WS}/isaac_ros_assets/models]
Start a new terminal and attach to the container.
cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \ ./scripts/run_dev.sh
Then run the Python script to generate the colored segmentation mask from raw mask.
ros2 run isaac_ros_segment_anything visualize_mask.py
Visualize and validate the output of the package by launching
rqt_image_view
. In another terminal enter the Docker container:
cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \ ./scripts/run_dev.shThen launch
rqt_image_view
:ros2 run rqt_image_view rqt_image_viewInside the
rqt_image_view
GUI, change the topic to/segment_anything/colored_segmentation_mask
to view a colorized segmentation mask.