u2seg / U2Seg

[CVPR 2024] Code release for "Unsupervised Universal Image Segmentation"
Apache License 2.0
147 stars 5 forks source link

No suitable configs for ImageNet + COCO ckpts #9

Open ControllableGeneration opened 2 months ago

ControllableGeneration commented 2 months ago

I use pretrained ckpt _imagenetcoco_800_model_9000.pth_ with _configs/u2seg_eval800.yaml and get an error:

list index out of range
  File "/root/mambaforge/lib/python3.10/site-packages/detectron2/utils/visualizer.py", line 244, in <listcomp>
    labels = [class_names[i] for i in classes]
  File "/root/mambaforge/lib/python3.10/site-packages/detectron2/utils/visualizer.py", line 244, in _create_text_labels
    labels = [class_names[i] for i in classes]
  File "/root/mambaforge/lib/python3.10/site-packages/detectron2/utils/visualizer.py", line 534, in draw_panoptic_seg
    labels = _create_text_labels(
  File "/raid/bzy/U2Seg-main/demo/predictor.py", line 54, in run_on_image
    vis_output = visualizer.draw_panoptic_seg_predictions(
  File "/raid/bzy/U2Seg-main/demo/u2seg_demo.py", line 121, in <module>
    predictions, visualized_output = demo.run_on_image(img)
  File "/root/mambaforge/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/root/mambaforge/lib/python3.10/runpy.py", line 196, in _run_module_as_main (Current frame)
    return _run_code(code, main_globals, None,
IndexError: list index out of range

I debug into it and realize that the config presume that there are only 80 classes (aligned with COCO), but the pretrained ckpt can produce indices up to 1000 (aligned with ImageNet).

Can you provide users with more configs, that are suitable for ImageNet + COCO ckpts?

ControllableGeneration commented 2 months ago

Or, maybe it is a matter of detectron2. Which commit of detectron2 should I use?

virmanii commented 1 week ago

Any update?