-
-
Notifications
You must be signed in to change notification settings - Fork 16k
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
masks2segments function does not always work correctly #9784
Comments
@vladoossss thanks! Can you please submit a PR with your proposed changes? Change #1 doesn't suffice by itself? |
Yes, i've submitted new PR, based on this issue. |
@vladoossss good news 😃! Your original issue may now be fixed ✅ in PR #9785. To receive this update:
Thank you for spotting this issue and informing us of the problem. Please let us know if this update resolves the issue for you, and feel free to inform us of any other issues you discover or feature requests that come to mind. Happy trainings with YOLOv5 🚀! |
Search before asking
YOLOv5 Component
No response
Bug
When i use
segment/predict.py --save-txt
to save segmentation results, sometimes i had an error.The reason for this was an empty mask (only zeros), which was passed to the input of the masks2segments function. In this regard,
c = cv2.findContours(x, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)[0]
produced an empty tuple(due to previous transformations over the mask) and then there was an error.I made the following changes in 3 places to avoid this:
It helps me to avoid an error.
I understand that my changes are not perfect. The main goal was to point out the problem itself.
Environment
No response
Minimal Reproducible Example
No response
Additional
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: