-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segmentation Message Types? #87
Comments
What are you looking for? These don't appear to me to be pixel-wise segmentation classes, unless you're only looking at the https://github.com/ros-perception/vision_msgs/blob/ros2/vision_msgs/msg/Detection2D.msg does something like the |
Yes, happy to consider any proposals on the segmentation front! |
I agree with everything @SteveMacenski said. Personally, I'd go with one of the following approaches:
This also depends what's inside the mask image(s):
If it's a single segmentation image, I'd go with approach (2) above, for the reasons I've outlined in this comment. If it's individual object masks (which is what Mask R-CNN is doing), approach (2) becomes very cumbersome/impossible, so I'd go with approach (1). |
I'm not 100% sure I understand having detection and segmentation masks together - these are often different processes building bounding boxes vs pixel-wise segmentation masks (though I suppose a BB could be generated from a mask rather easily).
I agree instance segmentation vs class segmentation adds in a wrench. For class segmentation, 1 image is OK, but for instance segmentation, we may need N images for the |
@SteveMacenski @mintar For example, this is JPEGImage : The mask for class segmentation (semantic segmentation) is like this: Then for instance segmentation, they add another mask for object like this: By using this rule, only 2 mask images is needed. |
But how does that distinguish the class of the instance? If you just have instance 1...N for 1...N objects, you'd have multiple 1 blocks representing different first-instances of N classes I think that mask would need to have 2 values: 1 for the instance # and another for the class #. It doubles the message size which I don't love, but without doing bit shifting, that's I think the best we can do. For non-instance segmentation algorithms, that can be left empty/non-allocated so it shouldn't be a huge amount of overhead relative to the image segmentation message size. Thoughts @mintar ? |
@SteveMacenski For sementic segmentation, 1 mask image is needed: For instance segmentation 's result, 2 mask images are needed. Instance segmentation can also be explained like :
instead of publishing entire image mask as above approach. We could cut off the mask for each box. then attach the mask image to each box's msg. |
Hi! I found this issue after reading the README. There, it is stated that segmentation masks should be published as images. I have some doubts about this strategy: should it be one image per detection? Should it be structured the same way as proposed by @gachiemchiep (two images, instances and classes) + one for the confidence? I am confused, as some popular object segmentation algorithms provide full image mask scores, and publishing a full size image for each detection is not feasible. The first solution proposed by @mintar seems the most natural one to me, where for each detection a segmentation mask is provided. Is there any specific reason why this solution was not adopted? |
You can have various channels in an image (i.e. rgb has 3, greyscale has 1) -- but I would expect it to have ~2 channels: class and confidence. if instances are provided by that segmentation model, then 3 :-) You wouldn't need 3x images, you'd have 1x image of 3 channels |
It sounds simpler and more efficient to have separate single-channel images, no? They can be in the same message. Three single-channel images take up the same space as one three-channel image. If an implementation doesn't provide one type of information (e.g., instance segmentation), that image can be empty if the images are separated. If you mix it into a combined image, you're wasting space. Also, you save the effort of having to mux and demux the separate images into a composite 3-channel image both on the sender's and the receiver's end. |
How should we handle overlapping masks with this image-based approach? @mintar solution with one mask for each detection would work perfectly for overlapping masks. Moreover, I can see the sum of the masks for the detected objects being smaller than a full image quite often. |
usually, if there are detected objects smaller than the full image, you still want to maintain the entire image size for the segmentation, and use an "unknown" or "background" class for the other pixels. This is standard practice for segmentation pipelines, so that you maintain the position of the segmented objects in the image. |
By having a mask per detection, the semantic class would be part of the detection information. There would be no need to report the class in the mask itself, which could be a 1/0 (or 255/0) mask. The full image segmentation, if required (I can see an rviz plugin doing this) could be reconstructed by combining the information in the detection message (as the x, y coordinates of the related bounding box) with the provided mask. |
Hi!
I'm looking for a std ros type to use for segmentation outputs.
Something like these:
https://github.com/DavidFernandezChaves/Detectron2_ros/blob/master/msg/Result.msg
https://github.com/akio/mask_rcnn_ros/blob/kinetic-devel/msg/Result.msg
Is there something in this package that's suitable for this already? If not, how would I go about contributing a proposal and getting something merged?
The text was updated successfully, but these errors were encountered: