问题描述
我正在开发一种对象检测模型,以使用YOLO检测船只。我想使用COCO数据集。有没有办法只下载带有注释的图像?
I am developing an object detection model to detect ships using YOLO. I want to use the COCO dataset. Is there a way to download only the images that have ships with the annotations?
推荐答案
根据我个人的了解,如果您仅谈论COCO数据集,我认为它们没有船舶类别。他们拥有的最接近的类别是船。这是检查可用类别的链接:
From what I personally know, if you're talking about the COCO dataset only, I don't think they have a category for "ships". The closest category they have is "boat". Here's the link to check the available categories: http://cocodataset.org/#overview
顺便说一句,船类中也有船只。
BTW, there are ships inside the boat category too.
如果您只想选择图像某个特定的COCO类别,您可能需要执行以下操作(摘自COCO的官方演示并进行了编辑):
If you want to just select images of a specific COCO category, you might want to do something like this (taken and edited from COCO's official demos):
# display COCO categories
cats = coco.loadCats(coco.getCatIds())
nms=[cat['name'] for cat in cats]
print('COCO categories: \n{}\n'.format(' '.join(nms)))
# get all images containing given categories (I'm selecting the "bird")
catIds = coco.getCatIds(catNms=['bird']);
imgIds = coco.getImgIds(catIds=catIds);
这篇关于如何下载Coco数据集的特定部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!