From 7800d516596f1a25986b458cddf8b8785bcc7df8 Mon Sep 17 00:00:00 2001 From: junyanz Date: Fri, 6 Oct 2017 10:46:43 -0700 Subject: support nc=1, add new leaerning rate policy and new initialization --- util/util.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'util/util.py') diff --git a/util/util.py b/util/util.py index 781239f..4de0a74 100644 --- a/util/util.py +++ b/util/util.py @@ -11,6 +11,8 @@ import collections # |imtype|: the desired type of the converted numpy array def tensor2im(image_tensor, imtype=np.uint8): image_numpy = image_tensor[0].cpu().float().numpy() + if image_numpy.shape[0] == 1: + image_numpy = np.tile(image_numpy, (3, 1, 1)) image_numpy = (np.transpose(image_numpy, (1, 2, 0)) + 1) / 2.0 * 255.0 return image_numpy.astype(imtype) -- cgit v1.2.3-70-g09d2