From 44dca63112bd9e2a9b6acba5115bf4855eed00e8 Mon Sep 17 00:00:00 2001 From: Dexter Fichuk Date: Mon, 20 Nov 2017 23:22:05 -0500 Subject: [PATCH] Fixed for numpy problems Fixes the ValueError: output of generator should be a tuple (x, y, sample_weight) or (x, y). Found: None --- utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.py b/utils.py index f9e0d6a..fdab317 100644 --- a/utils.py +++ b/utils.py @@ -97,7 +97,7 @@ def random_shadow(image): # as x2 == x1 causes zero-division problem, we'll write it in the below form: # (ym-y1)*(x2-x1) - (y2-y1)*(xm-x1) > 0 mask = np.zeros_like(image[:, :, 1]) - mask[(ym - y1) * (x2 - x1) - (y2 - y1) * (xm - x1) > 0] = 1 + mask[np.where((ym - y1) * (x2 - x1) - (y2 - y1) * (xm - x1) > 0)] = 1 # choose which side should have shadow and adjust saturation cond = mask == np.random.randint(2)