def main():
    # meta imitator
    test_opt = TestOptions().parse()
    test_opt.bg_ks = 25
    test_opt.front_warp = False
    test_opt.post_tune = True

    load_path = test_opt.load_path
    exp_name = load_path.split("/")[-2]
    print('-----------------------\n','EXP NAME: ',exp_name,'\n--------------------------')
    test_opt.output_dir = mkdir('./outputs/results/demos/imitators/' + exp_name)
    # source images from iPER
    images_paths = ['./assets/src_imgs/plaid_shirt.jpg']
                    #'./assets/src_imgs/beachshorts.jpg',
                    #'./assets/src_imgs/fashion_woman/Sweaters-id_0000088807_4_full.jpg']

    for src_img_path in tqdm(images_paths):
        generate_actor_result(test_opt, src_img_path)

    # clean other files
    clean(test_opt.output_dir)



    print('Completed! All demo videos are save in {}'.format(test_opt.output_dir))
Exemplo n.º 2
0
def setup(opts):
    shutil.move(opts['checkpoint_dir'], 'outputs/checkpoints')
    shutil.move(opts['pretrained_renderer_dir'], 'assets/pretrains')
    opt = TestOptions().parse()
    opt.bg_ks = 13
    opt.ft_ks = 3
    opt.has_detector = True
    opt.front_warp = True
    swapper = Swapper(opt=opt)
    imitator = Imitator(opt)
    return swapper, imitator
Exemplo n.º 3
0
def main():
    # meta imitator
    test_opt = TestOptions().parse()
    test_opt.bg_ks = 25
    test_opt.front_warp = False
    test_opt.post_tune = True

    test_opt.output_dir = mkdir('./outputs/results/demos/imitators')
    # source images from iPER
    images_paths = ['./assets/src_imgs/test.jpg']

    for src_img_path in tqdm(images_paths):
        generate_actor_result(test_opt, src_img_path)

    # clean other files
    clean(test_opt.output_dir)

    print('Completed! All demo videos are save in {}'.format(
        test_opt.output_dir))
def main():
    # meta imitator
    test_opt = TestOptions().parse()
    test_opt.bg_ks = 25
    test_opt.front_warp = False
    test_opt.post_tune = True

    test_opt.output_dir = mkdir('./outputs/results/demos/imitators')
    # source images from iPER
    images_paths = ['./assets/src_imgs/imper_A_Pose/009_5_1_000.jpg',
                    './assets/src_imgs/imper_A_Pose/024_8_2_0000.jpg',
                    './assets/src_imgs/fashion_woman/Sweaters-id_0000088807_4_full.jpg']

    for src_img_path in tqdm(images_paths):
        generate_actor_result(test_opt, src_img_path)

    # clean other files
    clean(test_opt.output_dir)

    print('Completed! All demo videos are save in {}'.format(test_opt.output_dir))
Exemplo n.º 5
0
    """
    make video
    """
    img_path_list = glob.glob("%s/imgs/*.jpg" % save_dir)
    output_mp4_path = '%s/%s.mp4' % (save_dir, src_img_true_name)
    make_video(output_mp4_path, img_path_list, save_frames_dir=None, fps=30)

    clean(opt.output_dir)
    clean(save_dir)


if __name__ == "__main__":

    opt = TestOptions().parse()
    opt.bg_ks = 31
    opt.T_pose = False
    opt.front_warp = False
    opt.bg_replace = True
    opt.post_tune = True
    opt.output_dir = './outputs/results/demos/viewers'

    src_path_list = [
        ('iPER', './assets/src_imgs/imper_Random_Pose/novel_3.jpg'),
        ('Fashion', './assets/src_imgs/fashion_woman/fashionWOMENDressesid0000271801_4full.jpg'),
        ('Fashion', './assets/src_imgs/fashion_man/Jackets_Vests-id_0000071603_4_full.jpg')
    ]

    for dataset, src_path in src_path_list:
        if dataset == 'Fashion':
            opt.T_pose = True
Exemplo n.º 6
0
from utils.visdom_visualizer import VisdomVisualizer
from utils.util import mkdir


def tensor2cv2(img_tensor):
    img = (img_tensor[0].cpu().numpy().transpose(1, 2, 0) + 1) / 2
    img = img[:, :, ::-1]
    img = (img * 255).astype(np.uint8)

    return img


if __name__ == "__main__":

    opt = TestOptions().parse()
    opt.bg_ks = 25
    opt.front_warp = True
    opt.post_tune = True

    src_path_list = [
        ('iPER', './assets/src_imgs/imper_A_Pose/009_5_1_000.jpg'),
        ('Fashion',
         './assets/src_imgs/fashion_man/Jackets_Vests-id_0000008408_4_full.jpg'
         ),
        ('Fashion',
         './assets/src_imgs/fashion_woman/Sweaters-id_0000088807_4_full.jpg')
    ]

    tgt_path_list = [
        './assets/src_imgs/fashion_woman/fashionWOMENBlouses_Shirtsid0000666802_4full.jpg',
        './assets/src_imgs/fashion_man/Sweatshirts_Hoodies-id_0000680701_4_full.jpg',