def finish(self):
     final_kernel = post_process_k(self.curr_k, n=self.conf.n_filtering)
     save_final_kernel(final_kernel, self.conf)
     print('KernelGAN estimation complete!')
     run_zssr(final_kernel, self.conf)
     print('FINISHED RUN (see --%s-- folder)\n' %
           self.conf.output_dir_path + '*' * 60 + '\n\n')
Beispiel #2
0
    def eval(self):
        self.quick_eval()
        if self.conf.debug:
            self.plot()

        util.save_final_kernel(util.move2cpu(self.curr_k), self.conf)
        plt.imsave(
            os.path.join(self.conf.output_dir,
                         '%s.png' % self.conf.abs_img_name),
            self.upsampled_img)

        if self.gt_img is not None:
            print('Upsampler PSNR = ', self.UP_psnrs[-1])
        if self.gt_kernel is not None:
            print("Downsampler PSNR = ", self.DN_psnrs[-1])
        print('*' * 60 +
              '\nOutput is saved in \'%s\' folder\n' % self.conf.output_dir)
        plt.close('all')