PengWeixuanSZU commited on
Commit
b8719ca
·
verified ·
1 Parent(s): 48b7ead

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -186,8 +186,8 @@ def inference_and_return_video(dilation_iterations, num_inference_steps, video_s
186
  images = video_state["origin_images"]
187
  masks = video_state["masks"]
188
 
189
- images = np.array(images)
190
- masks = np.array(masks)
191
  print(f"line 191 images shape:{images.shape},masks shape:{masks.shape}")
192
  #line 191 images shape:(1, 1024, 1820, 3),masks shape:(1, 1024, 1820), which should be (16, 1024, 1820, 3) and (16, 1024, 1820, 3)
193
  img_tensor, mask_tensor = preprocess_for_removal(images, masks)
@@ -280,6 +280,8 @@ def track_video(n_frames, video_state):
280
  output_frames.append(painted)
281
  print(f"line 281 len(output_frames)={len(output_frames)}, painted shape:{painted.shape}")
282
  video_state["masks"] = mask_frames
 
 
283
  video_file = f"/tmp/{time.time()}-{random.random()}-tracked_output.mp4"
284
  clip = ImageSequenceClip(output_frames, fps=15)
285
  clip.write_videofile(video_file, codec='libx264', audio=False, verbose=False, logger=None)
 
186
  images = video_state["origin_images"]
187
  masks = video_state["masks"]
188
 
189
+ #images = np.array(images)
190
+ #masks = np.array(masks)
191
  print(f"line 191 images shape:{images.shape},masks shape:{masks.shape}")
192
  #line 191 images shape:(1, 1024, 1820, 3),masks shape:(1, 1024, 1820), which should be (16, 1024, 1820, 3) and (16, 1024, 1820, 3)
193
  img_tensor, mask_tensor = preprocess_for_removal(images, masks)
 
280
  output_frames.append(painted)
281
  print(f"line 281 len(output_frames)={len(output_frames)}, painted shape:{painted.shape}")
282
  video_state["masks"] = mask_frames
283
+ print(f'line 283 len video_state["masks"]:{len(video_state["masks"])}')
284
+ print(f'line 284 video_state["masks"][0].shape:{video_state["masks"][0].shape}')
285
  video_file = f"/tmp/{time.time()}-{random.random()}-tracked_output.mp4"
286
  clip = ImageSequenceClip(output_frames, fps=15)
287
  clip.write_videofile(video_file, codec='libx264', audio=False, verbose=False, logger=None)