RizwanMunawar / yolov7-segmentation

YOLOv7 Instance Segmentation using OpenCV and PyTorch
GNU General Public License v3.0
291 stars 74 forks source link

yolov7 segmentation on custom data #68

Open hdm30 opened 8 months ago

hdm30 commented 8 months ago

Hi,

I need to train yolov7 on custom data. I labeled my data using online annotation tool that generates coordinates of polygon boxes that look like the following: 0 100 120 150 160 300 580 400 700 .... It seems that the format is different than yolo format. I'm wondering how should i proceed to convert the labels to yolo format.

Many thanks in advance.

dsuitt1 commented 5 months ago

I know this is an old comment, but for anyone else who might have the same question the yolo format for segmentation is class label x1 y1 x2 y2 ... xn yn but normalized by the image size. The values should be between 0 - 1. Divide the x values by image.shape[1] and the y values by image.shape[0].