fudan-zvg / SETR

[CVPR 2021] Rethinking Semantic Segmentation from a Sequence-to-Sequence Perspective with Transformers
MIT License
1.05k stars 150 forks source link

could you share the demo of SETR? #48

Open JoyHuYY1412 opened 2 years ago

JoyHuYY1412 commented 2 years ago

The demo in your repo is written for pspnet, so could you share the demo for SETR?

bpiyush commented 2 years ago

+1. Would be really helpful to share an inference demo for SETR. I tried using SETR-Naive model (replaced the given PSPNet model in the demo) but end up with the following error (with trace).

File ~/projects/video-segcap/lib/SETR/mmseg/datasets/pipelines/test_time_aug.py:59, in MultiScaleFlipAug.__init__(self, transforms, img_scale, img_ratios, flip, flip_direction)
     53 def __init__(self,
     54              transforms,
     55              img_scale,
     56              img_ratios=None,
     57              flip=False,
     58              flip_direction='horizontal'):
---> 59     self.transforms = Compose(transforms)
     60     if img_ratios is not None:
     61         # mode 1: given a scale and a range of image ratio
     62         img_ratios = img_ratios if isinstance(img_ratios,
     63                                               list) else [img_ratios]

File ~/projects/video-segcap/lib/SETR/mmseg/datasets/pipelines/compose.py:22, in Compose.__init__(self, transforms)
     20 for transform in transforms:
     21     if isinstance(transform, dict):
---> 22         transform = build_from_cfg(transform, PIPELINES)
     23         self.transforms.append(transform)
     24     elif callable(transform):

File ~/install/miniconda3/envs/clip/lib/python3.8/site-packages/mmcv/utils/registry.py:171, in build_from_cfg(cfg, registry, default_args)
    167 else:
    168     raise TypeError(
    169         f'type must be a str or valid type, but got {type(obj_type)}')
--> 171 return obj_cls(**args)

TypeError: __init__() got an unexpected keyword argument 'dataset'