This is a ROS2 wrapper for the DEtection TRansformer (DETR)
439
This is a ROS2 wrapper for the DEtection TRansformer (DETR). We utilize huggingface and the transformers for the source of the algorithm. The main idea is for this container to act as a standalone interface and node, removing the necessity to integrate separate packages and solve numerous dependency issues.
From Paper: The main ingredients of the new framework, called DEtection TRansformer or DETR, are a set-based global loss that forces unique predictions via bipartite matching, and a transformer encoder-decoder architecture. Given a fixed small set of learned object queries, DETR reasons about the relations of the objects and the global image context to directly output the final set of predictions in parallel. The new model is conceptually simple and does not require a specialized library, unlike many other modern detectors.
docker pull shaderobotics/detr-detection:${ROS2_DISTRO}-${MODEL_VERSION}git pull https://github.com/open-shade/detr_segmentation.gitcd detr_segmentationALGO_VERSION constant in /detr_seg/detr_seg.pydocker build . -t [name]. This will take a while. We have also provided associated cloudbuild.sh scripts to build on GCP all of the associated versions.resnet-50-panopticresnet-101-panopticMore information about these versions can be found in the paper. Size of the model increases with the number.
docker pull shaderobotics/beit-segmentation:foxy-resnet-50-panoptic
This wrapper utilizes 4 optional parameters to modify the data coming out of the published topics as well as the dataset YOLOS utilizes for comparison. Most parameters can be modified during runtime. However, if you wish to use your own dataset, you must pass that parameter in before runtime. If you are unsure how to pass or update parameters before or during runtime, visit the official ROS2 docs here.
The supported, optional parameters are...
| Name | Type | Default | Use |
|---|---|---|---|
| pub_image | Boolean | True | Enable or disable the pub of the processed image (with bounding boxes) |
| pub_pixels | Boolean | True | Enable or disable the pub of the pixels with associated classification IDs (8-bit image stream) |
| pub_detections | Boolean | True | Enable or disable the publishing of detections (whether or not to send back a string with all detections found) |
| pub_masks | Boolean | True | Enable or disable the publishing of masks (whether or not to send back a string with all detections found) |
You do not need to specify any parameters, unless you wish to modify the defaults.
| Name | IO | Type | Use |
|---|---|---|---|
| detr_seg/image_raw | sub | sensor_msgs.msg.Image | Takes the raw camera output to be processed |
| detr_seg/image | pub | sensor_msgs.msg.Image | Outputs the processed image with segmentation on top of the image |
| detr_seg/pixels | pub | sensor_msgs.msg.Image | Outputs each pixel classified with the associated class ID as an 8-bit stream |
| detr_seg/detections | pub | std_msgs.msg.String | Outputs all detected classes in the image |
| detr_seg/masks | pub | sensor_msgs.msg.Image | Outputs the masks all in one image colorized based on class |
To test and ensure that this package is properly installed, replace the Dockerfile in the root of this repo with what exists in the demo folder. Installed in the demo image contains a camera stream emulator by klintan which directly pubs images to the DETR node and processes it for you to observe the outputs.
To run this, run docker build . -t --net=host [name], then docker run -t [name]. Observing the logs for this will show you what is occuring within the container. If you wish to enter the running container and preform other activities, run docker ps, find the id of the running container, then run docker exec -it [containerId] /bin/bash
Content type
Image
Digest
Size
3.9 GB
Last updated
about 4 years ago
docker pull shaderobotics/detr-segmentation:humble-resnet-50-panoptic