Skip to content

Commit

Permalink
Move some variable (#19)
Browse files Browse the repository at this point in the history
* Move some variable

* bump 12.0.3
  • Loading branch information
xvjiarui authored Sep 20, 2020
1 parent 558d9e5 commit 01f805c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions pycocotools/pycocotools/coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ def __init__(self, annotation_file=None):
self.dataset, self.anns, self.cats, self.imgs = dict(), dict(), dict(
), dict()
self.imgToAnns, self.catToImgs = defaultdict(list), defaultdict(list)
self.img_ann_map = self.imgToAnns
self.cat_img_map = self.catToImgs
if annotation_file is not None:
print('loading annotations into memory...')
tic = time.time()
Expand All @@ -92,6 +90,8 @@ def __init__(self, annotation_file=None):
print('Done (t={:0.2f}s)'.format(time.time() - tic))
self.dataset = dataset
self.createIndex()
self.img_ann_map = self.imgToAnns
self.cat_img_map = self.catToImgs

def createIndex(self):
# create index
Expand Down Expand Up @@ -123,8 +123,6 @@ def createIndex(self):
self.catToImgs = catToImgs
self.imgs = imgs
self.cats = cats
self.img_ann_map = self.imgToAnns
self.cat_img_map = self.catToImgs

def info(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion pycocotools/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
install_requires=[
'setuptools>=18.0', 'cython>=0.27.3', 'matplotlib>=2.1.0'
],
version='12.0.2',
version='12.0.3',
ext_modules=ext_modules)

0 comments on commit 01f805c

Please sign in to comment.