Muhammad Taqi Raza
commited on
Commit
·
adeaae8
1
Parent(s):
c6141d6
printing camera positions
Browse files- gradio_app.py +1 -1
- inference/v2v_data/demo.py +1 -0
- inference/v2v_data/models/utils.py +3 -3
gradio_app.py
CHANGED
@@ -95,7 +95,7 @@ def get_anchor_video(video_path, fps, num_frames, target_pose, mode,
|
|
95 |
"--init_dx", str(init_dx),
|
96 |
"--init_dy", str(init_dy),
|
97 |
"--init_dz", str(init_dz),
|
98 |
-
|
99 |
]
|
100 |
|
101 |
try:
|
|
|
95 |
"--init_dx", str(init_dx),
|
96 |
"--init_dy", str(init_dy),
|
97 |
"--init_dz", str(init_dz),
|
98 |
+
|
99 |
]
|
100 |
|
101 |
try:
|
inference/v2v_data/demo.py
CHANGED
@@ -154,6 +154,7 @@ class GetAnchorVideos:
|
|
154 |
opts.mask,
|
155 |
twice=False,
|
156 |
)
|
|
|
157 |
warped_images.append(warped_frame2)
|
158 |
masks.append(mask2)
|
159 |
cond_video = (torch.cat(warped_images) + 1.0) / 2.0
|
|
|
154 |
opts.mask,
|
155 |
twice=False,
|
156 |
)
|
157 |
+
|
158 |
warped_images.append(warped_frame2)
|
159 |
masks.append(mask2)
|
160 |
cond_video = (torch.cat(warped_images) + 1.0) / 2.0
|
inference/v2v_data/models/utils.py
CHANGED
@@ -181,18 +181,17 @@ def sphere2pose(c2ws_input, theta, phi, r, device, x=None, y=None):
|
|
181 |
|
182 |
|
183 |
def generate_traj_specified(c2ws_anchor, theta, phi, d_r, d_x, d_y, frame, device, opts):
|
|
|
184 |
# Initialize a camera.
|
185 |
-
|
186 |
camera_x = getattr(opts, "init_dx", 0.0)
|
187 |
camera_y = getattr(opts, "init_dy", 0.0)
|
188 |
camera_z = getattr(opts, "init_dz", 0.0)
|
189 |
-
|
190 |
thetas = np.linspace(0, theta, frame)
|
191 |
phis = np.linspace(0, phi, frame)
|
192 |
-
|
193 |
rs = np.linspace(0, d_r, frame)+camera_z
|
194 |
xs = np.linspace(0, d_x, frame)+camera_x
|
195 |
ys = np.linspace(0, d_y, frame)+camera_y
|
|
|
196 |
# manipulate the above ones
|
197 |
c2ws_list = []
|
198 |
for th, ph, r, x, y in zip(thetas, phis, rs, xs, ys):
|
@@ -205,6 +204,7 @@ def generate_traj_specified(c2ws_anchor, theta, phi, d_r, d_x, d_y, frame, devic
|
|
205 |
np.float32(x),
|
206 |
np.float32(y),
|
207 |
)
|
|
|
208 |
c2ws_list.append(c2w_new)
|
209 |
c2ws = torch.cat(c2ws_list, dim=0)
|
210 |
return c2ws
|
|
|
181 |
|
182 |
|
183 |
def generate_traj_specified(c2ws_anchor, theta, phi, d_r, d_x, d_y, frame, device, opts):
|
184 |
+
|
185 |
# Initialize a camera.
|
|
|
186 |
camera_x = getattr(opts, "init_dx", 0.0)
|
187 |
camera_y = getattr(opts, "init_dy", 0.0)
|
188 |
camera_z = getattr(opts, "init_dz", 0.0)
|
|
|
189 |
thetas = np.linspace(0, theta, frame)
|
190 |
phis = np.linspace(0, phi, frame)
|
|
|
191 |
rs = np.linspace(0, d_r, frame)+camera_z
|
192 |
xs = np.linspace(0, d_x, frame)+camera_x
|
193 |
ys = np.linspace(0, d_y, frame)+camera_y
|
194 |
+
print(f"thetas: {thetas}, phis: {phis}, rs: {rs}, xs: {xs}, ys: {ys}")
|
195 |
# manipulate the above ones
|
196 |
c2ws_list = []
|
197 |
for th, ph, r, x, y in zip(thetas, phis, rs, xs, ys):
|
|
|
204 |
np.float32(x),
|
205 |
np.float32(y),
|
206 |
)
|
207 |
+
print(f"c2w_new: {c2w_new}")
|
208 |
c2ws_list.append(c2w_new)
|
209 |
c2ws = torch.cat(c2ws_list, dim=0)
|
210 |
return c2ws
|