bdd100k数据集VOC+YOLO格式79850张13类别

数据集格式:Pascal VOC格式+YOLO格式(不包含分割路径的txt文件,仅仅包含jpg图片以及对应的VOC格式xml文件和yolo格式txt文件)
图片数量(jpg文件个数):79850
标注数量(xml文件个数):79850
标注数量(txt文件个数):79850
标注类别数:13
标注类别名称:[“bicycle”,“bus”,“car”,“motorcycle”,“other person”,“other vehicle”,“pedestrian”,“rider”,“traffic light”,“traffic sign”,“trailer”,“train”,“truck”]
每个类别标注的框数:

类别名称框数
bicycle8161
bus13637
car803495
motorcycle3483
other person211
other vehicle889
pedestrian105573
rider5218
traffic light214746
traffic sign272977
trailer73
train143
truck32132
总框数1460738
使用标注工具:labelImg

标注规则:对类别进行画矩形框
重要说明:数据集经过检验发bddk100里面部分标注存在错误已经剔除
特别声明:本数据集不对训练的模型或者权重文件精度作任何保证,数据集只提供准确且合理标注

你可以使用以下代码将bddk100数据集转换为COCO格式: ```python import os import json from PIL import Image # BDDK100数据集的路径 bddk100_path = 'path_to_bddk100_dataset' output_path = 'path_to_save_coco_annotations' # 创建COCO格式的注释和图像列表 coco_data = { "info": {}, "licenses": [], "categories": [], "images": [], "annotations": [] } # 添加类别列表 category_list = ['car', 'bus', 'person', 'bike'] # 根据你的数据集进行修改 for i, category_name in enumerate(category_list): category = { "id": i+1, "name": category_name, "supercategory": "object" } coco_data["categories"].append(category) # 处理图像和注释 image_id = 1 annotation_id = 1 image_list = os.listdir(os.path.join(bddk100_path, 'images')) for image_filename in image_list: image_filepath = os.path.join(bddk100_path, 'images', image_filename) image = Image.open(image_filepath) image_info = { "file_name": image_filename, "height": image.height, "width": image.width, "id": image_id } coco_data["images"].append(image_info) annotation_filename = image_filename.replace(".jpg", ".json") annotation_filepath = os.path.join(bddk100_path, 'annotations', annotation_filename) with open(annotation_filepath, 'r') as f: annotation_data = json.load(f) for annotation in annotation_data['objects']: bbox = annotation['bbox'] annotation_info = { "id": annotation_id, "image_id": image_id, "category_id": category_list.index(annotation['category']) + 1, "bbox": bbox, "segmentation": [], "area": bbox[2] * bbox[3], "iscrowd": 0 } coco_data["annotations"].append(annotation_info) annotation_id += 1 image_id += 1 # 保存COCO格式的注释 with open(os.path.join(output_path, 'bddk100_coco.json'), 'w') as f: json.dump(coco_data, f) ``` 请替换`bddk100_path`为你的BDDK100数据集的路径,并设置`output_path`为你想要保存COCO注释的路径。此代码将遍历图像文件夹中的图像,并将其与相应的注释转换为COCO格式的JSON文件。注意,你需要根据你的数据集修改类别列表`category_list`。 运行以上代码后,你将得到一个名为`bddk100_coco.json`的COCO格式注释文件。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

FL1768317420

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值