Commit a11ff4bf authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

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
Pipeline #24758 passed with stages
in 14 minutes and 51 seconds
......@@ -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):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment