Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.pad.face
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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.pad.face
Commits
50bd1562
There was a problem fetching the pipeline summary.
Commit
50bd1562
authored
7 years ago
by
Olegs NIKISINS
Browse files
Options
Downloads
Patches
Plain Diff
Removed unused class VideoDataLoader, closes
#20
parent
7330db4c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!56
Removed unused class VideoDataLoader, closes #20
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/pad/face/extractor/VideoDataLoader.py
+0
-115
0 additions, 115 deletions
bob/pad/face/extractor/VideoDataLoader.py
bob/pad/face/extractor/__init__.py
+0
-2
0 additions, 2 deletions
bob/pad/face/extractor/__init__.py
with
0 additions
and
117 deletions
bob/pad/face/extractor/VideoDataLoader.py
deleted
100644 → 0
+
0
−
115
View file @
7330db4c
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 1 13:55:02 2017
@author: Olegs Nikisins
"""
#==============================================================================
# Import what is needed here:
import
os
import
bob.bio.video
#==============================================================================
# Main body of the class
class
VideoDataLoader
(
object
):
"""
This class is designed to load video data given name of the file.
The class is called by corresponding extractors in the experiments using
emty(!) preprocessor. In this scenario the video data is loaded directly
from the database, avoiding duplicate storage of non-processed data in the
experimental directory.
NOTE:
To use this class in PAD experiments the command line argument
``--preprocessed-directory`` must point to the original database directory.
For example:
--preprocessed-directory <DIRECTORY_CONTAINING_REPLAY_ATTACK_DATABASE>
At this point the class is just a collection of methods.
"""
#==========================================================================
def
get_complete_filename
(
self
,
filename
):
"""
Get a complete filename given a filename without an extension.
**Parameters:**
``filename`` : :py:class:`str`
A name of the file containing the path, but no extension.
**Returns:**
``filename_complete`` : :py:class:`str`
A complete filename, incliding extension.
"""
path
,
filename_no_ext
=
os
.
path
.
split
(
filename
)
filenames
=
[]
extensions
=
[]
for
f
in
os
.
listdir
(
path
):
filenames
.
append
(
os
.
path
.
splitext
(
f
)[
0
])
extensions
.
append
(
os
.
path
.
splitext
(
f
)[
1
])
idx
=
filenames
.
index
(
filename_no_ext
)
# index of the file
file_extension
=
extensions
[
idx
]
# get extension of the file
filename_complete
=
os
.
path
.
join
(
path
,
filename_no_ext
+
file_extension
)
return
filename_complete
#==========================================================================
def
load_video_data
(
self
,
filename_complete
):
"""
Load video data given a complete filename.
**Parameters:**
``filename_complete`` : :py:class:`str`
A complete filename, incliding extension.
**Returns:**
``video_data`` : FrameContainer
A FrameContainer containing the loaded video data.
"""
frame_selector
=
bob
.
bio
.
video
.
FrameSelector
(
selection_style
=
'
all
'
)
# select all frames from the video file
video_data
=
frame_selector
(
filename_complete
)
# video data
return
video_data
#==========================================================================
def
__call__
(
self
,
filename
):
"""
Load video data given a filename without an extension.
**Parameters:**
``filename`` : :py:class:`str`
A name of the file containing the path, but no extension.
**Returns:**
``video_data`` : FrameContainer
A FrameContainer containing the loaded video data.
"""
filename_complete
=
self
.
get_complete_filename
(
filename
)
video_data
=
self
.
load_video_data
(
filename_complete
)
return
video_data
This diff is collapsed.
Click to expand it.
bob/pad/face/extractor/__init__.py
+
0
−
2
View file @
50bd1562
from
.LBPHistogram
import
LBPHistogram
from
.ImageQualityMeasure
import
ImageQualityMeasure
from
.VideoDataLoader
import
VideoDataLoader
from
.FrameDiffFeatures
import
FrameDiffFeatures
...
...
@@ -25,7 +24,6 @@ def __appropriate__(*args):
__appropriate__
(
LBPHistogram
,
ImageQualityMeasure
,
VideoDataLoader
,
FrameDiffFeatures
,
)
__all__
=
[
_
for
_
in
dir
()
if
not
_
.
startswith
(
'
_
'
)]
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