yolo 画图 pr cruve
./darknet detector valid cfg/voc-mask.data cfg/yolov4-mask-test.cfg backup/yolov4-mask_final.weightspython reval_voc.py --voc_dir VOCdevkit --year 2007 --image_set test --classes data/voc-mask.names t
·
再voc.data中有valid的文件路径
./darknet detector valid cfg/voc-mask.data cfg/yolov4-mask-test.cfg backup/yolov4-mask_final.weights
会在results中生成 .txt文件
python reval_voc.py --voc_dir VOCdevkit --year 2007 --image_set test --classes data/voc-mask.names testmask
会生成pkl文件
import pickle as cPickle
import matplotlib.pyplot as plt
fr1= open('/home/xxp/darknet/testmask/v3mask_pr.pkl', 'rb') # 这里open中第一个参数需要修改成自己生产的pkl文件
inf1 = cPickle.load(fr1) #使用 load() 方法将该文件中的数据反序列化后输出:
fr1.close()
x1= inf1['rec']
y1= inf1['prec']
fr2= open('/home/xxp/darknet/testmask/v4mask_pr.pkl', 'rb') # 这里open中第一个参数需要修改成自己生产的pkl文件
inf2 = cPickle.load(fr2)
fr2.close()
x2= inf2['rec']
y2= inf2['prec']
fr3= open('/home/xxp/darknet/testmask/v3-3mask_pr.pkl', 'rb') # 这里open中第一个参数需要修改成自己生产的pkl文件
inf3 = cPickle.load(fr3)
fr3.close()
x3= inf3['rec']
y3= inf3['prec']
plt.figure()
plt.xlabel('recall')
plt.ylabel('precision')
plt.title('PR cruve')
plt.plot(x1, y1, color="red")
plt.plot(x2, y2, color="blue")
plt.plot(x3, y3, color="green")
plt.show()
print('AP:', inf['ap'])
./darknet detector recall ./cfg/voc-mask.data ./cfg/yolov3-tiny-mask5-test.cfg ./backup/yolov3-tiny-mask5_best.weights
./darknet detector map ./cfg/voc-mask.data ./cfg/yolov3-tiny-mask5-test.cfg ./backup/yolov3-tiny-mask5_best.weights
更多推荐
已为社区贡献3条内容
所有评论(0)