def _get_test_data(self): self.test_target3d, self.test_lf_extra = self.dataset.for_test() write3d(self.test_target3d[0:batch_size], test_saving_dir + '/target3d.tif', bitdepth=16, norm_max=norm_max) write3d(self.test_lf_extra[0:batch_size], test_saving_dir + '/lf_extra.tif', bitdepth=16, norm_max=norm_max)
def _save_intermediate_ckpt(self, tag, sess): tag = ('epoch%d' % tag) if is_number(tag) else tag npz_file_name = checkpoint_dir + '/vcdnet_{}.npz'.format(tag) tl.files.save_npz(self.net.all_params, name=npz_file_name, sess=sess) if 'epoch' in tag: test_lr_batch = self.test_lf_extra[0:batch_size] out = self.sess.run(self.net.outputs, {self.plchdr_lf: test_lr_batch}) write3d(out, test_saving_dir + 'test_{}.tif'.format(tag))
def _save_intermediate_ckpt(self, tag, sess): tag = ('epoch%d' % tag) if is_number(tag) else tag npz_file_name = checkpoint_dir + '/vcdnet_{}.npz'.format(tag) tl.files.save_npz(self.net.all_params, name=npz_file_name, sess=sess) for _, lf_batch, _ in self.dataset.for_test(): out = self.sess.run(self.net.outputs, {self.plchdr_lf: lf_batch}) write3d(out, test_saving_dir + 'test_{}.tif'.format(tag), bitdepth=8) break
def _write_test_samples(self): for hr_batch, lf_batch, _ in self.dataset.for_test(): write3d(hr_batch[0], test_saving_dir + '/target3d.tif', bitdepth=8) write3d(lf_batch, test_saving_dir + '/lf_extra.tif', bitdepth=8) if using_binary_loss: write3d(hr_batch[1], test_saving_dir + '/mask3d.tif', bitdepth=8) break