IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    coco2017数据集标注转化为yolo的标注格式

    coder4发表于 2024-09-12 04:19:39
    love 0
    我的需求是只保留人(和没有人的副样本),抽样,其他忽略 import json import os import shutil import random def coco_to_yolo_bbox(image_width, image_height, bbox): """ Convert bbox from COCO format to YOLO format. COCO format: [top_left_x, top_left_y, width, height] YOLO format: [x_center, y_center, width, height] (normalized) """ x_tl, y_tl, width, height = bbox x_center = (x_tl + width / 2.0) / image_width y_center = (y_tl + […]


沪ICP备19023445号-2号
友情链接