plot_report.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:hdidx-eval 作者: hdidx 项目源码 文件源码
def main(args):
    """ Main entry.
    """
    report_lines = load_report(args.report)
    v_results = parse_report(report_lines)

    font = {'family': 'normal',
            # 'weight': 'bold',
            'size': 16}

    matplotlib.rc('font', **font)

    for i, indexer in zip(range(len(args.indexers)), args.indexers):
        fig = plt.figure(i)
        ax = fig.add_subplot(1, 1, 1)
        ax.hold(True)
        print v_results
        for index, nbits, results in v_results:
            if nbits not in [128, 64, 32, 16, 8]:
                continue
            if index != indexer:
                continue
            X = [r[0] for r in results]
            Y = [r[1] for r in results]
            print np.vstack((X, Y))
            ax.plot(X, Y, label="%d-bit" % (nbits))
            plt.xlabel("$R$")
            plt.ylabel("$recall$")
        ax.hold(False)
        ax.set_xscale("log")
        # pl.legend(loc='lower right')
        plt.legend(loc='upper left')
        plt.savefig(args.figdir + "/%s.png" % indexer)
        plt.savefig(args.figdir + "/%s.eps" % indexer)
    plt.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号