Browse Source

Fix typos and indents

Bobholamovic 2 years ago
parent
commit
0ac304641b

+ 4 - 2
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)

+ 3 - 3
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:
 

+ 3 - 2
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)

+ 1 - 1
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
+    type: BIT

+ 1 - 1
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
+    type: ChangeFormer

+ 1 - 1
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

+ 3 - 3
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
+    type: HRNet_W18_C
+        args:
+            num_classes: 21

+ 3 - 3
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
+    type: PPYOLO
+        args:
+            num_classes: 1