Exemple #1
0
def pred_image(data_root, results_dir):
    opt = TestOptions().parse()   # get training options
    opt = make_val_opt(opt)
    opt.phase = 'test'
    opt.dataset_mode = 'changedetection'
    opt.n_class = 2
    opt.SA_mode = 'PAM'
    opt.arch = 'mynet3'
    opt.model = 'CDFA'
    opt.epoch = 'pam'
    opt.num_test = np.inf
    opt.name = 'pam'
    opt.dataroot = data_root
    opt.results_dir = results_dir

    val(opt)
Exemple #2
0
        if i % 5 == 0:  # save images to an HTML file
            print('processing (%04d)-th image... %s' % (i, img_path))

        save_visuals(visuals,save_path,img_path[0])
    score = running_metrics.get_scores()
    print_current_acc(log_name, opt.epoch, score)


if __name__ == '__main__':
    opt = TestOptions().parse()   # get training options
    opt = make_val_opt(opt)
    opt.phase = 'val'
    opt.dataroot = 'path-to-LEVIR-CD-test'

    opt.dataset_mode = 'changedetection'

    opt.n_class = 2

    opt.SA_mode = 'PAM'
    opt.arch = 'mynet3'

    opt.model = 'CDFA'

    opt.name = 'pam'
    opt.results_dir = './results/'

    opt.epoch = '78_F1_1_0.88780'
    opt.num_test = np.inf

    val(opt)