Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleOCR
提交
ea0ff9c3
P
PaddleOCR
项目概览
s920243400
/
PaddleOCR
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleOCR
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleOCR
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ea0ff9c3
编写于
3月 25, 2022
作者:
L
LDOUBLEV
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix html
上级
85a64cb0
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
26 addition
and
15 deletion
+26
-15
tools/end2end/draw_html.py
tools/end2end/draw_html.py
+26
-15
未找到文件。
tools/end2end/draw_html.py
浏览文件 @
ea0ff9c3
...
@@ -13,9 +13,29 @@
...
@@ -13,9 +13,29 @@
# limitations under the License.
# limitations under the License.
import
os
import
os
import
argparse
def
draw_debug_img
(
html_path
):
def
str2bool
(
v
):
return
v
.
lower
()
in
(
"true"
,
"t"
,
"1"
)
def
init_args
():
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"--image_dir"
,
type
=
str
,
default
=
""
)
parser
.
add_argument
(
"--save_html_path"
,
type
=
str
,
default
=
"./default.html"
)
parser
.
add_argument
(
"--width"
,
type
=
int
,
default
=
640
)
return
parser
def
parse_args
():
parser
=
init_args
()
return
parser
.
parse_args
()
def
draw_debug_img
(
args
):
html_path
=
args
.
save_html_path
err_cnt
=
0
err_cnt
=
0
with
open
(
html_path
,
'w'
)
as
html
:
with
open
(
html_path
,
'w'
)
as
html
:
...
@@ -25,23 +45,14 @@ def draw_debug_img(html_path):
...
@@ -25,23 +45,14 @@ def draw_debug_img(html_path):
"<meta http-equiv=
\"
Content-Type
\"
content=
\"
text/html; charset=utf-8
\"
/>"
"<meta http-equiv=
\"
Content-Type
\"
content=
\"
text/html; charset=utf-8
\"
/>"
)
)
image_list
=
[]
image_list
=
[]
path
=
"./det_results/310_gt/"
path
=
args
.
image_dir
for
i
,
filename
in
enumerate
(
sorted
(
os
.
listdir
(
path
))):
for
i
,
filename
in
enumerate
(
sorted
(
os
.
listdir
(
path
))):
if
filename
.
endswith
(
"txt"
):
continue
if
filename
.
endswith
(
"txt"
):
continue
print
(
filename
)
# The image path
# The image path
base
=
"{}/{}"
.
format
(
path
,
filename
)
base
=
"{}/{}"
.
format
(
path
,
filename
)
base_2
=
"../PaddleOCR/det_results/ch_PPOCRV2_infer/{}"
.
format
(
filename
)
base_3
=
"../PaddleOCR/det_results/ch_ppocr_mobile_infer/{}"
.
format
(
filename
)
html
.
write
(
"<tr>
\n
"
)
html
.
write
(
"<tr>
\n
"
)
html
.
write
(
f
'<td>
{
filename
}
\n
GT'
)
html
.
write
(
f
'<td>
{
filename
}
\n
GT'
)
html
.
write
(
'<td>GT
\n
<img src="%s" width=640></td>'
%
(
base
))
html
.
write
(
f
'<td>GT
\n
<img src="
{
base
}
" width=
{
args
.
width
}
></td>'
)
html
.
write
(
'<td>PPOCRV2
\n
<img src="%s" width=640></td>'
%
(
base_2
))
html
.
write
(
'<td>ppocr_mobile
\n
<img src="%s" width=640></td>'
%
(
base_3
))
html
.
write
(
"</tr>
\n
"
)
html
.
write
(
"</tr>
\n
"
)
html
.
write
(
'<style>
\n
'
)
html
.
write
(
'<style>
\n
'
)
...
@@ -51,12 +62,12 @@ def draw_debug_img(html_path):
...
@@ -51,12 +62,12 @@ def draw_debug_img(html_path):
html
.
write
(
'</style>
\n
'
)
html
.
write
(
'</style>
\n
'
)
html
.
write
(
'</table>
\n
'
)
html
.
write
(
'</table>
\n
'
)
html
.
write
(
'</html>
\n
</body>
\n
'
)
html
.
write
(
'</html>
\n
</body>
\n
'
)
print
(
"ok
"
)
print
(
f
"The html file saved in
{
html_path
}
"
)
return
return
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
html_path
=
"sys_visual_iou_310.html"
args
=
parse_args
()
draw_debug_img
()
draw_debug_img
(
args
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录