neu_yj的博客

我生待明日,万事成蹉跎

darknet 可视化yolo损失曲线

保存日志命令:

/darknet detector train my/mot/person.data my/mot/densenet201_yolo.cfg backup/mot/densenet201_yolo_final.weights >> log/mot-ramdon.log

python可视化代码:

#plot.py
import argparse 
import sys
import matplotlib.pyplot as plt
def main(argv):
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "-file",
        help = "path to log file"
        )
    args = parser.parse_args()
    f = open(args.file)
    
    lines  = [line.rstrip("\n") for line in f.readlines()]
    
    numbers = {'1','2','3','4','5','6','7','8','9'}
    iters = []
    loss = []
    
    fig,ax = plt.subplots()
    prev_line = ""
    for line in lines:
        args = line.split(' ')
        if args[0][-1:]==':' and args[0][0] in numbers :
            iters.append(int(args[0][:-1]))            
            loss.append(float(args[2]))
             
    ax.plot(iters,loss)
    plt.xlabel('iters')
    plt.ylabel('loss')
    plt.grid()
    ticks = range(0,250,10)
    
    #ax.set_yticks(ticks)
    plt.show()
    
if __name__ == "__main__":
    main(sys.argv)

效果图:

源地址:https://ricky.moe/2017/11/04/yolo-training-visualization/

阅读更多
个人分类: 目标检测
上一篇Online Instance Matching Loss的理解
下一篇Ubuntu14.04 死机强制关机后循环登陆问题解决
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭