Update app.py
Browse files
app.py
CHANGED
@@ -64,8 +64,16 @@ def inference_video(video, size):
|
|
64 |
os.system("rm -rf " + INPUT_DIR)
|
65 |
os.system("mkdir " + INPUT_DIR)
|
66 |
input_image_path = os.path.join(INPUT_DIR, 'input.jpg')
|
67 |
-
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
os.system("python inference_video.py")
|
70 |
return os.path.join('/tmp/results_mp4_videos/', 'input.mp4')
|
71 |
|
|
|
64 |
os.system("rm -rf " + INPUT_DIR)
|
65 |
os.system("mkdir " + INPUT_DIR)
|
66 |
input_image_path = os.path.join(INPUT_DIR, 'input.jpg')
|
67 |
+
try:
|
68 |
+
# Specify the desired output file path with the custom name and ".mp4" extension
|
69 |
+
output_file_path = f"/tmp/videos/{custom_name}.mp4"
|
70 |
+
|
71 |
+
# Save the video input to the specified file path
|
72 |
+
with open(output_file_path, 'wb') as output_file:
|
73 |
+
output_file.write(video)
|
74 |
+
print(f"Video input saved as {output_file_path}")
|
75 |
+
except Exception as e:
|
76 |
+
print(f"Error saving video input: {str(e)}")
|
77 |
os.system("python inference_video.py")
|
78 |
return os.path.join('/tmp/results_mp4_videos/', 'input.mp4')
|
79 |
|