Exemple #1
0
 def _plot_closure(self, step):
     print('Iteration {:5d}    Loss {:5f}  PSRN_gt: {:f}'.format(
         step, self.total_loss.item(), self.current_result.psnr),
           '\r',
           end='')
     if step % self.show_every == self.show_every - 1:
         plot_image_grid("left_right_{}".format(step), [
             self.current_result.reflection,
             self.current_result.transmission
         ])
 def _plot_closure(self, step):
     print('Iteration {:5d}    Loss {:5f} Fidelity {:5f} Exclusion {:5f}'.
           format(step, self.total_loss.item(), self.recon_loss,
                  self.exclusion.item()))
     if step % self.show_every == self.show_every - 1:
         plot_image_grid("left_right_{}".format(step), [
             self.current_result.reflection,
             self.current_result.transmission
         ],
                         output_path=self.output_folder)
         save_tiff('reflection_{}.tiff'.format(step),
                   np.squeeze(self.current_result.reflection),
                   output_path=self.output_folder)
         save_tiff('transmission_{}.tiff'.format(step),
                   np.squeeze(self.current_result.transmission),
                   output_path=self.output_folder)
         save_tiff('sum_{}.tiff'.format(step),
                   np.squeeze(self.current_result.sum),
                   output_path=self.output_folder)
Exemple #3
0
 def _plot_closure(self, step):
     print('Iteration {:5d}    Loss {:5f} Exclusion {:5f}  PSRN_gt: {:f}'.
           format(step, self.total_loss.item(), self.exclusion.item(),
                  self.current_result.psnr),
           '\r',
           end='')
     if self.plot_during_training and step % self.show_every == self.show_every - 1:
         plot_image_grid("reflection_transmission_{}".format(step), [
             self.current_result.reflection,
             self.current_result.transmission
         ])
         # plot_image_grid("learned_mask_{}".format(step),
         #                 [self.current_result.alpha1, self.current_result.alpha2])
         save_image(
             "sum1_{}".format(step),
             self.current_result.alpha1 * self.current_result.reflection +
             (1 - self.current_result.alpha1) *
             self.current_result.transmission)
         save_image(
             "sum2_{}".format(step),
             self.current_result.alpha2 * self.current_result.reflection +
             (1 - self.current_result.alpha2) *
             self.current_result.transmission)