detect.py multi_label default False

This commit is contained in:
Glenn Jocher 2020-04-05 11:05:49 -07:00
parent 41246aa042
commit 6203340888
2 changed files with 3 additions and 2 deletions

View File

@ -88,7 +88,8 @@ def detect(save_img=False):
t2 = torch_utils.time_synchronized() t2 = torch_utils.time_synchronized()
# Apply NMS # Apply NMS
pred = non_max_suppression(pred, opt.conf_thres, opt.iou_thres, classes=opt.classes, agnostic=opt.agnostic_nms) pred = non_max_suppression(pred, opt.conf_thres, opt.iou_thres,
multi_label=False, classes=opt.classes, agnostic=opt.agnostic_nms)
# Apply Classifier # Apply Classifier
if classify: if classify:

View File

@ -828,7 +828,7 @@ def fitness(x):
# Plotting functions --------------------------------------------------------------------------------------------------- # Plotting functions ---------------------------------------------------------------------------------------------------
def plot_one_box(x, img, color=None, label=None, line_thickness=None): def plot_one_box(x, img, color=None, label=None, line_thickness=None):
# Plots one bounding box on image img # Plots one bounding box on image img
tl = line_thickness or round(0.002 * (img.shape[0] + img.shape[1]) / 2) + 1 # line thickness tl = line_thickness or max(round(0.002 * (img.shape[0] + img.shape[1]) / 2), 1) # line thickness
color = color or [random.randint(0, 255) for _ in range(3)] color = color or [random.randint(0, 255) for _ in range(3)]
c1, c2 = (int(x[0]), int(x[1])), (int(x[2]), int(x[3])) c1, c2 = (int(x[0]), int(x[1])), (int(x[2]), int(x[3]))
cv2.rectangle(img, c1, c2, color, thickness=tl) cv2.rectangle(img, c1, c2, color, thickness=tl)