diff options
Diffstat (limited to 'util')
| -rw-r--r-- | util/image_pool.py | 3 | ||||
| -rw-r--r-- | util/util.py | 4 | ||||
| -rw-r--r-- | util/visualizer.py | 6 |
3 files changed, 4 insertions, 9 deletions
diff --git a/util/image_pool.py b/util/image_pool.py index ada1627..634fd81 100644 --- a/util/image_pool.py +++ b/util/image_pool.py @@ -1,5 +1,4 @@ import random -import numpy as np import torch from torch.autograd import Variable @@ -24,7 +23,7 @@ class ImagePool(): else: p = random.uniform(0, 1) if p > 0.5: - random_id = random.randint(0, self.pool_size-1) + random_id = random.randint(0, self.pool_size - 1) tmp = self.images[random_id].clone() self.images[random_id] = image return_images.append(tmp) diff --git a/util/util.py b/util/util.py index 26b259a..7a452a6 100644 --- a/util/util.py +++ b/util/util.py @@ -2,11 +2,7 @@ from __future__ import print_function import torch import numpy as np from PIL import Image -import inspect -import re -import numpy as np import os -import collections # Converts a Tensor into a Numpy array diff --git a/util/visualizer.py b/util/visualizer.py index 08eeb75..a98b512 100644 --- a/util/visualizer.py +++ b/util/visualizer.py @@ -56,7 +56,7 @@ class Visualizer(): if idx % ncols == 0: label_html += '<tr>%s</tr>' % label_html_row label_html_row = '' - white_image = np.ones_like(image_numpy.transpose([2, 0, 1]))*255 + white_image = np.ones_like(image_numpy.transpose([2, 0, 1])) * 255 while idx % ncols != 0: images.append(white_image) label_html_row += '<td></td>' @@ -114,8 +114,8 @@ class Visualizer(): win=self.display_id) # errors: same format as |errors| of plotCurrentErrors - def print_current_errors(self, epoch, i, errors, t): - message = '(epoch: %d, iters: %d, time: %.3f) ' % (epoch, i, t) + def print_current_errors(self, epoch, i, errors, t, t_data): + message = '(epoch: %d, iters: %d, time: %.3f, data: %.3f) ' % (epoch, i, t, t_data) for k, v in errors.items(): message += '%s: %.3f ' % (k, v) |
