Spaces:
Build error
Build error
annading commited on
Commit ·
bda28e6
1
Parent(s): 775d75f
added time print
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
BATCH_SIZE =
|
| 2 |
CUDA_PATH = "/usr/local/cuda-12.3/" # Change this to your CUDA path
|
| 3 |
|
| 4 |
|
|
@@ -14,6 +14,7 @@ import os
|
|
| 14 |
import numpy as np
|
| 15 |
import pandas as pd
|
| 16 |
import torch
|
|
|
|
| 17 |
|
| 18 |
from typing import Tuple
|
| 19 |
from PIL import Image
|
|
@@ -26,6 +27,7 @@ def run_owl(input_vid,
|
|
| 26 |
fps_processed,
|
| 27 |
scaling_factor
|
| 28 |
):
|
|
|
|
| 29 |
new_input_vid = input_vid.replace(" ", "_")
|
| 30 |
os.rename(input_vid, new_input_vid)
|
| 31 |
csv_path, vid_path = owl_full_video(new_input_vid,
|
|
@@ -39,6 +41,8 @@ def run_owl(input_vid,
|
|
| 39 |
CSV_PATH = csv_path
|
| 40 |
global VID_PATH
|
| 41 |
VID_PATH = vid_path
|
|
|
|
|
|
|
| 42 |
return vid_path
|
| 43 |
|
| 44 |
def vid_download():
|
|
|
|
| 1 |
+
BATCH_SIZE = 8 # Change this to your desired batch size
|
| 2 |
CUDA_PATH = "/usr/local/cuda-12.3/" # Change this to your CUDA path
|
| 3 |
|
| 4 |
|
|
|
|
| 14 |
import numpy as np
|
| 15 |
import pandas as pd
|
| 16 |
import torch
|
| 17 |
+
import time
|
| 18 |
|
| 19 |
from typing import Tuple
|
| 20 |
from PIL import Image
|
|
|
|
| 27 |
fps_processed,
|
| 28 |
scaling_factor
|
| 29 |
):
|
| 30 |
+
start_time = time.time()
|
| 31 |
new_input_vid = input_vid.replace(" ", "_")
|
| 32 |
os.rename(input_vid, new_input_vid)
|
| 33 |
csv_path, vid_path = owl_full_video(new_input_vid,
|
|
|
|
| 41 |
CSV_PATH = csv_path
|
| 42 |
global VID_PATH
|
| 43 |
VID_PATH = vid_path
|
| 44 |
+
end_time = time.time()
|
| 45 |
+
print(f'Processing time: {end_time - start_time} seconds')
|
| 46 |
return vid_path
|
| 47 |
|
| 48 |
def vid_download():
|