Installing COCO API in Windows(Python)
For all the ML enthusiast, especially someone starting with Google’s TensorFlow, COCO API is a must especially they provide a wide variety of Image data-sets.
This post is about how I installed COCO in windows. COCO officially does not support windows and it was not easily installable.
Prerequisites
Python
Steps
First, Clone the project from the official repository : https://github.com/cocodataset/cocoapi
Inside PythonAPI folder, we can find setpy.py file. Open the file and delete the following line:
extra_compile_args=[‘-Wno-cpp’, ‘-Wno-unused-function’, ‘-std=c99’]
Then open cmd in the PythonAPI folder and run the command
python setup.py build_ext install
Chances are you will get the error Visual Studio can’t build due to rc.exe
Follow the steps as specified in this stack overflow portal and rerun the command.
Quoting the post below::
I would assume that in your case you would copy
rc.exe
andrcdll.dll
tovisual studio 2012\vc\bin
or wherever you have it installed:Part 2: FIX LINK :
fatal error LNK1158: cannot run ‘rc.exe’
Add this to your PATH environment variables:
C:\Program Files (x86)\Windows Kits\8.0\bin\x86
Copy these files:
rc.exe
rcdll.dllFrom
C:\Program Files (x86)\Windows Kits\8.0\bin\x86
To
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin
Once you rerun the command, the COCO should get successfully installed in your windows system.