Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bob.paper.nir_patch_pooling
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.paper.nir_patch_pooling
Commits
cb61d1fc
Commit
cb61d1fc
authored
4 years ago
by
Ketan Kotwal
Browse files
Options
Downloads
Patches
Plain Diff
remove frameindexes while loading
parent
35611207
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/paper/nir_patch_pooling/database/mlfp.py
+4
-2
4 additions, 2 deletions
bob/paper/nir_patch_pooling/database/mlfp.py
bob/paper/nir_patch_pooling/script/convert_mlfp_database.py
+7
-2
7 additions, 2 deletions
bob/paper/nir_patch_pooling/script/convert_mlfp_database.py
with
11 additions
and
4 deletions
bob/paper/nir_patch_pooling/database/mlfp.py
+
4
−
2
View file @
cb61d1fc
...
...
@@ -39,8 +39,10 @@ class File(VideoPadFile):
hdf_file
=
h5py
.
File
(
path
)
fc
=
FrameContainer
()
for
idx
,
frame_data
in
enumerate
(
hdf_file
.
keys
()):
frame_keys
=
list
(
hdf_file
.
keys
())
frame_keys
.
remove
(
"
FrameIndexes
"
)
for
idx
,
frame_data
in
enumerate
(
frame_keys
):
frame
=
hdf_file
[
frame_data
][
"
array
"
].
value
fc
.
add
(
idx
,
frame
,
None
)
...
...
This diff is collapsed.
Click to expand it.
bob/paper/nir_patch_pooling/script/convert_mlfp_database.py
+
7
−
2
View file @
cb61d1fc
...
...
@@ -10,6 +10,12 @@ import os, sys
from
bob.bio.video
import
FrameContainer
from
bob.io.base
import
create_directories_safe
,
HDF5File
import
numpy
as
np
from
bob.pad.face.preprocessor.FaceCropAlign
import
detect_face_landmarks_in_image
import
json
import
logging
logger
=
logging
.
getLogger
(
__name__
)
logger
.
setLevel
(
logging
.
INFO
)
frames_per_video
=
20
...
...
@@ -51,7 +57,7 @@ class MLFPConvertor:
#------------------------------------------------------------------------------
def
normalize_image
(
self
,
image
,
n_sigma
=
3
.0
):
# or 4.0
def
normalize_image
(
self
,
image
,
n_sigma
=
4
.0
):
#
3.0
or 4.0
assert
(
len
(
image
.
shape
)
==
2
)
...
...
@@ -115,7 +121,6 @@ class MLFPConvertor:
# if image is grayscale, convert to 3 channel for face detection
if
len
(
image
.
shape
)
==
2
:
print
(
image
.
shape
)
image
=
np
.
repeat
(
image
[:,
:,
np
.
newaxis
],
3
,
axis
=
2
)
image
=
np
.
transpose
(
image
,
(
2
,
0
,
1
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment