Spaces:
Running
on
Zero
Running
on
Zero
thai thong
commited on
Commit
•
c412fb1
1
Parent(s):
839f10e
fix error
Browse files- app.py +3 -3
- requirements.txt +0 -1
app.py
CHANGED
@@ -25,18 +25,18 @@ def yolov9_inference(model_id, img_path=None, vid_path=None, tracking_algorithm
|
|
25 |
#if img_extension.lower() in img_extensions:
|
26 |
input_path = img_path
|
27 |
print(input_path)
|
28 |
-
output_path = run(weights=model_id, imgsz=(image_size,image_size), conf_thres=conf_threshold, iou_thres=iou_threshold, source=input_path, device='
|
29 |
elif vid_path is not None:
|
30 |
#_, vid_extension = os.path.splitext(vid_path)
|
31 |
#if vid_extension.lower() in vid_extensions:
|
32 |
input_path = vid_path
|
33 |
print(input_path)
|
34 |
if tracking_algorithm == 'deep_sort':
|
35 |
-
output_path = run_deepsort(weights=model_id, imgsz=(image_size,image_size), conf_thres=conf_threshold, iou_thres=iou_threshold, source=input_path, device='
|
36 |
elif tracking_algorithm == 'strong_sort':
|
37 |
output_path = run_strongsort(yolo_weights=model_id, imgsz=(image_size,image_size), conf_thres=conf_threshold, iou_thres=iou_threshold, source=input_path, device='0', strong_sort_weights = "osnet_x0_25_msmt17.pt", hide_conf= True)
|
38 |
else:
|
39 |
-
output_path = run(weights=model_id, imgsz=(image_size,image_size), conf_thres=conf_threshold, iou_thres=iou_threshold, source=input_path, device='
|
40 |
# Assuming output_path is the path to the output file
|
41 |
_, output_extension = os.path.splitext(output_path)
|
42 |
if output_extension.lower() in img_extensions:
|
|
|
25 |
#if img_extension.lower() in img_extensions:
|
26 |
input_path = img_path
|
27 |
print(input_path)
|
28 |
+
output_path = run(weights=model_id, imgsz=(image_size,image_size), conf_thres=conf_threshold, iou_thres=iou_threshold, source=input_path, device='0', hide_conf= True)
|
29 |
elif vid_path is not None:
|
30 |
#_, vid_extension = os.path.splitext(vid_path)
|
31 |
#if vid_extension.lower() in vid_extensions:
|
32 |
input_path = vid_path
|
33 |
print(input_path)
|
34 |
if tracking_algorithm == 'deep_sort':
|
35 |
+
output_path = run_deepsort(weights=model_id, imgsz=(image_size,image_size), conf_thres=conf_threshold, iou_thres=iou_threshold, source=input_path, device='0', draw_trails=True)
|
36 |
elif tracking_algorithm == 'strong_sort':
|
37 |
output_path = run_strongsort(yolo_weights=model_id, imgsz=(image_size,image_size), conf_thres=conf_threshold, iou_thres=iou_threshold, source=input_path, device='0', strong_sort_weights = "osnet_x0_25_msmt17.pt", hide_conf= True)
|
38 |
else:
|
39 |
+
output_path = run(weights=model_id, imgsz=(image_size,image_size), conf_thres=conf_threshold, iou_thres=iou_threshold, source=input_path, device='0', hide_conf= True)
|
40 |
# Assuming output_path is the path to the output file
|
41 |
_, output_extension = os.path.splitext(output_path)
|
42 |
if output_extension.lower() in img_extensions:
|
requirements.txt
CHANGED
@@ -11,7 +11,6 @@ Pillow>=7.1.2
|
|
11 |
psutil
|
12 |
torchreid
|
13 |
gdown
|
14 |
-
=======
|
15 |
PyYAML>=5.3.1
|
16 |
requests>=2.23.0
|
17 |
scipy>=1.4.1
|
|
|
11 |
psutil
|
12 |
torchreid
|
13 |
gdown
|
|
|
14 |
PyYAML>=5.3.1
|
15 |
requests>=2.23.0
|
16 |
scipy>=1.4.1
|