Commit 545314ae authored by holzinger's avatar holzinger
Browse files

Update categories_labels.py

parent 1e56fc18
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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)