예제 #1
0
        dl = create_test_dataset(32)

    if args.b is not None and args.p is None:
        dl_name = 'bright'
        dl = create_brighness_test_dataset(batch_size=32,
                                           root='./',
                                           bright_level=args.b)

    if args.p is not None and args.b is None:
        dl_name = 'sat{}'.format(args.p)
        dl = create_saturation_test_dataset(32,
                                            root='./',
                                            saturation_level=args.p)

    if args.k is not None:
        dl_name = 'p{}'.format(args.k)
        print('Creating path data')
        dl = create_patch_test_dataset(32, './', args.k)

    # style
    #dl = create_style_test_dataset(32)
    dl_name = 'adv'
    #xz_test(dl, 1,net, DEVICE)
    #test_model(net, dl)
    #test_model_adv_genera(net, dl, DEVICE)
    #l1_for_without_smooth(net, dl, DEVICE)
    #l1_for_with_smooth(net, dl, DEVICE)
    if not os.path.exists(os.path.join('../Maps', dl_name)):
        os.mkdir(os.path.join('../Maps', dl_name))
    get_result(net, dl, DEVICE, net_name, dl_name)
예제 #2
0
    root = '../../data/benchmark/'
    names = [
        'val', 'style', 'sat1024', 'sat1', 'sat64', 'sat16', 'sat8', 'sat4',
        'p2', 'p4', 'p8'
    ]
    dl_val = create_test_dataset(batch_size=64)
    dl_style = create_style_test_dataset(batch_size=64)
    dl_sat1024 = create_saturation_test_dataset(batch_size=64,
                                                saturation_level=1024)
    dl_sat02 = create_saturation_test_dataset(batch_size=64,
                                              saturation_level=1)
    dl_sat64 = create_saturation_test_dataset(batch_size=64,
                                              saturation_level=64)
    dl_sat16 = create_saturation_test_dataset(batch_size=64,
                                              saturation_level=16)
    dl_sat8 = create_saturation_test_dataset(batch_size=64, saturation_level=8)
    dl_sat4 = create_saturation_test_dataset(batch_size=64, saturation_level=4)
    dl_p2 = create_patch_test_dataset(64, k=2)
    dl_p4 = create_patch_test_dataset(64, k=4)
    dl_p8 = create_patch_test_dataset(64, k=8)

    dls = [
        dl_val, dl_style, dl_sat1024, dl_sat02, dl_sat64, dl_sat16, dl_sat8,
        dl_sat4, dl_p2, dl_p4, dl_p8
    ]

    for name, dl in zip(names, dls):
        dir = os.path.join(root, name)
        print('making {}'.format(dir))
        gen_benchmark(dl, p=dir)