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
72035ee5
Commit
72035ee5
authored
6 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Patches
Plain Diff
Add the giant video loader
parent
f3d9701f
No related branches found
No related tags found
1 merge request
!60
Change the API of yield_faces
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/pad/face/utils/__init__.py
+1
-1
1 addition, 1 deletion
bob/pad/face/utils/__init__.py
bob/pad/face/utils/load_utils.py
+15
-1
15 additions, 1 deletion
bob/pad/face/utils/load_utils.py
with
16 additions
and
2 deletions
bob/pad/face/utils/__init__.py
+
1
−
1
View file @
72035ee5
from
.load_utils
import
(
frames
,
number_of_frames
,
yield_frames
,
yield_faces
,
scale_face
,
blocks
,
bbx_cropper
,
min_face_size_normalizer
)
bbx_cropper
,
min_face_size_normalizer
,
the_giant_video_loader
)
# gets sphinx autodoc done right - don't remove it
__all__
=
[
_
for
_
in
dir
()
if
not
_
.
startswith
(
'
_
'
)]
This diff is collapsed.
Click to expand it.
bob/pad/face/utils/load_utils.py
+
15
−
1
View file @
72035ee5
...
...
@@ -5,7 +5,6 @@ from bob.ip.base import scale, block, block_output_shape
from
bob.ip.facedetect
import
bounding_box_from_annotation
from
functools
import
partial
import
numpy
import
six
def
frames
(
path
):
...
...
@@ -191,3 +190,18 @@ def blocks(data, block_size, block_overlap=(0, 0)):
else
:
raise
ValueError
(
"
Unknown data dimension {}
"
.
format
(
data
.
ndim
))
return
output
def
the_giant_video_loader
(
paddb
,
padfile
,
region
=
'
whole
'
,
scaling_factor
=
None
,
cropper
=
None
,
normalizer
=
None
):
generator
=
None
if
region
==
'
whole
'
:
generator
=
yield_frames
(
paddb
,
padfile
)
elif
region
==
'
crop
'
:
generator
=
yield_faces
(
paddb
,
padfile
,
cropper
=
cropper
,
normalizer
=
normalizer
)
if
scaling_factor
is
not
None
:
generator
=
(
scale
(
frame
,
scaling_factor
)
for
frame
in
generator
)
return
generator
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