Muhammad Taqi Raza commited on
Commit
e0df45d
·
1 Parent(s): f42f083

reverting gradio

Browse files
Files changed (1) hide show
  1. gradio_app.py +8 -3
gradio_app.py CHANGED
@@ -206,7 +206,7 @@ download_models()
206
  # -----------------------------
207
  # Step 2: Inference Logic
208
  # -----------------------------
209
- def run_epic_inference(video_path, target_pose, mode):
210
  temp_input_path = "/app/temp_input.mp4"
211
  output_dir = "/app/output_anchor"
212
  video_output_path = f"{output_dir}/masked_videos/output.mp4"
@@ -229,6 +229,7 @@ def run_epic_inference(video_path, target_pose, mode):
229
  "--camera", "target",
230
  "--mask",
231
  "--target_pose", theta, phi, r, x, y,
 
232
  "--save_name", "output",
233
  "--mode", mode,
234
  ]
@@ -254,8 +255,10 @@ def print_output_directory(out_dir):
254
  return result
255
 
256
  def inference(video_path, num_frames, fps, target_pose, mode):
257
- logs, video_masked = run_epic_inference(video_path, target_pose, mode)
258
- return logs, video_masked
 
 
259
 
260
  MODEL_PATH = "/app/pretrained/CogVideoX-5b-I2V"
261
  ckpt_steps = 500
@@ -265,6 +268,8 @@ def inference(video_path, num_frames, fps, target_pose, mode):
265
 
266
  video_root_dir = "/app/output_anchor"
267
  out_dir = "/app/output"
 
 
268
 
269
  command = [
270
  "python", "/app/inference/cli_demo_camera_i2v_pcd.py",
 
206
  # -----------------------------
207
  # Step 2: Inference Logic
208
  # -----------------------------
209
+ def run_epic_inference(video_path, num_frames, target_pose, mode):
210
  temp_input_path = "/app/temp_input.mp4"
211
  output_dir = "/app/output_anchor"
212
  video_output_path = f"{output_dir}/masked_videos/output.mp4"
 
229
  "--camera", "target",
230
  "--mask",
231
  "--target_pose", theta, phi, r, x, y,
232
+ "--video_length", num_frames,
233
  "--save_name", "output",
234
  "--mode", mode,
235
  ]
 
255
  return result
256
 
257
  def inference(video_path, num_frames, fps, target_pose, mode):
258
+ logs, video_masked = run_epic_inference(video_path, num_frames, target_pose, mode)
259
+
260
+ result_dir = print_output_directory("/app/output_anchor")
261
+
262
 
263
  MODEL_PATH = "/app/pretrained/CogVideoX-5b-I2V"
264
  ckpt_steps = 500
 
268
 
269
  video_root_dir = "/app/output_anchor"
270
  out_dir = "/app/output"
271
+ return logs + result_dir, video_masked
272
+
273
 
274
  command = [
275
  "python", "/app/inference/cli_demo_camera_i2v_pcd.py",