ROS wrapper for mmdetection framework with Hybrid Cascade Task model. This work was carried out as student trainee in the university Hochschule Weingarten.
NVIDIA driver of host system must be >= 410.48 to support CUDA 10.0 inside the docker container.
git clone https://github.com/iki-wgt/ros_htc_wrapper.git
cd ros_htc_wrapper/
docker build -t ros_htc . --no-cache
The Service message takes an RGB image and returns a list of recognized objects of Object message type with pixel segmentation:
sensor_msgs/Image image
---
htc_msg/Object[] objects
string class_name
float32 score
float32[] bbox
string rle
To transform an RLE string of Object message into a segmentation mask (2-dimensional boolean numpy array), use json and pycocotools libs:
import json
import numpy as np
import pycocotools.mask as maskUtils
rle = json.loads(result.objects[0].rle) # parse string from service response
rle['counts'] = bytearray(rle['counts']) # pycocotools demands encoded RLE
mask_np = maskUtils.decode(rle).astype(np.bool) # convert dict to boolean numpy array