diff --git a/test.py b/test.py index a9d69dce..9968cb65 100644 --- a/test.py +++ b/test.py @@ -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)