Changed data code to load all images for testing

Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
Jim Martens 2019-08-11 15:30:41 +02:00
parent 4a8d072b97
commit 39f74fb3bf
1 changed files with 1 additions and 2 deletions

View File

@ -294,12 +294,11 @@ def load_coco_val_ssd(clean_dataset: callable,
annotation_file_minival = f"{coco_path}/annotations/instances_minival2014.json"
resized_shape = (image_size, image_size)
cats_to_classes, classes_to_cats, _, _ = coco_utils.get_coco_category_maps(annotation_file_minival)
inlier_cat_ids = [classes_to_cats[i] for i in range(1, 61)]
coco_val = coco.COCO(annotation_file_minival)
img_ids = coco_val.getImgIds() # return all image IDs belonging to given category
images = coco_val.loadImgs(img_ids) # load all images
annotation_ids = coco_val.getAnnIds(img_ids, catIds=inlier_cat_ids)
annotation_ids = coco_val.getAnnIds(img_ids)
annotations = coco_val.loadAnns(annotation_ids) # load all image annotations
file_names = {image['id']: f"{coco_path}/val2014/{image['file_name']}" for image in images}
ids_to_images = {image['id']: image for image in images}