-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtest_pose.py
89 lines (85 loc) · 4.4 KB
/
test_pose.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import gzip
import numpy as np
# pose_gz = gzip.GzipFile("./demo/video_processed/obama/poseimg/obama.npy.gz", 'r')
# poseimg = np.load(pose_gz)
# print(poseimg.shape)
pose_gz = gzip.GzipFile("./demo/video_processed/W015_neu_1_002/poseimg/W015_neu_1_002.npy.gz", "r")
poseimg = np.load(pose_gz)
print(poseimg.shape)
print(poseimg)
driving_latent_path = "./preprocess/latents/mytemplate.npy"
driving_latent = np.load(driving_latent_path, allow_pickle=True)
print(driving_latent[0].shape) # (1, 15, 3) # 得到的潜在关键点坐标
print(driving_latent[1]["yaw"].shape) # (7102, 66)
"""
[array([[[ 4.1146830e-01, -2.0262894e-01, 3.2031313e-01],
[-6.2763679e-01, -1.6892946e-01, 6.6666722e-02],
[ 5.6803226e-03, -1.3746595e-01, 9.4716650e-01],
[-2.8410867e-02, 6.2295491e-01, 1.6565362e-01],
[ 6.5464005e-02, -6.6067177e-01, -6.6666171e-02],
[-2.6478165e-01, -6.4365879e-02, 6.6666715e-02],
[ 2.4857886e-02, 4.0230319e-01, -1.4995266e-01],
[ 3.5887957e-04, -4.1321002e-02, -7.3333341e-01],
[ 2.5681311e-01, 1.9549066e-02, -8.3146304e-02],
[ 4.7488153e-02, -7.7917792e-02, 2.0000006e-01],
[-1.0628210e-01, 1.0163950e-01, -1.9999991e-01],
[ 1.7885217e-01, 3.3389115e-01, 1.3819113e-01],
[-4.3306366e-01, 3.2558823e-01, -5.0515300e-01],
[ 2.6492912e-01, -3.6088485e-01, -6.6666603e-02],
[ 8.1519052e-02, -2.1060583e-01, 6.0000014e-01]]], dtype=float32)
{'yaw': array([[-3.1740754, -2.9423897, -3.4336622, ..., -3.350235 , -4.291702 ,
-2.999668 ],
[-3.163244 , -2.933292 , -3.422325 , ..., -3.3251364, -4.26538 ,
-2.975791 ],
[-3.2122555, -2.9820507, -3.4719462, ..., -3.3382363, -4.2833333,
-2.991121 ],
...,
[-3.651934 , -3.4161887, -3.9273047, ..., -3.0813997, -4.0095897,
-2.7451 ],
[-3.6654873, -3.4296813, -3.9388661, ..., -3.0774944, -4.0001197,
-2.7435942],
[-3.616534 , -3.387174 , -3.8869665, ..., -3.0573237, -3.9719017,
-2.7308652]], dtype=float32), 'pitch': array([[-5.06891 , -6.340728 , -3.9493158 , ..., -0.5131966 ,
-5.335382 , -5.17159 ],
[-5.010259 , -6.284561 , -3.8921483 , ..., -0.5568108 ,
-5.339625 , -5.1788836 ],
[-5.0176377 , -6.3021226 , -3.8889506 , ..., -0.5959905 ,
-5.39469 , -5.2337737 ],
...,
[-5.1929836 , -6.5514126 , -4.152153 , ..., -0.20888339,
-5.32139 , -5.1232367 ],
[-5.0891824 , -6.4644437 , -4.049771 , ..., -0.30600855,
-5.3456273 , -5.1505504 ],
[-4.9586167 , -6.296194 , -3.9121149 , ..., -0.37364542,
-5.3317914 , -5.139839 ]], dtype=float32), 'roll': array([[-2.1555986, -6.536282 , -4.1888103, ..., -5.710906 , -3.2737222,
-5.2318916],
[-2.1071596, -6.495192 , -4.131039 , ..., -5.6971536, -3.28394 ,
-5.221761 ],
[-2.0914152, -6.5269947, -4.1287174, ..., -5.7549596, -3.3394368,
-5.2786074],
...,
[-2.0060816, -6.56544 , -4.064121 , ..., -5.9173684, -3.3503718,
-5.4014535],
[-2.0176508, -6.561887 , -4.0594826, ..., -5.878569 , -3.33623 ,
-5.3677692],
[-1.9730682, -6.4772544, -3.9725366, ..., -5.767803 , -3.2767293,
-5.264035 ]], dtype=float32), 't': array([[ 0.01144275, -0.00947364, 0.25937355],
[ 0.0086417 , -0.00126567, 0.2597293 ],
[ 0.003962 , 0.00859996, 0.25894067],
...,
[ 0.06428912, 0.07165318, 0.25936383],
[ 0.06140355, 0.08714666, 0.26004672],
[ 0.05909844, 0.09374831, 0.25958169]], dtype=float32), 'exp': array([[ 6.7038581e-02, 9.2545915e-03, -5.0336821e-03, ...,
1.0441798e-02, 3.8599711e-02, 3.7463170e-02],
[ 6.6176146e-02, 1.0604929e-02, -5.5060419e-03, ...,
1.1844714e-02, 3.6740530e-02, 3.7789132e-02],
[ 6.5423295e-02, 1.2455728e-02, -5.9382198e-03, ...,
1.5109147e-02, 3.6738612e-02, 3.8871456e-02],
...,
[ 2.4187107e-02, -4.5988336e-03, -8.8627450e-04, ...,
2.5839988e-02, 3.3050384e-02, 2.5832346e-02],
[ 2.0838181e-02, -1.4504371e-04, 1.8790159e-03, ...,
2.8698731e-02, 2.9677479e-02, 2.5334707e-02],
[ 2.1678479e-02, 8.9396909e-04, 7.3822215e-05, ...,
3.1382211e-02, 2.7162544e-02, 2.3283066e-02]], dtype=float32)}
"""