glenn-jocher
commited on
Commit
·
b10609f
1
Parent(s):
7a61d52
updates
Browse files- README.md +1 -0
- models/yolov5m.yaml +0 -1
- utils/utils.py +15 -10
README.md
CHANGED
@@ -3,6 +3,7 @@
|
|
3 |
 
|
4 |
|
5 |
This repository represents Ultralytics open-source research into future object detection methods, and incorporates our lessons learned and best practices evolved over training thousands of models on custom client datasets with our previous YOLO repository https://github.com/ultralytics/yolov3. **All code and models are under active development, and are subject to modification or deletion without notice.** Use at your own risk.
|
|
|
6 |
<img src="https://user-images.githubusercontent.com/26833433/83359175-63b6c680-a32d-11ea-970a-9f602e022468.png" width="1000">
|
7 |
** GPU Latency measures end-to-end latency per image averaged over 5000 COCO val2017 images using a V100 GPU and includes image preprocessing, inference, postprocessing and NMS.
|
8 |
|
|
|
3 |
 
|
4 |
|
5 |
This repository represents Ultralytics open-source research into future object detection methods, and incorporates our lessons learned and best practices evolved over training thousands of models on custom client datasets with our previous YOLO repository https://github.com/ultralytics/yolov3. **All code and models are under active development, and are subject to modification or deletion without notice.** Use at your own risk.
|
6 |
+
|
7 |
<img src="https://user-images.githubusercontent.com/26833433/83359175-63b6c680-a32d-11ea-970a-9f602e022468.png" width="1000">
|
8 |
** GPU Latency measures end-to-end latency per image averaged over 5000 COCO val2017 images using a V100 GPU and includes image preprocessing, inference, postprocessing and NMS.
|
9 |
|
models/yolov5m.yaml
CHANGED
@@ -43,4 +43,3 @@ head:
|
|
43 |
|
44 |
[[], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
|
45 |
]
|
46 |
-
|
|
|
43 |
|
44 |
[[], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
|
45 |
]
|
|
utils/utils.py
CHANGED
@@ -983,7 +983,11 @@ def plot_study_txt(f='study.txt', x=None): # from utils.utils import *; plot_st
|
|
983 |
fig, ax = plt.subplots(2, 4, figsize=(10, 6), tight_layout=True)
|
984 |
ax = ax.ravel()
|
985 |
|
986 |
-
|
|
|
|
|
|
|
|
|
987 |
y = np.loadtxt(f, dtype=np.float32, usecols=[0, 1, 2, 3, 7, 8, 9], ndmin=2).T
|
988 |
x = np.arange(y.shape[1]) if x is None else np.array(x)
|
989 |
s = ['P', 'R', 'mAP@.5', 'mAP@.5:.95', 't_inference (ms/img)', 't_NMS (ms/img)', 't_total (ms/img)']
|
@@ -992,15 +996,16 @@ def plot_study_txt(f='study.txt', x=None): # from utils.utils import *; plot_st
|
|
992 |
ax[i].set_title(s[i])
|
993 |
|
994 |
j = y[3].argmax() + 1
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
|
|
1004 |
plt.savefig(f.replace('.txt', '.png'), dpi=200)
|
1005 |
|
1006 |
|
|
|
983 |
fig, ax = plt.subplots(2, 4, figsize=(10, 6), tight_layout=True)
|
984 |
ax = ax.ravel()
|
985 |
|
986 |
+
fig2, ax2 = plt.subplots(1, 1, figsize=(8, 4), tight_layout=True)
|
987 |
+
ax2.plot(1E3 / np.array([209, 140, 97, 58, 35, 18][:-1]), [33.5, 39.1, 42.5, 45.9, 49., 50.5][:-1],
|
988 |
+
'.-', linewidth=2, markersize=8, alpha=0.3, label='EfficientDet')
|
989 |
+
|
990 |
+
for f in sorted(glob.glob('study*.txt')):
|
991 |
y = np.loadtxt(f, dtype=np.float32, usecols=[0, 1, 2, 3, 7, 8, 9], ndmin=2).T
|
992 |
x = np.arange(y.shape[1]) if x is None else np.array(x)
|
993 |
s = ['P', 'R', 'mAP@.5', 'mAP@.5:.95', 't_inference (ms/img)', 't_NMS (ms/img)', 't_total (ms/img)']
|
|
|
996 |
ax[i].set_title(s[i])
|
997 |
|
998 |
j = y[3].argmax() + 1
|
999 |
+
ax2.plot(y[6, :j], y[3, :j] * 1E2, '.-', linewidth=2, markersize=8,
|
1000 |
+
label=Path(f).stem.replace('study_coco_', '').replace('yolo', 'YOLO'))
|
1001 |
+
|
1002 |
+
ax2.set_xlim(0)
|
1003 |
+
ax2.set_ylim(23, 50)
|
1004 |
+
ax2.set_xlabel('GPU Latency (ms)')
|
1005 |
+
ax2.set_ylabel('COCO AP val')
|
1006 |
+
ax2.legend(loc='lower right')
|
1007 |
+
ax2.grid()
|
1008 |
+
plt.savefig('study_mAP_latency.png', dpi=300)
|
1009 |
plt.savefig(f.replace('.txt', '.png'), dpi=200)
|
1010 |
|
1011 |
|