-
-
Notifications
You must be signed in to change notification settings - Fork 236
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
YOLOv5 segmentation now is possible! #46
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution.
I think you have skipped all pre-commit when committing your code. Please do following:
- Please run
black -l 79 .
to format your code. - Run
pre-commit run --all-files
and refactor your code to follow this repo's standards. - Use uppercase character for the first character of all comments.
- Use models here: https://github.com/vietanhdev/anylabeling-assets/releases/tag/v0.3.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All changes requested have been done
if area > avg_area * 0.2 | ||
] | ||
contours = filtered_approx_contours | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the first point again as the last element to close the contour.
Like the line 271 of this file: https://github.com/vietanhdev/anylabeling/blob/master/anylabeling/services/auto_labeling/segment_anything.py
points.append(points[0])
The contours will not be closed if you don't do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some differences between your YOLOv5 segmentation result with the result from this repo (using the same model). For YOLOv5n Segmentation
Note: Missing chairs and not good segmentation result in the man's leg. For YOLOv5x Segmentation
Could you please check the implementation for the reason? |
Thanks @vietanhdev, Please, could you share the image you are using? so both, can work on the same source. |
Please check this image. |
In this PR you will be able to use YOLOv5 segmentation from Ultralytics to create masks and accelerate the process in labeling data.
All the segmentation models can be downloaded from here: https://github.com/hdnh2006/anylabeling-assets/releases/tag/v0.0.0
They have been exported with
--opset 12
as option as following:python export.py --weights yolov5x-seg.pt --include onnx --opset 12
An important change has been done in the
blob
preprocessing of all yolo models, since the image is already in BGR format, soswapRB=False
has been set in order to avoid changes in the channels.Again, if there is any change you need, please let me know.