Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
0b33aced
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
0b33aced
编写于
4月 07, 2020
作者:
K
Kaipeng Deng
提交者:
GitHub
4月 07, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add yolov3_mobilenet_v3 (#443)
* add yolov3_mobilenet_v3
上级
365082f2
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
105 addition
and
12 deletion
+105
-12
configs/yolov3_darknet.yml
configs/yolov3_darknet.yml
+2
-2
configs/yolov3_mobilenet_v1.yml
configs/yolov3_mobilenet_v1.yml
+2
-2
configs/yolov3_mobilenet_v3.yml
configs/yolov3_mobilenet_v3.yml
+68
-0
configs/yolov3_r34.yml
configs/yolov3_r34.yml
+2
-2
docs/MODEL_ZOO.md
docs/MODEL_ZOO.md
+3
-0
docs/MODEL_ZOO_cn.md
docs/MODEL_ZOO_cn.md
+3
-0
ppdet/modeling/backbones/mobilenet_v3.py
ppdet/modeling/backbones/mobilenet_v3.py
+9
-5
ppdet/utils/checkpoint.py
ppdet/utils/checkpoint.py
+11
-0
ppdet/utils/download.py
ppdet/utils/download.py
+5
-1
未找到文件。
configs/yolov3_darknet.yml
浏览文件 @
0b33aced
architecture
:
YOLOv3
architecture
:
YOLOv3
use_gpu
:
true
use_gpu
:
true
max_iters
:
500
2
00
max_iters
:
500
0
00
log_smooth_window
:
20
log_smooth_window
:
20
save_dir
:
output
save_dir
:
output
snapshot_iter
:
2
000
snapshot_iter
:
10
000
metric
:
COCO
metric
:
COCO
pretrain_weights
:
https://paddle-imagenet-models-name.bj.bcebos.com/DarkNet53_pretrained.tar
pretrain_weights
:
https://paddle-imagenet-models-name.bj.bcebos.com/DarkNet53_pretrained.tar
weights
:
output/yolov3_darknet/model_final
weights
:
output/yolov3_darknet/model_final
...
...
configs/yolov3_mobilenet_v1.yml
浏览文件 @
0b33aced
architecture
:
YOLOv3
architecture
:
YOLOv3
use_gpu
:
true
use_gpu
:
true
max_iters
:
500
2
00
max_iters
:
500
0
00
log_smooth_window
:
20
log_smooth_window
:
20
save_dir
:
output
save_dir
:
output
snapshot_iter
:
2
000
snapshot_iter
:
10
000
metric
:
COCO
metric
:
COCO
pretrain_weights
:
http://paddle-imagenet-models-name.bj.bcebos.com/MobileNetV1_pretrained.tar
pretrain_weights
:
http://paddle-imagenet-models-name.bj.bcebos.com/MobileNetV1_pretrained.tar
weights
:
output/yolov3_mobilenet_v1/model_final
weights
:
output/yolov3_mobilenet_v1/model_final
...
...
configs/yolov3_mobilenet_v3.yml
0 → 100644
浏览文件 @
0b33aced
architecture
:
YOLOv3
use_gpu
:
true
max_iters
:
500000
log_smooth_window
:
20
save_dir
:
output
snapshot_iter
:
10000
metric
:
COCO
pretrain_weights
:
https://paddle-imagenet-models-name.bj.bcebos.com/MobileNetV3_large_x1_0_pretrained.tar
weights
:
output/yolov3_mobilenet_v3/model_final
num_classes
:
80
use_fine_grained_loss
:
false
YOLOv3
:
backbone
:
MobileNetV3
yolo_head
:
YOLOv3Head
MobileNetV3
:
norm_type
:
sync_bn
norm_decay
:
0.
model_name
:
large
scale
:
1.
with_extra_blocks
:
false
YOLOv3Head
:
anchor_masks
:
[[
6
,
7
,
8
],
[
3
,
4
,
5
],
[
0
,
1
,
2
]]
anchors
:
[[
10
,
13
],
[
16
,
30
],
[
33
,
23
],
[
30
,
61
],
[
62
,
45
],
[
59
,
119
],
[
116
,
90
],
[
156
,
198
],
[
373
,
326
]]
norm_decay
:
0.
yolo_loss
:
YOLOv3Loss
nms
:
background_label
:
-1
keep_top_k
:
100
nms_threshold
:
0.45
nms_top_k
:
1000
normalized
:
false
score_threshold
:
0.01
YOLOv3Loss
:
# batch_size here is only used for fine grained loss, not used
# for training batch_size setting, training batch_size setting
# is in configs/yolov3_reader.yml TrainReader.batch_size, batch
# size here should be set as same value as TrainReader.batch_size
batch_size
:
8
ignore_thresh
:
0.7
label_smooth
:
false
LearningRate
:
base_lr
:
0.001
schedulers
:
-
!PiecewiseDecay
gamma
:
0.1
milestones
:
-
400000
-
450000
-
!LinearWarmup
start_factor
:
0.
steps
:
4000
OptimizerBuilder
:
optimizer
:
momentum
:
0.9
type
:
Momentum
regularizer
:
factor
:
0.0005
type
:
L2
_READER_
:
'
yolov3_reader.yml'
configs/yolov3_r34.yml
浏览文件 @
0b33aced
architecture
:
YOLOv3
architecture
:
YOLOv3
use_gpu
:
true
use_gpu
:
true
max_iters
:
500
2
00
max_iters
:
500
0
00
log_smooth_window
:
20
log_smooth_window
:
20
save_dir
:
output
save_dir
:
output
snapshot_iter
:
2
000
snapshot_iter
:
10
000
metric
:
COCO
metric
:
COCO
pretrain_weights
:
https://paddle-imagenet-models-name.bj.bcebos.com/ResNet34_pretrained.tar
pretrain_weights
:
https://paddle-imagenet-models-name.bj.bcebos.com/ResNet34_pretrained.tar
weights
:
output/yolov3_r34/model_final
weights
:
output/yolov3_r34/model_final
...
...
docs/MODEL_ZOO.md
浏览文件 @
0b33aced
...
@@ -133,6 +133,9 @@ The backbone models pretrained on ImageNet are available. All backbone models ar
...
@@ -133,6 +133,9 @@ The backbone models pretrained on ImageNet are available. All backbone models ar
| MobileNet-V1 | ImageNet | 608 | False | 8 | 270e | 78.302 | 29.3 |
[
model
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_mobilenet_v1.tar
)
|
| MobileNet-V1 | ImageNet | 608 | False | 8 | 270e | 78.302 | 29.3 |
[
model
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_mobilenet_v1.tar
)
|
| MobileNet-V1 | ImageNet | 416 | False | 8 | 270e | - | 29.3 |
[
model
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_mobilenet_v1.tar
)
|
| MobileNet-V1 | ImageNet | 416 | False | 8 | 270e | - | 29.3 |
[
model
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_mobilenet_v1.tar
)
|
| MobileNet-V1 | ImageNet | 320 | False | 8 | 270e | - | 27.1 |
[
model
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_mobilenet_v1.tar
)
|
| MobileNet-V1 | ImageNet | 320 | False | 8 | 270e | - | 27.1 |
[
model
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_mobilenet_v1.tar
)
|
| MobileNet-V3 | ImageNet | 608 | False | 8 | 270e | - | 31.6 |
[
model
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_mobilenet_v3.pdparams
)
|
| MobileNet-V3 | ImageNet | 416 | False | 8 | 270e | - | 29.9 |
[
model
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_mobilenet_v3.pdparams
)
|
| MobileNet-V3 | ImageNet | 320 | False | 8 | 270e | - | 27.1 |
[
model
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_mobilenet_v3.pdparams
)
|
| ResNet34 | ImageNet | 608 | False | 8 | 270e | 63.356 | 36.2 |
[
model
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_r34.tar
)
|
| ResNet34 | ImageNet | 608 | False | 8 | 270e | 63.356 | 36.2 |
[
model
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_r34.tar
)
|
| ResNet34 | ImageNet | 416 | False | 8 | 270e | - | 34.3 |
[
model
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_r34.tar
)
|
| ResNet34 | ImageNet | 416 | False | 8 | 270e | - | 34.3 |
[
model
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_r34.tar
)
|
| ResNet34 | ImageNet | 320 | False | 8 | 270e | - | 31.4 |
[
model
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_r34.tar
)
|
| ResNet34 | ImageNet | 320 | False | 8 | 270e | - | 31.4 |
[
model
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_r34.tar
)
|
...
...
docs/MODEL_ZOO_cn.md
浏览文件 @
0b33aced
...
@@ -129,6 +129,9 @@ Paddle提供基于ImageNet的骨架网络预训练模型。所有预训练模型
...
@@ -129,6 +129,9 @@ Paddle提供基于ImageNet的骨架网络预训练模型。所有预训练模型
| MobileNet-V1 | ImageNet | 608 | 否 | 8 | 270e | 78.302 | 29.3 |
[
下载链接
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_mobilenet_v1.tar
)
|
| MobileNet-V1 | ImageNet | 608 | 否 | 8 | 270e | 78.302 | 29.3 |
[
下载链接
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_mobilenet_v1.tar
)
|
| MobileNet-V1 | ImageNet | 416 | 否 | 8 | 270e | - | 29.3 |
[
下载链接
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_mobilenet_v1.tar
)
|
| MobileNet-V1 | ImageNet | 416 | 否 | 8 | 270e | - | 29.3 |
[
下载链接
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_mobilenet_v1.tar
)
|
| MobileNet-V1 | ImageNet | 320 | 否 | 8 | 270e | - | 27.1 |
[
下载链接
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_mobilenet_v1.tar
)
|
| MobileNet-V1 | ImageNet | 320 | 否 | 8 | 270e | - | 27.1 |
[
下载链接
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_mobilenet_v1.tar
)
|
| MobileNet-V1 | ImageNet | 608 | 否 | 8 | 270e | - | 31.6 |
[
下载链接
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_mobilenet_v3.pdparams
)
|
| MobileNet-V1 | ImageNet | 416 | 否 | 8 | 270e | - | 29.9 |
[
下载链接
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_mobilenet_v3.pdparams
)
|
| MobileNet-V1 | ImageNet | 320 | 否 | 8 | 270e | - | 27.1 |
[
下载链接
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_mobilenet_v3.pdparams
)
|
| ResNet34 | ImageNet | 608 | 否 | 8 | 270e | 63.356 | 36.2 |
[
下载链接
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_r34.tar
)
|
| ResNet34 | ImageNet | 608 | 否 | 8 | 270e | 63.356 | 36.2 |
[
下载链接
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_r34.tar
)
|
| ResNet34 | ImageNet | 416 | 否 | 8 | 270e | - | 34.3 |
[
下载链接
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_r34.tar
)
|
| ResNet34 | ImageNet | 416 | 否 | 8 | 270e | - | 34.3 |
[
下载链接
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_r34.tar
)
|
| ResNet34 | ImageNet | 320 | 否 | 8 | 270e | - | 31.4 |
[
下载链接
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_r34.tar
)
|
| ResNet34 | ImageNet | 320 | 否 | 8 | 270e | - | 31.4 |
[
下载链接
](
https://paddlemodels.bj.bcebos.com/object_detection/yolov3_r34.tar
)
|
...
...
ppdet/modeling/backbones/mobilenet_v3.py
浏览文件 @
0b33aced
...
@@ -15,7 +15,8 @@ class MobileNetV3():
...
@@ -15,7 +15,8 @@ class MobileNetV3():
model_name
=
'small'
,
model_name
=
'small'
,
with_extra_blocks
=
False
,
with_extra_blocks
=
False
,
conv_decay
=
0.0
,
conv_decay
=
0.0
,
bn_decay
=
0.0
,
norm_type
=
'bn'
,
norm_decay
=
0.0
,
extra_block_filters
=
[[
256
,
512
],
[
128
,
256
],
[
128
,
256
],
extra_block_filters
=
[[
256
,
512
],
[
128
,
256
],
[
128
,
256
],
[
64
,
128
]]):
[
64
,
128
]]):
self
.
scale
=
scale
self
.
scale
=
scale
...
@@ -23,7 +24,7 @@ class MobileNetV3():
...
@@ -23,7 +24,7 @@ class MobileNetV3():
self
.
with_extra_blocks
=
with_extra_blocks
self
.
with_extra_blocks
=
with_extra_blocks
self
.
extra_block_filters
=
extra_block_filters
self
.
extra_block_filters
=
extra_block_filters
self
.
conv_decay
=
conv_decay
self
.
conv_decay
=
conv_decay
self
.
bn_decay
=
bn
_decay
self
.
norm_decay
=
norm
_decay
self
.
inplanes
=
16
self
.
inplanes
=
16
self
.
end_points
=
[]
self
.
end_points
=
[]
self
.
block_stride
=
1
self
.
block_stride
=
1
...
@@ -90,9 +91,9 @@ class MobileNetV3():
...
@@ -90,9 +91,9 @@ class MobileNetV3():
bias_attr
=
False
)
bias_attr
=
False
)
bn_name
=
name
+
'_bn'
bn_name
=
name
+
'_bn'
bn_param_attr
=
ParamAttr
(
bn_param_attr
=
ParamAttr
(
name
=
bn_name
+
"_scale"
,
regularizer
=
L2Decay
(
self
.
bn
_decay
))
name
=
bn_name
+
"_scale"
,
regularizer
=
L2Decay
(
self
.
norm
_decay
))
bn_bias_attr
=
ParamAttr
(
bn_bias_attr
=
ParamAttr
(
name
=
bn_name
+
"_offset"
,
regularizer
=
L2Decay
(
self
.
bn
_decay
))
name
=
bn_name
+
"_offset"
,
regularizer
=
L2Decay
(
self
.
norm
_decay
))
bn
=
fluid
.
layers
.
batch_norm
(
bn
=
fluid
.
layers
.
batch_norm
(
input
=
conv
,
input
=
conv
,
param_attr
=
bn_param_attr
,
param_attr
=
bn_param_attr
,
...
@@ -238,6 +239,8 @@ class MobileNetV3():
...
@@ -238,6 +239,8 @@ class MobileNetV3():
i
=
0
i
=
0
for
layer_cfg
in
cfg
:
for
layer_cfg
in
cfg
:
self
.
block_stride
*=
layer_cfg
[
5
]
self
.
block_stride
*=
layer_cfg
[
5
]
if
layer_cfg
[
5
]
==
2
:
blocks
.
append
(
conv
)
conv
=
self
.
_residual_unit
(
conv
=
self
.
_residual_unit
(
input
=
conv
,
input
=
conv
,
num_in_filter
=
inplanes
,
num_in_filter
=
inplanes
,
...
@@ -250,9 +253,10 @@ class MobileNetV3():
...
@@ -250,9 +253,10 @@ class MobileNetV3():
name
=
'conv'
+
str
(
i
+
2
))
name
=
'conv'
+
str
(
i
+
2
))
inplanes
=
int
(
scale
*
layer_cfg
[
2
])
inplanes
=
int
(
scale
*
layer_cfg
[
2
])
i
+=
1
i
+=
1
blocks
.
append
(
conv
)
if
not
self
.
with_extra_blocks
:
if
not
self
.
with_extra_blocks
:
return
conv
return
blocks
# extra block
# extra block
conv_extra
=
self
.
_conv_bn_layer
(
conv_extra
=
self
.
_conv_bn_layer
(
...
...
ppdet/utils/checkpoint.py
浏览文件 @
0b33aced
...
@@ -92,6 +92,13 @@ def _load_state(path):
...
@@ -92,6 +92,13 @@ def _load_state(path):
return
state
return
state
def
_strip_postfix
(
path
):
path
,
ext
=
os
.
path
.
splitext
(
path
)
assert
ext
in
[
''
,
'.pdparams'
,
'.pdopt'
,
'.pdmodel'
],
\
"Unknown postfix {} from weights"
.
format
(
ext
)
return
path
def
load_params
(
exe
,
prog
,
path
,
ignore_params
=
[]):
def
load_params
(
exe
,
prog
,
path
,
ignore_params
=
[]):
"""
"""
Load model from the given path.
Load model from the given path.
...
@@ -106,6 +113,8 @@ def load_params(exe, prog, path, ignore_params=[]):
...
@@ -106,6 +113,8 @@ def load_params(exe, prog, path, ignore_params=[]):
if
is_url
(
path
):
if
is_url
(
path
):
path
=
_get_weight_path
(
path
)
path
=
_get_weight_path
(
path
)
path
=
_strip_postfix
(
path
)
if
not
(
os
.
path
.
isdir
(
path
)
or
os
.
path
.
exists
(
path
+
'.pdparams'
)):
if
not
(
os
.
path
.
isdir
(
path
)
or
os
.
path
.
exists
(
path
+
'.pdparams'
)):
raise
ValueError
(
"Model pretrain path {} does not "
raise
ValueError
(
"Model pretrain path {} does not "
"exists."
.
format
(
path
))
"exists."
.
format
(
path
))
...
@@ -151,6 +160,8 @@ def load_checkpoint(exe, prog, path):
...
@@ -151,6 +160,8 @@ def load_checkpoint(exe, prog, path):
"""
"""
if
is_url
(
path
):
if
is_url
(
path
):
path
=
_get_weight_path
(
path
)
path
=
_get_weight_path
(
path
)
path
=
_strip_postfix
(
path
)
if
not
(
os
.
path
.
isdir
(
path
)
or
os
.
path
.
exists
(
path
+
'.pdparams'
)):
if
not
(
os
.
path
.
isdir
(
path
)
or
os
.
path
.
exists
(
path
+
'.pdparams'
)):
raise
ValueError
(
"Model pretrain path {} does not "
raise
ValueError
(
"Model pretrain path {} does not "
"exists."
.
format
(
path
))
"exists."
.
format
(
path
))
...
...
ppdet/utils/download.py
浏览文件 @
0b33aced
...
@@ -201,6 +201,10 @@ def get_path(url, root_dir, md5sum=None, check_exist=True):
...
@@ -201,6 +201,10 @@ def get_path(url, root_dir, md5sum=None, check_exist=True):
else
:
else
:
exist_flag
=
False
exist_flag
=
False
fullname
=
_download
(
url
,
root_dir
,
md5sum
)
fullname
=
_download
(
url
,
root_dir
,
md5sum
)
# new weights format which postfix is 'pdparams' not
# need to decompress
if
osp
.
splitext
(
fullname
)[
-
1
]
!=
'.pdparams'
:
_decompress
(
fullname
)
_decompress
(
fullname
)
return
fullpath
,
exist_flag
return
fullpath
,
exist_flag
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录