will-jl944 před 4 roky
rodič
revize
df7dc71cf8
32 změnil soubory, kde provedl 84 přidání a 782 odebrání
  1. 0 1
      dygraph/paddlex/__init__.py
  2. 44 207
      dygraph/paddlex/cls.py
  3. 8 259
      dygraph/paddlex/det.py
  4. 0 78
      dygraph/paddlex/models.py
  5. 5 209
      dygraph/paddlex/seg.py
  6. 1 1
      dygraph/tutorials/slim/prune/image_classification/mobilenetv2_train.py
  7. 1 1
      dygraph/tutorials/slim/prune/object_detection/yolov3_train.py
  8. 1 1
      dygraph/tutorials/slim/prune/semantic_segmentation/unet_train.py
  9. 1 1
      dygraph/tutorials/slim/quantize/image_classification/mobilenetv2_train.py
  10. 1 1
      dygraph/tutorials/slim/quantize/object_detection/yolov3_train.py
  11. 1 1
      dygraph/tutorials/slim/quantize/semantic_segmentation/unet_train.py
  12. 1 1
      dygraph/tutorials/train/image_classification/alexnet.py
  13. 1 1
      dygraph/tutorials/train/image_classification/darknet53.py
  14. 1 1
      dygraph/tutorials/train/image_classification/densenet121.py
  15. 1 1
      dygraph/tutorials/train/image_classification/hrnet_w18_c.py
  16. 1 1
      dygraph/tutorials/train/image_classification/mobilenetv3_large_w_custom_optimizer.py
  17. 1 1
      dygraph/tutorials/train/image_classification/mobilenetv3_small.py
  18. 1 1
      dygraph/tutorials/train/image_classification/resnet50_vd_ssld.py
  19. 1 1
      dygraph/tutorials/train/image_classification/shufflenetv2.py
  20. 1 1
      dygraph/tutorials/train/image_classification/xception41.py
  21. 1 1
      dygraph/tutorials/train/instance_segmentation/mask_rcnn_r50_fpn.py
  22. 1 1
      dygraph/tutorials/train/object_detection/faster_rcnn_hrnet_w18.py
  23. 1 1
      dygraph/tutorials/train/object_detection/faster_rcnn_r50_fpn.py
  24. 1 1
      dygraph/tutorials/train/object_detection/ppyolo.py
  25. 1 1
      dygraph/tutorials/train/object_detection/ppyolotiny.py
  26. 1 2
      dygraph/tutorials/train/object_detection/ppyolov2.py
  27. 1 1
      dygraph/tutorials/train/object_detection/yolov3_darknet53.py
  28. 1 1
      dygraph/tutorials/train/semantic_segmentation/bisenetv2.py
  29. 1 1
      dygraph/tutorials/train/semantic_segmentation/deeplabv3p_resnet50_vd.py
  30. 1 1
      dygraph/tutorials/train/semantic_segmentation/fastscnn.py
  31. 1 1
      dygraph/tutorials/train/semantic_segmentation/hrnet.py
  32. 1 1
      dygraph/tutorials/train/semantic_segmentation/unet.py

+ 0 - 1
dygraph/paddlex/__init__.py

@@ -21,7 +21,6 @@ from . import cv
 from . import seg
 from . import cls
 from . import det
-from . import models
 from . import tools
 
 from .cv.models.utils.visualize import visualize_detection

+ 44 - 207
dygraph/paddlex/cls.py

@@ -13,211 +13,48 @@
 # limitations under the License.
 
 from . import cv
-import paddlex.utils.logging as logging
 
-
-class ResNet18(cv.models.ResNet18):
-    def __init__(self, num_classes=1000, input_channel=None):
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        super(ResNet18, self).__init__(num_classes=num_classes)
-
-
-class ResNet34(cv.models.ResNet34):
-    def __init__(self, num_classes=1000, input_channel=None):
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        super(ResNet34, self).__init__(num_classes=num_classes)
-
-
-class ResNet50(cv.models.ResNet50):
-    def __init__(self, num_classes=1000, input_channel=None):
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        super(ResNet50, self).__init__(num_classes=num_classes)
-
-
-class ResNet101(cv.models.ResNet101):
-    def __init__(self, num_classes=1000, input_channel=None):
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        super(ResNet101, self).__init__(num_classes=num_classes)
-
-
-class ResNet50_vd(cv.models.ResNet50_vd):
-    def __init__(self, num_classes=1000, input_channel=None):
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        super(ResNet50_vd, self).__init__(num_classes=num_classes)
-
-
-class ResNet101_vd(cv.models.ResNet101_vd):
-    def __init__(self, num_classes=1000, input_channel=None):
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        super(ResNet101_vd, self).__init__(num_classes=num_classes)
-
-
-class ResNet50_vd_ssld(cv.models.ResNet50_vd_ssld):
-    def __init__(self, num_classes=1000, input_channel=None):
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        super(ResNet50_vd_ssld, self).__init__(num_classes=num_classes)
-
-
-class ResNet101_vd_ssld(cv.models.ResNet101_vd_ssld):
-    def __init__(self, num_classes=1000, input_channel=None):
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        super(ResNet101_vd_ssld, self).__init__(num_classes=num_classes)
-
-
-class DarkNet53(cv.models.DarkNet53):
-    def __init__(self, num_classes=1000, input_channel=None):
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        super(DarkNet53, self).__init__(num_classes=num_classes)
-
-
-class MobileNetV1(cv.models.MobileNetV1):
-    def __init__(self, num_classes=1000, input_channel=None):
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        super(MobileNetV1, self).__init__(num_classes=num_classes)
-
-
-class MobileNetV2(cv.models.MobileNetV2):
-    def __init__(self, num_classes=1000, input_channel=None):
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        super(MobileNetV2, self).__init__(num_classes=num_classes)
-
-
-class MobileNetV3_small(cv.models.MobileNetV3_small):
-    def __init__(self, num_classes=1000, input_channel=None):
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        super(MobileNetV3_small, self).__init__(num_classes=num_classes)
-
-
-class MobileNetV3_large(cv.models.MobileNetV3_large):
-    def __init__(self, num_classes=1000, input_channel=None):
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        super(MobileNetV3_large, self).__init__(num_classes=num_classes)
-
-
-class MobileNetV3_small_ssld(cv.models.MobileNetV3_small_ssld):
-    def __init__(self, num_classes=1000, input_channel=None):
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        super(MobileNetV3_small_ssld, self).__init__(num_classes=num_classes)
-
-
-class MobileNetV3_large_ssld(cv.models.MobileNetV3_large_ssld):
-    def __init__(self, num_classes=1000, input_channel=None):
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        super(MobileNetV3_large_ssld, self).__init__(num_classes=num_classes)
-
-
-class Xception41(cv.models.Xception41):
-    def __init__(self, num_classes=1000, input_channel=None):
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        super(Xception41, self).__init__(num_classes=num_classes)
-
-
-class Xception65(cv.models.Xception65):
-    def __init__(self, num_classes=1000, input_channel=None):
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        super(Xception65, self).__init__(num_classes=num_classes)
-
-
-class DenseNet121(cv.models.DenseNet121):
-    def __init__(self, num_classes=1000, input_channel=None):
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        super(DenseNet121, self).__init__(num_classes=num_classes)
-
-
-class DenseNet161(cv.models.DenseNet161):
-    def __init__(self, num_classes=1000, input_channel=None):
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        super(DenseNet161, self).__init__(num_classes=num_classes)
-
-
-class DenseNet201(cv.models.DenseNet201):
-    def __init__(self, num_classes=1000, input_channel=None):
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        super(DenseNet201, self).__init__(num_classes=num_classes)
-
-
-class ShuffleNetV2(cv.models.ShuffleNetV2):
-    def __init__(self, num_classes=1000, input_channel=None):
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        super(ShuffleNetV2, self).__init__(num_classes=num_classes)
-
-
-class HRNet_W18(cv.models.HRNet_W18_C):
-    def __init__(self, num_classes=1000, input_channel=None):
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        super(HRNet_W18, self).__init__(num_classes=num_classes)
-
-
-class AlexNet(cv.models.AlexNet):
-    def __init__(self, num_classes=1000, input_channel=None):
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        super(AlexNet, self).__init__(num_classes=num_classes)
+ResNet18 = cv.models.ResNet18
+ResNet34 = cv.models.ResNet34
+ResNet50 = cv.models.ResNet50
+ResNet101 = cv.models.ResNet101
+ResNet152 = cv.models.ResNet152
+
+ResNet18_vd = cv.models.ResNet18_vd
+ResNet34_vd = cv.models.ResNet34_vd
+ResNet50_vd = cv.models.ResNet50_vd
+ResNet50_vd_ssld = cv.models.ResNet50_vd_ssld
+ResNet101_vd = cv.models.ResNet101_vd
+ResNet101_vd_ssld = cv.models.ResNet101_vd_ssld
+ResNet152_vd = cv.models.ResNet152_vd
+ResNet200_vd = cv.models.ResNet200_vd
+
+MobileNetV1 = cv.models.MobileNetV1
+MobileNetV2 = cv.models.MobileNetV2
+MobileNetV3_small = cv.models.MobileNetV3_small
+MobileNetV3_large = cv.models.MobileNetV3_large
+
+AlexNet = cv.models.AlexNet
+
+DarkNet53 = cv.models.DarkNet53
+
+DenseNet121 = cv.models.DenseNet121
+DenseNet161 = cv.models.DenseNet161
+DenseNet169 = cv.models.DenseNet169
+DenseNet201 = cv.models.DenseNet201
+DenseNet264 = cv.models.DenseNet264
+
+HRNet_W18_C = cv.models.HRNet_W18_C
+HRNet_W30_C = cv.models.HRNet_W30_C
+HRNet_W32_C = cv.models.HRNet_W32_C
+HRNet_W40_C = cv.models.HRNet_W40_C
+HRNet_W44_C = cv.models.HRNet_W44_C
+HRNet_W48_C = cv.models.HRNet_W48_C
+HRNet_W64_C = cv.models.HRNet_W64_C
+
+Xception41 = cv.models.Xception41
+Xception65 = cv.models.Xception65
+Xception71 = cv.models.Xception71
+
+ShuffleNetV2 = cv.models.ShuffleNetV2
+ShuffleNetV2_swish = cv.models.ShuffleNetV2_swish

+ 8 - 259
dygraph/paddlex/det.py

@@ -12,269 +12,18 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import copy
 from . import cv
 from .cv.models.utils.visualize import visualize_detection, draw_pr_curve
-from paddlex.cv.transforms.operators import _NormalizeBox, _PadBox, _BboxXYXY2XYWH
-from paddlex.cv.transforms.batch_operators import BatchCompose, BatchRandomResize, BatchRandomResizeByShort, \
-    _BatchPadding, _Gt2YoloTarget
-import paddlex.utils.logging as logging
 
 visualize = visualize_detection
 draw_pr_curve = draw_pr_curve
 
+# detection
+YOLOv3 = cv.models.YOLOv3
+FasterRCNN = cv.models.FasterRCNN
+PPYOLO = cv.models.PPYOLO
+PPYOLOTiny = cv.models.PPYOLOTiny
+PPYOLOv2 = cv.models.PPYOLOv2
 
-class FasterRCNN(cv.models.FasterRCNN):
-    def __init__(self,
-                 num_classes=81,
-                 backbone='ResNet50',
-                 with_fpn=True,
-                 aspect_ratios=[0.5, 1.0, 2.0],
-                 anchor_sizes=[32, 64, 128, 256, 512],
-                 with_dcn=None,
-                 rpn_cls_loss=None,
-                 rpn_focal_loss_alpha=None,
-                 rpn_focal_loss_gamma=None,
-                 rcnn_bbox_loss=None,
-                 rcnn_nms=None,
-                 keep_top_k=100,
-                 nms_threshold=0.5,
-                 score_threshold=0.05,
-                 softnms_sigma=None,
-                 bbox_assigner=None,
-                 fpn_num_channels=256,
-                 input_channel=None,
-                 rpn_batch_size_per_im=256,
-                 rpn_fg_fraction=0.5,
-                 test_pre_nms_top_n=None,
-                 test_post_nms_top_n=1000):
-        if with_dcn is not None:
-            logging.warning(
-                "`with_dcn` is deprecated in PaddleX 2.0 and won't take effect. Defaults to False."
-            )
-        if rpn_cls_loss is not None:
-            logging.warning(
-                "`rpn_cls_loss` is deprecated in PaddleX 2.0 and won't take effect. "
-                "Defaults to 'SigmoidCrossEntropy'.")
-        if rpn_focal_loss_alpha is not None or rpn_focal_loss_gamma is not None:
-            logging.warning(
-                "Focal loss is deprecated in PaddleX 2.0."
-                " `rpn_focal_loss_alpha` and `rpn_focal_loss_gamma` won't take effect."
-            )
-        if rcnn_bbox_loss is not None:
-            logging.warning(
-                "`rcnn_bbox_loss` is deprecated in PaddleX 2.0 and won't take effect. "
-                "Defaults to 'SmoothL1Loss'")
-        if rcnn_nms is not None:
-            logging.warning(
-                "MultiClassSoftNMS is deprecated in PaddleX 2.0. "
-                "`rcnn_nms` and `softnms_sigma` won't take effect. MultiClassNMS will be used by default"
-            )
-        if bbox_assigner is not None:
-            logging.warning(
-                "`bbox_assigner` is deprecated in PaddleX 2.0 and won't take effect. "
-                "Defaults to 'BBoxAssigner'")
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        if isinstance(anchor_sizes[0], int):
-            anchor_sizes = [[size] for size in anchor_sizes]
-        super(FasterRCNN, self).__init__(
-            num_classes=num_classes - 1,
-            backbone=backbone,
-            with_fpn=with_fpn,
-            aspect_ratios=aspect_ratios,
-            anchor_sizes=anchor_sizes,
-            keep_top_k=keep_top_k,
-            nms_threshold=nms_threshold,
-            score_threshold=score_threshold,
-            fpn_num_channels=fpn_num_channels,
-            rpn_batch_size_per_im=rpn_batch_size_per_im,
-            rpn_fg_fraction=rpn_fg_fraction,
-            test_pre_nms_top_n=test_pre_nms_top_n,
-            test_post_nms_top_n=test_post_nms_top_n)
-
-
-class YOLOv3(cv.models.YOLOv3):
-    def __init__(self,
-                 num_classes=80,
-                 backbone='MobileNetV1',
-                 anchors=None,
-                 anchor_masks=None,
-                 ignore_threshold=0.7,
-                 nms_score_threshold=0.01,
-                 nms_topk=1000,
-                 nms_keep_topk=100,
-                 nms_iou_threshold=0.45,
-                 label_smooth=False,
-                 train_random_shapes=[
-                     320, 352, 384, 416, 448, 480, 512, 544, 576, 608
-                 ],
-                 input_channel=None):
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        if anchors is None:
-            anchors = [[10, 13], [16, 30], [33, 23], [30, 61], [62, 45],
-                       [59, 119], [116, 90], [156, 198], [373, 326]]
-        if anchor_masks is None:
-            anchor_masks = [[6, 7, 8], [3, 4, 5], [0, 1, 2]]
-        super(YOLOv3, self).__init__(
-            num_classes=num_classes,
-            backbone=backbone,
-            anchors=anchors,
-            anchor_masks=anchor_masks,
-            ignore_threshold=ignore_threshold,
-            nms_score_threshold=nms_score_threshold,
-            nms_topk=nms_topk,
-            nms_keep_topk=nms_keep_topk,
-            nms_iou_threshold=nms_iou_threshold,
-            label_smooth=label_smooth)
-        self.train_random_shapes = train_random_shapes
-
-    def _compose_batch_transform(self, transforms, mode='train'):
-        if mode == 'train':
-            default_batch_transforms = [
-                _BatchPadding(pad_to_stride=-1), _NormalizeBox(),
-                _PadBox(getattr(self, 'num_max_boxes', 50)), _BboxXYXY2XYWH(),
-                _Gt2YoloTarget(
-                    anchor_masks=self.anchor_masks,
-                    anchors=self.anchors,
-                    downsample_ratios=getattr(self, 'downsample_ratios',
-                                              [32, 16, 8]),
-                    num_classes=self.num_classes)
-            ]
-        else:
-            default_batch_transforms = [_BatchPadding(pad_to_stride=-1)]
-        if mode == 'eval' and self.metric == 'voc':
-            collate_batch = False
-        else:
-            collate_batch = True
-
-        custom_batch_transforms = []
-        random_shape_defined = False
-        for i, op in enumerate(transforms.transforms):
-            if isinstance(op, (BatchRandomResize, BatchRandomResizeByShort)):
-                if mode != 'train':
-                    raise Exception(
-                        "{} cannot be present in the {} transforms. ".format(
-                            op.__class__.__name__, mode) +
-                        "Please check the {} transforms.".format(mode))
-                custom_batch_transforms.insert(0, copy.deepcopy(op))
-                random_shape_defined = True
-        if not random_shape_defined:
-            default_batch_transforms.insert(
-                0,
-                BatchRandomResize(
-                    target_sizes=self.train_random_shapes, interp='RANDOM'))
-
-        batch_transforms = BatchCompose(
-            custom_batch_transforms + default_batch_transforms,
-            collate_batch=collate_batch)
-
-        return batch_transforms
-
-
-class PPYOLO(cv.models.PPYOLO):
-    def __init__(
-            self,
-            num_classes=80,
-            backbone='ResNet50_vd_ssld',
-            with_dcn_v2=None,
-            # YOLO Head
-            anchors=None,
-            anchor_masks=None,
-            use_coord_conv=True,
-            use_iou_aware=True,
-            use_spp=True,
-            use_drop_block=True,
-            scale_x_y=1.05,
-            # PPYOLO Loss
-            ignore_threshold=0.7,
-            label_smooth=False,
-            use_iou_loss=True,
-            # NMS
-            use_matrix_nms=True,
-            nms_score_threshold=0.01,
-            nms_topk=1000,
-            nms_keep_topk=100,
-            nms_iou_threshold=0.45,
-            train_random_shapes=[
-                320, 352, 384, 416, 448, 480, 512, 544, 576, 608
-            ],
-            input_channel=None):
-        if backbone == 'ResNet50_vd_ssld':
-            backbone = 'ResNet50_vd_dcn'
-        if with_dcn_v2 is not None:
-            logging.warning(
-                "`with_dcn_v2` is deprecated in PaddleX 2.0 and will not take effect. "
-                "To use backbone with deformable convolutional networks, "
-                "please specify in `backbone_name`. "
-                "Currently the only backbone with dcn is 'ResNet50_vd_dcn'.")
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-        super(PPYOLO, self).__init__(
-            num_classes=num_classes,
-            backbone=backbone,
-            anchors=anchors,
-            anchor_masks=anchor_masks,
-            use_coord_conv=use_coord_conv,
-            use_iou_aware=use_iou_aware,
-            use_spp=use_spp,
-            use_drop_block=use_drop_block,
-            scale_x_y=scale_x_y,
-            ignore_threshold=ignore_threshold,
-            label_smooth=label_smooth,
-            use_iou_loss=use_iou_loss,
-            use_matrix_nms=use_matrix_nms,
-            nms_score_threshold=nms_score_threshold,
-            nms_topk=nms_topk,
-            nms_keep_topk=nms_keep_topk,
-            nms_iou_threshold=nms_iou_threshold)
-        self.train_random_shapes = train_random_shapes
-
-    def _compose_batch_transform(self, transforms, mode='train'):
-        if mode == 'train':
-            default_batch_transforms = [
-                _BatchPadding(pad_to_stride=-1), _NormalizeBox(),
-                _PadBox(getattr(self, 'num_max_boxes', 50)), _BboxXYXY2XYWH(),
-                _Gt2YoloTarget(
-                    anchor_masks=self.anchor_masks,
-                    anchors=self.anchors,
-                    downsample_ratios=getattr(self, 'downsample_ratios',
-                                              [32, 16, 8]),
-                    num_classes=self.num_classes)
-            ]
-        else:
-            default_batch_transforms = [_BatchPadding(pad_to_stride=-1)]
-        if mode == 'eval' and self.metric == 'voc':
-            collate_batch = False
-        else:
-            collate_batch = True
-
-        custom_batch_transforms = []
-        random_shape_defined = False
-        for i, op in enumerate(transforms.transforms):
-            if isinstance(op, (BatchRandomResize, BatchRandomResizeByShort)):
-                if mode != 'train':
-                    raise Exception(
-                        "{} cannot be present in the {} transforms. ".format(
-                            op.__class__.__name__, mode) +
-                        "Please check the {} transforms.".format(mode))
-                custom_batch_transforms.insert(0, copy.deepcopy(op))
-                random_shape_defined = True
-        if not random_shape_defined:
-            default_batch_transforms.insert(
-                0,
-                BatchRandomResize(
-                    target_sizes=self.train_random_shapes, interp='RANDOM'))
-
-        batch_transforms = BatchCompose(
-            custom_batch_transforms + default_batch_transforms,
-            collate_batch=collate_batch)
-
-        return batch_transforms
+# instance segmentation
+MaskRCNN = cv.models.MaskRCNN

+ 0 - 78
dygraph/paddlex/models.py

@@ -1,78 +0,0 @@
-# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from . import cv
-
-# image classification
-ResNet18 = cv.models.ResNet18
-ResNet34 = cv.models.ResNet34
-ResNet50 = cv.models.ResNet50
-ResNet101 = cv.models.ResNet101
-ResNet152 = cv.models.ResNet152
-
-ResNet18_vd = cv.models.ResNet18_vd
-ResNet34_vd = cv.models.ResNet34_vd
-ResNet50_vd = cv.models.ResNet50_vd
-ResNet50_vd_ssld = cv.models.ResNet50_vd_ssld
-ResNet101_vd = cv.models.ResNet101_vd
-ResNet101_vd_ssld = cv.models.ResNet101_vd_ssld
-ResNet152_vd = cv.models.ResNet152_vd
-ResNet200_vd = cv.models.ResNet200_vd
-
-MobileNetV1 = cv.models.MobileNetV1
-MobileNetV2 = cv.models.MobileNetV2
-MobileNetV3_small = cv.models.MobileNetV3_small
-MobileNetV3_large = cv.models.MobileNetV3_large
-
-AlexNet = cv.models.AlexNet
-
-DarkNet53 = cv.models.DarkNet53
-
-DenseNet121 = cv.models.DenseNet121
-DenseNet161 = cv.models.DenseNet161
-DenseNet169 = cv.models.DenseNet169
-DenseNet201 = cv.models.DenseNet201
-DenseNet264 = cv.models.DenseNet264
-
-HRNet_W18_C = cv.models.HRNet_W18_C
-HRNet_W30_C = cv.models.HRNet_W30_C
-HRNet_W32_C = cv.models.HRNet_W32_C
-HRNet_W40_C = cv.models.HRNet_W40_C
-HRNet_W44_C = cv.models.HRNet_W44_C
-HRNet_W48_C = cv.models.HRNet_W48_C
-HRNet_W64_C = cv.models.HRNet_W64_C
-
-Xception41 = cv.models.Xception41
-Xception65 = cv.models.Xception65
-Xception71 = cv.models.Xception71
-
-ShuffleNetV2 = cv.models.ShuffleNetV2
-ShuffleNetV2_swish = cv.models.ShuffleNetV2_swish
-
-# object detection
-YOLOv3 = cv.models.YOLOv3
-FasterRCNN = cv.models.FasterRCNN
-PPYOLO = cv.models.PPYOLO
-PPYOLOTiny = cv.models.PPYOLOTiny
-PPYOLOv2 = cv.models.PPYOLOv2
-
-# instance segmentation
-MaskRCNN = cv.models.MaskRCNN
-
-# semantic segmentattion
-UNet = cv.models.UNet
-DeepLabV3P = cv.models.DeepLabV3P
-FastSCNN = cv.models.FastSCNN
-HRNet = cv.models.HRNet
-BiSeNetV2 = cv.models.BiSeNetV2

+ 5 - 209
dygraph/paddlex/seg.py

@@ -14,215 +14,11 @@
 
 from . import cv
 from .cv.models.utils.visualize import visualize_segmentation
-import paddlex.utils.logging as logging
 
 visualize = visualize_segmentation
 
-
-class UNet(cv.models.UNet):
-    def __init__(self,
-                 num_classes=2,
-                 upsample_mode='bilinear',
-                 use_bce_loss=False,
-                 use_dice_loss=False,
-                 class_weight=None,
-                 ignore_index=None,
-                 input_channel=None):
-        if num_classes > 2 and (use_bce_loss or use_dice_loss):
-            raise ValueError(
-                "dice loss and bce loss is only applicable to binary classification"
-            )
-        elif num_classes == 2:
-            if use_bce_loss and use_dice_loss:
-                use_mixed_loss = [('CrossEntropyLoss', 1), ('DiceLoss', 1)]
-            elif use_bce_loss:
-                use_mixed_loss = [('CrossEntropyLoss', 1)]
-            elif use_dice_loss:
-                use_mixed_loss = [('DiceLoss', 1)]
-            else:
-                use_mixed_loss = False
-        else:
-            use_mixed_loss = False
-
-        if class_weight is not None:
-            logging.warning(
-                "`class_weight` is not supported in PaddleX 2.0 currently and is forcibly set to None."
-            )
-        if ignore_index is not None:
-            logging.warning(
-                "`ignore_index` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 255."
-            )
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-
-        if upsample_mode == 'bilinear':
-            use_deconv = False
-        else:
-            use_deconv = True
-        super(UNet, self).__init__(
-            num_classes=num_classes,
-            use_mixed_loss=use_mixed_loss,
-            use_deconv=use_deconv)
-
-
-class DeepLabV3P(cv.models.DeepLabV3P):
-    def __init__(self,
-                 num_classes=2,
-                 backbone='ResNet50_vd',
-                 output_stride=8,
-                 aspp_with_sep_conv=None,
-                 decoder_use_sep_conv=None,
-                 encoder_with_aspp=None,
-                 enable_decoder=None,
-                 use_bce_loss=False,
-                 use_dice_loss=False,
-                 class_weight=None,
-                 ignore_index=None,
-                 pooling_crop_size=None,
-                 input_channel=None):
-        if num_classes > 2 and (use_bce_loss or use_dice_loss):
-            raise ValueError(
-                "dice loss and bce loss is only applicable to binary classification"
-            )
-        elif num_classes == 2:
-            if use_bce_loss and use_dice_loss:
-                use_mixed_loss = [('CrossEntropyLoss', 1), ('DiceLoss', 1)]
-            elif use_bce_loss:
-                use_mixed_loss = [('CrossEntropyLoss', 1)]
-            elif use_dice_loss:
-                use_mixed_loss = [('DiceLoss', 1)]
-            else:
-                use_mixed_loss = False
-        else:
-            use_mixed_loss = False
-
-        if aspp_with_sep_conv is not None:
-            logging.warning(
-                "`aspp_with_sep_conv` is deprecated in PaddleX 2.0 and will not take effect. "
-                "Defaults to True")
-        if decoder_use_sep_conv is not None:
-            logging.warning(
-                "`decoder_use_sep_conv` is deprecated in PaddleX 2.0 and will not take effect. "
-                "Defaults to True")
-        if encoder_with_aspp is not None:
-            logging.warning(
-                "`encoder_with_aspp` is deprecated in PaddleX 2.0 and will not take effect. "
-                "Defaults to True")
-        if enable_decoder is not None:
-            logging.warning(
-                "`enable_decoder` is deprecated in PaddleX 2.0 and will not take effect. "
-                "Defaults to True")
-        if class_weight is not None:
-            logging.warning(
-                "`class_weight` is not supported in PaddleX 2.0 currently and is forcibly set to None."
-            )
-        if ignore_index is not None:
-            logging.warning(
-                "`ignore_index` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 255."
-            )
-        if pooling_crop_size is not None:
-            logging.warning(
-                "Backbone 'MobileNetV3_large_x1_0_ssld' is currently not supported in PaddleX 2.0. "
-                "`pooling_crop_size` will not take effect. Defaults to None")
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-
-        super(DeepLabV3P, self).__init__(
-            num_classes=num_classes,
-            backbone=backbone,
-            use_mixed_loss=use_mixed_loss,
-            output_stride=output_stride)
-
-
-class HRNet(cv.models.HRNet):
-    def __init__(self,
-                 num_classes=2,
-                 width=18,
-                 use_bce_loss=False,
-                 use_dice_loss=False,
-                 class_weight=None,
-                 ignore_index=None,
-                 input_channel=None):
-        if num_classes > 2 and (use_bce_loss or use_dice_loss):
-            raise ValueError(
-                "dice loss and bce loss is only applicable to binary classification"
-            )
-        elif num_classes == 2:
-            if use_bce_loss and use_dice_loss:
-                use_mixed_loss = [('CrossEntropyLoss', 1), ('DiceLoss', 1)]
-            elif use_bce_loss:
-                use_mixed_loss = [('CrossEntropyLoss', 1)]
-            elif use_dice_loss:
-                use_mixed_loss = [('DiceLoss', 1)]
-            else:
-                use_mixed_loss = False
-        else:
-            use_mixed_loss = False
-
-        if class_weight is not None:
-            logging.warning(
-                "`class_weight` is not supported in PaddleX 2.0 currently and is forcibly set to None."
-            )
-        if ignore_index is not None:
-            logging.warning(
-                "`ignore_index` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 255."
-            )
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-
-        super(HRNet, self).__init__(
-            num_classes=num_classes,
-            width=width,
-            use_mixed_loss=use_mixed_loss)
-
-
-class FastSCNN(cv.models.FastSCNN):
-    def __init__(self,
-                 num_classes=2,
-                 use_bce_loss=False,
-                 use_dice_loss=False,
-                 class_weight=None,
-                 ignore_index=255,
-                 multi_loss_weight=None,
-                 input_channel=3):
-        if num_classes > 2 and (use_bce_loss or use_dice_loss):
-            raise ValueError(
-                "dice loss and bce loss is only applicable to binary classification"
-            )
-        elif num_classes == 2:
-            if use_bce_loss and use_dice_loss:
-                use_mixed_loss = [('CrossEntropyLoss', 1), ('DiceLoss', 1)]
-            elif use_bce_loss:
-                use_mixed_loss = [('CrossEntropyLoss', 1)]
-            elif use_dice_loss:
-                use_mixed_loss = [('DiceLoss', 1)]
-            else:
-                use_mixed_loss = False
-        else:
-            use_mixed_loss = False
-
-        if class_weight is not None:
-            logging.warning(
-                "`class_weight` is not supported in PaddleX 2.0 currently and is forcibly set to None."
-            )
-        if ignore_index is not None:
-            logging.warning(
-                "`ignore_index` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 255."
-            )
-        if multi_loss_weight is not None:
-            logging.warning(
-                "`multi_loss_weight` is deprecated in PaddleX 2.0 and will not take effect. "
-                "Defaults to [1.0, 0.4]")
-        if input_channel is not None:
-            logging.warning(
-                "`input_channel` is deprecated in PaddleX 2.0 and won't take effect. Defaults to 3."
-            )
-
-        super(FastSCNN, self).__init__(
-            num_classes=num_classes, use_mixed_loss=use_mixed_loss)
+UNet = cv.models.UNet
+DeepLabV3P = cv.models.DeepLabV3P
+FastSCNN = cv.models.FastSCNN
+HRNet = cv.models.HRNet
+BiSeNetV2 = cv.models.BiSeNetV2

+ 1 - 1
dygraph/tutorials/slim/prune/image_classification/mobilenetv2_train.py

@@ -32,7 +32,7 @@ eval_dataset = pdx.datasets.ImageNet(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.MobileNetV2(num_classes=num_classes)
+model = pdx.cls.MobileNetV2(num_classes=num_classes)
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/95c53dec89ab0f3769330fa445c6d9213986ca5f/paddlex/cv/models/classifier.py#L153
 # 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html

+ 1 - 1
dygraph/tutorials/slim/prune/object_detection/yolov3_train.py

@@ -41,7 +41,7 @@ eval_dataset = pdx.datasets.VOCDetection(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.YOLOv3(num_classes=num_classes, backbone='DarkNet53')
+model = pdx.det.YOLOv3(num_classes=num_classes, backbone='DarkNet53')
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/release/2.0-rc/paddlex/cv/models/detector.py#L154
 # 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html

+ 1 - 1
dygraph/tutorials/slim/prune/semantic_segmentation/unet_train.py

@@ -39,7 +39,7 @@ eval_dataset = pdx.datasets.SegDataset(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.UNet(num_classes=num_classes)
+model = pdx.seg.UNet(num_classes=num_classes)
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/release/2.0-rc/paddlex/cv/models/segmenter.py#L150
 # 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html

+ 1 - 1
dygraph/tutorials/slim/quantize/image_classification/mobilenetv2_train.py

@@ -32,7 +32,7 @@ eval_dataset = pdx.datasets.ImageNet(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.MobileNetV3_large(num_classes=num_classes)
+model = pdx.cls.MobileNetV3_large(num_classes=num_classes)
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/95c53dec89ab0f3769330fa445c6d9213986ca5f/paddlex/cv/models/classifier.py#L153
 # 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html

+ 1 - 1
dygraph/tutorials/slim/quantize/object_detection/yolov3_train.py

@@ -41,7 +41,7 @@ eval_dataset = pdx.datasets.VOCDetection(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.YOLOv3(num_classes=num_classes, backbone='DarkNet53')
+model = pdx.det.YOLOv3(num_classes=num_classes, backbone='DarkNet53')
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/release/2.0-rc/paddlex/cv/models/detector.py#L154
 # 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html

+ 1 - 1
dygraph/tutorials/slim/quantize/semantic_segmentation/unet_train.py

@@ -39,7 +39,7 @@ eval_dataset = pdx.datasets.SegDataset(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.UNet(num_classes=num_classes)
+model = pdx.seg.UNet(num_classes=num_classes)
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/release/2.0-rc/paddlex/cv/models/segmenter.py#L150
 # 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html

+ 1 - 1
dygraph/tutorials/train/image_classification/alexnet.py

@@ -32,7 +32,7 @@ eval_dataset = pdx.datasets.ImageNet(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.AlexNet(num_classes=num_classes)
+model = pdx.cls.AlexNet(num_classes=num_classes)
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/95c53dec89ab0f3769330fa445c6d9213986ca5f/paddlex/cv/models/classifier.py#L153
 # 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html

+ 1 - 1
dygraph/tutorials/train/image_classification/darknet53.py

@@ -32,7 +32,7 @@ eval_dataset = pdx.datasets.ImageNet(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.DarkNet53(num_classes=num_classes)
+model = pdx.cls.DarkNet53(num_classes=num_classes)
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/95c53dec89ab0f3769330fa445c6d9213986ca5f/paddlex/cv/models/classifier.py#L153
 # 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html

+ 1 - 1
dygraph/tutorials/train/image_classification/densenet121.py

@@ -32,7 +32,7 @@ eval_dataset = pdx.datasets.ImageNet(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.DenseNet121(num_classes=num_classes)
+model = pdx.cls.DenseNet121(num_classes=num_classes)
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/95c53dec89ab0f3769330fa445c6d9213986ca5f/paddlex/cv/models/classifier.py#L153
 # 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html

+ 1 - 1
dygraph/tutorials/train/image_classification/hrnet_w18_c.py

@@ -32,7 +32,7 @@ eval_dataset = pdx.datasets.ImageNet(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.HRNet_W18_C(num_classes=num_classes)
+model = pdx.cls.HRNet_W18_C(num_classes=num_classes)
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/95c53dec89ab0f3769330fa445c6d9213986ca5f/paddlex/cv/models/classifier.py#L153
 # 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html

+ 1 - 1
dygraph/tutorials/train/image_classification/mobilenetv3_large_w_custom_optimizer.py

@@ -33,7 +33,7 @@ eval_dataset = pdx.datasets.ImageNet(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.MobileNetV3_large(num_classes=num_classes)
+model = pdx.cls.MobileNetV3_large(num_classes=num_classes)
 
 # 自定义优化器:使用CosineAnnealingDecay
 train_batch_size = 64

+ 1 - 1
dygraph/tutorials/train/image_classification/mobilenetv3_small.py

@@ -32,7 +32,7 @@ eval_dataset = pdx.datasets.ImageNet(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.MobileNetV3_small(num_classes=num_classes)
+model = pdx.cls.MobileNetV3_small(num_classes=num_classes)
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/95c53dec89ab0f3769330fa445c6d9213986ca5f/paddlex/cv/models/classifier.py#L153
 # 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html

+ 1 - 1
dygraph/tutorials/train/image_classification/resnet50_vd_ssld.py

@@ -32,7 +32,7 @@ eval_dataset = pdx.datasets.ImageNet(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.ResNet50_vd_ssld(num_classes=num_classes)
+model = pdx.cls.ResNet50_vd_ssld(num_classes=num_classes)
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/95c53dec89ab0f3769330fa445c6d9213986ca5f/paddlex/cv/models/classifier.py#L153
 # 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html

+ 1 - 1
dygraph/tutorials/train/image_classification/shufflenetv2.py

@@ -32,7 +32,7 @@ eval_dataset = pdx.datasets.ImageNet(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.ShuffleNetV2(num_classes=num_classes)
+model = pdx.cls.ShuffleNetV2(num_classes=num_classes)
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/95c53dec89ab0f3769330fa445c6d9213986ca5f/paddlex/cv/models/classifier.py#L153
 # 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html

+ 1 - 1
dygraph/tutorials/train/image_classification/xception41.py

@@ -32,7 +32,7 @@ eval_dataset = pdx.datasets.ImageNet(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.Xception41(num_classes=num_classes)
+model = pdx.cls.Xception41(num_classes=num_classes)
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/95c53dec89ab0f3769330fa445c6d9213986ca5f/paddlex/cv/models/classifier.py#L153
 # 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html

+ 1 - 1
dygraph/tutorials/train/instance_segmentation/mask_rcnn_r50_fpn.py

@@ -36,7 +36,7 @@ eval_dataset = pdx.datasets.CocoDetection(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.MaskRCNN(
+model = pdx.det.MaskRCNN(
     num_classes=num_classes, backbone='ResNet50', with_fpn=True)
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/release/2.0-rc/paddlex/cv/models/detector.py#L155

+ 1 - 1
dygraph/tutorials/train/object_detection/faster_rcnn_hrnet_w18.py

@@ -40,7 +40,7 @@ eval_dataset = pdx.datasets.VOCDetection(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.FasterRCNN(num_classes=num_classes, backbone='HRNet_W18')
+model = pdx.seg.FasterRCNN(num_classes=num_classes, backbone='HRNet_W18')
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/release/2.0-rc/paddlex/cv/models/detector.py#L155
 # 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html

+ 1 - 1
dygraph/tutorials/train/object_detection/faster_rcnn_r50_fpn.py

@@ -40,7 +40,7 @@ eval_dataset = pdx.datasets.VOCDetection(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.FasterRCNN(
+model = pdx.det.FasterRCNN(
     num_classes=num_classes, backbone='ResNet50', with_fpn=True)
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/release/2.0-rc/paddlex/cv/models/detector.py#L155

+ 1 - 1
dygraph/tutorials/train/object_detection/ppyolo.py

@@ -41,7 +41,7 @@ eval_dataset = pdx.datasets.VOCDetection(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.PPYOLO(num_classes=num_classes, backbone='ResNet50_vd_dcn')
+model = pdx.det.PPYOLO(num_classes=num_classes, backbone='ResNet50_vd_dcn')
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/release/2.0-rc/paddlex/cv/models/detector.py#L155
 # 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html

+ 1 - 1
dygraph/tutorials/train/object_detection/ppyolotiny.py

@@ -41,7 +41,7 @@ eval_dataset = pdx.datasets.VOCDetection(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.PPYOLOTiny(num_classes=num_classes)
+model = pdx.det.PPYOLOTiny(num_classes=num_classes)
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/release/2.0-rc/paddlex/cv/models/detector.py#L155
 # 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html

+ 1 - 2
dygraph/tutorials/train/object_detection/ppyolov2.py

@@ -44,8 +44,7 @@ eval_dataset = pdx.datasets.VOCDetection(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.PPYOLOv2(
-    num_classes=num_classes, backbone='ResNet50_vd_dcn')
+model = pdx.det.PPYOLOv2(num_classes=num_classes, backbone='ResNet50_vd_dcn')
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/release/2.0-rc/paddlex/cv/models/detector.py#L155
 # 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html

+ 1 - 1
dygraph/tutorials/train/object_detection/yolov3_darknet53.py

@@ -41,7 +41,7 @@ eval_dataset = pdx.datasets.VOCDetection(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.YOLOv3(num_classes=num_classes, backbone='DarkNet53')
+model = pdx.det.YOLOv3(num_classes=num_classes, backbone='DarkNet53')
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/release/2.0-rc/paddlex/cv/models/detector.py#L155
 # 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html

+ 1 - 1
dygraph/tutorials/train/semantic_segmentation/bisenetv2.py

@@ -39,7 +39,7 @@ eval_dataset = pdx.datasets.SegDataset(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.BiSeNetV2(num_classes=num_classes)
+model = pdx.seg.BiSeNetV2(num_classes=num_classes)
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/release/2.0-rc/paddlex/cv/models/segmenter.py#L150
 # 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html

+ 1 - 1
dygraph/tutorials/train/semantic_segmentation/deeplabv3p_resnet50_vd.py

@@ -39,7 +39,7 @@ eval_dataset = pdx.datasets.SegDataset(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.DeepLabV3P(num_classes=num_classes, backbone='ResNet50_vd')
+model = pdx.seg.DeepLabV3P(num_classes=num_classes, backbone='ResNet50_vd')
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/release/2.0-rc/paddlex/cv/models/segmenter.py#L150
 # 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html

+ 1 - 1
dygraph/tutorials/train/semantic_segmentation/fastscnn.py

@@ -39,7 +39,7 @@ eval_dataset = pdx.datasets.SegDataset(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.FastSCNN(num_classes=num_classes)
+model = pdx.seg.FastSCNN(num_classes=num_classes)
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/release/2.0-rc/paddlex/cv/models/segmenter.py#L150
 # 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html

+ 1 - 1
dygraph/tutorials/train/semantic_segmentation/hrnet.py

@@ -39,7 +39,7 @@ eval_dataset = pdx.datasets.SegDataset(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.HRNet(num_classes=num_classes, width=48)
+model = pdx.seg.HRNet(num_classes=num_classes, width=48)
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/release/2.0-rc/paddlex/cv/models/segmenter.py#L150
 # 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html

+ 1 - 1
dygraph/tutorials/train/semantic_segmentation/unet.py

@@ -39,7 +39,7 @@ eval_dataset = pdx.datasets.SegDataset(
 # 初始化模型,并进行训练
 # 可使用VisualDL查看训练指标,参考https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#visualdl可视化训练指标
 num_classes = len(train_dataset.labels)
-model = pdx.models.UNet(num_classes=num_classes)
+model = pdx.seg.UNet(num_classes=num_classes)
 
 # API说明:https://github.com/PaddlePaddle/PaddleX/blob/release/2.0-rc/paddlex/cv/models/segmenter.py#L150
 # 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html