Skip to content

Commit

Permalink
Add OC code
Browse files Browse the repository at this point in the history
  • Loading branch information
jsliacan committed Sep 20, 2024
1 parent 435617d commit 3c07d4b
Show file tree
Hide file tree
Showing 3 changed files with 1,728 additions and 22 deletions.
18 changes: 13 additions & 5 deletions __main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
dflist = util.get_box_files(constants.DATA_HOME, "txt")

all_ot_events = []
lds = []
total_num_OC = 0
all_oc_events = []
ot_lds = []
oc_lds = []

for csv_file in dflist:
print(csv_file, flush=True)
Expand All @@ -40,11 +41,16 @@

b_partitions, a_partitions, b_modularities, a_modularities = mod.get_partitions(ldata, press_starts, press_lengths)

ot_events = mod.get_ot_events(date_string, ldata, press_starts, b_partitions, b_modularities)
all_ot_events.extend(ot_events)
oc_events = mod.get_oc_events(date_string, ldata, press_starts, a_partitions, a_modularities)
all_oc_events.extend(oc_events)
# ot_events = mod.get_ot_events(date_string, ldata, press_starts, b_partitions, b_modularities)
# all_ot_events.extend(ot_events)

util.write_to_csv_file(os.path.join("data", "ot_events.csv"), all_ot_events)
# util.write_to_csv_file(os.path.join("data", "ot_events.csv"), all_ot_events)
util.write_to_csv_file(os.path.join("data", "oc_events.csv"), all_oc_events)


"""
print("Number of OT events:", len(ot_events))
lds = [ote[-2] for ote in all_ot_events]
lds_trimmed_means = [stats.trim_mean(ld, 0.1)-20 for ld in lds]
Expand All @@ -70,6 +76,8 @@
# run some basic stats & figs
# plt.hist(lds_trimmed_mins, bins=50)
# plt.show()
"""


"""
# --------- vehicle recognition from video ----------
Expand Down
Loading

0 comments on commit 3c07d4b

Please sign in to comment.