forked from IDEA-Research/Grounded-Segment-Anything
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_long_trip_to_tracking.py
24 lines (20 loc) · 1.06 KB
/
run_long_trip_to_tracking.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from utils.utils import Utils
import subprocess
import os
import shutil
if __name__ == "__main__":
#input_dir = "/media/NAS/sd_nas_01/shuo/denso_data/20240613_101744_6/sms_right/raw_data"
input_dir = "/media/NAS/sd_nas_01/shuo/denso_data/20240613_101744_1/sms_rear/raw_data"
output_dir = "/media/NAS/sd_nas_01/shuo/denso_data/20240613_101744_1/sms_rear"
#output_dir = "/media/NAS/sd_nas_01/shuo/denso_data/20240613_101744_6/sms_right/"
trip_length = 50
box_threshold = 0.23
trip_count = Utils.split_trip_to_small(input_dir, output_dir, trip_length=trip_length)
for i_trip_count in trip_count:
input_tracking_raw_image = os.path.join(output_dir, str(i_trip_count))
command = "python grounded_sam_with_sam_tracking.py -i {} -o {} --box_threshold {}".format(input_tracking_raw_image, output_dir, box_threshold)
# 使用 subprocess.run 运行命令
print(command)
result = subprocess.run(command, shell=True, text=True, capture_output=True)
# 输出命令的输出
print("Output:", result.stdout)