Skip to content

Commit

Permalink
rename variable windows->window_ids
Browse files Browse the repository at this point in the history
Former-commit-id: 01475119e39735fd05cf3ca30ff993222764d0a2
  • Loading branch information
Javi Ribera committed Oct 7, 2018
1 parent 35369f7 commit 736ee04
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions object-locator/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
6 changes: 3 additions & 3 deletions object-locator/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand All @@ -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)
Expand Down

0 comments on commit 736ee04

Please sign in to comment.