Ubuntu下python版COCO API的安装

论坛 期权论坛 编程之家     
选择匿名的用户   2021-5-29 23:40   61   0

COCO数据集的官方介绍:

COCO is a large image dataset designed for object detection, segmentation, person keypoints detection, stuff segmentation, and caption generation. This package provides Matlab, Python, and Lua APIs that assists in loading, parsing, and visualizing the annotations in COCO. Please visit http://cocodataset.org/ for more information on COCO, including for the data, paper, and tutorials.

使用coco数据集之前需要安装官方提供的api,github链接如下:

https://github.com/cocodataset/cocoapi

安装的时候根据python版本的不同,步骤也略有不同。

首先,切换到coco api下PythonAPI路径:

cd cocoapi/PythonAPI

1. python 2.7版本,在我的机器上直接make就可以正常使用。如果不行的话,参考如下步骤:

make
make install
python setup.py install

2. python 3.5版本

python3 setup.py build_ext --inplace
python3 setup.py build_ext install

配置完成后,通过测试pycocotools能否正常导入来检查cocoapi是否安装成功。

import pycocotools

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP