Skip to content
Snippets Groups Projects
Commit a11ff4bf authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Merge branch 'p1' into 'master'

Use the builtin method for converting frame containers to arrays

Closes #29 and #18

See merge request !56
parents 172d46e0 b655a657
No related branches found
No related tags found
1 merge request!56Use the builtin method for converting frame containers to arrays
Pipeline #24758 passed
......@@ -24,24 +24,7 @@ def convert_frame_cont_to_array(frame_container):
An array containing features for all frames.
The rows are samples, the columns are features.
"""
feature_vectors = []
frame_dictionary = {}
for frame in frame_container:
frame_dictionary[frame[0]] = frame[1]
sorted_keys = np.sort([int(key) for key in frame_dictionary.keys()])
for idx, _ in enumerate(frame_container):
# Frames are stored in a mixed order, therefore we get them using incrementing frame index.
# Also, some frames might be missing, this is also addressed.
feature_vectors.append(frame_dictionary[str(sorted_keys[idx])])
features_array = np.vstack(feature_vectors)
return features_array
return frame_container.as_array()
def convert_and_prepare_features(features):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment