This commit is contained in:
2025-06-21 13:42:44 +08:00
6 changed files with 2174 additions and 5 deletions

View File

@ -5,7 +5,7 @@ from os import getcwd
sets = ['train', 'val', 'test']
classes = ['tag', 'bandage']
classes = ['tag', 'bandage', 'word', 'package']
def convert(size, box):
@ -51,8 +51,9 @@ def convert_annotation(image_id, imgname_list, label_path, Annotation_path, imag
cls_id = classes.index(cls)
xmlbox = obj.find('bndbox')
b = (
float(xmlbox.find('xmin').text), float(xmlbox.find('xmax').text), float(xmlbox.find('ymin').text),
float(xmlbox.find('ymax').text))
float(xmlbox.find('xmin').text), float(xmlbox.find('xmax').text),
float(xmlbox.find('ymin').text),
float(xmlbox.find('ymax').text))
b1, b2, b3, b4 = b
# 标注越界修正