MCPcopy Create free account
hub / github.com/NVlabs/SPADE / __init__

Method __init__

util/visualizer.py:18–39  ·  view source on GitHub ↗
(self, opt)

Source from the content-addressed store, hash-verified

16
17class Visualizer():
18 def __init__(self, opt):
19 self.opt = opt
20 self.tf_log = opt.isTrain and opt.tf_log
21 self.use_html = opt.isTrain and not opt.no_html
22 self.win_size = opt.display_winsize
23 self.name = opt.name
24 if self.tf_log:
25 import tensorflow as tf
26 self.tf = tf
27 self.log_dir = os.path.join(opt.checkpoints_dir, opt.name, 'logs')
28 self.writer = tf.summary.FileWriter(self.log_dir)
29
30 if self.use_html:
31 self.web_dir = os.path.join(opt.checkpoints_dir, opt.name, 'web')
32 self.img_dir = os.path.join(self.web_dir, 'images')
33 print('create web directory %s...' % self.web_dir)
34 util.mkdirs([self.web_dir, self.img_dir])
35 if opt.isTrain:
36 self.log_name = os.path.join(opt.checkpoints_dir, opt.name, 'loss_log.txt')
37 with open(self.log_name, "a") as log_file:
38 now = time.strftime("%c")
39 log_file.write('================ Training Loss (%s) ================\n' % now)
40
41 # |visuals|: dictionary of images to display or save
42 def display_current_results(self, visuals, epoch, step):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected