-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
45 lines (40 loc) · 1.06 KB
/
run.py
File metadata and controls
45 lines (40 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
from detection_helpers import *
from tracking_helpers import *
from bridge_wrapper import *
from PIL import Image
def run(
global_file_path_undetected,
global_file_name,
close_loading,
start_timer,
stop_timer,
update_text,
update_image,
selected_number,
):
selected_value_str = selected_number.get()
selected_value_int = int(selected_value_str)
detector = Detector(
classes=None
)
detector.load_model(
"./weights/best_exp4.pt",
)
# Initialise class that binds detector and tracker in one class
tracker = YOLOv7_DeepSORT(
reID_model_path="./deep_sort/model_weights/mars-small128.pb", detector=detector
)
start_timer()
# output = None will not save the output video
tracker.track_video(
update_text,
update_image,
global_file_path_undetected,
output=f"./video_output/{global_file_name}",
show_live=False,
skip_frames=selected_value_int,
count_objects=True,
verbose=1,
)
stop_timer()
close_loading()