Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.bio.base
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.bio.base
Commits
6298fa61
There was a problem fetching the pipeline summary.
Commit
6298fa61
authored
7 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Patches
Plain Diff
compromise for Sphinx
parent
28768e34
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!82
Add a function to read features with generators
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/bio/base/utils/io.py
+5
-8
5 additions, 8 deletions
bob/bio/base/utils/io.py
with
5 additions
and
8 deletions
bob/bio/base/utils/io.py
+
5
−
8
View file @
6298fa61
import
os
import
tempfile
import
tarfile
try
:
# this is needed for the sphinx documentation
from
collections.abc
import
Callable
,
Iterable
except
ImportError
:
from
collections
import
Callable
,
Iterable
import
collections
# this is needed for the sphinx documentation
import
functools
# this is needed for the sphinx documentation
import
numpy
import
logging
...
...
@@ -185,9 +182,9 @@ def _generate_features(reader, paths):
Parameters
----------
reader : Callable
reader :
``collections.
Callable
``
See the documentation of :py:func:`vstack_features`.
paths : Iterable
paths :
``collections.
Iterable
``
See the documentation of :py:func:`vstack_features`.
Yields
...
...
@@ -273,14 +270,14 @@ def vstack_features(reader, paths, same_size=False):
Parameters
----------
reader : Callable
reader :
``collections.
Callable
``
The function to load the features. The function should only take one
argument being the path to the features. Use
:any:`functools.partial` to accommodate your reader to this format.
The features returned by ``reader`` are expected to have the same
:py:class:`numpy.dtype` and the same shape except for their first
dimension. First dimension is should correspond to the number of samples.
paths : Iterable
paths :
``collections.
Iterable
``
An iterable of paths to iterate on. Whatever is inside path is given to
``reader``. If ``same_size`` is ``True``, ``len(paths)`` must be valid.
same_size : :obj:`bool`, optional
...
...
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