Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
models
提交
01435d00
M
models
项目概览
PaddlePaddle
/
models
接近 2 年 前同步成功
通知
230
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看板
未验证
提交
01435d00
编写于
10月 25, 2019
作者:
K
Kaipeng Deng
提交者:
GitHub
10月 25, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix unicode python3 compatable (#3759)
上级
357c46ee
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
11 addition
and
4 deletion
+11
-4
PaddleCV/rcnn/eval_coco_map.py
PaddleCV/rcnn/eval_coco_map.py
+5
-2
PaddleCV/ssd/eval_coco_map.py
PaddleCV/ssd/eval_coco_map.py
+3
-1
PaddleCV/yolov3/eval.py
PaddleCV/yolov3/eval.py
+3
-1
未找到文件。
PaddleCV/rcnn/eval_coco_map.py
浏览文件 @
01435d00
...
@@ -17,6 +17,7 @@ from __future__ import division
...
@@ -17,6 +17,7 @@ from __future__ import division
from
__future__
import
print_function
from
__future__
import
print_function
import
os
import
os
import
io
import
io
import
six
import
time
import
time
import
numpy
as
np
import
numpy
as
np
from
eval_helper
import
*
from
eval_helper
import
*
...
@@ -118,7 +119,8 @@ def eval():
...
@@ -118,7 +119,8 @@ def eval():
Please use reasonable model and check input data."
Please use reasonable model and check input data."
with
io
.
open
(
"detection_bbox_result.json"
,
'w'
)
as
outfile
:
with
io
.
open
(
"detection_bbox_result.json"
,
'w'
)
as
outfile
:
outfile
.
write
(
unicode
(
json
.
dumps
(
dts_res
)))
encode_func
=
unicode
if
six
.
PY2
else
str
outfile
.
write
(
encode_func
(
json
.
dumps
(
dts_res
)))
print
(
"start evaluate bbox using coco api"
)
print
(
"start evaluate bbox using coco api"
)
cocoDt
=
cocoGt
.
loadRes
(
"detection_bbox_result.json"
)
cocoDt
=
cocoGt
.
loadRes
(
"detection_bbox_result.json"
)
cocoEval
=
COCOeval
(
cocoGt
,
cocoDt
,
'bbox'
)
cocoEval
=
COCOeval
(
cocoGt
,
cocoDt
,
'bbox'
)
...
@@ -128,7 +130,8 @@ def eval():
...
@@ -128,7 +130,8 @@ def eval():
if
cfg
.
MASK_ON
:
if
cfg
.
MASK_ON
:
with
io
.
open
(
"detection_segms_result.json"
,
'w'
)
as
outfile
:
with
io
.
open
(
"detection_segms_result.json"
,
'w'
)
as
outfile
:
outfile
.
write
(
unicode
(
json
.
dumps
(
segms_res
)))
encode_func
=
unicode
if
six
.
PY2
else
str
outfile
.
write
(
encode_func
(
json
.
dumps
(
segms_res
)))
print
(
"start evaluate mask using coco api"
)
print
(
"start evaluate mask using coco api"
)
cocoDt
=
cocoGt
.
loadRes
(
"detection_segms_result.json"
)
cocoDt
=
cocoGt
.
loadRes
(
"detection_segms_result.json"
)
cocoEval
=
COCOeval
(
cocoGt
,
cocoDt
,
'segm'
)
cocoEval
=
COCOeval
(
cocoGt
,
cocoDt
,
'segm'
)
...
...
PaddleCV/ssd/eval_coco_map.py
浏览文件 @
01435d00
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
# limitations under the License.
# limitations under the License.
import
os
import
os
import
io
import
io
import
six
import
time
import
time
import
numpy
as
np
import
numpy
as
np
import
argparse
import
argparse
...
@@ -130,7 +131,8 @@ def eval(args, data_args, test_list, batch_size, model_dir=None):
...
@@ -130,7 +131,8 @@ def eval(args, data_args, test_list, batch_size, model_dir=None):
dts_res
+=
get_dt_res
(
nmsed_out_v
,
data
)
dts_res
+=
get_dt_res
(
nmsed_out_v
,
data
)
with
io
.
open
(
"detection_result.json"
,
'w'
)
as
outfile
:
with
io
.
open
(
"detection_result.json"
,
'w'
)
as
outfile
:
outfile
.
write
(
unicode
(
json
.
dumps
(
dts_res
)))
encode_func
=
unicode
if
six
.
PY2
else
str
outfile
.
write
(
encode_func
(
json
.
dumps
(
dts_res
)))
print
(
"start evaluate using coco api"
)
print
(
"start evaluate using coco api"
)
cocoGt
=
COCO
(
os
.
path
.
join
(
data_args
.
data_dir
,
test_list
))
cocoGt
=
COCO
(
os
.
path
.
join
(
data_args
.
data_dir
,
test_list
))
cocoDt
=
cocoGt
.
loadRes
(
"detection_result.json"
)
cocoDt
=
cocoGt
.
loadRes
(
"detection_result.json"
)
...
...
PaddleCV/yolov3/eval.py
浏览文件 @
01435d00
...
@@ -17,6 +17,7 @@ from __future__ import division
...
@@ -17,6 +17,7 @@ from __future__ import division
from
__future__
import
print_function
from
__future__
import
print_function
import
os
import
os
import
io
import
io
import
six
import
time
import
time
import
json
import
json
import
numpy
as
np
import
numpy
as
np
...
@@ -115,7 +116,8 @@ def eval():
...
@@ -115,7 +116,8 @@ def eval():
total_time
+=
end_time
-
start_time
total_time
+=
end_time
-
start_time
with
io
.
open
(
"yolov3_result.json"
,
'w'
)
as
outfile
:
with
io
.
open
(
"yolov3_result.json"
,
'w'
)
as
outfile
:
outfile
.
write
(
unicode
(
json
.
dumps
(
dts_res
)))
encode_func
=
unicode
if
six
.
PY2
else
str
outfile
.
write
(
encode_func
(
json
.
dumps
(
dts_res
)))
print
(
"start evaluate detection result with coco api"
)
print
(
"start evaluate detection result with coco api"
)
coco
=
COCO
(
os
.
path
.
join
(
cfg
.
data_dir
,
test_list
))
coco
=
COCO
(
os
.
path
.
join
(
cfg
.
data_dir
,
test_list
))
cocoDt
=
coco
.
loadRes
(
"yolov3_result.json"
)
cocoDt
=
coco
.
loadRes
(
"yolov3_result.json"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录