Commit 9d65b96a authored by Olegs NIKISINS's avatar Olegs NIKISINS

Merge branch 'algo_helpers_fix' into 'master'

Fixed convert_frame_cont_to_array addressing missing annotations

See merge request !36
parents 6573130e 3a608248
Pipeline #17374 passed with stages
in 19 minutes and 26 seconds
...@@ -32,9 +32,12 @@ def convert_frame_cont_to_array(frame_container): ...@@ -32,9 +32,12 @@ def convert_frame_cont_to_array(frame_container):
for frame in frame_container: for frame in frame_container:
frame_dictionary[frame[0]] = frame[1] frame_dictionary[frame[0]] = frame[1]
sorted_keys = np.sort([int(key) for key in frame_dictionary.keys()])
for idx, _ in enumerate(frame_container): for idx, _ in enumerate(frame_container):
# Frames are stored in a mixed order, therefore we get them using incrementing frame index: # Frames are stored in a mixed order, therefore we get them using incrementing frame index.
feature_vectors.append(frame_dictionary[str(idx)]) # 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) features_array = np.vstack(feature_vectors)
...@@ -88,14 +91,14 @@ def convert_list_of_frame_cont_to_array(frame_containers): ...@@ -88,14 +91,14 @@ def convert_list_of_frame_cont_to_array(frame_containers):
""" """
if isinstance( frame_containers[0], bob.bio.video.FrameContainer): if isinstance( frame_containers[0], bob.bio.video.FrameContainer):
feature_vectors = [] feature_vectors = []
for frame_container in frame_containers: for frame_container in frame_containers:
video_features_array = convert_frame_cont_to_array( video_features_array = convert_frame_cont_to_array(
frame_container) frame_container)
feature_vectors.append(video_features_array) feature_vectors.append(video_features_array)
else: else:
feature_vectors = frame_containers feature_vectors = frame_containers
features_array = np.vstack(feature_vectors) features_array = np.vstack(feature_vectors)
......
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