diff --git a/object-locator/logger.py b/object-locator/logger.py index 0d22d9d..224e5f6 100644 --- a/object-locator/logger.py +++ b/object-locator/logger.py @@ -94,23 +94,23 @@ def train_losses(self, terms, iteration_number, terms_legends=None): xlabel='Epoch'), win='train_losses') - def image(self, imgs, titles, windows): + def image(self, imgs, titles, window_ids): """Send images to Visdom. Each image will be shown in a different window/plot. :param imgs: List of numpy images. :param titles: List of titles of each image. - :param windows: List of window names. + :param window_ids: List of window IDs. """ # Watchdog - if not(len(imgs) == len(titles) == len(windows)): + if not(len(imgs) == len(titles) == len(window_ids)): raise ValueError('The number of "imgs", "titles" and ' - '"windows" must be equal, got ' + '"window_ids" must be equal, got ' '%s, %s and %s, respectively' - % (len(imgs), len(titles), len(windows))) + % (len(imgs), len(titles), len(window_ids))) - for img, title, win in zip(imgs, titles, windows): + for img, title, win in zip(imgs, titles, window_ids): self.client.image(img, opts=dict(title=title), win=str(win)) diff --git a/object-locator/train.py b/object-locator/train.py index d2693d7..9838b35 100644 --- a/object-locator/train.py +++ b/object-locator/train.py @@ -237,7 +237,7 @@ log.image(imgs=[orig_img_origsize, est_map_origsize], titles=['(Training) Input', '(Training) U-Net output'], - windows=[1, 2]) + window_ids=[1, 2]) # # Read image with GT dots from disk # gt_img_numpy = skimage.io.imread( @@ -375,7 +375,7 @@ log.image(imgs=[orig_img_origsize, est_map_origsize], titles=['(Validation) Input', '(Validation) U-Net output'], - windows=[5, 6]) + window_ids=[5, 6]) # # Read image with GT dots from disk # gt_img_numpy = skimage.io.imread( @@ -401,7 +401,7 @@ log.image(imgs=[np.moveaxis(image_with_x, 2, 0)], titles=[ '(Validation) Estimated centers @ crossings'], - windows=[8]) + window_ids=[8]) avg_term1_val = sum_term1 / len(valset_loader) avg_term2_val = sum_term2 / len(valset_loader)