u2seg / U2Seg

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

inference error #14

Open regainOWO opened 2 hours ago

regainOWO commented 2 hours ago

i use the inference demo. and the checkpoint is cocotrain_800_0089999.pth, it got an error

python ./demo/u2seg_demo.py --config-file configs/COCO-PanopticSegmentation/u2seg_eval_800.yaml --input demo/images/*jpg --output results/demo_800
Traceback (most recent call last):
  File "./demo/u2seg_demo.py", line 121, in <module>
    predictions, visualized_output = demo.run_on_image(img)
  File "/media/ubuntu20/EXOS_1/fxk/projects/unsupervised/U2Seg/demo/predictor.py", line 54, in run_on_image
    vis_output = visualizer.draw_panoptic_seg_predictions(
  File "/home/ubuntu20/fxk/VENVS/openmmlab_old/lib/python3.8/site-packages/detectron2/utils/visualizer.py", line 534, in draw_panoptic_seg
    labels = _create_text_labels(
  File "/home/ubuntu20/fxk/VENVS/openmmlab_old/lib/python3.8/site-packages/detectron2/utils/visualizer.py", line 244, in _create_text_labels
    labels = [class_names[i] for i in classes]
  File "/home/ubuntu20/fxk/VENVS/openmmlab_old/lib/python3.8/site-packages/detectron2/utils/visualizer.py", line 244, in <listcomp>
    labels = [class_names[i] for i in classes]
IndexError: list index out of range

image

regainOWO commented 2 hours ago

u2seg_eval_800.yaml content

_BASE_: "Base-Panoptic-FPN.yaml"
MODEL:
  PIXEL_MEAN: [ 123.675, 116.280, 103.530 ]
  PIXEL_STD: [ 58.395, 57.120, 57.375 ]
  WEIGHTS: "ckpts/cocotrain_800_0089999.pth"
  RESNETS:
    DEPTH: 50
    NORM: "SyncBN"
    STRIDE_IN_1X1: False
  BACKBONE:
    FREEZE_AT: 0
  SEM_SEG_HEAD:
    NUM_CLASSES: 28
  ROI_BOX_HEAD:
    CLS_AGNOSTIC_BBOX_REG: True
  RPN:
    POST_NMS_TOPK_TRAIN: 4000
    NMS_THRESH: 0.65
  FPN:
    NORM: "SyncBN"
  ROI_HEADS:
    NAME: CascadeROIHeads
    NUM_CLASSES: 800

SOLVER:
  STEPS: (210000, 250000)
  MAX_ITER: 270000
  IMS_PER_BATCH: 16
  BASE_LR: 0.01
  WEIGHT_DECAY: 0.00005
  GAMMA: 0.02
  CLIP_GRADIENTS:
    CLIP_TYPE: norm
    CLIP_VALUE: 1.0
    ENABLED: true
    NORM_TYPE: 2.0
  AMP:
    ENABLED: True
  CHECKPOINT_PERIOD: 10000

INPUT:
  MIN_SIZE_TRAIN: (240, 320, 480, 640, 672, 704, 736, 768, 800, 1024)
  MAX_SIZE_TRAIN: 1333
  MASK_FORMAT: "bitmask"
  FORMAT: "RGB"
TEST:
  EVAL_PERIOD: 0
  PRECISE_BN:
    ENABLED: True
    NUM_ITER: 200
  DETECTIONS_PER_IMAGE: 100

OUTPUT_DIR: ./u2seg_300_coco_eval