kevinwang676 commited on
Commit
379b09d
1 Parent(s): 7590016

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -94,6 +94,9 @@ def inference_image(image_np, prompt):
94
  @torch.no_grad()
95
  @torch.autocast(device_type="cuda", dtype=torch.float16)
96
  def inference_video(video_path, prompt):
 
 
 
97
 
98
  os.system("rm -rf demo_temp")
99
  os.makedirs("demo_temp/input_frames", exist_ok=True)
@@ -119,7 +122,7 @@ def inference_video(video_path, prompt):
119
  input_ids,
120
  )
121
  # save visualization
122
- video_writer = cv2.VideoWriter("demo_temp/out.mp4", fourcc, 30,
123
  (width, height))
124
  # pbar = tqdm(input_frames)
125
  # pbar.set_description("generating video: ")
 
94
  @torch.no_grad()
95
  @torch.autocast(device_type="cuda", dtype=torch.float16)
96
  def inference_video(video_path, prompt):
97
+ cap = cv2.VideoCapture(video_path)
98
+ fps = cap.get(cv2.CAP_PROP_FPS)
99
+ cap.release()
100
 
101
  os.system("rm -rf demo_temp")
102
  os.makedirs("demo_temp/input_frames", exist_ok=True)
 
122
  input_ids,
123
  )
124
  # save visualization
125
+ video_writer = cv2.VideoWriter("demo_temp/out.mp4", fourcc, fps, #30,
126
  (width, height))
127
  # pbar = tqdm(input_frames)
128
  # pbar.set_description("generating video: ")