chrise96 / image-to-coco-json-converter

Convert segmentation RGB mask images to COCO JSON format
199 stars 57 forks source link

I don't know this error #7

Closed didnmj closed 2 years ago

didnmj commented 2 years ago

KeyError Traceback (most recent call last) in () 84 85 # Create images and annotations sections ---> 86 coco_format["images"], coco_format["annotations"], annotation_cnt = images_annotations_info(mask_path) 87 88 with open("output/{}.json".format(keyword),"w") as outfile:

in images_annotations_info(maskpath) 47 sub_masks = create_sub_masks(mask_image_open, w, h) 48 for color, sub_mask in sub_masks.items(): ---> 49 category_id = category_colors[color] 50 51 # "annotations" info

KeyError: '(130, 130, 130)'

chrise96 commented 2 years ago

Hi @ikjoooon, You can define this RGB value in category_colors in the main notebook.