最近在使用COCO数据集做框检测,对其内容进行记录。

1、首先是下载COCO

MS COCO 数据集主页:http://mscoco.org/,进去以后点击DownLoad下载,2017要下载这些,总过有20多G

2、安装pycocotools

这个是解析COCO代码的工具包,具体安装方式为

apt-get install cython #先得在系统安装cython pip install cython #然后再用PIP安装一下
pip install pycocotools

3、解析COCO

ann_train_file='annotations/instances_train2017.json'
coco_train = COCO(ann_train_file)
#loading annotations into memory...
#Done (t=17.70s)
#creating index...
#index created!
coco_train.dataset['categories']
Out[25]:
[{'supercategory': 'person', 'id': 1, 'name': 'person'},{'supercategory': 'vehicle', 'id': 2, 'name': 'bicycle'},{'supercategory': 'vehicle', 'id': 3, 'name': 'car'},{'supercategory': 'vehicle', 'id': 4, 'name': 'motorcycle'},{'supercategory': 'vehicle', 'id': 5, 'name': 'airplane'},{'supercategory': 'vehicle', 'id': 6, 'name': 'bus'},{'supercategory': 'vehicle', 'id': 7, 'name': 'train'},{'supercategory': 'vehicle', 'id': 8, 'name': 'truck'},{'supercategory': 'vehicle', 'id': 9, 'name': 'boat'},{'supercategory': 'outdoor', 'id': 10, 'name': 'traffic light'},{'supercategory': 'outdoor', 'id': 11, 'name': 'fire hydrant'},{'supercategory': 'outdoor', 'id': 13, 'name': 'stop sign'},{'supercategory': 'outdoor', 'id': 14, 'name': 'parking meter'},{'supercategory': 'outdoor', 'id': 15, 'name': 'bench'},{'supercategory': 'animal', 'id': 16, 'name': 'bird'},{'supercategory': 'animal', 'id': 17, 'name': 'cat'},{'supercategory': 'animal', 'id': 18, 'name': 'dog'},{'supercategory': 'animal', 'id': 19, 'name': 'horse'},{'supercategory': 'animal', 'id': 20, 'name': 'sheep'},{'supercategory': 'animal', 'id': 21, 'name': 'cow'},{'supercategory': 'animal', 'id': 22, 'name': 'elephant'},{'supercategory': 'animal', 'id': 23, 'name': 'bear'},{'supercategory': 'animal', 'id': 24, 'name': 'zebra'},{'supercategory': 'animal', 'id': 25, 'name': 'giraffe'},{'supercategory': 'accessory', 'id': 27, 'name': 'backpack'},{'supercategory': 'accessory', 'id': 28, 'name': 'umbrella'},{'supercategory': 'accessory', 'id': 31, 'name': 'handbag'},{'supercategory': 'accessory', 'id': 32, 'name': 'tie'},{'supercategory': 'accessory', 'id': 33, 'name': 'suitcase'},{'supercategory': 'sports', 'id': 34, 'name': 'frisbee'},{'supercategory': 'sports', 'id': 35, 'name': 'skis'},{'supercategory': 'sports', 'id': 36, 'name': 'snowboard'},{'supercategory': 'sports', 'id': 37, 'name': 'sports ball'},{'supercategory': 'sports', 'id': 38, 'name': 'kite'},{'supercategory': 'sports', 'id': 39, 'name': 'baseball bat'},{'supercategory': 'sports', 'id': 40, 'name': 'baseball glove'},{'supercategory': 'sports', 'id': 41, 'name': 'skateboard'},{'supercategory': 'sports', 'id': 42, 'name': 'surfboard'},{'supercategory': 'sports', 'id': 43, 'name': 'tennis racket'},{'supercategory': 'kitchen', 'id': 44, 'name': 'bottle'},{'supercategory': 'kitchen', 'id': 46, 'name': 'wine glass'},{'supercategory': 'kitchen', 'id': 47, 'name': 'cup'},{'supercategory': 'kitchen', 'id': 48, 'name': 'fork'},{'supercategory': 'kitchen', 'id': 49, 'name': 'knife'},{'supercategory': 'kitchen', 'id': 50, 'name': 'spoon'},{'supercategory': 'kitchen', 'id': 51, 'name': 'bowl'},{'supercategory': 'food', 'id': 52, 'name': 'banana'},{'supercategory': 'food', 'id': 53, 'name': 'apple'},{'supercategory': 'food', 'id': 54, 'name': 'sandwich'},{'supercategory': 'food', 'id': 55, 'name': 'orange'},{'supercategory': 'food', 'id': 56, 'name': 'broccoli'},{'supercategory': 'food', 'id': 57, 'name': 'carrot'},{'supercategory': 'food', 'id': 58, 'name': 'hot dog'},{'supercategory': 'food', 'id': 59, 'name': 'pizza'},{'supercategory': 'food', 'id': 60, 'name': 'donut'},{'supercategory': 'food', 'id': 61, 'name': 'cake'},{'supercategory': 'furniture', 'id': 62, 'name': 'chair'},{'supercategory': 'furniture', 'id': 63, 'name': 'couch'},{'supercategory': 'furniture', 'id': 64, 'name': 'potted plant'},{'supercategory': 'furniture', 'id': 65, 'name': 'bed'},{'supercategory': 'furniture', 'id': 67, 'name': 'dining table'},{'supercategory': 'furniture', 'id': 70, 'name': 'toilet'},{'supercategory': 'electronic', 'id': 72, 'name': 'tv'},{'supercategory': 'electronic', 'id': 73, 'name': 'laptop'},{'supercategory': 'electronic', 'id': 74, 'name': 'mouse'},{'supercategory': 'electronic', 'id': 75, 'name': 'remote'},{'supercategory': 'electronic', 'id': 76, 'name': 'keyboard'},{'supercategory': 'electronic', 'id': 77, 'name': 'cell phone'},{'supercategory': 'appliance', 'id': 78, 'name': 'microwave'},{'supercategory': 'appliance', 'id': 79, 'name': 'oven'},{'supercategory': 'appliance', 'id': 80, 'name': 'toaster'},{'supercategory': 'appliance', 'id': 81, 'name': 'sink'},{'supercategory': 'appliance', 'id': 82, 'name': 'refrigerator'},{'supercategory': 'indoor', 'id': 84, 'name': 'book'},{'supercategory': 'indoor', 'id': 85, 'name': 'clock'},{'supercategory': 'indoor', 'id': 86, 'name': 'vase'},{'supercategory': 'indoor', 'id': 87, 'name': 'scissors'},{'supercategory': 'indoor', 'id': 88, 'name': 'teddy bear'},{'supercategory': 'indoor', 'id': 89, 'name': 'hair drier'},{'supercategory': 'indoor', 'id': 90, 'name': 'toothbrush'}]
coco_train.dataset['images'][0]
Out[26]:
{'license': 3,'file_name': '000000391895.jpg','coco_url': 'http://images.cocodataset.org/train2017/000000391895.jpg','height': 360,'width': 640,'date_captured': '2013-11-14 11:18:45','flickr_url': 'http://farm9.staticflickr.com/8186/8119368305_4e622c8349_z.jpg','id': 391895}
coco_train.dataset['annotations'][0]
Out[27]:
{'segmentation': [[239.97,260.24,222.04,270.49,199.84,253.41,213.5,227.79,259.62,200.46,274.13,202.17,277.55,210.71,249.37,253.41,237.41,264.51,242.54,261.95,228.87,271.34]],'area': 2765.1486500000005,'iscrowd': 0,'image_id': 558840,'bbox': [199.84, 200.46, 77.71, 70.88],'category_id': 58,'id': 156}详细的介绍可以看官网和知乎[链接](https://zhuanlan.zhihu.com/p/29393415)

COCO数据集合解析相关推荐

  1. yolov5 从配置环境到自己训练数据集合

    yolov5 (Macre) 目录 文章目录 yolov5 (Macre) 一.yolov5介绍 1 四种网络模型 2 yolov5 输入结构 2.1 **Mosaic数据增强** 2.2 **自适应 ...

  2. MATLAB中深度学习的数据集合

    简 介: 本文总结了部分MATLAB中用于深度学习的数据集合. 关键词: MATLAB,DEEPLENARING #mermaid-svg-xPWl4yTsAw5Z4HFe {font-family: ...

  3. 网络爬虫模拟登陆获取数据并解析实战(二)

    本文为原创博客,仅供学习使用.未经本人允许禁止复制下来,上传到百度文库等平台. 目录 分析要获取的数据 程序的结构 构建封装数据的model 模拟登陆程序并解析数据 结果展示 分析要获取的数据 下面继 ...

  4. android json.out,Android 之 json数据的解析(jsonReader)

    json数据的解析相对而言,还是比较容易的,实现的代码也十分简单.这里用的是jsonReade方法来进行json数据解析. 1.在解析之前,大家需要知道什么是json数据. json数据存储的对象是无 ...

  5. Android网络数据JSON解析使用总结

    一.JSON基础知识 (一)什么是json JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式. 易于人阅读和编写.同时也易于机器解析和生成. 它基于Java ...

  6. 利用百度APIStoreSDK获取Json数据并解析加载到ListView上

    效果图(这里只是截取了List中的一项): 一.:登录百度ApiStore,获取移动sdk Android版(同时有使用文档和示例),将jar包导入到项目中 Android Studio请在放入lib ...

  7. 2D人体姿态识别-Human3.6M与COCO数据集中,各人体骨骼关键点可视化及对应关节标注顺序(heatmap可视化,热力图和原图融合显示)

    003-2.processData 文章目录 前言 一.最终结果展示 1. Human3.6M数据集中32个人体关键点可视化及含义 2. COCO数据集中19个人体关键点可视化及含义 3. Human ...

  8. 【数据集合集】最全最新——智能交通和无人驾驶相关数据集

    [数据集合集]智能交通和无人驾驶相关 一.无人驾驶数据集: 1. The H3D Dataset: 2. nuscenes: 3. ApolloCar3D: 4. KITTI Vision Bench ...

  9. JavaScript——JSON数据和解析

    1.JSON(JavaScript Object Notation, JS对象简谱)是一种轻量级的数据交换格式.它基于 ECMAScript(European Computer Manufacture ...

  10. 教你动手写UDP协议栈 - UDP数据包解析<1>

    前景 为啥要自己写一个mini UDP的协议栈?因为我们干偷偷摸摸的事情,哈哈哈!!! 其实是为了不跑一个庞大的LWIP协议栈,通过自己写的mini udp协议栈截取数据包给设备升级.这样节省了很多资 ...

最新文章

  1. redis 中 set 和 hset 有什么不同,什么时候使用 hset 什么时候使用set?
  2. SQL 2014新特性- Delayed durability
  3. 联想 facebook android,Lenovo Vantage
  4. 指针与数组关联导致的一些现象
  5. python-pcl
  6. vim normal 模式下L键
  7. 计算机二级和英语四六级是同一个账号吗,英语四六级考试和计算机考试的登录账号和密码一样吗?我好像混了,但是密码一直输不对,...
  8. DES的原理及python实现
  9. python+OpenCV图像处理(十一)图像轮廓检测
  10. idou老师教你学Istio 27:解读Mixer Report流程
  11. Tarjan点的双联通(寻找割点)
  12. java string返回_老生常谈Java String字符串(必看篇)
  13. springboot集成jooq异常集合
  14. 客户需求分析8个维度_电商数据分析的4大思维和8个指标
  15. 合成孔径雷达影像(SAR图像)变化检测传统研究方法
  16. ubuntu各文件夹简介
  17. 惠普电脑无故出现第三方屏保
  18. 外虚内实是什么意思_俗语“五虚令人贫,五实人富贵”是什么意思?有道理吗?...
  19. UltraISO 如何制作U盘启动安装Win10系统
  20. Java合并流实现简单的文件合并示例

热门文章

  1. 蜗牛星际安装U-NAS
  2. 计算机上可以插键盘吗,电脑外接键盘好用吗 哪些键盘可以外接电脑使用
  3. 测试图片色域软件,显示器色域检测
  4. python做音频格式转换
  5. LocalDateTime日期格式之间的转换
  6. 国内主机备案是干嘛的? 国内免备案主机是真的吗?
  7. 儿童计算机编程竞赛,一年获全国少儿编程比赛一等奖,他是怎么做到的?
  8. nodejs个人学习笔记
  9. QT中on_pushButton_clicked()用法
  10. 微信公众号菜单html5,微信公众号自定义菜单全攻略