- 🚀 Get rid of dependency (CUDA, PyTorch, cuDNN, ...) problems and install them in docker container
- 🚀 Simple ROS agnostic communication (IPC) between Docker container and ROS1 node
- IPC based on Shared Memory (very low latency, 2ms)
- IPC based on TCP socket (allows inference on remote machine with strong GPUs)
- 🚀 Automatic deployment: build, start and stop of Docker container
- Install Docker
- Install NVIDIA Container Toolkit
- Install ROS1
- Setup ROS workspace (if not already existing)
- Navigate to
src
folder of your catkin workspace (or some sub-folder of your choice) - Get ROS GitHub Dependencies & this project:
# ROS message definitions for instance/semantic/panoptic segmentation & object detection
git clone https://github.com/UniBwTAS/object_instance_msgs.git
# RVIZ plugin to visualize above messages
git clone https://github.com/UniBwTAS/rviz_object_instance.git
# our ROS package
git clone https://github.com/UniBwTAS/containerize_inference.git
- Get some other dependencies via rosdep:
sudo rosdep update
sudo rosdep install --from-paths . --ignore-src -r -y
- Get dependencies for IPC:
sudo apt install python3-opencv
pip3 install posix-ipc
- Build everything
- Run node (with YOLOv8) + visualization:
roslaunch containerize_inference inference.launch
Note
The first time a new docker_image
is used this takes some time as it has to be built first! In subsequent calls this will be much faster.
- mmdetection:
mask-rcnn_r50_fpn_1x_coco
(Instance Segmentation)mask2former_swin-t-p4-w7-224_8xb2-lsj-50e_coco-panoptic
(Panoptic Segmentation, Tiny)mask2former_swin-s-p4-w7-224_8xb2-lsj-50e_coco-panoptic
(Panoptic Segmentation, Small)mask2former_swin-l-p4-w12-384-in21k_16xb1-lsj-100e_coco-panoptic
(Panoptic Segmentation, Large)faster-rcnn_r50_fpn_1x_coco
(Object Detection)- and more... (see GitHub project)
- mmdetection3d
- (Not fully implemented yet)
- ultralytics (YOLOv8)
yolov8m.pt
(Object Detection)yolov8m-seg.pt
(Instance Segmentation)- and more... (see GitHub project)
roslaunch containerize_inference inference.launch docker_image:=ultralytics neural_network_config:=yolov8m-seg.pt
roslaunch containerize_inference inference.launch docker_host:="ssh://[email protected]"
Note
Docker and NVIDIA Container Toolkit has to be installed on remote machine. Consider copying your public ssh key to the
remote machine as an authorized key in order to avoid entering the password each time: ssh-copy-id [email protected]