Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
caries_classifier
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sjjsmuel
caries_classifier
Commits
78bac83b
Commit
78bac83b
authored
Jun 05, 2020
by
sjjsmuel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revert to old order for 'cache'
parent
6934c408
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
helpers/DataLoader.py
helpers/DataLoader.py
+4
-4
No files found.
helpers/DataLoader.py
View file @
78bac83b
...
...
@@ -246,7 +246,7 @@ class DataLoader(object):
# Load images
print
(
'Loading images of dataset into memory.'
)
self
.
dataset_1
=
self
.
dataset_1
.
map
(
self
.
decode_img
,
num_parallel_calls
=
self
.
NR_THREADS
)
self
.
dataset_1
=
self
.
dataset_1
.
repeat
(
self
.
dataset_1_repeat_factor
)
self
.
dataset_1
=
self
.
dataset_1
.
cache
().
repeat
(
self
.
dataset_1_repeat_factor
)
if
self
.
AUGMENT
:
for
f
in
self
.
AUGMENTATIONS
:
...
...
@@ -255,16 +255,16 @@ class DataLoader(object):
self
.
dataset_1
=
self
.
dataset_1
.
map
(
lambda
x
,
y
:
clip
(
x
,
y
))
if
self
.
dataset_2
:
self
.
dataset_2
=
self
.
dataset_2
.
map
(
self
.
decode_img
,
num_parallel_calls
=
self
.
NR_THREADS
)
self
.
dataset_2
=
self
.
dataset_2
.
repeat
(
self
.
dataset_2_repeat_factor
)
self
.
dataset_2
=
self
.
dataset_2
.
cache
().
repeat
(
self
.
dataset_2_repeat_factor
)
for
f
in
self
.
AUGMENTATIONS
:
self
.
dataset_2
=
self
.
dataset_2
.
map
(
lambda
x
,
y
:
tf
.
cond
(
tf
.
random
.
uniform
([],
0
,
1
)
>
0.1
,
lambda
:
f
(
x
,
y
,
(
self
.
IMG_WIDTH
,
self
.
IMG_HEIGHT
)),
lambda
:
(
x
,
y
)),
num_parallel_calls
=
self
.
NR_THREADS
)
self
.
dataset_2
=
self
.
dataset_2
.
map
(
lambda
x
,
y
:
clip
(
x
,
y
))
self
.
dataset_1
=
self
.
dataset_1
.
cache
().
shuffle
(
self
.
dataset_1_size
).
batch
(
self
.
batch_size
,
drop_remainder
=
True
).
prefetch
(
tf
.
data
.
experimental
.
AUTOTUNE
)
self
.
dataset_1
=
self
.
dataset_1
.
shuffle
(
self
.
dataset_1_size
).
batch
(
self
.
batch_size
,
drop_remainder
=
True
).
prefetch
(
tf
.
data
.
experimental
.
AUTOTUNE
)
if
self
.
dataset_2
:
self
.
dataset_2
=
self
.
dataset_2
.
cache
().
shuffle
(
self
.
dataset_2_size
).
batch
(
self
.
batch_size
,
drop_remainder
=
True
).
prefetch
(
tf
.
data
.
experimental
.
AUTOTUNE
)
self
.
dataset_2
=
self
.
dataset_2
.
shuffle
(
self
.
dataset_2_size
).
batch
(
self
.
batch_size
,
drop_remainder
=
True
).
prefetch
(
tf
.
data
.
experimental
.
AUTOTUNE
)
return
self
.
dataset_1
,
self
.
dataset_2
else
:
return
self
.
dataset_1
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