ford442 commited on
Commit
23191d1
1 Parent(s): 9bdea9f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -124,7 +124,7 @@ def center_crop_and_resize(frame, target_height, target_width):
124
  frame_resized = cv2.resize(frame_cropped, (target_width, target_height))
125
  return frame_resized
126
 
127
- def load_image_to_tensor_with_resize(image_path, target_height=768, target_width=768):
128
  image = Image.open(image_path).convert("RGB")
129
  image_np = np.array(image)
130
  frame_resized = center_crop_and_resize(image_np, target_height, target_width)
@@ -394,11 +394,9 @@ def generate_video_from_image_90(
394
  f"An error occurred while generating the video. Please try again. Error: {e}",
395
  duration=5,
396
  )
397
-
398
  finally:
399
  torch.cuda.empty_cache()
400
  gc.collect()
401
-
402
  return output_path
403
 
404
  def create_advanced_options():
 
124
  frame_resized = cv2.resize(frame_cropped, (target_width, target_height))
125
  return frame_resized
126
 
127
+ def load_image_to_tensor_with_resize(image_path, target_height, target_width):
128
  image = Image.open(image_path).convert("RGB")
129
  image_np = np.array(image)
130
  frame_resized = center_crop_and_resize(image_np, target_height, target_width)
 
394
  f"An error occurred while generating the video. Please try again. Error: {e}",
395
  duration=5,
396
  )
 
397
  finally:
398
  torch.cuda.empty_cache()
399
  gc.collect()
 
400
  return output_path
401
 
402
  def create_advanced_options():