WongKinYiu / yolov7

Implementation of paper - YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors
GNU General Public License v3.0
13.34k stars 4.21k forks source link

/segment/predict.py does not provide output annotations #1483

Open lev-enzo opened 1 year ago

lev-enzo commented 1 year ago

I am running segmentation on a custom dataset (COCO-style) using the u7 fork (https://github.com/WongKinYiu/yolov7/blob/u7/seg/segment/predict.py). The predict.py file has an optional parameter --save-txt but it only gives the bbox points, not segmentation polygons (as the expected input). How can I export the segmentation polygons, or at least the masked images (per image per object/ class) ? I guess at the end there will be a new line something like: parser.add_argument('--save-segmentations', action='store_true', help='save the segmentation results to *.txt')

but where in the code do I get the these results from? and how to save them correctly? Alternatively just the masks would also be ok (which are created in lines 161-165 I think?).

thanks!

yulin010101 commented 1 year ago

You can try to save the mask as a picture.