natanielruiz
2017-09-27 8f2b081586161a55388934456a9b0193d02dd267
Random downsample experiment
3个文件已修改
14 ■■■■■ 已修改文件
code/datasets.py 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
code/hopenet.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
code/train_preangles.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
code/datasets.py
@@ -128,12 +128,10 @@
        yaw = pose[1] * 180 / np.pi
        roll = pose[2] * 180 / np.pi
        rnd = np.random.random_sample()
        if rnd < 0.5:
            ds = 10
            original_size = img.size
            img = img.resize((img.size[0] / ds, img.size[1] / ds), resample=Image.NEAREST)
            img = img.resize((original_size[0], original_size[1]), resample=Image.NEAREST)
        ds = np.random.randint(1,11)
        original_size = img.size
        img = img.resize((img.size[0] / ds, img.size[1] / ds), resample=Image.NEAREST)
        img = img.resize((original_size[0], original_size[1]), resample=Image.NEAREST)
        # Flip?
        rnd = np.random.random_sample()
code/hopenet.py
@@ -339,7 +339,7 @@
        preangles = torch.cat([yaw, pitch, roll], 1)
        angles.append(preangles)
        return pre_yaw, pre_pitch, pre_roll, angles, sr_output
        return pre_yaw, pre_pitch, pre_roll, angles, sr_y
class Hopenet_new(nn.Module):
    # This is just Hopenet with 3 output layers for yaw, pitch and roll.
code/train_preangles.py
@@ -125,7 +125,7 @@
    if args.dataset == 'Pose_300W_LP':
        pose_dataset = datasets.Pose_300W_LP(args.data_dir, args.filename_list, transformations)
    if args.dataset == 'Pose_300W_LP_random_ds':
    elif args.dataset == 'Pose_300W_LP_random_ds':
        pose_dataset = datasets.Pose_300W_LP_random_ds(args.data_dir, args.filename_list, transformations)
    elif args.dataset == 'AFLW2000':
        pose_dataset = datasets.AFLW2000(args.data_dir, args.filename_list, transformations)