This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# columns in the data that you want to visualize (visualize each column's value along the rows, where the row number is the x-axis) | |
VISUALIZED_COLUMNS = [0, -1, -2, -3, -4] | |
# show visualization of data, change to only one column (second argument) if only want to visualize current set of data instead of contrasting pre- vs post-filtering | |
fig, axs = plt.subplots(len(VISUALIZED_COLUMNS), 2) | |
for i, column in enumerate(VISUALIZED_COLUMNS): | |
old_data = data[:, column] | |
# plot pre-filtered data | |
axs[i, 0].plot(range(len(data)), old_data) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pick bin dimensions in the vector [aruco_marker[:72], color_bins[72:92], optical_flow_avg[92:94], hand_loc[94:96]] | |
pick_bins = [i for i in range(24 * 2)] | |
place_bins = [i for i in range(24 * 2, 36 * 2)] | |
for i in range(1,41): | |
with open(f"htk_inputs_aruco/picklist_{i}.txt") as infile: | |
infile = infile.readlines() | |
for line in infile: | |
line = line.split() | |
aruco_markers = line[:72] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
files = glob.glob("*_raw.txt") | |
for file in files: | |
with open(file, "r") as infile: | |
phrase = infile.read().strip() | |
with open(file.replace("_raw.txt", "_place.lab"), "w") as outfile: | |
#prepend sil for HTK formatting | |
outfile.write("sil\n") |