Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Training ADE20K for Instance Segmentation Only #113

Open
eBeyzaG opened this issue Feb 25, 2024 · 0 comments
Open

Training ADE20K for Instance Segmentation Only #113

eBeyzaG opened this issue Feb 25, 2024 · 0 comments

Comments

@eBeyzaG
Copy link

eBeyzaG commented Feb 25, 2024

I'm trying to train OneFormer for instance segmentation on a COCO dataset but the results were not really good so I decided to try training ADE20k first to try and detect errors in my code.

Training with ade20k for instance only, I get the following error:

File "/OneFormer-main/datasets/custom_datasets/instance_coco_custom_dataset_mapper.py", line 209, in call
instances = utils.annotations_to_instances(annos, image_shape)
File "/lib/python3.10/site-packages/detectron2/data/detection_utils.py", line 418, in annotations_to_instances
raise ValueError(
ValueError: Failed to use mask_format=='polygon' from the given annotations!

Here are the steps I followed:
I created a folder named "ADEChallengeData2016" under the datasets directory. I downloaded the annotations_instance/ and images/ in there. As I will only train for instance, I didn't download other files.
After this, I ran the prepare_ade20k_ins_seg.py file which created the json files. However, when I inspect the json files, I noticed "counts" key under the "segmentation" key for annotations have confusing values which may be the cause of the problem. Here is an example:

{'id': 191613, 'image_id': 'ADE_train_00019634', 'iscrowd': 0, 'category_id': 19, 'bbox': [668, 313, 94, 192], 'segmentation': {'size': [512, 763], 'counts': 'a_^:8_?9_Oa0G9H8G9H8G9H8OM4L3L>C4K5L001N2O1N5M2L4100O1O2O0O100O2O0O1O100O2O0O100O101N10000O2O000O101O0O1000001O00000O2PBkNS=Q200O1000000F:FOF73;F;D;F:O2O001O01O01O00001O010O00001O01O01O1O01O01O001OhMX2bMa8'}, 'area': 8073}

I use ade20k/oneformer_R50_bs16_160k.yaml config file and I changed TEST.SEMANTIC_ON and PANOPTIC_ON to False and TASK to "instance". I also changed dataset mapper to instance_coco_custom_dataset_mapper.

How can I fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant