-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrun.py
More file actions
39 lines (30 loc) · 1.01 KB
/
Copy pathrun.py
File metadata and controls
39 lines (30 loc) · 1.01 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
# %%
from ClusteringPipelineEngine import ClusteringPipelineEngine
from Experiment import Experiment
from VideoData import VideoData
vid = "auburn_first_angle"
hours = list(range(10,11))
### AHEAD-OF-TIME PROCESSING ###
# This is done once per video
for hr in hours:
VideoData(vid, hr).check_vids()
Experiment(vid, hr).run_ingest()
# QUERY-TIME PROCESSING ###
# This is done once per query
query_class = "car"
model = "yolov3-coco"
acc_target = 0.9
query_conf = 0.7
qtype = "binary"
pc = 0.1
# convert query_class name to the corresponding index
qclass_label = {"car" : 2, "person": 0}[query_class] # coco
cpe = ClusteringPipelineEngine(vid, query_conf=query_conf)
results_df = cpe.execute(hours, qtype, model, qclass_label, acc_target, percent_clusters=pc, ioda=0.1, get_boggart_results=True)
# Results of boggart are located in results_df
# If bounding box query,
# columns: hour, frame_no, x1, y1, x2, y2
# If count query,
# columns: hour, frame_no, count
# If binary query,
# columns: hour, frame_no, found