From 5b0ba6d7b27b7b1055f1f06725d20afc393cc995 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 9 Jul 2019 18:16:15 +0200 Subject: [PATCH] updates --- utils/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/utils.py b/utils/utils.py index acfcd583..ae951abc 100755 --- a/utils/utils.py +++ b/utils/utils.py @@ -616,6 +616,7 @@ def plot_images(imgs, targets, paths=None, fname='images.jpg'): # Plots training images overlaid with targets imgs = imgs.cpu().numpy() targets = targets.cpu().numpy() + # targets = targets[targets[:, 1] == 21] # plot only one class fig = plt.figure(figsize=(10, 10)) bs, _, h, w = imgs.shape # batch size, _, height, width @@ -626,7 +627,7 @@ def plot_images(imgs, targets, paths=None, fname='images.jpg'): boxes[[0, 2]] *= w boxes[[1, 3]] *= h plt.subplot(ns, ns, i + 1).imshow(imgs[i].transpose(1, 2, 0)) - plt.plot(boxes[[0, 2, 2, 0, 0]], boxes[[1, 1, 3, 3, 1]], '.-') + plt.plot(boxes[[0, 2, 2, 0, 0]], boxes[[1, 1, 3, 3, 1]], 'w.-') plt.axis('off') if paths is not None: s = Path(paths[i]).name