xizaoqu commited on
Commit
982f81d
·
1 Parent(s): e128dab
Files changed (2) hide show
  1. algorithms/worldmem/df_video.py +1 -1
  2. app.py +1 -1
algorithms/worldmem/df_video.py CHANGED
@@ -807,7 +807,7 @@ class WorldMemMinecraft(DiffusionForcingBase):
807
  new_c2w_mat = euler_to_camera_to_world_matrix(first_pose)
808
  self_memory_c2w = new_c2w_mat[None, None].to(device)
809
  self_frame_idx = torch.tensor([[context_frames_idx]]).to(device)
810
- return first_frame.cpu(), self_frames.cpu().numpy(), self_actions.cpu().numpy(), self_poses.cpu().numpy(), self_memory_c2w.cpu().numpy(), self_frame_idx.cpu().numpy()
811
  else:
812
  self_frames = torch.from_numpy(self_frames)
813
  self_actions = torch.from_numpy(self_actions).to(device)
 
807
  new_c2w_mat = euler_to_camera_to_world_matrix(first_pose)
808
  self_memory_c2w = new_c2w_mat[None, None].to(device)
809
  self_frame_idx = torch.tensor([[context_frames_idx]]).to(device)
810
+ return first_frame.cpu().numpy(), self_frames.cpu().numpy(), self_actions.cpu().numpy(), self_poses.cpu().numpy(), self_memory_c2w.cpu().numpy(), self_frame_idx.cpu().numpy()
811
  else:
812
  self_frames = torch.from_numpy(self_frames)
813
  self_actions = torch.from_numpy(self_actions).to(device)
app.py CHANGED
@@ -241,7 +241,7 @@ def generate(keys):
241
 
242
  memory_frames.append(new_frame)
243
 
244
- out_video = torch.stack(memory_frames)
245
  out_video = out_video.permute(0,2,3,1).numpy()
246
  out_video = np.clip(out_video, a_min=0.0, a_max=1.0)
247
  out_video = (out_video * 255).astype(np.uint8)
 
241
 
242
  memory_frames.append(new_frame)
243
 
244
+ out_video = np.stack(memory_frames)
245
  out_video = out_video.permute(0,2,3,1).numpy()
246
  out_video = np.clip(out_video, a_min=0.0, a_max=1.0)
247
  out_video = (out_video * 255).astype(np.uint8)