ROS wrapper for Hybrid Task Cascade

ROS wrapper for mmdetection framework with Hybrid Cascade Task model. This work was carried out as student trainee in the university Hochschule Weingarten.

Requirements

NVIDIA driver of host system must be >= 410.48 to support CUDA 10.0 inside the docker container.

Build docker image

git clone https://github.com/iki-wgt/ros_htc_wrapper.git
cd ros_htc_wrapper/
docker build -t ros_htc . --no-cache

Messages

Service message

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

Object message

string class_name
float32 score
float32[] bbox
string rle

Parsing RLE string

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