Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
grp-bio-it
ai4ia
Commits
08167e64
Commit
08167e64
authored
Jul 28, 2020
by
Constantin Pape
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix wrong print statements
parent
7e7bf87b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
stardist/stardist_impl/train_stardist_2d.py
stardist/stardist_impl/train_stardist_2d.py
+2
-2
stardist/stardist_impl/train_stardist_3d.py
stardist/stardist_impl/train_stardist_3d.py
+3
-3
No files found.
stardist/stardist_impl/train_stardist_2d.py
View file @
08167e64
...
...
@@ -48,7 +48,7 @@ def load_training_data(root, image_folder, labels_folder, ext, multichannel):
train_images
.
sort
()
label_pattern
=
os
.
path
.
join
(
root
,
labels_folder
,
f
'*
{
ext
}
'
)
print
(
"Looking for labels with the pattern"
,
image
_pattern
)
print
(
"Looking for labels with the pattern"
,
label
_pattern
)
train_labels
=
glob
(
label_pattern
)
assert
len
(
train_labels
)
>
0
,
"Did not find any labels"
train_labels
.
sort
()
...
...
@@ -166,7 +166,7 @@ def train_stardist_model(root, model_save_path, image_folder, labels_folder, ext
print
(
"Made train validation split with validation fraction"
,
validation_fraction
,
"resulting in"
)
print
(
len
(
x_train
),
"training images"
)
print
(
len
(
y_train
),
"validation images"
)
print
(
len
(
x_val
),
"validation images"
)
print
(
"Start model training ..."
)
print
(
"You can connect to the tensorboard by typing 'tensorboaed --logdir=.' in the folder where the training runs"
)
...
...
stardist/stardist_impl/train_stardist_3d.py
View file @
08167e64
...
...
@@ -36,7 +36,7 @@ def load_training_data(root, image_folder, labels_folder, ext):
train_images
.
sort
()
label_pattern
=
os
.
path
.
join
(
root
,
labels_folder
,
f
'*
{
ext
}
'
)
print
(
"Looking for labels with the pattern"
,
image
_pattern
)
print
(
"Looking for labels with the pattern"
,
label
_pattern
)
train_labels
=
glob
(
label_pattern
)
assert
len
(
train_labels
)
>
0
,
"Did not find any labels"
train_labels
.
sort
()
...
...
@@ -162,7 +162,7 @@ def train_stardist_model(root, model_save_path, image_folder, labels_folder, ext
print
(
"Made train validation split with validation fraction"
,
validation_fraction
,
"resulting in"
)
print
(
len
(
x_train
),
"training images"
)
print
(
len
(
y_train
),
"validation images"
)
print
(
len
(
x_val
),
"validation images"
)
print
(
"Start model training ..."
)
print
(
"You can connect to the tensorboard by typing 'tensorboaed --logdir=.' in the folder where the training runs"
)
...
...
@@ -188,7 +188,7 @@ def main():
help
=
"The fraction of available data that is used for validation, default: .1"
)
parser
.
add_argument
(
'--patch_size'
,
type
=
int
,
nargs
=
3
,
default
=
[
128
,
128
,
128
],
help
=
"Size of the image patches used to train the network, default: 128, 128, 128"
)
aniso_help
=
"""Anisotropy factor, needs to be passed as json encoded list, e.g.
\"
[.0
5,0.5
,0.5]
\"
.
aniso_help
=
"""Anisotropy factor, needs to be passed as json encoded list, e.g.
\"
[
1
.0
,1.0
,0.5]
\"
.
If not given, will be computed from the dimensions of the input data, default: None"""
parser
.
add_argument
(
'--anisotropy'
,
type
=
str
,
default
=
None
,
help
=
aniso_help
)
...
...
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