This commit is contained in:
Glenn Jocher 2019-12-20 09:59:25 -08:00
parent 25580dfb84
commit 05b1e437a0
1 changed files with 11 additions and 7 deletions

18
test.py
View File

@ -244,13 +244,17 @@ if __name__ == '__main__':
r = test(opt.cfg, opt.data, opt.weights, opt.batch_size, opt.img_size, opt.conf_thres, v, opt.save_json)[0]
y.append(r + (time.time() - t,))
y = np.stack(y, 0)
np.savetxt('study.txt', y, fmt='%10.4g')
# Plot
fig, ax = plt.subplots(1, 1, figsize=(10, 5))
ax.plot(x, y[:, 2], marker='.', label='mAP@0.5')
ax.plot(x, y[:, 3], marker='.', label='mAP@0.5:0.95')
ax.legend()
ax.set_xlabel('nms_thr')
ax.set_ylabel('mAP')
fig, ax = plt.subplots(2, 1, figsize=(6, 6))
ax[0].plot(x, y[:, 2], marker='.', label='mAP@0.5')
ax[0].plot(x, y[:, 3], marker='.', label='mAP@0.5:0.95')
ax[0].legend()
ax[0].set_xlabel('nms_thr')
ax[0].set_ylabel('mAP')
ax[1].plot(x, y[:, -1], marker='.', label='time')
ax[1].set_xlabel('nms_thr')
ax[1].set_ylabel('time (s)')
fig.tight_layout()
plt.savefig('parameters.jpg', dpi=200)
plt.savefig('study.jpg', dpi=200)