Loading preprocessing/coco_preprocessing/categories_labels.py +2 −3 Original line number Diff line number Diff line Loading @@ -7,12 +7,11 @@ import json import os path = '/softpro/ss18/caption/cocoapi/images_txt/' coco = COCO('/softpro/ss18/caption/cocoapi/annotations/train/instances_train2017.json') coco = COCO('../../cocoapi/annotations/train/instances_train2017.json') cats = coco.loadCats(coco.getCatIds()) nms = [cat['name'] for cat in cats] with open('labels.txt', 'w') as handle: with open('../../cocoapi/labels.txt', 'w') as handle: for category in nms: out = category + '\n' handle.write(out) Loading
preprocessing/coco_preprocessing/categories_labels.py +2 −3 Original line number Diff line number Diff line Loading @@ -7,12 +7,11 @@ import json import os path = '/softpro/ss18/caption/cocoapi/images_txt/' coco = COCO('/softpro/ss18/caption/cocoapi/annotations/train/instances_train2017.json') coco = COCO('../../cocoapi/annotations/train/instances_train2017.json') cats = coco.loadCats(coco.getCatIds()) nms = [cat['name'] for cat in cats] with open('labels.txt', 'w') as handle: with open('../../cocoapi/labels.txt', 'w') as handle: for category in nms: out = category + '\n' handle.write(out)