Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
13759f95
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看板
未验证
提交
13759f95
编写于
7月 23, 2020
作者:
W
wangguanzhong
提交者:
GitHub
7月 23, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove im_shape for evaluation (#1089)
上级
897d86ac
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
12 addition
and
17 deletion
+12
-17
ppdet/modeling/architecture/cascade_rcnn.py
ppdet/modeling/architecture/cascade_rcnn.py
+0
-1
ppdet/modeling/architecture/faster_rcnn.py
ppdet/modeling/architecture/faster_rcnn.py
+1
-2
ppdet/modeling/architecture/mask_rcnn.py
ppdet/modeling/architecture/mask_rcnn.py
+1
-2
ppdet/modeling/architecture/yolo.py
ppdet/modeling/architecture/yolo.py
+2
-1
ppdet/py_op/post_process.py
ppdet/py_op/post_process.py
+1
-8
ppdet/utils/eval_utils.py
ppdet/utils/eval_utils.py
+7
-3
未找到文件。
ppdet/modeling/architecture/cascade_rcnn.py
浏览文件 @
13759f95
...
@@ -122,6 +122,5 @@ class CascadeRCNN(BaseArch):
...
@@ -122,6 +122,5 @@ class CascadeRCNN(BaseArch):
'bbox_nums'
:
self
.
gbd
[
'predicted_bbox_nums'
].
numpy
(),
'bbox_nums'
:
self
.
gbd
[
'predicted_bbox_nums'
].
numpy
(),
'mask'
:
self
.
gbd
[
'predicted_mask'
].
numpy
(),
'mask'
:
self
.
gbd
[
'predicted_mask'
].
numpy
(),
'im_id'
:
self
.
gbd
[
'im_id'
].
numpy
(),
'im_id'
:
self
.
gbd
[
'im_id'
].
numpy
(),
'im_shape'
:
self
.
gbd
[
'im_shape'
].
numpy
()
}
}
return
inputs
return
inputs
ppdet/modeling/architecture/faster_rcnn.py
浏览文件 @
13759f95
...
@@ -73,7 +73,6 @@ class FasterRCNN(BaseArch):
...
@@ -73,7 +73,6 @@ class FasterRCNN(BaseArch):
outs
=
{
outs
=
{
"bbox"
:
self
.
gbd
[
'predicted_bbox'
].
numpy
(),
"bbox"
:
self
.
gbd
[
'predicted_bbox'
].
numpy
(),
"bbox_nums"
:
self
.
gbd
[
'predicted_bbox_nums'
].
numpy
(),
"bbox_nums"
:
self
.
gbd
[
'predicted_bbox_nums'
].
numpy
(),
'im_id'
:
self
.
gbd
[
'im_id'
].
numpy
(),
'im_id'
:
self
.
gbd
[
'im_id'
].
numpy
()
'im_shape'
:
self
.
gbd
[
'im_shape'
].
numpy
()
}
}
return
outs
return
outs
ppdet/modeling/architecture/mask_rcnn.py
浏览文件 @
13759f95
...
@@ -96,7 +96,6 @@ class MaskRCNN(BaseArch):
...
@@ -96,7 +96,6 @@ class MaskRCNN(BaseArch):
'bbox'
:
self
.
gbd
[
'predicted_bbox'
].
numpy
(),
'bbox'
:
self
.
gbd
[
'predicted_bbox'
].
numpy
(),
'bbox_nums'
:
self
.
gbd
[
'predicted_bbox_nums'
].
numpy
(),
'bbox_nums'
:
self
.
gbd
[
'predicted_bbox_nums'
].
numpy
(),
'mask'
:
self
.
gbd
[
'predicted_mask'
].
numpy
(),
'mask'
:
self
.
gbd
[
'predicted_mask'
].
numpy
(),
'im_id'
:
self
.
gbd
[
'im_id'
].
numpy
(),
'im_id'
:
self
.
gbd
[
'im_id'
].
numpy
()
'im_shape'
:
self
.
gbd
[
'im_shape'
].
numpy
()
}
}
return
inputs
return
inputs
ppdet/modeling/architecture/yolo.py
浏览文件 @
13759f95
...
@@ -48,6 +48,7 @@ class YOLOv3(BaseArch):
...
@@ -48,6 +48,7 @@ class YOLOv3(BaseArch):
def
infer
(
self
,
):
def
infer
(
self
,
):
outs
=
{
outs
=
{
"bbox"
:
self
.
gbd
[
'predicted_bbox'
].
numpy
(),
"bbox"
:
self
.
gbd
[
'predicted_bbox'
].
numpy
(),
"bbox_nums"
:
self
.
gbd
[
'predicted_bbox_nums'
]
"bbox_nums"
:
self
.
gbd
[
'predicted_bbox_nums'
],
'im_id'
:
self
.
gbd
[
'im_id'
].
numpy
()
}
}
return
outs
return
outs
ppdet/py_op/post_process.py
浏览文件 @
13759f95
...
@@ -120,12 +120,7 @@ def mask_post_process(bbox_nums, bboxes, masks, im_info):
...
@@ -120,12 +120,7 @@ def mask_post_process(bbox_nums, bboxes, masks, im_info):
@
jit
@
jit
def
get_det_res
(
bbox_nums
,
def
get_det_res
(
bbox_nums
,
bbox
,
image_id
,
num_id_to_cat_id_map
,
batch_size
=
1
):
bbox
,
image_id
,
image_shape
,
num_id_to_cat_id_map
,
batch_size
=
1
):
det_res
=
[]
det_res
=
[]
bbox_v
=
np
.
array
(
bbox
)
bbox_v
=
np
.
array
(
bbox
)
if
bbox_v
.
shape
==
(
if
bbox_v
.
shape
==
(
...
@@ -139,8 +134,6 @@ def get_det_res(bbox_nums,
...
@@ -139,8 +134,6 @@ def get_det_res(bbox_nums,
for
i
in
range
(
batch_size
):
for
i
in
range
(
batch_size
):
dt_num_this_img
=
bbox_nums
[
i
+
1
]
-
bbox_nums
[
i
]
dt_num_this_img
=
bbox_nums
[
i
+
1
]
-
bbox_nums
[
i
]
image_id
=
int
(
image_id
[
i
][
0
])
image_id
=
int
(
image_id
[
i
][
0
])
image_width
=
int
(
image_shape
[
i
][
1
])
#int(data[i][-1][1])
image_height
=
int
(
image_shape
[
i
][
2
])
#int(data[i][-1][2])
for
j
in
range
(
dt_num_this_img
):
for
j
in
range
(
dt_num_this_img
):
dt
=
bbox_v
[
k
]
dt
=
bbox_v
[
k
]
k
=
k
+
1
k
=
k
+
1
...
...
ppdet/utils/eval_utils.py
浏览文件 @
13759f95
...
@@ -2,6 +2,8 @@ from __future__ import absolute_import
...
@@ -2,6 +2,8 @@ from __future__ import absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
os
def
json_eval_results
(
metric
,
json_directory
=
None
,
dataset
=
None
):
def
json_eval_results
(
metric
,
json_directory
=
None
,
dataset
=
None
):
"""
"""
...
@@ -39,14 +41,16 @@ def coco_eval_results(outs_res=None,
...
@@ -39,14 +41,16 @@ def coco_eval_results(outs_res=None,
from
ppdet.py_op.post_process
import
get_det_res
,
get_seg_res
from
ppdet.py_op.post_process
import
get_det_res
,
get_seg_res
anno_file
=
os
.
path
.
join
(
dataset
.
dataset_dir
,
dataset
.
anno_path
)
anno_file
=
os
.
path
.
join
(
dataset
.
dataset_dir
,
dataset
.
anno_path
)
cocoGt
=
COCO
(
anno_file
)
cocoGt
=
COCO
(
anno_file
)
catid
=
{
i
+
1
:
v
for
i
,
v
in
enumerate
(
cocoGt
.
getCatIds
())}
catid
=
{
i
+
dataset
.
with_background
:
v
for
i
,
v
in
enumerate
(
cocoGt
.
getCatIds
())
}
if
outs_res
is
not
None
and
len
(
outs_res
)
>
0
:
if
outs_res
is
not
None
and
len
(
outs_res
)
>
0
:
det_res
=
[]
det_res
=
[]
for
outs
in
outs_res
:
for
outs
in
outs_res
:
det_res
+=
get_det_res
(
outs
[
'bbox_nums'
],
outs
[
'bbox'
],
det_res
+=
get_det_res
(
outs
[
'bbox_nums'
],
outs
[
'bbox'
],
outs
[
'im_id'
],
outs
[
'im_shape'
],
catid
,
outs
[
'im_id'
],
catid
,
batch_size
)
batch_size
)
with
io
.
open
(
"bbox_eval.json"
,
'w'
)
as
outfile
:
with
io
.
open
(
"bbox_eval.json"
,
'w'
)
as
outfile
:
encode_func
=
unicode
if
six
.
PY2
else
str
encode_func
=
unicode
if
six
.
PY2
else
str
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录