coco 检测 val2017的图片与标注用的图片分析

检测方面

1 coco val 2017的图片有5000张

2 annotations 中用的图片只有 4952张

[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import json
>>> a=json.load(open('instances_val2017.json'))
>>> print(type(a))
<class 'dict'>
>>> print(a.keys())
dict_keys(['images', 'annotations', 'info', 'categories', 'licenses'])
>>> print(len(a['images']))
5000
>>> print(len(a['annotations']))
36781

 

统计coco2017 验证集 标注所用图片的代码

def get_anns_image_id(json_file):
    """
    函数的作用是json文件中的image_id
    :param result_file: json文件名
    :return:
    """
    a = json.load(open(json_file))
    image_id_chongfu = []
    for i in range(len(a['annotations'])):
        image_id_chongfu.append(a['annotations'][i]['image_id'])
    image_id = set(image_id_chongfu)
    return list(image_id)

输出结果是4952  

因此标注用的的图片为 4952 张  (意味着一些图片没有标注)

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值