Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
models
提交
10cf8081
M
models
项目概览
PaddlePaddle
/
models
大约 1 年 前同步成功
通知
222
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
10cf8081
编写于
9月 17, 2019
作者:
W
wangguanzhong
提交者:
GitHub
9月 17, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix rcnn eval on voc (#3344)
* fix rcnn eval on voc * update comment
上级
bf0899a5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
48 addition
and
4 deletion
+48
-4
PaddleCV/PaddleDetection/ppdet/data/data_feed.py
PaddleCV/PaddleDetection/ppdet/data/data_feed.py
+5
-4
PaddleCV/PaddleDetection/ppdet/data/transform/arrange_sample.py
...CV/PaddleDetection/ppdet/data/transform/arrange_sample.py
+43
-0
未找到文件。
PaddleCV/PaddleDetection/ppdet/data/data_feed.py
浏览文件 @
10cf8081
...
...
@@ -30,8 +30,8 @@ from ppdet.data.transform.operators import (
Permute
)
from
ppdet.data.transform.arrange_sample
import
(
ArrangeRCNN
,
Arrange
TestRCNN
,
ArrangeSSD
,
ArrangeEvalSSD
,
ArrangeTestSSD
,
ArrangeYOLO
,
ArrangeEvalYOLO
,
ArrangeTestYOLO
)
ArrangeRCNN
,
Arrange
EvalRCNN
,
ArrangeTestRCNN
,
ArrangeSSD
,
ArrangeEvalSSD
,
Arrange
TestSSD
,
Arrange
YOLO
,
ArrangeEvalYOLO
,
ArrangeTestYOLO
)
__all__
=
[
'PadBatch'
,
'MultiScale'
,
'RandomShape'
,
'DataSet'
,
'CocoDataSet'
,
...
...
@@ -476,7 +476,8 @@ class FasterRCNNEvalFeed(DataFeed):
def
__init__
(
self
,
dataset
=
CocoDataSet
(
COCO_VAL_ANNOTATION
,
COCO_VAL_IMAGE_DIR
).
__dict__
,
fields
=
[
'image'
,
'im_info'
,
'im_id'
,
'im_shape'
],
fields
=
[
'image'
,
'im_info'
,
'im_id'
,
'im_shape'
,
'gt_box'
,
'gt_label'
,
'is_difficult'
],
image_shape
=
[
3
,
800
,
1333
],
sample_transforms
=
[
DecodeImage
(
to_rgb
=
True
),
...
...
@@ -494,7 +495,7 @@ class FasterRCNNEvalFeed(DataFeed):
drop_last
=
False
,
num_workers
=
2
,
use_padded_im_info
=
True
):
sample_transforms
.
append
(
Arrange
Test
RCNN
())
sample_transforms
.
append
(
Arrange
Eval
RCNN
())
super
(
FasterRCNNEvalFeed
,
self
).
__init__
(
dataset
,
fields
,
...
...
PaddleCV/PaddleDetection/ppdet/data/transform/arrange_sample.py
浏览文件 @
10cf8081
...
...
@@ -90,6 +90,47 @@ class ArrangeRCNN(BaseOperator):
return
outs
@
register_op
class
ArrangeEvalRCNN
(
BaseOperator
):
"""
Transform dict to the tuple format needed for evaluation.
"""
def
__init__
(
self
):
super
(
ArrangeEvalRCNN
,
self
).
__init__
()
def
__call__
(
self
,
sample
,
context
=
None
):
"""
Args:
sample: a dict which contains image
info and annotation info.
context: a dict which contains additional info.
Returns:
sample: a tuple containing the following items:
(image, im_info, im_id, im_shape, gt_bbox,
gt_class, difficult)
"""
im
=
sample
[
'image'
]
keys
=
list
(
sample
.
keys
())
if
'im_info'
in
keys
:
im_info
=
sample
[
'im_info'
]
else
:
raise
KeyError
(
"The dataset doesn't have 'im_info' key."
)
im_id
=
sample
[
'im_id'
]
h
=
sample
[
'h'
]
w
=
sample
[
'w'
]
# For rcnn models in eval and infer stage, original image size
# is needed to clip the bounding boxes. And box clip op in
# bbox prediction needs im_info as input in format of [N, 3],
# so im_shape is appended by 1 to match dimension.
im_shape
=
np
.
array
((
h
,
w
,
1
),
dtype
=
np
.
float32
)
gt_bbox
=
sample
[
'gt_bbox'
]
gt_class
=
sample
[
'gt_class'
]
difficult
=
sample
[
'difficult'
]
outs
=
(
im
,
im_info
,
im_id
,
im_shape
,
gt_bbox
,
gt_class
,
difficult
)
return
outs
@
register_op
class
ArrangeTestRCNN
(
BaseOperator
):
"""
...
...
@@ -152,6 +193,7 @@ class ArrangeSSD(BaseOperator):
outs
=
(
im
,
gt_bbox
,
gt_class
)
return
outs
@
register_op
class
ArrangeEvalSSD
(
BaseOperator
):
"""
...
...
@@ -184,6 +226,7 @@ class ArrangeEvalSSD(BaseOperator):
return
outs
@
register_op
class
ArrangeTestSSD
(
BaseOperator
):
"""
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录