fffiloni commited on
Commit
e5f04d4
1 Parent(s): f1da812

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -191,6 +191,8 @@ def infer_auto(project_name, video_in, subject_to_remove):
191
  timestamp = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
192
  my_video_directory = f"{project_name}_{timestamp}"
193
  os.makedirs(my_video_directory)
 
 
194
 
195
  # Assuming 'images' is a list of image file paths
196
  for idx, image in enumerate(video_frames[0]):
@@ -211,6 +213,12 @@ def infer_auto(project_name, video_in, subject_to_remove):
211
  my_masks_directory = f"{project_name}_masks"
212
  if not os.path.exists(my_masks_directory):
213
  os.makedirs(my_masks_directory)
 
 
 
 
 
 
214
 
215
  # Assuming 'images' is a list of image file paths
216
  for idx, image in enumerate(masks_frames[0]):
 
191
  timestamp = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
192
  my_video_directory = f"{project_name}_{timestamp}"
193
  os.makedirs(my_video_directory)
194
+ print(f"Created the dir: {my_video_directory}")
195
+
196
 
197
  # Assuming 'images' is a list of image file paths
198
  for idx, image in enumerate(video_frames[0]):
 
213
  my_masks_directory = f"{project_name}_masks"
214
  if not os.path.exists(my_masks_directory):
215
  os.makedirs(my_masks_directory)
216
+ else:
217
+ # If the directory already exists, add a timestamp to the new directory name
218
+ timestamp = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
219
+ my_masks_directory = f"{project_name}_masks_{timestamp}"
220
+ os.makedirs(my_masks_directory)
221
+ print(f"Created the dir: {my_masks_directory}")
222
 
223
  # Assuming 'images' is a list of image file paths
224
  for idx, image in enumerate(masks_frames[0]):