Detic ros - A simple ROS wrapper for Detic instance segmentation using pre-trained dataset

Overview

detic_ros

ROS package for Detic.

This package is still in under active-development. Here is the current TODO list.

image

Howto use

Building docker image

git clone https://github.com/HiroIshida/detic_ros.git
cd detic_ros
docker build -t detic_ros .

step1 (launch Detic-segmentor node)

Example for running node on pr1040 network:

docker run --rm --net=host -it --gpus 1 detic_ros:latest \
    /bin/bash -i -c \
    'source ~/.bashrc; \
    rossetip; rossetmaster pr1040; \
    roslaunch detic_ros sample.launch \
    out_debug_img:=true \
    out_debug_segimg:=false \
    compressed:=false \
    input_image:=/kinect_head/rgb/image_color'

Change the pr1040 part and /kinect_head/rgb/image_color in command above by your custom host name and an image topic. If compressed image (e.g. /kinect_head/rgb/image_color/compressed) corresponding to the specified input_image is also published, by setting compressed:=true, you can reduce the topic pub-sub latency.

step2 (Subscribe from node in step1 and do something)

Example for using the published topic from the node above is masked_image_publisher.py. By using subscribed segmentation image and segmentation info and, this node converts a subscribed rgb image into a masked rgb image.

ROS node information

  • ~input_image (sensor_msgs/Image)
    • Input image
  • ~debug_image (sensor_msgs/Image)
    • debug image
  • ~segmentation_image (sensor_msgs/Image with 8UC1 encoding)
    • Segmentation image. Suppose detected class number is 14, image is filled with 0~14 uint8 values. Note that 0 means background label.
  • ~debug_segmentation_image (sensor_msgs/Image with 8UC1 encoding)
    • Say detected class number is 14, ~segmentation_image in grayscale image is almost completely dark and not good for debugging. Therefore this topic scale the value to [0 ~ 255] so that grayscale image is human-friendly.
  • ~segmentation_info (detic_ros/SegmentationInfo)
    • class name list and confidence score list corresponding to ~segmentation_image. Note that score of background class is always 1.0

As for rosparam, see node_cofig.py.

Comments
  • Add vocabulary and custom_vocabulary

    Add vocabulary and custom_vocabulary

    This PR enables to specify vocabulary and custom_vocabulary from launch files.

    • Sample usage
    roslaunch detic_ros sample.launch out_debug_img:=true out_debug_segimg:=false compressed:=false device:=auto input_image:=/kinect_head/rgb/image_color vocabulary:='custom' custom_vocabulary:='bottle, shoe'
    
    opened by tkmtnt7000 3
  • refactor: wrapper should not have internal state

    refactor: wrapper should not have internal state

    I think DetecWrapper should be just a function, and should not have any internal state. Based on this concept, the source code is refactored.

    @Affonso-Gui

    opened by HiroIshida 2
  • TODO

    TODO

    major

    • [x] publish pcl_msgs/pointInices
    • [x] publish/subscribe compressed image
    • [ ] publish image bounding box
    • [ ] fix up docker file (especially part where torch installation procedure)

    minor

    • [x] check installation instruction in README.md
    • [x] use user-defined instance class names
    opened by HiroIshida 2
  • Specify CvBridge encoding bgr8

    Specify CvBridge encoding bgr8

    The colors of the debug_image are inverted when the input image topic is not encoded in bgr8. I apologize for the lack of confirmation, but I suspect that the input to the Detic model is also inverted.

    This problem can be solved by specifying the encoding of the CvBridge conversion. This is also done in jsk_recognition, which I used as a reference.

    image topic not in bgr8 encoding

    $ rostopic echo /hsrb/head_rgbd_sensor/rgb/image_rect_color --noarr
    header: 
      seq: 25135
      stamp: 
        secs: 1668335381
        nsecs: 431184046
      frame_id: "head_rgbd_sensor_rgb_frame"
    height: 480
    width: 640
    encoding: "rgb8"
    is_bigendian: 0
    step: 1920
    data: "<array type: uint8, length: 921600>"
    ---
    

    | before | after | | ---- | ---- | | Screenshot from 2022-11-13 19-09-23_crop | Screenshot from 2022-11-13 19-10-40_crop |

    Comparison before and after change, the upper image is input image topic and the lower image is debug_image.

    image topic in bgr8 encoding

    $ rostopic echo /kinect_head/rgb/image_color --noarr
    header: 
      seq: 39033
      stamp: 
        secs: 1668335714
        nsecs: 387932439
      frame_id: "head_mount_kinect_rgb_optical_frame"
    height: 480
    width: 640
    encoding: "bgr8"
    is_bigendian: 0
    step: 1920
    data: "<array type: uint8, length: 921600>"
    ---
    

    | before | after | | ---- | ---- | | Screenshot from 2022-11-13 19-14-24 | Screenshot from 2022-11-13 19-13-29 |

    Comparison before and after change, the upper image is debug_image and the lower image is input image topic.

    opened by Kanazawanaoaki 1
  • Build image_tranport_plugin from source

    Build image_tranport_plugin from source

    The depth compression nodes here causes the error, and because of this entire launched nodes do not function https://github.com/HiroIshida/detic_ros/blob/e3596bd88c02f9f99f4dac2688741b6d886e2b57/launch/decompress_depth.launch#L6 [ERROR] [1668268511.903285160]: Unsupported image format: 32FC1; compressedDepth

    Anyway, I fixed the error by building image_transport_plugins inside docker. But, I don't have time to find the cause of this.

    opened by HiroIshida 1
  • Update Dockerfile for sample_detection.launch

    Update Dockerfile for sample_detection.launch

    This PR solve https://github.com/HiroIshida/detic_ros/issues/34

    • Changed to install in the same way as other ros-noetic- packages.
    • Avoid hang on keyboard country setting. https://stackoverflow.com/questions/63476497/docker-build-with-ubuntu-18-04-image-hangs-after-prompting-for-country-of-origin
    • After consulting with @HiroIshida , I removed the comment out.

    If we really want to comment in, do we need to change the wording in the README as well?

    opened by Kanazawanaoaki 1
  • Docker build failed when commenting out lines of launch/sample_detection.launch

    Docker build failed when commenting out lines of launch/sample_detection.launch

    when trying to use launch/sample_detection.launch docker build failed when commenting out lines, https://github.com/HiroIshida/detic_ros/blob/2b2ccb94f37901d923b7c29f3afb9fefdf8173fb/Dockerfile#L49-L5   These are error messages

    E: Unable to locate package ros-noetic-jsk-pcl-ros
    E: Unable to locate package ros-noetic-jsk-pcl-ros-utils
    

    All of log

    opened by soonhyo 0
  • Add support for real-time models

    Add support for real-time models

    • Update the detic submodule
    • Add model_type option to select different real time models (https://github.com/facebookresearch/Detic/blob/main/docs/MODEL_ZOO.md#real-time-models)
    • Add use_jsk_msgs option to publish the result as jsk_recognition_msgs types
    • Add sample launch file of 3D object detection using the jsk_pcl_ros pipeline.
    • Remove explicit background item from published topics for compatibility with jsk_recognition nodes.

    With this I could get around 10Hz bounding box detection on the res50:

    roslaunch detic_ros sample_detection.launch vocabulary:=custom custom_vocabulary:=cup,bottle,bottle_cap
    

    Screenshot from 2022-11-02 18-59-30

    opened by Affonso-Gui 0
Owner
Hirokazu Ishida
Hirokazu Ishida
Small Robot, with LIDAR and DepthCamera. Using ROS for Maping and Navigation

?? RoboCop ?? Small Robot, with LIDAR and DepthCamera. Using ROS for Maping and Navigation Made by Clemente Donoso, ?? Chile ???? RoboCop Lateral Fron

Clemente Donoso Krauss 2 Jan 4, 2022
2D waypoints will be predefined in ROS based robots to navigate to the destination avoiding obstacles.

A number of 2D waypoints will be predefined in ROS based robots to navigate to the destination avoiding obstacles.

Arghya Chatterjee 5 Nov 5, 2022
Playing diabolo with two robot arms in ROS + Gazebo

Playing diabolo with robots This repository holds the ROS packages for playing diabolo with two UR5e robot arms on ROS Melodic (Ubuntu 18.04). Read ou

null 23 Dec 18, 2022
Mini Pupper - Open-Source,ROS Robot Dog Kit

Mini Pupper - Open-Source,ROS Robot Dog Kit

MangDang 747 Dec 28, 2022
Projet d'integration SRI 3A ROS

projet-integration-sri-2021-2022 Projet d'intégration ROS SRI 2021 2022 Organization: Planification de tâches Perception Saisie: Cédérick Mouliets Sim

AIP Primeca Occitanie 3 Jan 7, 2022
Connect a TeslaMate instance to Home Assistant, using MQTT

TeslaBuddy Connect a TeslaMate instance to Home Assistant, using MQTT. It allows basic control of your Tesla vehicle via Home Assistant (currently, ju

null 4 May 23, 2022
GUI wrapper designed for convenient service work with TI CC1352/CC2538/CC2652 based Zigbee sticks or gateways. Packed into single executable file

ZigStar GW Multi tool is GUI wrapper firtsly designed for convenient service work with Zig Star LAN GW, but now supports any TI CC1352/CC2538/CC2652 b

null 133 Jan 1, 2023
Robot Framework keyword library wrapper for atlassian-python-api

Robot Framework keyword library wrapper for atlassian-python-api

Marcin Koperski 3 Jul 29, 2022
Python Wrapper for Homeassistant's REST API

HomeassistantAPI Python Wrapper for Homeassistant's REST API Please ⭐️ the repo if you find this project useful or cool! Here is a quick example. from

Nate 29 Dec 31, 2022
Pylorawan is a Micropython wrapper for lorawan devices from RAK Wireless.

pylorawan Pylorawan is a Micropython wrapper for lorawan devices from RAK Wireless. Tested on a Raspberry PI Pico with a RAK4200(H) Evaluation Board (

Peter Houghton 3 Nov 4, 2022
Micropython-wifimanager-esp8266 - Simple Wifi Manager for ESP8266 using MicroPython

micropython-wifimanager-esp8266 Simple Wifi Manager for ESP8266 using MicroPytho

Abhinuv Nitin Pitale 1 Jan 4, 2022
A simple non-official manager interface I'm using for my Raspberry Pis.

My Raspberry Pi Manager Overview I have two Raspberry Pi 4 Model B devices that I hooked up to my two TVs (one in my bedroom and the other in my new g

Christian Deacon 21 Jan 4, 2023
Alternative firmware for ESP8266 with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at

Alternative firmware for ESP8266/ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability

Theo Arends 59 Dec 26, 2022
A module for cross-platform control of the mouse and keyboard in python that is simple to install and use.

PyUserInput PyUserInput is a group project so we've moved the project over to a group organization: https://github.com/PyUserInput/PyUserInput . That

Paul Barton 1k Dec 27, 2022
Simple Python script to decode and verify an European Health Certificate QR-code

A simple Python script to decode and verify an European Health Certificate QR-code.

Mathias Panzenböck 61 Oct 5, 2022
This is a Virtual Keyboard which is simple yet effective to use.

Virtual-Keyboard This is a Virtual KeyBoard which can track finger movements and lets you type anywhere ranging from notepad to even web browsers. It

Jehan Patel 3 Oct 1, 2021
A simple Python script for toggling Philips Hue Lights by clapping

LightsClap A simple Python script for toggling Philips Hue Lights by clapping Usage pip3 install -r requirements.txt python3 main.py and press the Ent

Flux Industries 2 Nov 16, 2021
A Simple Python KeyLogger App

✨ Kurulum Uygulamayı bilgisayarınızda kullana bilmek için bazı işlemler yapmanız gerekiyor. Aşağıdaki yönlendirmeleri takip ederek bunu yapabilirsiniz

VorteX 7 Jun 11, 2022
A simple Picobot project implemented in Python

Python-Picobot A simple Picobot project implemented in Python About Explanation This is my first programming project. Picobot use rules.txt file which

Shayan Shiravani 0 Apr 3, 2022