Skip to content

Commit

Permalink
Merge pull request NVIDIA#5 from javl/master
Browse files Browse the repository at this point in the history
Fixes webpage autorefresh and lowers default refresh rate
  • Loading branch information
tcwang0509 authored Dec 19, 2017
2 parents e9e6ef6 + 9cf2a95 commit dd05da7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions util/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


class HTML:
def __init__(self, web_dir, title, reflesh=0):
def __init__(self, web_dir, title, refresh=0):
self.title = title
self.web_dir = web_dir
self.img_dir = os.path.join(self.web_dir, 'images')
Expand All @@ -14,9 +14,9 @@ def __init__(self, web_dir, title, reflesh=0):
os.makedirs(self.img_dir)

self.doc = dominate.document(title=title)
if reflesh > 0:
if refresh > 0:
with self.doc.head:
meta(http_equiv="reflesh", content=str(reflesh))
meta(http_equiv="refresh", content=str(refresh))

def get_image_dir(self):
return self.img_dir
Expand Down
8 changes: 4 additions & 4 deletions util/visualizer.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
### Copyright (C) 2017 NVIDIA Corporation. All rights reserved.
### Copyright (C) 2017 NVIDIA Corporation. All rights reserved.
### Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).
import numpy as np
import os
import ntpath
import time
from . import util
from . import html
import scipy.misc
import scipy.misc
try:
from StringIO import StringIO # Python 2.7
except ImportError:
Expand Down Expand Up @@ -66,7 +66,7 @@ def display_current_results(self, visuals, epoch, step):
util.save_image(image_numpy, img_path)

# update website
webpage = html.HTML(self.web_dir, 'Experiment name = %s' % self.name, reflesh=1)
webpage = html.HTML(self.web_dir, 'Experiment name = %s' % self.name, refresh=5)
for n in range(epoch, 0, -1):
webpage.add_header('epoch [%d]' % n)
ims = []
Expand Down Expand Up @@ -96,7 +96,7 @@ def display_current_results(self, visuals, epoch, step):
# errors: dictionary of error labels and values
def plot_current_errors(self, errors, step):
if self.tf_log:
for tag, value in errors.items():
for tag, value in errors.items():
summary = self.tf.Summary(value=[self.tf.Summary.Value(tag=tag, simple_value=value)])
self.writer.add_summary(summary, step)

Expand Down

0 comments on commit dd05da7

Please sign in to comment.