diff --git a/README.md b/README.md index 2475242cc60db4edf395387a50907c23706ac6a0..4e97b8225bad6543d45a7c9844b260425838446b 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,6 @@ 飞桨图像识别套件PaddleClas是飞桨为工业界和学术界所准备的一个图像识别任务的工具集,助力使用者训练出更好的视觉模型和应用落地。 -**近期更新** - - 2021.06.16 PaddleClas v2.2版本升级 - 集成Metric learning,向量检索等组件。 - 新增商品识别、动漫人物识别、车辆识别和logo识别等4个图像识别应用。 diff --git a/ppcls/arch/backbone/__init__.py b/ppcls/arch/backbone/__init__.py index a519811bdb9c56b5f5610e592add4d9d4f6c52b9..5d113e44bb7e6f022edc454e0b92cba031e69326 100644 --- a/ppcls/arch/backbone/__init__.py +++ b/ppcls/arch/backbone/__init__.py @@ -45,7 +45,6 @@ from ppcls.arch.backbone.model_zoo.darknet import DarkNet53 from ppcls.arch.backbone.model_zoo.regnet import RegNetX_200MF, RegNetX_4GF, RegNetX_32GF, RegNetY_200MF, RegNetY_4GF, RegNetY_32GF from ppcls.arch.backbone.model_zoo.vision_transformer import ViT_small_patch16_224, ViT_base_patch16_224, ViT_base_patch16_384, ViT_base_patch32_384, ViT_large_patch16_224, ViT_large_patch16_384, ViT_large_patch32_384, ViT_huge_patch16_224, ViT_huge_patch32_384 from ppcls.arch.backbone.model_zoo.distilled_vision_transformer import DeiT_tiny_patch16_224, DeiT_small_patch16_224, DeiT_base_patch16_224, DeiT_tiny_distilled_patch16_224, DeiT_small_distilled_patch16_224, DeiT_base_distilled_patch16_224, DeiT_base_patch16_384, DeiT_base_distilled_patch16_384 -from ppcls.arch.backbone.model_zoo.distillation_models import ResNet50_vd_distill_MobileNetV3_large_x1_0, ResNeXt101_32x16d_wsl_distill_ResNet50_vd from ppcls.arch.backbone.model_zoo.swin_transformer import SwinTransformer_tiny_patch4_window7_224, SwinTransformer_small_patch4_window7_224, SwinTransformer_base_patch4_window7_224, SwinTransformer_base_patch4_window12_384, SwinTransformer_large_patch4_window7_224, SwinTransformer_large_patch4_window12_384 from ppcls.arch.backbone.model_zoo.mixnet import MixNet_S, MixNet_M, MixNet_L from ppcls.arch.backbone.model_zoo.rexnet import ReXNet_1_0, ReXNet_1_3, ReXNet_1_5, ReXNet_2_0, ReXNet_3_0 diff --git a/ppcls/arch/backbone/model_zoo/distillation_models.py b/ppcls/arch/backbone/model_zoo/distillation_models.py deleted file mode 100644 index f9a36dd310aa6e8c33699f686ccd762d49a4283c..0000000000000000000000000000000000000000 --- a/ppcls/arch/backbone/model_zoo/distillation_models.py +++ /dev/null @@ -1,65 +0,0 @@ -# copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. -# -# 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 __future__ import absolute_import -from __future__ import division -from __future__ import print_function - -import math - -import paddle -import paddle.nn as nn - -from .resnet_vd import ResNet50_vd -from .mobilenet_v3 import MobileNetV3_large_x1_0 -from .resnext101_wsl import ResNeXt101_32x16d_wsl - -__all__ = [ - 'ResNet50_vd_distill_MobileNetV3_large_x1_0', - 'ResNeXt101_32x16d_wsl_distill_ResNet50_vd' -] - - -class ResNet50_vd_distill_MobileNetV3_large_x1_0(nn.Layer): - def __init__(self, class_dim=1000, freeze_teacher=True, **args): - super(ResNet50_vd_distill_MobileNetV3_large_x1_0, self).__init__() - - self.teacher = ResNet50_vd(class_dim=class_dim, **args) - self.student = MobileNetV3_large_x1_0(class_dim=class_dim, **args) - - if freeze_teacher: - for param in self.teacher.parameters(): - param.trainable = False - - def forward(self, x): - teacher_label = self.teacher(x) - student_label = self.student(x) - return teacher_label, student_label - - -class ResNeXt101_32x16d_wsl_distill_ResNet50_vd(nn.Layer): - def __init__(self, class_dim=1000, freeze_teacher=True, **args): - super(ResNeXt101_32x16d_wsl_distill_ResNet50_vd, self).__init__() - - self.teacher = ResNeXt101_32x16d_wsl(class_dim=class_dim, **args) - self.student = ResNet50_vd(class_dim=class_dim, **args) - - if freeze_teacher: - for param in self.teacher.parameters(): - param.trainable = False - - def forward(self, x): - teacher_label = self.teacher(x) - student_label = self.student(x) - return teacher_label, student_label diff --git a/ppcls/configs/Cartoonface/ResNet50_icartoon.yaml b/ppcls/configs/Cartoonface/ResNet50_icartoon.yaml index 01ab83e176444710c1f4a81088f583c8a368ed85..bd39afd901759977c8ec5c841dda6f8513933da6 100644 --- a/ppcls/configs/Cartoonface/ResNet50_icartoon.yaml +++ b/ppcls/configs/Cartoonface/ResNet50_icartoon.yaml @@ -14,7 +14,7 @@ Global: use_visualdl: False image_shape: [3, 224, 224] infer_imgs: - save_inference_dir: "./output" + save_inference_dir: "./inference" feature_normalize: True Arch: diff --git a/ppcls/configs/Products/ResNet50_vd_Aliproduct.yaml b/ppcls/configs/Products/ResNet50_vd_Aliproduct.yaml index 5c8a01ab2f139cb6267fc4e8e6b8382cc8a62614..9a8469d4bb1b91fa81ac9a36da6b2b21d5f07a02 100644 --- a/ppcls/configs/Products/ResNet50_vd_Aliproduct.yaml +++ b/ppcls/configs/Products/ResNet50_vd_Aliproduct.yaml @@ -19,6 +19,9 @@ Global: # model architecture Arch: name: RecModel + infer_output_key: features + infer_add_softmax: False + Backbone: name: ResNet50_vd pretrained: True