-
Notifications
You must be signed in to change notification settings - Fork 3
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
Yolov8 segmentation output giving multiple contours per bounding box. #2
Comments
In general, a single object can consist of several parts, and in this case the mask will contain several polygons. If it so, you should treat all these polygons equally related to a single object with a single probability. What is your problem? To get a correct answer, please, provide more context., share the source image, the mask and the model that you used. |
Sometimes ONNX version of inference gives different results, than official YOLOv8 API, perhaps because of additional image preprocessing procedures and augmentations, used in the official package. You can either filter out small polygons and use only the biggest one, or learn the Ultralytics API source code to find, which way it preprocesses the source image before inference. I think, it is here: https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/predictor.py in the |
Hi. I am trying to write a custom code for handling segmentation output. The problem I am facing is converting the outputs to a binary mask and the binary mask detecting multiple contours for a single bounding box coordinate.
When I save the mask and have a look, I get multiple white contours for a single bounding box. And when this mask is passed to
cv2.drawContours
I get multiple polygon coordinates.I should have got a single polygon shape. Moreover there is a single probability attached to per box. Per box giving 5 contours is not matching with a single probability. If anyone can pls help me with this issueThe text was updated successfully, but these errors were encountered: