This commit is contained in:
琉璃月光
2025-10-21 14:11:52 +08:00
parent 349449f2b7
commit df7c0730f5
363 changed files with 5386 additions and 578 deletions

View File

@ -90,13 +90,13 @@ def labelme_to_yolo_segmentation_batch(json_dir, output_dir, target_label="夹
# ================== 用户配置区 ==================
JSON_DIR = "/media/hx/04e879fa-d697-4b02-ac7e-a4148876ebb0/dataset/seg/class4" # LabelMe JSON 文件夹路径
JSON_DIR = "/media/hx/04e879fa-d697-4b02-ac7e-a4148876ebb0/dataset/seg/class3" # LabelMe JSON 文件夹路径
OUTPUT_DIR = "/media/hx/04e879fa-d697-4b02-ac7e-a4148876ebb0/dataset/seg/label" # 输出 YOLO 标注文件夹
TARGET_LABEL = "yeimian" # 只转换这个标签
TARGET_LABEL = "液面" # 只转换这个标签
#TARGET_LABEL = "夹具1" # 只转换这个标签i
CLASS_ID = 0 # YOLO 中该类的 ID
IMG_SHAPE = (1440, 2560) # 图像实际尺寸 (高度, 宽度)
#IMG_SHAPE = (1440, 2560) # 图像实际尺寸 (高度, 宽度)
IMG_SHAPE = (640, 640) # 图像实际尺寸 (高度, 宽度)
# ================== 执行转换 ==================
if __name__ == "__main__":
print(f"🚀 开始转换 LabelMe → YOLO (仅 '{TARGET_LABEL}')")