cocodataset / cocoapi - 配置环境

cocodataset / cocoapi - 配置环境

https://github.com/cocodataset/cocoapi
COCO API - Dataset
http://cocodataset.org/

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. The exact format of the annotations is also described on the COCO website. The Matlab and Python APIs are complete, the Lua API provides only basic functionality.

In addition to this API, please download both the COCO images and annotations in order to run the demos and use the API. Both are available on the project website.
-Please download, unzip, and place the images in: coco/images/
-Please download and place the annotations in: coco/annotations/
For substantially more details on the API please see http://cocodataset.org/#download.

After downloading the images and annotations, run the Matlab, Python, or Lua demos for example usage.

To install:
-For Matlab, add coco/MatlabApi to the Matlab path (OSX/Linux binaries provided)
-For Python, run "make" under coco/PythonAPI
-For Lua, run “luarocks make LuaAPI/rocks/coco-scm-1.rockspec” under coco/

strong@foreverstrong:~/darknet_model_validation/coco_detection_evaluation$ git clone https://github.com/cocodataset/cocoapi.git
Cloning into 'cocoapi'...
remote: Counting objects: 936, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 936 (delta 0), reused 4 (delta 0), pack-reused 931
Receiving objects: 100% (936/936), 11.69 MiB | 1.59 MiB/s, done.
Resolving deltas: 100% (557/557), done.
Checking connectivity... done.
strong@foreverstrong:~/darknet_model_validation/coco_detection_evaluation$ ls
cocoapi
strong@foreverstrong:~/darknet_model_validation/coco_detection_evaluation$ cd cocoapi/
strong@foreverstrong:~/darknet_model_validation/coco_detection_evaluation/cocoapi$ ls
common  license.txt  LuaAPI  MatlabAPI  PythonAPI  README.txt  results
strong@foreverstrong:~/darknet_model_validation/coco_detection_evaluation/cocoapi$ cd PythonAPI/
strong@foreverstrong:~/darknet_model_validation/coco_detection_evaluation/cocoapi/PythonAPI$ ls
Makefile  pycocoDemo.ipynb  pycocoEvalDemo.ipynb  pycocotools  setup.py

strong@foreverstrong:~/darknet_model_validation/coco_detection_evaluation/cocoapi/PythonAPI$ sudo pip install cython
[sudo] password for strong: 
The directory '/home/strong/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/strong/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting cython
  Downloading https://files.pythonhosted.org/packages/fe/d6/a097bd9913cc0fc974b968f5586d3f0609f46ca58b2aae3b8dfd51c1fe18/Cython-0.28.2-cp27-cp27mu-manylinux1_x86_64.whl (3.3MB)
    100% |████████████████████████████████| 3.3MB 516kB/s 
Installing collected packages: cython
Successfully installed cython-0.28.2
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

strong@foreverstrong:~/darknet_model_validation/coco_detection_evaluation/cocoapi/PythonAPI$ make
python setup.py build_ext --inplace
running build_ext
cythoning pycocotools/_mask.pyx to pycocotools/_mask.c
building 'pycocotools._mask' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/home/strong/.local/lib/python2.7/site-packages/numpy/core/include -I../common -I/usr/include/python2.7 -c ../common/maskApi.c -o build/temp.linux-x86_64-2.7/../common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/home/strong/.local/lib/python2.7/site-packages/numpy/core/include -I../common -I/usr/include/python2.7 -c pycocotools/_mask.c -o build/temp.linux-x86_64-2.7/pycocotools/_mask.o -Wno-cpp -Wno-unused-function -std=c99
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/pycocotools
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/../common/maskApi.o build/temp.linux-x86_64-2.7/pycocotools/_mask.o -o build/lib.linux-x86_64-2.7/pycocotools/_mask.so
copying build/lib.linux-x86_64-2.7/pycocotools/_mask.so -> pycocotools
rm -rf build
strong@foreverstrong:~/darknet_model_validation/coco_detection_evaluation/cocoapi/PythonAPI$

strong@foreverstrong:~/darknet_model_validation/coco_detection_evaluation/cocoapi$ mkdir images
strong@foreverstrong:~/darknet_model_validation/coco_detection_evaluation/cocoapi$ mkdir annotations

验证 cocodataset / cocoapi 配置环境
strong@foreverstrong:~/darknet_model_validation/coco_detection_evaluation/cocoapi/PythonAPI$ python
Python 2.7.12 (default, Dec  4 2017, 14:50:18) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pycocotools
>>> exit()
strong@foreverstrong:~/darknet_model_validation/coco_detection_evaluation/cocoapi/PythonAPI$

猜你喜欢

转载自blog.csdn.net/chengyq116/article/details/80443836