1. yolov5 detect.py输出的txt文件内的坐标信息,是归一化之后的数值,转换到xml中要乘以图片的宽高。
2.此外txt坐标信息为cx,cy,w,h,xml坐标信息是(x1,y1)(x2,y2)需要转换。
import os
import cv2
from pathlib import Path
class_name = ['bud', 'half', 'impurity', 'moldy', 'normal'
1. yolov5 detect.py输出的txt文件内的坐标信息,是归一化之后的数值,转换到xml中要乘以图片的宽高。
2.此外txt坐标信息为cx,cy,w,h,xml坐标信息是(x1,y1)(x2,y2)需要转换。
import os
import cv2
from pathlib import Path
class_name = ['bud', 'half', 'impurity', 'moldy', 'normal'