Bobholamovic 2 rokov pred
rodič
commit
5dc93677ba

+ 5 - 3
paddlers/rs_models/cd/backbones/resnet.py

@@ -168,10 +168,12 @@ class ResNet(nn.Layer):
     
     Args:
         Block (BasicBlock|BottleneckBlock): block module of model.
-        depth (int): layers of resnet, default: 50.
-        num_classes (int): output dim of last fc layer. If num_classes <=0, last fc 
+        depth (int): layers of resnet.
+        num_classes (int, optional): output dim of last fc layer. If num_classes <=0, last fc 
             layer will not be defined. Default: 1000.
-        with_pool (bool): use pool before the last fc layer or not. Default: True.
+        with_pool (bool, optional): use pool before the last fc layer or not. Default: True.
+        strides (tuple[int], optional): Strides to use in each stage. Default: (1, 1, 2, 2, 2).
+        norm_layer (nn.Layer|None): Type of normalization layer. Default: None.
     
     Examples:
         .. code-block:: python

+ 1 - 1
paddlers/rs_models/cd/cdnet.py

@@ -32,7 +32,7 @@ class CDNet(nn.Layer):
         num_classes (int): Number of target classes.
     """
 
-    def __init__(self, in_channels=6, num_classes=2):
+    def __init__(self, in_channels, num_classes):
         super(CDNet, self).__init__()
         self.conv1 = Conv7x7(in_channels, 64, norm=True, act=True)
         self.pool1 = nn.MaxPool2D(2, 2, return_mask=True)

+ 4 - 4
paddlers/rs_models/cd/changeformer.py

@@ -178,15 +178,15 @@ class ChangeFormer(nn.Layer):
         (https://arxiv.org/pdf/2201.01293.pdf).
 
     Args:
-        in_channels (int): Number of bands of the input images. Default: 3.
-        num_classes (int): Number of target classes. Default: 2.
+        in_channels (int): Number of bands of the input images.
+        num_classes (int): Number of target classes.
         decoder_softmax (bool, optional): Use softmax after decode or not. Default: False.
         embed_dim (int, optional): Embedding dimension of each decoder head. Default: 256.
     """
 
     def __init__(self,
-                 in_channels=3,
-                 num_classes=2,
+                 in_channels,
+                 num_classes,
                  decoder_softmax=False,
                  embed_dim=256):
         super(ChangeFormer, self).__init__()

+ 5 - 5
paddlers/rs_models/cd/fccdn.py

@@ -361,13 +361,13 @@ class FCCDN(nn.Layer):
         (https://arxiv.org/pdf/2105.10860.pdf).
 
     Args:
-        in_channels (int): Number of input channels. Default: 3.
-        num_classes (int): Number of target classes. Default: 2.
-        os (int): Number of output stride. Default: 16.
-        use_se (bool): Whether to use SEModule. Default: True.
+        in_channels (int): Number of input channels.
+        num_classes (int): Number of target classes.
+        os (int, optional): Number of output stride. Default: 16.
+        use_se (bool, optional): Whether to use SEModule. Default: True.
     """
 
-    def __init__(self, in_channels=3, num_classes=2, os=16, use_se=True):
+    def __init__(self, in_channels, num_classes, os=16, use_se=True):
         super(FCCDN, self).__init__()
         if os >= 16:
             dilation_list = [1, 1, 1, 1]

+ 10 - 10
paddlers/rs_models/seg/farseg.py

@@ -236,19 +236,19 @@ class FarSeg(nn.Layer):
     and pattern recognition. 2020: 4096-4105.
 
     Args:
-        in_channels (int): The number of image channels for the input model. Default: 3.
-        num_classes (int): The unique number of target classes. Default: 16.
-        backbone (str): A backbone network, models available in `paddle.vision.models.resnet`. Default: resnet50.
-        backbone_pretrained (bool): Whether the backbone network uses IMAGENET pretrained weights. Default: True.
-        fpn_out_channels (int): The number of channels output by the feature pyramid network. Default: 256.
-        fsr_out_channels (int): The number of channels output by the F-S relation module. Default: 256.
-        scale_aware_proj (bool): Whether to use scale awareness in F-S relation module. Default: True.
-        decoder_out_channels (int): The number of channels output by the decoder. Default: 128.
+        in_channels (int): Number of input channels.
+        num_classes (int): Unique number of target classes.
+        backbone (str, optional): Backbone network, one of models available in `paddle.vision.models.resnet`. Default: resnet50.
+        backbone_pretrained (bool, optional): Whether the backbone network uses IMAGENET pretrained weights. Default: True.
+        fpn_out_channels (int, optional): Number of channels output by the feature pyramid network. Default: 256.
+        fsr_out_channels (int, optional): Number of channels output by the F-S relation module. Default: 256.
+        scale_aware_proj (bool, optional): Whether to use scale awareness in F-S relation module. Default: True.
+        decoder_out_channels (int, optional): Number of channels output by the decoder. Default: 128.
     """
 
     def __init__(self,
-                 in_channels=3,
-                 num_classes=16,
+                 in_channels,
+                 num_classes,
                  backbone='resnet50',
                  backbone_pretrained=True,
                  fpn_out_channels=256,