module updates

This commit is contained in:
Glenn Jocher committed 2020-06-08 22:13:01 -07:00
1 parent d187459dd4
commit ff02ae0869
3 files changed
+16 -43

No files matched your search

+5 -4
View File
@@ -468,6 +468,7 @@ def non_max_suppression(prediction, conf_thres=0.1, iou_thres=0.6, fast=False, c
nx6 (x1, y1, x2, y2, conf, cls)
"""
nc = prediction[0].shape[1] - 5 # number of classes
xc = prediction[..., 4] > conf_thres # candidates
# Settings
min_wh, max_wh = 2, 4096 # (pixels) minimum and maximum box width and height
@@ -487,7 +488,7 @@ def non_max_suppression(prediction, conf_thres=0.1, iou_thres=0.6, fast=False, c
for xi, x in enumerate(prediction): # image index, image inference
# Apply constraints
# x[((x[..., 2:4] < min_wh) | (x[..., 2:4] > max_wh)).any(1), 4] = 0 # width-height
x = x[x[:, 4] > conf_thres] # confidence
x = x[xc[xi]] # confidence
# If none remain process next image
if not x.shape[0]:
@@ -1074,9 +1075,9 @@ def plot_results_overlay(start=0, stop=0): # from utils.utils import *; plot_re
for i in range(5):
for j in [i, i + 5]:
y = results[j, x]
# ax[i].plot(x, y, marker='.', label=s[j])
y_smooth = butter_lowpass_filtfilt(y)
ax[i].plot(x, np.gradient(y_smooth), marker='.', label=s[j])
ax[i].plot(x, y, marker='.', label=s[j])
# y_smooth = butter_lowpass_filtfilt(y)
# ax[i].plot(x, np.gradient(y_smooth), marker='.', label=s[j])
ax[i].set_title(t[i])
ax[i].legend()