Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.pad.base
Commits
cb6d74b9
Commit
cb6d74b9
authored
Nov 05, 2018
by
Amir MOHAMMADI
Browse files
Use the builtin method for converting frame containers to arrays
parent
88d40c99
Pipeline
#24879
passed with stage
in 6 minutes and 6 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/pad/base/utils/helper_functions.py
View file @
cb6d74b9
...
...
@@ -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
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment