lhoyer / DAFormer

[CVPR22] Official Implementation of DAFormer: Improving Network Architectures and Training Strategies for Domain-Adaptive Semantic Segmentation
Other
466 stars 91 forks source link

The running order of code. #63

Closed QChhh123 closed 1 year ago

QChhh123 commented 1 year ago

Thank you for your great work, I'm really interested in it.

Due to my poor coding ability, there are some questions about the framework. In your config file, we can know that you define uda part as a segmentor, https://github.com/lhoyer/DAFormer/blob/1dc68355f6ce8c5abb58d3900b094097b8b13d1e/mmseg/models/uda/uda_decorator.py#L29 but in the model part there is a segmentor too. https://github.com/lhoyer/DAFormer/blob/1dc68355f6ce8c5abb58d3900b094097b8b13d1e/configs/_base_/models/daformer_conv1_mitb5.py#L13 Why there are two segmentors, and what's the running logit of that. Looking forward to your reply.

lhoyer commented 1 year ago

Thank you for your interest in our work!

UDADecorator is the base class for adding UDA training functionality to a segmentation model. It follows the decorator coding design pattern (https://en.wikipedia.org/wiki/Decorator_pattern). It contains a regular segmentation model (e.g. EncoderDecoder) as you can see here: https://github.com/lhoyer/DAFormer/blob/1dc68355f6ce8c5abb58d3900b094097b8b13d1e/mmseg/models/uda/uda_decorator.py#L34

A UDADecorator is built if the run config contains the config group 'uda' as you can see here: https://github.com/lhoyer/DAFormer/blob/438603d1cf9ebf58728fbfa440113aac3d733103/mmseg/models/builder.py#L51

QChhh123 commented 1 year ago

A very beneficial answer, thanks a lot.