-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Open
Description
Minimal example to reproduce
from multiprocessing.pool import Pool
from pycocotools.coco import COCO
ann_file = '/home/nvme/MS-COCO/annotations/instances_train2017.json'
coco = COCO(ann_file)
category_ids = coco.getCatIds()
categories = coco.loadCats(category_ids)
img_ids = coco.getImgIds()
img_dicts = coco.loadImgs(img_ids)
num_classes = max(category_ids) + 1
def run(img_dict):
ann_ids = coco.getAnnIds(imgIds = img_dict['id'], iscrowd = None)
anns = coco.loadAnns(ann_ids)
for a in anns:
mask = coco.annToMask(a)
return None
p = Pool(16)
# This does not use much memory
#out = list(map(run, img_dicts))
# This chews up pretty much all of the memory of my system and doesn't give it back once map has finished
out = p.map(run, img_dicts)
del out
ofekp and accelotron
Metadata
Metadata
Assignees
Labels
No labels