Skip to content

Commit

Permalink
Fix Panoptic config (#10495)
Browse files Browse the repository at this point in the history
  • Loading branch information
hhaAndroid committed Jun 13, 2023
1 parent ad3b574 commit c7e171c
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 49 deletions.
2 changes: 1 addition & 1 deletion mmdet/datasets/ade20k.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,6 @@ def load_data_list(self) -> List[dict]:
data_info['seg_map_path'] = osp.join(ann_dir, seg_map)
data_info['label_map'] = self.label_map
if self.return_classes:
data_info['text'] = list(self._metainfo('classes'))
data_info['text'] = list(self._metainfo['classes'])
data_list.append(data_info)
return data_list
20 changes: 10 additions & 10 deletions projects/XDecoder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ Prepare your dataset according to the [docs](https://mmdetection.readthedocs.io/
**Test Command**

```shell
./tools/dist_test.sh projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-semseg_coco.py xdecoder_focalt_last_novg.pt 8
./tools/dist_test.sh projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-semseg_coco.py xdecoder_focalt_last_novg.pt 8 --cfg-options model.test_cfg.use_thr_for_mc=False
```

| Model | mIOU | Config |
| :------------------------------------------------ | :--: | :----------------------------------------------------------------: |
| `xdecoder-tiny_zeroshot_open-vocab-semseg_coco`\* | | [config](configs/xdecoder-tiny_zeroshot_open-vocab-semseg_coco.py) |
| Model | mIOU | mIOU(official) | Config |
| :------------------------------------------------ |:----:|---------------:| :----------------------------------------------------------------: |
| `xdecoder-tiny_zeroshot_open-vocab-semseg_coco`\* | 61.8 | 62.1 | [config](configs/xdecoder-tiny_zeroshot_open-vocab-semseg_coco.py) |

### Instance segmentation on COCO2017

Expand All @@ -77,9 +77,9 @@ Prepare your dataset according to the [docs](https://mmdetection.readthedocs.io/
./tools/dist_test.sh projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-instance_coco.py xdecoder_focalt_last_novg.pt 8
```

| Model | mAP | Config |
| :-------------------------------------------------- | :--: | :------------------------------------------------------------------: |
| `xdecoder-tiny_zeroshot_open-vocab-instance_coco`\* | 39.7 | [config](configs/xdecoder-tiny_zeroshot_open-vocab-instance_coco.py) |
| Model | mAP | mAP(official) | Config |
| :-------------------------------------------------- | :--: | ------------: | :------------------------------------------------------------------: |
| `xdecoder-tiny_zeroshot_open-vocab-instance_coco`\* | 39.7 | 39.7 | [config](configs/xdecoder-tiny_zeroshot_open-vocab-instance_coco.py) |

### Panoptic segmentation on COCO2017

Expand All @@ -91,9 +91,9 @@ Prepare your dataset according to the [docs](https://mmdetection.readthedocs.io/
./tools/dist_test.sh projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-panoptic_coco.py xdecoder_focalt_last_novg.pt 8
```

| Model | mIOU | Config |
| :-------------------------------------------------- | :--: | :------------------------------------------------------------------: |
| `xdecoder-tiny_zeroshot_open-vocab-panoptic_coco`\* | | [config](configs/xdecoder-tiny_zeroshot_open-vocab-panoptic_coco.py) |
| Model | PQ | PQ(official) | Config |
| :-------------------------------------------------- | :---: | :----------: | :------------------------------------------------------------------: |
| `xdecoder-tiny_zeroshot_open-vocab-panoptic_coco`\* | 51.16 | 51.16 | [config](configs/xdecoder-tiny_zeroshot_open-vocab-panoptic_coco.py) |

### Referring segmentation on RefCOCO

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_base_ = 'xdecoder-tiny_open-vocab-semseg.py'

model = dict(
head=dict(task='panoptic'), test_cfg=dict(mask_thr=0.8, overlap_thr=0.5))
head=dict(task='panoptic'), test_cfg=dict(mask_thr=0.8, overlap_thr=0.8))
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@
type='LoadImageFromFile',
imdecode_backend='pillow',
backend_args=_base_.backend_args),
dict(
type='FixScaleResize',
scale=800,
keep_ratio=True,
short_side_mode=True,
backend='pillow',
interpolation='bicubic'),
dict(type='Resize', scale=(1333, 800), backend='pillow', keep_ratio=True),
dict(
type='PackDetInputs',
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,12 @@
'mmdet::_base_/datasets/coco_panoptic.py'
]

# test_pipeline = [
# dict(
# type='LoadImageFromFile',
# imdecode_backend='pillow',
# backend_args=_base_.backend_args),
# dict(
# type='FixScaleResize',
# scale=800,
# keep_ratio=True,
# short_side_mode=True,
# backend='pillow',
# interpolation='bicubic'),
# dict(
# type='PackDetInputs',
# meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
# 'scale_factor', 'text', 'stuff_text'))
# ]

test_pipeline = [
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(type='Resize', scale=(1333, 800), keep_ratio=True),
dict(
type='LoadImageFromFile',
imdecode_backend='pillow',
backend_args=_base_.backend_args),
dict(type='Resize', scale=(1333, 800), backend='pillow', keep_ratio=True),
dict(
type='PackDetInputs',
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
_base_ = [
'_base_/xdecoder-tiny_ref-seg.py', 'mmdet::_base_/datasets/refcocog.py'
]

test_dataloader = dict(dataset=dict(split='val'))

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
data_root = 'data/coco/'

test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(1333, 800), keep_ratio=True),
dict(
type='LoadImageFromFile', imdecode_backend='pillow',
backend_args=None),
dict(type='Resize', scale=(1333, 800), backend='pillow', keep_ratio=True),
dict(
type='LoadAnnotations',
with_bbox=False,
Expand Down
3 changes: 0 additions & 3 deletions projects/XDecoder/configs/xdecoder-tiny_zeroshot_ref-seg.py

This file was deleted.

0 comments on commit c7e171c

Please sign in to comment.