diff --git a/paddlers/tasks/change_detector.py b/paddlers/tasks/change_detector.py index 9d631e6..b3fa32c 100644 --- a/paddlers/tasks/change_detector.py +++ b/paddlers/tasks/change_detector.py @@ -1066,11 +1066,12 @@ class ChangeStar(BaseChangeDetector): class ChangeFormer(BaseChangeDetector): def __init__(self, - in_channels=3, num_classes=2, + use_mixed_loss=False, + losses=None, + in_channels=3, decoder_softmax=False, embed_dim=256, - use_mixed_loss=False, **params): params.update({ 'in_channels': in_channels, @@ -1081,4 +1082,5 @@ class ChangeFormer(BaseChangeDetector): model_name='ChangeFormer', num_classes=num_classes, use_mixed_loss=use_mixed_loss, + losses=losses, **params) diff --git a/paddlers/transforms/operators.py b/paddlers/transforms/operators.py index ec9b424..c7603b1 100644 --- a/paddlers/transforms/operators.py +++ b/paddlers/transforms/operators.py @@ -616,10 +616,10 @@ class RandomFlipOrRotate(Transform): probs (list[float]): Probabilities of performing flipping and rotation. Default: [0.35,0.25]. probsf (list[float]): Probabilities of 5 flipping modes (horizontal, - vertical, both horizontal diction and vertical, diagonal, - anti-diagonal). Default: [0.3, 0.3, 0.2, 0.1, 0.1]. + vertical, both horizontal and vertical, diagonal, anti-diagonal). + Default: [0.3, 0.3, 0.2, 0.1, 0.1]. probsr (list[float]): Probabilities of 3 rotation modes (90°, 180°, 270° - clockwise). Default: [0.25,0.5,0.25]. + clockwise). Default: [0.25, 0.5, 0.25]. Examples: diff --git a/test_tipc/config_utils.py b/test_tipc/config_utils.py index fa137f8..9f1b6fc 100644 --- a/test_tipc/config_utils.py +++ b/test_tipc/config_utils.py @@ -152,6 +152,7 @@ def parse_args(*args, **kwargs): if osp.exists(cfg_path): cfg = parse_configs(cfg_path, inherit_on) parser, node_keys = _cfg2args(cfg, parser, '') + node_keys = sorted(node_keys, reverse=True) args = parser.parse_args(*args, **kwargs) return _args2cfg(dict(), args, node_keys) elif cfg_path != '': @@ -178,7 +179,7 @@ class CfgNode(yaml.YAMLObject, metaclass=_CfgNodeMeta): super().__init__() self.type = dict_['type'] self.args = dict_.get('args', []) - self.module = self._get_module(dict_.get('module', '')) + self.module = dict_.get('module', '') @classmethod def set_context(cls, ctx): @@ -189,7 +190,7 @@ class CfgNode(yaml.YAMLObject, metaclass=_CfgNodeMeta): def build_object(self, mod=None): if mod is None: - mod = self.module + mod = self._get_module(self.module) cls = getattr(mod, self.type) if isinstance(self.args, list): args = build_objects(self.args) diff --git a/test_tipc/configs/cd/bit/bit.yaml b/test_tipc/configs/cd/bit/bit.yaml index 735a318..3d3c62b 100644 --- a/test_tipc/configs/cd/bit/bit.yaml +++ b/test_tipc/configs/cd/bit/bit.yaml @@ -5,4 +5,4 @@ _base_: ../_base_/airchange.yaml save_dir: ./test_tipc/output/cd/bit/ model: !Node - type: BIT \ No newline at end of file + type: BIT \ No newline at end of file diff --git a/test_tipc/configs/cd/changeformer/changeformer.yaml b/test_tipc/configs/cd/changeformer/changeformer.yaml index 072678b..785749d 100644 --- a/test_tipc/configs/cd/changeformer/changeformer.yaml +++ b/test_tipc/configs/cd/changeformer/changeformer.yaml @@ -5,4 +5,4 @@ _base_: ../_base_/airchange.yaml save_dir: ./test_tipc/output/cd/changeformer/ model: !Node - type: ChangeFormer \ No newline at end of file + type: ChangeFormer \ No newline at end of file diff --git a/test_tipc/configs/clas/_base_/ucmerced.yaml b/test_tipc/configs/clas/_base_/ucmerced.yaml index 424f45e..bff0b8f 100644 --- a/test_tipc/configs/clas/_base_/ucmerced.yaml +++ b/test_tipc/configs/clas/_base_/ucmerced.yaml @@ -64,7 +64,7 @@ num_epochs: 2 train_batch_size: 16 save_interval_epochs: 5 log_interval_steps: 50 -save_dir: e./test_tipc/output/clas/ +save_dir: ./test_tipc/output/clas/ learning_rate: 0.01 early_stop: False early_stop_patience: 5 diff --git a/test_tipc/configs/clas/hrnet/hrnet.yaml b/test_tipc/configs/clas/hrnet/hrnet.yaml index 2f0a000..f402c26 100644 --- a/test_tipc/configs/clas/hrnet/hrnet.yaml +++ b/test_tipc/configs/clas/hrnet/hrnet.yaml @@ -5,6 +5,6 @@ _base_: ../_base_/ucmerced.yaml save_dir: ./test_tipc/output/clas/hrnet/ model: !Node - type: HRNet_W18_C - args: - num_classes: 21 \ No newline at end of file + type: HRNet_W18_C + args: + num_classes: 21 \ No newline at end of file diff --git a/test_tipc/configs/det/ppyolo/ppyolo.yaml b/test_tipc/configs/det/ppyolo/ppyolo.yaml index 6d9ef3d..f36919c 100644 --- a/test_tipc/configs/det/ppyolo/ppyolo.yaml +++ b/test_tipc/configs/det/ppyolo/ppyolo.yaml @@ -5,6 +5,6 @@ _base_: ../_base_/sarship.yaml save_dir: ./test_tipc/output/det/ppyolo/ model: !Node - type: PPYOLO - args: - num_classes: 1 \ No newline at end of file + type: PPYOLO + args: + num_classes: 1 \ No newline at end of file