Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
396827cc
P
PaddleClas
项目概览
PaddlePaddle
/
PaddleClas
大约 1 年 前同步成功
通知
115
Star
4999
Fork
1114
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
19
列表
看板
标记
里程碑
合并请求
6
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleClas
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
19
Issue
19
列表
看板
标记
里程碑
合并请求
6
合并请求
6
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
396827cc
编写于
6月 21, 2021
作者:
W
Wei Shengyu
提交者:
GitHub
6月 21, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #937 from lyuwenyu/hub_develop_L
align hubconfig with new arch
上级
0703bb14
6f2f3193
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
64 addition
and
48 deletion
+64
-48
hubconf.py
hubconf.py
+64
-48
未找到文件。
hubconf.py
浏览文件 @
396827cc
...
...
@@ -43,8 +43,8 @@ class _SysPathG(object):
with
_SysPathG
(
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
'ppcls'
,
'
modeling
'
)):
import
architectures
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
'ppcls'
,
'
arch
'
)):
import
backbone
def
_load_pretrained_parameters
(
model
,
name
):
url
=
'https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/{}_pretrained.pdparams'
.
format
(
...
...
@@ -63,7 +63,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `AlexNet` model depends on args.
"""
model
=
architectures
.
AlexNet
(
**
kwargs
)
model
=
backbone
.
AlexNet
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'AlexNet'
)
...
...
@@ -80,7 +80,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `VGG11` model depends on args.
"""
model
=
architectures
.
VGG11
(
**
kwargs
)
model
=
backbone
.
VGG11
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'VGG11'
)
...
...
@@ -97,7 +97,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `VGG13` model depends on args.
"""
model
=
architectures
.
VGG13
(
**
kwargs
)
model
=
backbone
.
VGG13
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'VGG13'
)
...
...
@@ -114,7 +114,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `VGG16` model depends on args.
"""
model
=
architectures
.
VGG16
(
**
kwargs
)
model
=
backbone
.
VGG16
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'VGG16'
)
...
...
@@ -131,7 +131,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `VGG19` model depends on args.
"""
model
=
architectures
.
VGG19
(
**
kwargs
)
model
=
backbone
.
VGG19
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'VGG19'
)
...
...
@@ -149,7 +149,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `ResNet18` model depends on args.
"""
model
=
architectures
.
ResNet18
(
**
kwargs
)
model
=
backbone
.
ResNet18
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'ResNet18'
)
...
...
@@ -167,7 +167,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `ResNet34` model depends on args.
"""
model
=
architectures
.
ResNet34
(
**
kwargs
)
model
=
backbone
.
ResNet34
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'ResNet34'
)
...
...
@@ -185,7 +185,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `ResNet50` model depends on args.
"""
model
=
architectures
.
ResNet50
(
**
kwargs
)
model
=
backbone
.
ResNet50
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'ResNet50'
)
...
...
@@ -203,7 +203,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `ResNet101` model depends on args.
"""
model
=
architectures
.
ResNet101
(
**
kwargs
)
model
=
backbone
.
ResNet101
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'ResNet101'
)
...
...
@@ -221,7 +221,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `ResNet152` model depends on args.
"""
model
=
architectures
.
ResNet152
(
**
kwargs
)
model
=
backbone
.
ResNet152
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'ResNet152'
)
...
...
@@ -237,7 +237,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `SqueezeNet1_0` model depends on args.
"""
model
=
architectures
.
SqueezeNet1_0
(
**
kwargs
)
model
=
backbone
.
SqueezeNet1_0
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'SqueezeNet1_0'
)
...
...
@@ -253,7 +253,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `SqueezeNet1_1` model depends on args.
"""
model
=
architectures
.
SqueezeNet1_1
(
**
kwargs
)
model
=
backbone
.
SqueezeNet1_1
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'SqueezeNet1_1'
)
...
...
@@ -271,7 +271,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `DenseNet121` model depends on args.
"""
model
=
architectures
.
DenseNet121
(
**
kwargs
)
model
=
backbone
.
DenseNet121
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'DenseNet121'
)
...
...
@@ -289,7 +289,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `DenseNet161` model depends on args.
"""
model
=
architectures
.
DenseNet161
(
**
kwargs
)
model
=
backbone
.
DenseNet161
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'DenseNet161'
)
...
...
@@ -307,7 +307,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `DenseNet169` model depends on args.
"""
model
=
architectures
.
DenseNet169
(
**
kwargs
)
model
=
backbone
.
DenseNet169
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'DenseNet169'
)
...
...
@@ -325,7 +325,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `DenseNet201` model depends on args.
"""
model
=
architectures
.
DenseNet201
(
**
kwargs
)
model
=
backbone
.
DenseNet201
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'DenseNet201'
)
...
...
@@ -343,7 +343,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `DenseNet264` model depends on args.
"""
model
=
architectures
.
DenseNet264
(
**
kwargs
)
model
=
backbone
.
DenseNet264
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'DenseNet264'
)
...
...
@@ -359,7 +359,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `InceptionV3` model depends on args.
"""
model
=
architectures
.
InceptionV3
(
**
kwargs
)
model
=
backbone
.
InceptionV3
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'InceptionV3'
)
...
...
@@ -375,7 +375,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `InceptionV4` model depends on args.
"""
model
=
architectures
.
InceptionV4
(
**
kwargs
)
model
=
backbone
.
InceptionV4
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'InceptionV4'
)
...
...
@@ -391,7 +391,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `GoogLeNet` model depends on args.
"""
model
=
architectures
.
GoogLeNet
(
**
kwargs
)
model
=
backbone
.
GoogLeNet
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'GoogLeNet'
)
...
...
@@ -407,7 +407,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `ShuffleNetV2_x0_25` model depends on args.
"""
model
=
architectures
.
ShuffleNetV2_x0_25
(
**
kwargs
)
model
=
backbone
.
ShuffleNetV2_x0_25
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'ShuffleNetV2_x0_25'
)
...
...
@@ -423,7 +423,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `MobileNetV1` model depends on args.
"""
model
=
architectures
.
MobileNetV1
(
**
kwargs
)
model
=
backbone
.
MobileNetV1
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'MobileNetV1'
)
...
...
@@ -439,7 +439,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `MobileNetV1_x0_25` model depends on args.
"""
model
=
architectures
.
MobileNetV1_x0_25
(
**
kwargs
)
model
=
backbone
.
MobileNetV1_x0_25
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'MobileNetV1_x0_25'
)
...
...
@@ -455,7 +455,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `MobileNetV1_x0_5` model depends on args.
"""
model
=
architectures
.
MobileNetV1_x0_5
(
**
kwargs
)
model
=
backbone
.
MobileNetV1_x0_5
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'MobileNetV1_x0_5'
)
...
...
@@ -471,7 +471,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `MobileNetV1_x0_75` model depends on args.
"""
model
=
architectures
.
MobileNetV1_x0_75
(
**
kwargs
)
model
=
backbone
.
MobileNetV1_x0_75
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'MobileNetV1_x0_75'
)
...
...
@@ -487,7 +487,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `MobileNetV2_x0_25` model depends on args.
"""
model
=
architectures
.
MobileNetV2_x0_25
(
**
kwargs
)
model
=
backbone
.
MobileNetV2_x0_25
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'MobileNetV2_x0_25'
)
...
...
@@ -503,7 +503,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `MobileNetV2_x0_5` model depends on args.
"""
model
=
architectures
.
MobileNetV2_x0_5
(
**
kwargs
)
model
=
backbone
.
MobileNetV2_x0_5
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'MobileNetV2_x0_5'
)
...
...
@@ -519,7 +519,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `MobileNetV2_x0_75` model depends on args.
"""
model
=
architectures
.
MobileNetV2_x0_75
(
**
kwargs
)
model
=
backbone
.
MobileNetV2_x0_75
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'MobileNetV2_x0_75'
)
...
...
@@ -535,7 +535,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `MobileNetV2_x1_5` model depends on args.
"""
model
=
architectures
.
MobileNetV2_x1_5
(
**
kwargs
)
model
=
backbone
.
MobileNetV2_x1_5
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'MobileNetV2_x1_5'
)
...
...
@@ -551,7 +551,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `MobileNetV2_x2_0` model depends on args.
"""
model
=
architectures
.
MobileNetV2_x2_0
(
**
kwargs
)
model
=
backbone
.
MobileNetV2_x2_0
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'MobileNetV2_x2_0'
)
...
...
@@ -567,7 +567,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `MobileNetV3_large_x0_35` model depends on args.
"""
model
=
architectures
.
MobileNetV3_large_x0_35
(
**
kwargs
)
model
=
backbone
.
MobileNetV3_large_x0_35
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'MobileNetV3_large_x0_35'
)
...
...
@@ -584,7 +584,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `MobileNetV3_large_x0_5` model depends on args.
"""
model
=
architectures
.
MobileNetV3_large_x0_5
(
**
kwargs
)
model
=
backbone
.
MobileNetV3_large_x0_5
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'MobileNetV3_large_x0_5'
)
...
...
@@ -601,7 +601,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `MobileNetV3_large_x0_75` model depends on args.
"""
model
=
architectures
.
MobileNetV3_large_x0_75
(
**
kwargs
)
model
=
backbone
.
MobileNetV3_large_x0_75
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'MobileNetV3_large_x0_75'
)
...
...
@@ -618,7 +618,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `MobileNetV3_large_x1_0` model depends on args.
"""
model
=
architectures
.
MobileNetV3_large_x1_0
(
**
kwargs
)
model
=
backbone
.
MobileNetV3_large_x1_0
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'MobileNetV3_large_x1_0'
)
...
...
@@ -635,7 +635,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `MobileNetV3_large_x1_25` model depends on args.
"""
model
=
architectures
.
MobileNetV3_large_x1_25
(
**
kwargs
)
model
=
backbone
.
MobileNetV3_large_x1_25
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'MobileNetV3_large_x1_25'
)
...
...
@@ -652,7 +652,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `MobileNetV3_small_x0_35` model depends on args.
"""
model
=
architectures
.
MobileNetV3_small_x0_35
(
**
kwargs
)
model
=
backbone
.
MobileNetV3_small_x0_35
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'MobileNetV3_small_x0_35'
)
...
...
@@ -669,7 +669,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `MobileNetV3_small_x0_5` model depends on args.
"""
model
=
architectures
.
MobileNetV3_small_x0_5
(
**
kwargs
)
model
=
backbone
.
MobileNetV3_small_x0_5
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'MobileNetV3_small_x0_5'
)
...
...
@@ -686,7 +686,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `MobileNetV3_small_x0_75` model depends on args.
"""
model
=
architectures
.
MobileNetV3_small_x0_75
(
**
kwargs
)
model
=
backbone
.
MobileNetV3_small_x0_75
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'MobileNetV3_small_x0_75'
)
...
...
@@ -703,7 +703,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `MobileNetV3_small_x1_0` model depends on args.
"""
model
=
architectures
.
MobileNetV3_small_x1_0
(
**
kwargs
)
model
=
backbone
.
MobileNetV3_small_x1_0
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'MobileNetV3_small_x1_0'
)
...
...
@@ -720,7 +720,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `MobileNetV3_small_x1_25` model depends on args.
"""
model
=
architectures
.
MobileNetV3_small_x1_25
(
**
kwargs
)
model
=
backbone
.
MobileNetV3_small_x1_25
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'MobileNetV3_small_x1_25'
)
...
...
@@ -737,7 +737,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `ResNeXt101_32x4d` model depends on args.
"""
model
=
architectures
.
ResNeXt101_32x4d
(
**
kwargs
)
model
=
backbone
.
ResNeXt101_32x4d
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'ResNeXt101_32x4d'
)
...
...
@@ -753,7 +753,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `ResNeXt101_64x4d` model depends on args.
"""
model
=
architectures
.
ResNeXt101_64x4d
(
**
kwargs
)
model
=
backbone
.
ResNeXt101_64x4d
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'ResNeXt101_64x4d'
)
...
...
@@ -769,7 +769,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `ResNeXt152_32x4d` model depends on args.
"""
model
=
architectures
.
ResNeXt152_32x4d
(
**
kwargs
)
model
=
backbone
.
ResNeXt152_32x4d
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'ResNeXt152_32x4d'
)
...
...
@@ -785,7 +785,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `ResNeXt152_64x4d` model depends on args.
"""
model
=
architectures
.
ResNeXt152_64x4d
(
**
kwargs
)
model
=
backbone
.
ResNeXt152_64x4d
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'ResNeXt152_64x4d'
)
...
...
@@ -801,7 +801,7 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `ResNeXt50_32x4d` model depends on args.
"""
model
=
architectures
.
ResNeXt50_32x4d
(
**
kwargs
)
model
=
backbone
.
ResNeXt50_32x4d
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'ResNeXt50_32x4d'
)
...
...
@@ -817,8 +817,24 @@ with _SysPathG(
Returns:
model: nn.Layer. Specific `ResNeXt50_64x4d` model depends on args.
"""
model
=
architectures
.
ResNeXt50_64x4d
(
**
kwargs
)
model
=
backbone
.
ResNeXt50_64x4d
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'ResNeXt50_64x4d'
)
return
model
def
darknet53
(
pretrained
=
False
,
**
kwargs
):
"""
DarkNet53
Args:
pretrained: bool=False. If `True` load pretrained parameters, `False` otherwise.
kwargs:
class_dim: int=1000. Output dim of last fc layer.
Returns:
model: nn.Layer. Specific `ResNeXt50_64x4d` model depends on args.
"""
model
=
backbone
.
DarkNet53
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'DarkNet53'
)
return
model
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录