cocodataset / panopticapi

COCO 2018 Panoptic Segmentation Task API (Beta version)
Other
424 stars 185 forks source link

KeyError: 'color' when running panoptic2detection_coco_format.py #33

Open vighneshbirodkar opened 4 years ago

vighneshbirodkar commented 4 years ago

Hello

I am trying to run the script panoptic2detection_coco_format.py

My full command is

python converters/panoptic2detection_coco_format.py   --input_json_file ~/data/coco_panoptic/annotations/panoptic_val2017.json --categories_json_file ./panoptic_coco_categories.json  --segmentations_folder ~/data/coco_panoptic/annotations/panoptic_val2017  --output_json_file ~/data/coco_panoptic/annotations/converted/panoptic2det_val2017.json

However, after a few seconds of processing the script errors out with

Traceback (most recent call last):
  File "converters/panoptic2detection_coco_format.py", line 153, in <module>
    args.things_only)
  File "converters/panoptic2detection_coco_format.py", line 120, in convert_panoptic_to_detection_coco_format
    category.pop('color')
KeyError: 'color'

I was wondering is this was a bug or a mistake in how I am invoking the converter. Any help would be appreciated.

Thanks Vighnesh

gouthamvgk commented 4 years ago

Comment out line 120 in panoptic2detection_coco_format.py and it runs fine. They are poping the key 'color' from the dictionary of each category, but the key 'color' is actually not present in the annotations.

zeng-hello-world commented 4 years ago

I tried the same operation with yours. The coco detection annotaion json file does not have color in categories, but the coco detection examples json file in this panoptic folder does.