Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleX
提交
bc44ce9d
P
PaddleX
项目概览
PaddlePaddle
/
PaddleX
通知
138
Star
4
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
43
列表
看板
标记
里程碑
合并请求
5
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleX
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
43
Issue
43
列表
看板
标记
里程碑
合并请求
5
合并请求
5
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
bc44ce9d
编写于
6月 08, 2020
作者:
S
SunAhong1993
提交者:
GitHub
6月 08, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request
#12
from PaddlePaddle/develop
00
上级
f13d9367
2b69eaea
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
45 addition
and
43 deletion
+45
-43
docs/appendix/model_zoo.md
docs/appendix/model_zoo.md
+22
-22
paddlex/cv/models/hrnet.py
paddlex/cv/models/hrnet.py
+5
-3
paddlex/cv/models/load_model.py
paddlex/cv/models/load_model.py
+1
-14
paddlex/cv/models/slim/prune_config.py
paddlex/cv/models/slim/prune_config.py
+4
-1
paddlex/cv/nets/segmentation/hrnet.py
paddlex/cv/nets/segmentation/hrnet.py
+13
-3
未找到文件。
docs/appendix/model_zoo.md
浏览文件 @
bc44ce9d
...
...
@@ -6,28 +6,28 @@
| 模型 | 模型大小 | 预测速度(毫秒) | Top1准确率(%) | Top5准确率(%) |
| :----| :------- | :----------- | :--------- | :--------- |
| ResNet18| 46.9MB |
1.499
| 71.0 | 89.9 |
| ResNet34| 87.5MB |
2.272
| 74.6 | 92.1 |
| ResNet50| 102.7MB |
2.939
| 76.5 | 93.0 |
| ResNet101 |179.1MB |
5.314
| 77.6 | 93.6 |
| ResNet50_vd |102.8MB |
3.165
| 79.1 | 94.4 |
| ResNet101_vd| 179.2MB |
5.252
| 80.2 | 95.0 |
| ResNet50_vd_ssld |102.8MB |
3.165
| 82.4 | 96.1 |
| ResNet101_vd_ssld| 179.2MB |
5.252
| 83.7 | 96.7 |
| DarkNet53|166.9MB |
3.139
| 78.0 | 94.1 |
| MobileNetV1 | 16.0MB |
32.523
| 71.0 | 89.7 |
| MobileNetV2 | 14.0MB |
23.318
| 72.2 | 90.7 |
| MobileNetV3_large| 21.0MB |
19.308
| 75.3 | 93.2 |
| MobileNetV3_small | 12.0MB |
6.546
| 68.2 | 88.1 |
| MobileNetV3_large_ssld| 21.0MB |
19.308
| 79.0 | 94.5 |
| MobileNetV3_small_ssld | 12.0MB |
6.546
| 71.3 | 90.1 |
| Xception41 |92.4MB |
4.408
| 79.6 | 94.4 |
| Xception65 | 144.6MB |
6.464
| 80.3 | 94.5 |
| DenseNet121 | 32.8MB |
4.371
| 75.7 | 92.6 |
| DenseNet161|116.3MB |
8.863
| 78.6 | 94.1 |
| DenseNet201| 84.6MB |
8.173
| 77.6 | 93.7 |
| ShuffleNetV2 | 9.0MB |
10.941
| 68.8 | 88.5 |
| HRNet_W18 | 21.29MB |
7.368 (V100 GPU)
| 76.9 | 93.4 |
| ResNet18| 46.9MB |
-
| 71.0 | 89.9 |
| ResNet34| 87.5MB |
-
| 74.6 | 92.1 |
| ResNet50| 102.7MB |
-
| 76.5 | 93.0 |
| ResNet101 |179.1MB |
-
| 77.6 | 93.6 |
| ResNet50_vd |102.8MB |
-
| 79.1 | 94.4 |
| ResNet101_vd| 179.2MB |
-
| 80.2 | 95.0 |
| ResNet50_vd_ssld |102.8MB |
-
| 82.4 | 96.1 |
| ResNet101_vd_ssld| 179.2MB |
-
| 83.7 | 96.7 |
| DarkNet53|166.9MB |
-
| 78.0 | 94.1 |
| MobileNetV1 | 16.0MB |
-
| 71.0 | 89.7 |
| MobileNetV2 | 14.0MB |
-
| 72.2 | 90.7 |
| MobileNetV3_large| 21.0MB |
-
| 75.3 | 93.2 |
| MobileNetV3_small | 12.0MB |
-
| 68.2 | 88.1 |
| MobileNetV3_large_ssld| 21.0MB |
-
| 79.0 | 94.5 |
| MobileNetV3_small_ssld | 12.0MB |
-
| 71.3 | 90.1 |
| Xception41 |92.4MB |
-
| 79.6 | 94.4 |
| Xception65 | 144.6MB |
-
| 80.3 | 94.5 |
| DenseNet121 | 32.8MB |
-
| 75.7 | 92.6 |
| DenseNet161|116.3MB |
-
| 78.6 | 94.1 |
| DenseNet201| 84.6MB |
-
| 77.6 | 93.7 |
| ShuffleNetV2 | 9.0MB |
-
| 68.8 | 88.5 |
| HRNet_W18 | 21.29MB |
-
| 76.9 | 93.4 |
## 目标检测模型
...
...
paddlex/cv/models/hrnet.py
浏览文件 @
bc44ce9d
...
...
@@ -77,6 +77,7 @@ class HRNet(DeepLabv3p):
self
.
class_weight
=
class_weight
self
.
ignore_index
=
ignore_index
self
.
labels
=
None
self
.
fixed_input_shape
=
None
def
build_net
(
self
,
mode
=
'train'
):
model
=
paddlex
.
cv
.
nets
.
segmentation
.
HRNet
(
...
...
@@ -86,7 +87,8 @@ class HRNet(DeepLabv3p):
use_bce_loss
=
self
.
use_bce_loss
,
use_dice_loss
=
self
.
use_dice_loss
,
class_weight
=
self
.
class_weight
,
ignore_index
=
self
.
ignore_index
)
ignore_index
=
self
.
ignore_index
,
fixed_input_shape
=
self
.
fixed_input_shape
)
inputs
=
model
.
generate_inputs
()
model_out
=
model
.
build_net
(
inputs
)
outputs
=
OrderedDict
()
...
...
@@ -170,6 +172,6 @@ class HRNet(DeepLabv3p):
return
super
(
HRNet
,
self
).
train
(
num_epochs
,
train_dataset
,
train_batch_size
,
eval_dataset
,
save_interval_epochs
,
log_interval_steps
,
save_dir
,
pretrain_weights
,
optimizer
,
learning_rate
,
lr_decay_power
,
use_vdl
,
sensitivities_file
,
eval_metric_loss
,
early_stop
,
pretrain_weights
,
optimizer
,
learning_rate
,
lr_decay_power
,
use_vdl
,
sensitivities_file
,
eval_metric_loss
,
early_stop
,
early_stop_patience
,
resume_checkpoint
)
paddlex/cv/models/load_model.py
浏览文件 @
bc44ce9d
...
...
@@ -116,20 +116,7 @@ def fix_input_shape(info, fixed_input_shape=None):
resize
=
{
'ResizeByShort'
:
{}}
padding
=
{
'Padding'
:
{}}
if
info
[
'_Attributes'
][
'model_type'
]
==
'classifier'
:
crop_size
=
0
for
transform
in
info
[
'Transforms'
]:
if
'CenterCrop'
in
transform
:
crop_size
=
transform
[
'CenterCrop'
][
'crop_size'
]
break
assert
crop_size
==
fixed_input_shape
[
0
],
"fixed_input_shape must == CenterCrop:crop_size:{}"
.
format
(
crop_size
)
assert
crop_size
==
fixed_input_shape
[
1
],
"fixed_input_shape must == CenterCrop:crop_size:{}"
.
format
(
crop_size
)
if
crop_size
==
0
:
logging
.
warning
(
"fixed_input_shape must == input shape when trainning"
)
pass
else
:
resize
[
'ResizeByShort'
][
'short_size'
]
=
min
(
fixed_input_shape
)
resize
[
'ResizeByShort'
][
'max_size'
]
=
max
(
fixed_input_shape
)
...
...
paddlex/cv/models/slim/prune_config.py
浏览文件 @
bc44ce9d
...
...
@@ -142,13 +142,16 @@ def get_prune_params(model):
program
=
model
.
test_prog
if
model_type
.
startswith
(
'ResNet'
)
or
\
model_type
.
startswith
(
'DenseNet'
)
or
\
model_type
.
startswith
(
'DarkNet'
):
model_type
.
startswith
(
'DarkNet'
)
or
\
model_type
.
startswith
(
'AlexNet'
):
for
block
in
program
.
blocks
:
for
param
in
block
.
all_parameters
():
pd_var
=
fluid
.
global_scope
().
find_var
(
param
.
name
)
pd_param
=
pd_var
.
get_tensor
()
if
len
(
np
.
array
(
pd_param
).
shape
)
==
4
:
prune_names
.
append
(
param
.
name
)
if
model_type
==
'AlexNet'
:
prune_names
.
remove
(
'conv5_weights'
)
elif
model_type
==
"MobileNetV1"
:
prune_names
.
append
(
"conv1_weights"
)
for
param
in
program
.
global_block
().
all_parameters
():
...
...
paddlex/cv/nets/segmentation/hrnet.py
浏览文件 @
bc44ce9d
...
...
@@ -38,7 +38,8 @@ class HRNet(object):
use_bce_loss
=
False
,
use_dice_loss
=
False
,
class_weight
=
None
,
ignore_index
=
255
):
ignore_index
=
255
,
fixed_input_shape
=
None
):
# dice_loss或bce_loss只适用两类分割中
if
num_classes
>
2
and
(
use_bce_loss
or
use_dice_loss
):
raise
ValueError
(
...
...
@@ -66,6 +67,7 @@ class HRNet(object):
self
.
use_dice_loss
=
use_dice_loss
self
.
class_weight
=
class_weight
self
.
ignore_index
=
ignore_index
self
.
fixed_input_shape
=
fixed_input_shape
self
.
backbone
=
paddlex
.
cv
.
nets
.
hrnet
.
HRNet
(
width
=
width
,
feature_maps
=
"stage4"
)
...
...
@@ -131,8 +133,16 @@ class HRNet(object):
def
generate_inputs
(
self
):
inputs
=
OrderedDict
()
inputs
[
'image'
]
=
fluid
.
data
(
dtype
=
'float32'
,
shape
=
[
None
,
3
,
None
,
None
],
name
=
'image'
)
if
self
.
fixed_input_shape
is
not
None
:
input_shape
=
[
None
,
3
,
self
.
fixed_input_shape
[
1
],
self
.
fixed_input_shape
[
0
]
]
inputs
[
'image'
]
=
fluid
.
data
(
dtype
=
'float32'
,
shape
=
input_shape
,
name
=
'image'
)
else
:
inputs
[
'image'
]
=
fluid
.
data
(
dtype
=
'float32'
,
shape
=
[
None
,
3
,
None
,
None
],
name
=
'image'
)
if
self
.
mode
==
'train'
:
inputs
[
'label'
]
=
fluid
.
data
(
dtype
=
'int32'
,
shape
=
[
None
,
1
,
None
,
None
],
name
=
'label'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录