Commit 53a6e1ee authored by holzinger's avatar holzinger
Browse files

Update extract_multilabel_pics.py

parent 90f6582d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -8,11 +8,11 @@ import os


coco = COCO(
    '/../../cocoapi/annotations/train/instances_train2017.json')
    '../../cocoapi/annotations/train/instances_train2017.json')
cats = coco.loadCats(coco.getCatIds())
nms = [cat['name'] for cat in cats]

path = '/../../cocoapi/multilabel_outer/'
path = '../../cocoapi/multilabel_outer/'
subfolder = path + 'multilabel_images/'
if not os.path.exists(path):
    print(f'Folder multilabel not existing.\nCreatue folder: {path}')
@@ -26,4 +26,4 @@ for category in nms:
    imgIds = coco.getImgIds(catIds=catIds)
    for pic in imgIds:
        name = coco.loadImgs(pic)[0]['file_name']
        shutil.copy2('/../../cocoapi/images/train/' + name, subfolder + name)
        shutil.copy2('../../cocoapi/images/train/' + name, subfolder + name)