def get_complete_output(reference_frames,output_frames,mode,pr_resolution,outdir):
print ("Processing Layer: %s" % mode_names[mode])
start_time = time.time()
pr_x, pr_y, pr_AUC= get_pr(reference_frames,output_frames,mode,pr_resolution)
# create a plot
plt.plot(pr_x,pr_y)
plt.title(mode_names[mode])
plt.xlabel('recall')
plt.ylabel('precision')
plt.grid()
ax = plt.gca()
ax.set_ylim([-0.05, 1.05])
ax.set_xlim([-0.05, 1.05])
ax.set(adjustable='box-forced', aspect='equal')
gc = plt.gcf()
gc.set_size_inches(7, 7)
str1 = "AUC=%.3f" % (pr_AUC)
plt.legend([str1], loc='upper right')
pp = PdfPages(os.path.join(outdir,'curve_'+mode_names[mode]+'.pdf'))
pp.savefig(plt.gcf())
pp.close()
plt.close()
# save complete log
arr = np.array([pr_x,pr_y])
np.savetxt(os.path.join(outdir,'log_'+mode_names[mode]+'.tsv'), np.transpose(arr), fmt='%.8f', delimiter="\t", header="recall\tprecision", comments='')
print("AUC = %.3f" % pr_AUC)
print("Done --- %s seconds ---" % (time.time() - start_time))
return pr_x, pr_y, pr_AUC
################################################################################
# MAIN
################################################################################
speech_eval_old.py 文件源码
python
阅读 31
收藏 0
点赞 0
评论 0
评论列表
文章目录