Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.io.stream
Commits
f2cdc116
Commit
f2cdc116
authored
Sep 07, 2020
by
Vincent POLLET
Browse files
Fix: correctly handle buffering of filter computations (not relying on parent stream buffered data)
parent
005f889d
Pipeline
#42490
failed with stage
in 4 minutes and 34 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/io/stream/stream.py
View file @
f2cdc116
...
...
@@ -249,7 +249,8 @@ def stream_filter(name):
class
StreamFilter
(
Stream
):
def
__init__
(
self
,
name
,
parent
):
super
().
__init__
(
name
=
name
,
parent
=
parent
)
pass
self
.
__loaded
=
None
self
.
__data
=
None
def
get_frame_indices
(
self
,
index
):
return
super
().
get_frame_indices
(
index
)
...
...
@@ -264,15 +265,13 @@ class StreamFilter(Stream):
# load one or several frames
def
load
(
self
,
index
=
None
):
indices
=
self
.
get_frame_indices
(
index
)
# return buffered data OR load from file OR process data
if
self
.
_Stream__loaded
==
indices
and
self
.
_Stream__data
is
not
None
:
# print('loaded', self.name)
# if data is buffered, do not do processing again !
if
self
.
__loaded
==
indices
and
self
.
__data
is
not
None
:
pass
else
:
self
.
__data
=
self
.
process
(
self
.
parent
.
load
(
indices
),
indices
)
self
.
__loaded
=
indices
# buffer and return data
self
.
__loaded
=
indices
return
self
.
__data
################################################################################
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment