Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
models
提交
bcb1af07
M
models
项目概览
PaddlePaddle
/
models
1 年多 前同步成功
通知
226
Star
6828
Fork
2962
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
602
列表
看板
标记
里程碑
合并请求
255
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
models
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
602
Issue
602
列表
看板
标记
里程碑
合并请求
255
合并请求
255
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
bcb1af07
编写于
4月 22, 2019
作者:
K
Kaipeng Deng
提交者:
GitHub
4月 22, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2096 from heavengate/yolo_syncbn
sync bn for yolov3.
上级
900c733a
f7efca5e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
24 addition
and
16 deletion
+24
-16
PaddleCV/yolov3/README.md
PaddleCV/yolov3/README.md
+10
-2
PaddleCV/yolov3/README_cn.md
PaddleCV/yolov3/README_cn.md
+11
-3
PaddleCV/yolov3/models/yolov3.py
PaddleCV/yolov3/models/yolov3.py
+1
-11
PaddleCV/yolov3/train.py
PaddleCV/yolov3/train.py
+1
-0
PaddleCV/yolov3/utility.py
PaddleCV/yolov3/utility.py
+1
-0
未找到文件。
PaddleCV/yolov3/README.md
浏览文件 @
bcb1af07
...
...
@@ -134,14 +134,22 @@ Evaluation is to evaluate the performance of a trained model. This sample provid
-
Set
```export CUDA_VISIBLE_DEVICES=0```
to specifiy one GPU to eval.
Evalutaion result is shown as below:
If train with '--syncbn=False',
Evalutaion result is shown as below:
| input size | mAP(IoU=0.50:0.95) | mAP(IoU=0.50) | mAP(IoU=0.75) |
| :------: | :------: | :------: | :------: |
| 608x608| 37.7 | 59.8 | 40.8 |
| 608x608
| 37.7 | 59.8 | 40.8 |
| 416x416 | 36.5 | 58.2 | 39.1 |
| 320x320 | 34.1 | 55.4 | 36.3 |
If train with '--syncbn=True', Evalutaion result is shown as below:
| input size | mAP(IoU=0.50:0.95) | mAP(IoU=0.50) | mAP(IoU=0.75) |
| :------: | :------: | :------: | :------: |
| 608x608 | 38.9 | 61.1 | 42.0 |
| 416x416 | 37.5 | 59.6 | 40.2 |
| 320x320 | 34.8 | 56.4 | 36.9 |
-
**NOTE:**
evaluations based on
`pycocotools`
evaluator, predict bounding boxes with
`score < 0.05`
were not filtered out. Some frameworks which filtered out predict bounding boxes with
`score < 0.05`
will cause a drop in accuracy.
## Inference and Visualization
...
...
PaddleCV/yolov3/README_cn.md
浏览文件 @
bcb1af07
...
...
@@ -134,15 +134,23 @@ Train Loss
-
通过设置export CUDA
\_
VISIBLE
\_
DEVICES=0指定单卡GPU评估。
模型评估结果:
若训练时指定'--syncbn=False', 模型评估精度如下:
| input size | mAP(IoU=0.50:0.95) | mAP(IoU=0.50) | mAP(IoU=0.75) |
| :------: | :------: | :------: | :------: |
| 608x608| 37.7 | 59.8 | 40.8 |
| 608x608
| 37.7 | 59.8 | 40.8 |
| 416x416 | 36.5 | 58.2 | 39.1 |
| 320x320 | 34.1 | 55.4 | 36.3 |
-
**注意: **
评估结果基于
`pycocotools`
评估器,没有滤除
`score < 0.05`
的预测框,其他框架有此滤除操作会导致精度下降。
若训练时指定'--syncbn=True', 模型评估精度如下:
| input size | mAP(IoU=0.50:0.95) | mAP(IoU=0.50) | mAP(IoU=0.75) |
| :------: | :------: | :------: | :------: |
| 608x608 | 38.9 | 61.1 | 42.0 |
| 416x416 | 37.5 | 59.6 | 40.2 |
| 320x320 | 34.8 | 56.4 | 36.9 |
-
**注意:**
评估结果基于
`pycocotools`
评估器,没有滤除
`score < 0.05`
的预测框,其他框架有此滤除操作会导致精度下降。
...
...
PaddleCV/yolov3/models/yolov3.py
浏览文件 @
bcb1af07
...
...
@@ -46,19 +46,9 @@ def yolo_detection_block(input, channel, is_test=True, name=None):
return
route
,
tip
def
upsample
(
input
,
scale
=
2
,
name
=
None
):
# get dynamic upsample output shape
shape_nchw
=
fluid
.
layers
.
shape
(
input
)
shape_hw
=
fluid
.
layers
.
slice
(
shape_nchw
,
axes
=
[
0
],
starts
=
[
2
],
ends
=
[
4
])
shape_hw
.
stop_gradient
=
True
in_shape
=
fluid
.
layers
.
cast
(
shape_hw
,
dtype
=
'int32'
)
out_shape
=
in_shape
*
scale
out_shape
.
stop_gradient
=
True
# reisze by actual_shape
out
=
fluid
.
layers
.
resize_nearest
(
input
=
input
,
scale
=
scale
,
actual_shape
=
out_shape
,
scale
=
float
(
scale
),
name
=
name
)
return
out
...
...
PaddleCV/yolov3/train.py
浏览文件 @
bcb1af07
...
...
@@ -82,6 +82,7 @@ def train():
build_strategy
=
fluid
.
BuildStrategy
()
build_strategy
.
memory_optimize
=
True
build_strategy
.
sync_batch_norm
=
cfg
.
syncbn
compile_program
=
fluid
.
compiler
.
CompiledProgram
(
fluid
.
default_main_program
()).
with_data_parallel
(
loss_name
=
loss
.
name
,
build_strategy
=
build_strategy
)
...
...
PaddleCV/yolov3/utility.py
浏览文件 @
bcb1af07
...
...
@@ -112,6 +112,7 @@ def parse_args():
add_arg
(
'no_mixup_iter'
,
int
,
40000
,
"Disable mixup in last N iter."
)
# TRAIN TEST INFER
add_arg
(
'input_size'
,
int
,
608
,
"Image input size of YOLOv3."
)
add_arg
(
'syncbn'
,
bool
,
True
,
"Whether to use synchronized batch normalization."
)
add_arg
(
'random_shape'
,
bool
,
True
,
"Resize to random shape for train reader."
)
add_arg
(
'valid_thresh'
,
float
,
0.005
,
"Valid confidence score for NMS."
)
add_arg
(
'nms_thresh'
,
float
,
0.45
,
"NMS threshold."
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录