yolov5 label格式说明
5个值分别为 :标签编号
box中心x
box中心y
宽
高
分别对应label
x_center
y_center
width
height
label值由训练时设定
比如训练时为'Car', 'Cyclist', 'Pedestrian'
那么
0对应'Car'
1对应'Cyclist'
2对应'Pedestrian'`
后4个值都在0-1之间,分别为box中心的x、box中心的y、图像宽、图像高。
box_x_min # 左上角横坐标
box_y_min # 左上角纵坐标
box_x_max # 右下角横坐标
box_y_max # 右下角纵坐标
x_center = float(box_x_min + box_x_max) / (2 * picture_width)
y_center = float(box_y_min + box_y_max) / (2 * picture_height)
width = float(box_x_max - box_x_min) / picture_width
height = float(box_y_max - box_y_min) / picture_height