cocodataset / cocoapi

COCO API - Dataset @ http://cocodataset.org/
Other
6.07k stars 3.75k forks source link

Changing the 197 line code in the file cocoapi/PythonAPI/pycocotools/coco.py #316

Open lyw615 opened 5 years ago

lyw615 commented 5 years ago

if len(imgIds) == len(catIds) == 0: ids = self.imgs.keys() else: ids = set(imgIds) for i, catId in enumerate(catIds): if i == 0 and len(ids) == 0: ids = set(self.catToImgs[catId]) else: 197 -> ids &= set(self.catToImgs[catId]) In my annotations.json, the codes this line makes ids an empty list object. However,when i changed to ids |= set(self.catToImgs[catId]) ,everything was ok !! So i think some other situation should be included.

github756878399 commented 5 years ago

and coco.py import matplotlib; matplotlib.use('TkAgg') repair UserWarning: Matplotlib is currently using agg,which is a non-GUI backend, so cannot show the figure