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.learn.tensorflow
Commits
e5a29aa5
Commit
e5a29aa5
authored
May 02, 2019
by
Amir MOHAMMADI
Browse files
Improve patch extractor
parent
30dd85ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
bob/learn/tensorflow/dataset/__init__.py
View file @
e5a29aa5
...
...
@@ -395,7 +395,18 @@ def all_patches(image, label, key, size):
key:
"""
blocks
,
n_blocks
=
blocks_tensorflow
(
image
,
size
)
# duplicate label and key as n_blocks
label
=
tf_repeat
(
label
,
[
n_blocks
])
key
=
tf_repeat
(
key
,
[
n_blocks
])
def
repeats
(
shape
):
r
=
shape
.
as_list
()
for
i
in
range
(
len
(
r
)):
if
i
==
0
:
r
[
i
]
=
n_blocks
else
:
r
[
i
]
=
1
return
r
label
=
tf_repeat
(
label
,
repeats
(
label
.
shape
))
key
=
tf_repeat
(
key
,
repeats
(
key
.
shape
))
return
blocks
,
label
,
key
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