seawolf2357 commited on
Commit
5f5104c
·
verified ·
1 Parent(s): b40ffb2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -7,10 +7,10 @@ from pathlib import Path
7
  def image_to_video(input_file, fps=30):
8
  # Create a temporary directory to store the image
9
  with tempfile.TemporaryDirectory() as temp_dir:
10
- # Save the uploaded file to the temp directory
11
- file_path = os.path.join(temp_dir, f"image{Path(input_file.name).suffix}")
12
  with open(file_path, 'wb') as file:
13
- file.write(input_file.read())
 
14
 
15
  # Read the image to set the video size
16
  frame = cv2.imread(file_path)
 
7
  def image_to_video(input_file, fps=30):
8
  # Create a temporary directory to store the image
9
  with tempfile.TemporaryDirectory() as temp_dir:
10
+ file_path = os.path.join(temp_dir, "image.jpg")
 
11
  with open(file_path, 'wb') as file:
12
+ file.write(input_file)
13
+
14
 
15
  # Read the image to set the video size
16
  frame = cv2.imread(file_path)