How to download COCO dataset images? I'm trying to download the COCO dataset images using the following COCO API command:

from pycocotools.coco import COCO
import requests
catIds = COCO.getCatIds(catNms=['person','dog', 'car'])


... but getting the following error message. Any idea why is it so?

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
&lt;ipython-input-42-9cc4e2f62a0e&gt; in &lt;module&gt;
----&gt; 1 catIds = COCO.getCatIds(catNms=['person','dog', 'car'])

TypeError: getCatIds() missing 1 required positional argument: 'self'


Previously I configured pycocotools using the following instruction:
https://www.kaggle.com/c/tgs-salt-identification-challenge/discussion/62381
COCO is a python class and getCatIds is not a Static Method, tho can only be called by an instance/object of the Class COCO and not from the class itself.

You can probably solve it by doing this instead:

a = COCO() # calling init
catIds = a.getCatIds(catNms=['person','dog', 'car']) # calling the method from the class


(answer based on reading the code from https://github.com/cocodataset/cocoapi/blob/master/PythonAPI/pycocotools/coco.py)