目标检测数据集标注笔记

本文介绍了目标检测中的常用数据集VOC和COCO,包括下载链接,并详细讲解了如何使用PyTorch库加载COCO数据集以及自定义数据集进行标注和可视化。
摘要由CSDN通过智能技术生成

一、目标检测常见数据集

1.VOC:​​​​​​

官网:The PASCAL Visual Object Classes Homepage (ox.ac.uk)

VOC2012:http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar

VOC2007:http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar

2.COCO:

官网:

​COCO - Common Objects in Context (cocodataset.org)

COCO2017val:http://images.cocodataset.org/zips/val2017.zip

COCO2017val annotations:http://images.cocodataset.org/annotations/stuff_annotations_trainval2017.zip

复制链接到迅雷下载更快

二、数据集标注

1.在线标注

Make Sense

https://app.cvat.ai/

2.软件标注:精灵标注助手-人工智能数据集标注工具 (jinglingbiaozhu.com)

三、用pytorch加载COCO数据集

import torchvision
from PIL import ImageDraw
coco_dataset=torchvision.datasets.CocoDetection(root="train2017/train2017",
                                                annFile="annotations_trainval2017/annotations/instances_train2017.json")

image,info=coco_dataset[0]
image_handler=ImageDraw.ImageDraw(image)

for annotation in info:
    x_min,y_min,width,height=annotation['bbox']
    image_handler.rectangle(((x_min,y_min),(x_min+width,y_min+height)))

image.show()

四、用pytorch加载自己数据集

import torchvision
from PIL import ImageDraw
coco_dataset=torchvision.datasets.CocoDetection(root="image/mydataset",
                                                annFile="image/instances_default.json")

image,info=coco_dataset[0]
image_handler=ImageDraw.ImageDraw(image)

for annotation in info:
    x_min,y_min,width,height=annotation['bbox']
    image_handler.rectangle(((x_min,y_min),(x_min+width,y_min+height)))

image.show()

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值