remove save folder for storage
Browse files- app_batch.py +7 -1
- owl_batch.py +1 -1
app_batch.py
CHANGED
@@ -12,6 +12,7 @@ import gradio as gr
|
|
12 |
from tqdm import tqdm
|
13 |
import os
|
14 |
import time
|
|
|
15 |
|
16 |
from owl_batch import owl_batch_video
|
17 |
|
@@ -58,6 +59,8 @@ def run_owl_batch(
|
|
58 |
now = datetime.now()
|
59 |
timestamp = now.strftime("%Y-%m-%d_%H-%M")
|
60 |
|
|
|
|
|
61 |
zip_path = owl_batch_video(
|
62 |
input_vids,
|
63 |
target_prompt,
|
@@ -66,8 +69,11 @@ def run_owl_batch(
|
|
66 |
fps_processed=fps_processed,
|
67 |
scaling_factor=1/scaling_factor,
|
68 |
batch_size=BATCH_SIZE,
|
69 |
-
save_dir=
|
70 |
progress=progress)
|
|
|
|
|
|
|
71 |
|
72 |
end_time = time.time()
|
73 |
print(f'Processing time: {end_time - start_time} seconds')
|
|
|
12 |
from tqdm import tqdm
|
13 |
import os
|
14 |
import time
|
15 |
+
import shutil
|
16 |
|
17 |
from owl_batch import owl_batch_video
|
18 |
|
|
|
59 |
now = datetime.now()
|
60 |
timestamp = now.strftime("%Y-%m-%d_%H-%M")
|
61 |
|
62 |
+
save_dir = f"temp_{timestamp}"
|
63 |
+
|
64 |
zip_path = owl_batch_video(
|
65 |
input_vids,
|
66 |
target_prompt,
|
|
|
69 |
fps_processed=fps_processed,
|
70 |
scaling_factor=1/scaling_factor,
|
71 |
batch_size=BATCH_SIZE,
|
72 |
+
save_dir=save_dir,
|
73 |
progress=progress)
|
74 |
+
|
75 |
+
# remove save_dir for storage
|
76 |
+
shutil.rmtree(save_dir)
|
77 |
|
78 |
end_time = time.time()
|
79 |
print(f'Processing time: {end_time - start_time} seconds')
|
owl_batch.py
CHANGED
@@ -50,7 +50,7 @@ def owl_batch_video(
|
|
50 |
df.to_csv(f"{save_dir}/detection_results.csv")
|
51 |
|
52 |
# zip the save_dir
|
53 |
-
zip_file = f"
|
54 |
zip_directory(save_dir, zip_file)
|
55 |
|
56 |
return zip_file
|
|
|
50 |
df.to_csv(f"{save_dir}/detection_results.csv")
|
51 |
|
52 |
# zip the save_dir
|
53 |
+
zip_file = f"results.zip"
|
54 |
zip_directory(save_dir, zip_file)
|
55 |
|
56 |
return zip_file
|