Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -107,6 +107,24 @@ def run_inference(temp_dir, removed_bg_path):
|
|
| 107 |
|
| 108 |
# Retrieve the file name without the extension
|
| 109 |
removed_bg_file_name = os.path.splitext(os.path.basename(removed_bg_path))[0]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
output_videos = glob(os.path.join(f"out/{removed_bg_file_name}", "*.mp4"))
|
| 111 |
return output_videos
|
| 112 |
except subprocess.CalledProcessError as e:
|
|
|
|
| 107 |
|
| 108 |
# Retrieve the file name without the extension
|
| 109 |
removed_bg_file_name = os.path.splitext(os.path.basename(removed_bg_path))[0]
|
| 110 |
+
|
| 111 |
+
# List objects in the "out" folder
|
| 112 |
+
out_folder_path = "out"
|
| 113 |
+
out_folder_objects = os.listdir(out_folder_path)
|
| 114 |
+
print(f"Objects in '{out_folder_path}':")
|
| 115 |
+
for obj in out_folder_objects:
|
| 116 |
+
print(f" - {obj}")
|
| 117 |
+
|
| 118 |
+
# List objects in the "out/{removed_bg_file_name}" folder
|
| 119 |
+
specific_out_folder_path = os.path.join(out_folder_path, removed_bg_file_name)
|
| 120 |
+
if os.path.exists(specific_out_folder_path) and os.path.isdir(specific_out_folder_path):
|
| 121 |
+
specific_out_folder_objects = os.listdir(specific_out_folder_path)
|
| 122 |
+
print(f"\nObjects in '{specific_out_folder_path}':")
|
| 123 |
+
for obj in specific_out_folder_objects:
|
| 124 |
+
print(f" - {obj}")
|
| 125 |
+
else:
|
| 126 |
+
print(f"\nThe folder '{specific_out_folder_path}' does not exist.")
|
| 127 |
+
|
| 128 |
output_videos = glob(os.path.join(f"out/{removed_bg_file_name}", "*.mp4"))
|
| 129 |
return output_videos
|
| 130 |
except subprocess.CalledProcessError as e:
|