Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
bob.learn.tensorflow
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
10
Issues
10
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bob
bob.learn.tensorflow
Commits
e154fba1
Commit
e154fba1
authored
Feb 10, 2020
by
Amir MOHAMMADI
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the biogenerator when the multiple samples is False
parent
a67951e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
bob/learn/tensorflow/dataset/bio.py
bob/learn/tensorflow/dataset/bio.py
+9
-4
No files found.
bob/learn/tensorflow/dataset/bio.py
View file @
e154fba1
...
...
@@ -56,15 +56,20 @@ class BioGenerator(Generator):
self
.
load_data
=
load_data
self
.
biofile_to_label
=
biofile_to_label
def
reader
(
f
):
def
_
reader
(
f
):
label
=
int
(
self
.
biofile_to_label
(
f
))
data
=
self
.
load_data
(
self
.
database
,
f
)
key
=
str
(
f
.
make_path
(
""
,
""
)).
encode
(
"utf-8"
)
if
self
.
multiple_samples
:
return
data
,
label
,
key
if
multiple_samples
:
def
reader
(
f
):
data
,
label
,
key
=
_reader
(
f
)
for
d
in
data
:
yield
(
d
,
label
,
key
)
else
:
yield
(
data
,
label
,
key
)
else
:
def
reader
(
f
):
return
_reader
(
f
)
super
(
BioGenerator
,
self
).
__init__
(
biofiles
,
reader
,
multiple_samples
=
multiple_samples
,
**
kwargs
...
...
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