vietanhdev / anylabeling

Effortless AI-assisted data labeling with AI support from YOLO, Segment Anything (SAM+SAM2), MobileSAM!!
https://anylabeling.nrl.ai
GNU General Public License v3.0
2.2k stars 236 forks source link

YOLOv5 segmentation now is possible! #46

Closed hdnh2006 closed 11 months ago

hdnh2006 commented 1 year ago

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, so swapRB=False has been set in order to avoid changes in the channels.

Again, if there is any change you need, please let me know.

vietanhdev commented 1 year ago

There are some differences between your YOLOv5 segmentation result with the result from this repo (using the same model).

For YOLOv5n Segmentation

n_segment n_segment_anylabeling

Note: Missing chairs and not good segmentation result in the man's leg.

For YOLOv5x Segmentation

x_segment x_segment_anylabeling

Could you please check the implementation for the reason? Thank you!

hdnh2006 commented 1 year ago

Thanks @vietanhdev,

Please, could you share the image you are using? so both, can work on the same source.

vietanhdev commented 1 year ago

Please check this image. photo-1595950009887-e9842bcbc1ae.png.zip