Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bob.io.stream
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
Model registry
Operate
Environments
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.io.stream
Commits
2c717320
Commit
2c717320
authored
4 years ago
by
David GEISSBUHLER
Browse files
Options
Downloads
Patches
Plain Diff
Update README.rst
parent
c7cd96d0
No related branches found
No related tags found
No related merge requests found
Pipeline
#47868
failed
4 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.rst
+10
-0
10 additions, 0 deletions
README.rst
with
10 additions
and
0 deletions
README.rst
+
10
−
0
View file @
2c717320
...
@@ -45,6 +45,7 @@ with a focus on raw multi-channel video. It shares part of the interface of a :o
...
@@ -45,6 +45,7 @@ with a focus on raw multi-channel video. It shares part of the interface of a :o
instance the propertises :obj:`ndim` and :obj:`shape`, but with a name on top
instance the propertises :obj:`ndim` and :obj:`shape`, but with a name on top
.. code-block:: python
.. code-block:: python
from bob.io.stream import Stream
from bob.io.stream import Stream
color = Stream("color")
color = Stream("color")
...
@@ -56,6 +57,7 @@ A :obj:`Stream` object is created in an 'indefinite' state, characterised by a :
...
@@ -56,6 +57,7 @@ A :obj:`Stream` object is created in an 'indefinite' state, characterised by a :
Such a newly created can be made to point to a dataset stored in a properly formated HDF5 file
Such a newly created can be made to point to a dataset stored in a properly formated HDF5 file
.. code-block:: python
.. code-block:: python
from bob.io.stream import StreamFile
from bob.io.stream import StreamFile
f = StreamFile("data.h5")
f = StreamFile("data.h5")
...
@@ -69,6 +71,7 @@ Which is the 'definite' state where the objet points towards a data source, this
...
@@ -69,6 +71,7 @@ Which is the 'definite' state where the objet points towards a data source, this
A last possible state for such an object is a 'streaming' state where
A last possible state for such an object is a 'streaming' state where
.. code-block:: python
.. code-block:: python
color.source = streaming_source
color.source = streaming_source
print(color.ndim) # -> 4
print(color.ndim) # -> 4
...
@@ -79,6 +82,7 @@ object, the first dimension of a stream :obj:`Stream` is always a time direction
...
@@ -79,6 +82,7 @@ object, the first dimension of a stream :obj:`Stream` is always a time direction
our stream to a definite state
our stream to a definite state
.. code-block:: python
.. code-block:: python
color.source = f
color.source = f
frame = color[0]
frame = color[0]
...
@@ -91,6 +95,7 @@ Similarly to a numpy array of more than one dimension, subscripting on the first
...
@@ -91,6 +95,7 @@ Similarly to a numpy array of more than one dimension, subscripting on the first
the first index however is not an integer but a range (a pythonic :obj:`slice` formally)
the first index however is not an integer but a range (a pythonic :obj:`slice` formally)
.. code-block:: python
.. code-block:: python
what = color[3:13, :, 100:200, 300:400]
what = color[3:13, :, 100:200, 300:400]
print(what.ndim) # -> 4
print(what.ndim) # -> 4
...
@@ -102,6 +107,7 @@ the data in the object it subscripts. It should be noted that no data is transfe
...
@@ -102,6 +107,7 @@ the data in the object it subscripts. It should be noted that no data is transfe
is a only node in a data processing chain, with a parent and a child
is a only node in a data processing chain, with a parent and a child
.. code-block:: python
.. code-block:: python
print(color.parent == f) # -> True
print(color.parent == f) # -> True
print(color.child == what) # -> True
print(color.child == what) # -> True
...
@@ -109,12 +115,14 @@ This processing chain can be further extended by adding 'filters' after the chil
...
@@ -109,12 +115,14 @@ This processing chain can be further extended by adding 'filters' after the chil
implemented by the :obj:`stream` object
implemented by the :obj:`stream` object
.. code-block:: python
.. code-block:: python
norm = what.normalise() # -> <class 'StreamNormalise'>
norm = what.normalise() # -> <class 'StreamNormalise'>
real = norm.as_type('float') # -> <class 'StreamAsType'>
real = norm.as_type('float') # -> <class 'StreamAsType'>
A list of filters is returned by the :obj:`get_available_filters()` method of the :obj:`Stream` class.
A list of filters is returned by the :obj:`get_available_filters()` method of the :obj:`Stream` class.
.. code-block:: python
.. code-block:: python
# StreamFile("file.h5")
# StreamFile("file.h5")
# -> Stream("color")
# -> Stream("color")
# -> StreamView(index=(slice(3,13), slice(None), slice(100,200), slice(300,400)))
# -> StreamView(index=(slice(3,13), slice(None), slice(100,200), slice(300,400)))
...
@@ -127,6 +135,7 @@ In the following example, the data goes down the chain on the first line, on the
...
@@ -127,6 +135,7 @@ In the following example, the data goes down the chain on the first line, on the
('real') is returned.
('real') is returned.
.. code-block:: python
.. code-block:: python
data = real[0]
data = real[0]
data = real[0]
data = real[0]
...
@@ -134,6 +143,7 @@ This buffering avoids useless computation in more complex pipelines. An alternat
...
@@ -134,6 +143,7 @@ This buffering avoids useless computation in more complex pipelines. An alternat
the :obj:`load` method that also allows loading several frames at the same time
the :obj:`load` method that also allows loading several frames at the same time
.. code-block:: python
.. code-block:: python
data0, *meta0 = real.load(0)
data0, *meta0 = real.load(0)
data1, *meta1 = real.load(slice(3,13,2))
data1, *meta1 = real.load(slice(3,13,2))
...
...
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