Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
1089bcf6
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
接近 2 年 前同步成功
通知
706
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看板
未验证
提交
1089bcf6
编写于
4月 28, 2021
作者:
W
wangguanzhong
提交者:
GitHub
4月 28, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix voc eval (#2731)
* fix voc eval * remove debug code * add comments * update comment for collate_batch
上级
38a9b7c5
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
61 addition
and
9 deletion
+61
-9
configs/ppyolo/ppyolo_r50vd_dcn_voc.yml
configs/ppyolo/ppyolo_r50vd_dcn_voc.yml
+6
-0
configs/ssd/ssd_mobilenet_v1_300_120e_voc.yml
configs/ssd/ssd_mobilenet_v1_300_120e_voc.yml
+6
-0
configs/ssd/ssd_vgg16_300_240e_voc.yml
configs/ssd/ssd_vgg16_300_240e_voc.yml
+6
-0
configs/yolov3/yolov3_darknet53_270e_voc.yml
configs/yolov3/yolov3_darknet53_270e_voc.yml
+6
-0
configs/yolov3/yolov3_mobilenet_v1_270e_voc.yml
configs/yolov3/yolov3_mobilenet_v1_270e_voc.yml
+6
-0
configs/yolov3/yolov3_mobilenet_v1_ssld_270e_voc.yml
configs/yolov3/yolov3_mobilenet_v1_ssld_270e_voc.yml
+6
-0
configs/yolov3/yolov3_mobilenet_v3_large_270e_voc.yml
configs/yolov3/yolov3_mobilenet_v3_large_270e_voc.yml
+6
-0
configs/yolov3/yolov3_mobilenet_v3_large_ssld_270e_voc.yml
configs/yolov3/yolov3_mobilenet_v3_large_ssld_270e_voc.yml
+6
-0
ppdet/data/reader.py
ppdet/data/reader.py
+6
-2
ppdet/metrics/metrics.py
ppdet/metrics/metrics.py
+7
-7
未找到文件。
configs/ppyolo/ppyolo_r50vd_dcn_voc.yml
浏览文件 @
1089bcf6
...
...
@@ -13,6 +13,12 @@ TrainReader:
mixup_epoch
:
350
batch_size
:
12
# set collate_batch to false because ground-truth info is needed
# on voc dataset and should not collate data in batch when batch size
# is larger than 1.
EvalReader
:
collate_batch
:
false
epoch
:
583
LearningRate
:
...
...
configs/ssd/ssd_mobilenet_v1_300_120e_voc.yml
浏览文件 @
1089bcf6
...
...
@@ -6,3 +6,9 @@ _BASE_: [
'
_base_/ssd_mobilenet_reader.yml'
,
]
weights
:
output/ssd_mobilenet_v1_300_120e_voc/model_final
# set collate_batch to false because ground-truth info is needed
# on voc dataset and should not collate data in batch when batch size
# is larger than 1.
EvalReader
:
collate_batch
:
false
configs/ssd/ssd_vgg16_300_240e_voc.yml
浏览文件 @
1089bcf6
...
...
@@ -6,3 +6,9 @@ _BASE_: [
'
_base_/ssd_reader.yml'
,
]
weights
:
output/ssd_vgg16_300_240e_voc/model_final
# set collate_batch to false because ground-truth info is needed
# on voc dataset and should not collate data in batch when batch size
# is larger than 1.
EvalReader
:
collate_batch
:
false
configs/yolov3/yolov3_darknet53_270e_voc.yml
浏览文件 @
1089bcf6
...
...
@@ -8,3 +8,9 @@ _BASE_: [
snapshot_epoch
:
5
weights
:
output/yolov3_darknet53_270e_voc/model_final
# set collate_batch to false because ground-truth info is needed
# on voc dataset and should not collate data in batch when batch size
# is larger than 1.
EvalReader
:
collate_batch
:
false
configs/yolov3/yolov3_mobilenet_v1_270e_voc.yml
浏览文件 @
1089bcf6
...
...
@@ -9,6 +9,12 @@ _BASE_: [
snapshot_epoch
:
5
weights
:
output/yolov3_mobilenet_v1_270e_voc/model_final
# set collate_batch to false because ground-truth info is needed
# on voc dataset and should not collate data in batch when batch size
# is larger than 1.
EvalReader
:
collate_batch
:
false
LearningRate
:
base_lr
:
0.001
schedulers
:
...
...
configs/yolov3/yolov3_mobilenet_v1_ssld_270e_voc.yml
浏览文件 @
1089bcf6
...
...
@@ -10,6 +10,12 @@ snapshot_epoch: 5
pretrain_weights
:
https://paddledet.bj.bcebos.com/models/pretrained/MobileNetV1_ssld_pretrained.pdparams
weights
:
output/yolov3_mobilenet_v1_ssld_270e_voc/model_final
# set collate_batch to false because ground-truth info is needed
# on voc dataset and should not collate data in batch when batch size
# is larger than 1.
EvalReader
:
collate_batch
:
false
LearningRate
:
base_lr
:
0.001
schedulers
:
...
...
configs/yolov3/yolov3_mobilenet_v3_large_270e_voc.yml
浏览文件 @
1089bcf6
...
...
@@ -9,6 +9,12 @@ _BASE_: [
snapshot_epoch
:
5
weights
:
output/yolov3_mobilenet_v3_large_270e_voc/model_final
# set collate_batch to false because ground-truth info is needed
# on voc dataset and should not collate data in batch when batch size
# is larger than 1.
EvalReader
:
collate_batch
:
false
LearningRate
:
base_lr
:
0.001
schedulers
:
...
...
configs/yolov3/yolov3_mobilenet_v3_large_ssld_270e_voc.yml
浏览文件 @
1089bcf6
...
...
@@ -10,6 +10,12 @@ snapshot_epoch: 5
pretrain_weights
:
https://paddledet.bj.bcebos.com/models/pretrained/MobileNetV3_large_x1_0_ssld_pretrained.pdparams
weights
:
output/yolov3_mobilenet_v3_large_ssld_270e_voc/model_final
# set collate_batch to false because ground-truth info is needed
# on voc dataset and should not collate data in batch when batch size
# is larger than 1.
EvalReader
:
collate_batch
:
false
LearningRate
:
base_lr
:
0.001
schedulers
:
...
...
ppdet/data/reader.py
浏览文件 @
1089bcf6
...
...
@@ -95,10 +95,9 @@ class BatchCompose(Compose):
tmp_data
=
[]
for
i
in
range
(
len
(
data
)):
tmp_data
.
append
(
data
[
i
][
k
])
if
not
'gt_'
in
k
and
not
'is_crowd'
in
k
:
if
not
'gt_'
in
k
and
not
'is_crowd'
in
k
and
not
'difficult'
in
k
:
tmp_data
=
np
.
stack
(
tmp_data
,
axis
=
0
)
batch_data
[
k
]
=
tmp_data
return
batch_data
...
...
@@ -118,6 +117,11 @@ class BaseDataLoader(object):
drop_empty (bool): whether to drop samples with no ground
truth labels, default True
num_classes (int): class number of dataset, default 80
collate_batch (bool): whether to collate batch in dataloader.
If set to True, the samples will collate into batch according
to the batch size. Otherwise, the ground-truth will not collate,
which is used when the number of ground-truch is different in
samples.
use_shared_memory (bool): whether to use shared memory to
accelerate data loading, enable this only if you
are sure that the shared memory size of your OS
...
...
ppdet/metrics/metrics.py
浏览文件 @
1089bcf6
...
...
@@ -202,9 +202,9 @@ class VOCMetric(Metric):
if
bboxes
.
shape
==
(
1
,
1
)
or
bboxes
is
None
:
return
gt_boxes
=
inputs
[
'gt_bbox'
]
.
numpy
()
gt_labels
=
inputs
[
'gt_class'
]
.
numpy
()
difficults
=
inputs
[
'difficult'
]
.
numpy
()
if
not
self
.
evaluate_difficult
\
gt_boxes
=
inputs
[
'gt_bbox'
]
gt_labels
=
inputs
[
'gt_class'
]
difficults
=
inputs
[
'difficult'
]
if
not
self
.
evaluate_difficult
\
else
None
scale_factor
=
inputs
[
'scale_factor'
].
numpy
(
...
...
@@ -212,13 +212,13 @@ class VOCMetric(Metric):
(
gt_boxes
.
shape
[
0
],
2
)).
astype
(
'float32'
)
bbox_idx
=
0
for
i
in
range
(
gt_boxes
.
shape
[
0
]
):
gt_box
=
gt_boxes
[
i
]
for
i
in
range
(
len
(
gt_boxes
)
):
gt_box
=
gt_boxes
[
i
]
.
numpy
()
h
,
w
=
scale_factor
[
i
]
gt_box
=
gt_box
/
np
.
array
([
w
,
h
,
w
,
h
])
gt_label
=
gt_labels
[
i
]
gt_label
=
gt_labels
[
i
]
.
numpy
()
difficult
=
None
if
difficults
is
None
\
else
difficults
[
i
]
else
difficults
[
i
]
.
numpy
()
bbox_num
=
bbox_lengths
[
i
]
bbox
=
bboxes
[
bbox_idx
:
bbox_idx
+
bbox_num
]
score
=
scores
[
bbox_idx
:
bbox_idx
+
bbox_num
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录