Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Tom Rink
python
Commits
cafa8d94
Commit
cafa8d94
authored
2 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
8d2a4482
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/deeplearning/unet.py
+11
-11
11 additions, 11 deletions
modules/deeplearning/unet.py
with
11 additions
and
11 deletions
modules/deeplearning/unet.py
+
11
−
11
View file @
cafa8d94
...
...
@@ -286,7 +286,7 @@ class UNET:
def
get_in_mem_data_batch
(
self
,
idxs
,
is_training
):
if
is_training
:
train_data
=
[]
label
_data
=
[]
train_
label
=
[]
for
k
in
idxs
:
f
=
self
.
train_data_files
[
k
]
nda
=
np
.
load
(
f
)
...
...
@@ -294,35 +294,35 @@ class UNET:
f
=
self
.
train_label_files
[
k
]
nda
=
np
.
load
(
f
)
label
_data
.
append
(
nda
)
train_
label
.
append
(
nda
)
data
=
np
.
concatenate
(
train_data
)
data
=
np
.
expand_dims
(
data
,
axis
=
3
)
label
=
np
.
concatenate
(
label
_data
)
label
=
np
.
concatenate
(
train_
label
)
label
=
np
.
expand_dims
(
label
,
axis
=
3
)
else
:
t
rain
_data
=
[]
label
_data
=
[]
t
est
_data
=
[]
test_
label
=
[]
for
k
in
idxs
:
f
=
self
.
test_data_files
[
k
]
nda
=
np
.
load
(
f
)
t
rain
_data
.
append
(
nda
)
t
est
_data
.
append
(
nda
)
f
=
self
.
test_label_files
[
k
]
nda
=
np
.
load
(
f
)
label
_data
.
append
(
nda
)
test_
label
.
append
(
nda
)
data
=
np
.
concatenate
(
t
rain
_data
)
data
=
np
.
concatenate
(
t
est
_data
)
data
=
np
.
expand_dims
(
data
,
axis
=
3
)
label
=
np
.
concatenate
(
label
_data
)
label
=
np
.
concatenate
(
test_
label
)
label
=
np
.
expand_dims
(
label
,
axis
=
3
)
data
=
data
.
astype
(
np
.
float32
)
label
=
label
.
astype
(
np
.
float32
)
normalize
(
data
,
'
M15
'
,
mean_std_dct
)
normalize
(
label
,
'
M15
'
,
mean_std_dct
)
data
=
normalize
(
data
,
'
M15
'
,
mean_std_dct
)
label
=
normalize
(
label
,
'
M15
'
,
mean_std_dct
)
if
is_training
and
DO_AUGMENT
:
data_ud
=
np
.
flip
(
data
,
axis
=
1
)
...
...
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