Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
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
|
|
|
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)
|