Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yolov5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Administrator
yolov5
Commits
69ea70cd
Unverified
提交
69ea70cd
authored
12月 16, 2020
作者:
Glenn Jocher
提交者:
GitHub
12月 16, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add idetection_profile() function to plots.py (#1700)
上级
e92245a3
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
34 行增加
和
1 行删除
+34
-1
plots.py
utils/plots.py
+34
-1
没有找到文件。
utils/plots.py
浏览文件 @
69ea70cd
# Plotting utils
import
glob
import
math
import
os
import
random
from
copy
import
copy
from
pathlib
import
Path
import
cv2
import
math
import
matplotlib
import
matplotlib.pyplot
as
plt
import
numpy
as
np
...
...
@@ -329,6 +329,39 @@ def plot_evolution(yaml_file='data/hyp.finetune.yaml'): # from utils.plots impo
print
(
'
\n
Plot saved as evolve.png'
)
def
profile_idetection
(
start
=
0
,
stop
=
0
,
labels
=
(),
save_dir
=
''
):
# Plot iDetection '*.txt' per-image logs. from . import *; profile_idetection()
fig
,
ax
=
plt
.
subplots
(
2
,
4
,
figsize
=
(
12
,
6
),
tight_layout
=
True
)
ax
=
ax
.
ravel
()
s
=
[
'Images'
,
'Free Storage (GB)'
,
'RAM Usage (GB)'
,
'Battery'
,
'dt_raw (ms)'
,
'dt_smooth (ms)'
,
'real-world FPS'
]
files
=
list
(
Path
(
save_dir
)
.
glob
(
'frames*.txt'
))
for
fi
,
f
in
enumerate
(
files
):
try
:
results
=
np
.
loadtxt
(
f
,
ndmin
=
2
)
.
T
[:,
90
:
-
30
]
# clip first and last rows
n
=
results
.
shape
[
1
]
# number of rows
x
=
np
.
arange
(
start
,
min
(
stop
,
n
)
if
stop
else
n
)
t
=
(
results
[
0
]
-
results
[
0
]
.
min
())
# set t0=0s
results
[
0
]
=
x
for
i
,
a
in
enumerate
(
ax
):
if
i
<
len
(
results
):
y
=
results
[
i
,
x
]
label
=
labels
[
fi
]
if
len
(
labels
)
else
f
.
stem
.
replace
(
'frames_'
,
''
)
a
.
plot
(
t
,
y
,
marker
=
'.'
,
label
=
label
,
linewidth
=
1
,
markersize
=
5
)
a
.
set_title
(
s
[
i
])
a
.
set_xlabel
(
'time (s)'
)
# if fi == len(files) - 1:
# a.set_ylim(bottom=0)
for
side
in
[
'top'
,
'right'
]:
a
.
spines
[
side
]
.
set_visible
(
False
)
else
:
a
.
remove
()
except
Exception
as
e
:
print
(
'Warning: Plotting error for
%
s;
%
s'
%
(
f
,
e
))
ax
[
1
]
.
legend
()
fig
.
savefig
(
Path
(
save_dir
)
/
'idetection_profile.png'
,
dpi
=
200
)
def
plot_results_overlay
(
start
=
0
,
stop
=
0
):
# from utils.plots import *; plot_results_overlay()
# Plot training 'results*.txt', overlaying train and val losses
s
=
[
'train'
,
'train'
,
'train'
,
'Precision'
,
'mAP@0.5'
,
'val'
,
'val'
,
'val'
,
'Recall'
,
'mAP@0.5:0.95'
]
# legends
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论