包含OTB数据绘图和保存的函数,只需要更改图片保存路径即可使用。
注意运行时输入: ./pysot-toolkit-OTB2015/bin/eval.py --show_video_level --vis
import matplotlib.pyplot as plt
import numpy as np
from .draw_utils import COLOR, LINE_STYLE
# figure_dir = r"C:\Users\lpf\Desktop\paper Latex\latex_lpf\figure\ps"
figure_dir = r"C:\Users\lpf\Desktop\毕业相关\paper\0_SiamLPF\Latex\figure\OTB2015"
def draw_success_precision(success_ret, name, videos, attr, precision_ret=None,
norm_precision_ret=None, bold_name=None, axis=[0, 1]):
# success plot
fig, ax = plt.subplots()
ax.grid(b=True)
ax.set_aspect(1)
plt.xlabel('Overlap threshold', fontdict={
'family': 'Times New Roman', 'size': 16})
plt.ylabel('Success rate', fontdict={
'family': 'Times New Roman', 'size': 16})
if attr == 'ALL':
plt.title(r'\textbf{Success plots of OPE on %s}' % (name))
path_name = name
else:
plt.title(r'\textbf{Success plots of OPE - %s}' % (attr))
path_attr = attr
plt.axis([0, 1] + axis)
success = {
}
# 阈值 产生0-1(闭区间)数组,间隔0.05
thresholds = np.arange(0, 1.05, 0.05)
for tracker_name in success_ret.keys():
value = [v for k, v in success_ret[tracker_name].items() if k in videos]
success[tracker_name] = np.mean(value)
for idx, (tracker_name, auc) in \
enumerate(sorted(success.items(), key=lambda x: x[1], reverse=True)):
if tracker_name == bold_name:
label = r"\textbf{[%.3f] %s}" % (auc, tracker_name)

该博客介绍了如何使用pysot工具包对OTB数据集的算法结果进行绘图和保存,提供了调整图片保存路径即可操作的函数。读者可以通过在命令行运行指定命令来展示视频级别的结果并进行可视化。
最低0.47元/天 解锁文章
3339

被折叠的 条评论
为什么被折叠?



