Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mednet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package 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
medai
software
mednet
Commits
446eebf9
Commit
446eebf9
authored
1 year ago
by
Daniel CARRON
Browse files
Options
Downloads
Patches
Plain Diff
[test] Add missing datasets in padchest loading test
parent
91f61866
No related branches found
No related tags found
2 merge requests
!18
Update tests
,
!16
Make square centre-padding a model transform
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_padchest.py
+29
-17
29 additions, 17 deletions
tests/test_padchest.py
with
29 additions
and
17 deletions
tests/test_padchest.py
+
29
−
17
View file @
446eebf9
...
@@ -40,18 +40,18 @@ def test_protocol_consistency(
...
@@ -40,18 +40,18 @@ def test_protocol_consistency(
)
)
# TODO: Improve this to include other protocols
@pytest.mark.skip_if_rc_var_not_set
(
"
datadir.padchest
"
)
@pytest.mark.skip_if_rc_var_not_set
(
"
datadir.padchest
"
)
@pytest.mark.parametrize
(
@pytest.mark.parametrize
(
"
dataset
"
,
"
dataset
"
,
[
[
"
train
"
,
"
test
"
],
"
train
"
,
],
)
)
@pytest.mark.parametrize
(
@pytest.mark.parametrize
(
"
name
"
,
"
name
"
,
[
[
"
idiap
"
,
"
idiap
"
,
"
tb_idiap
"
,
"
no_tb_idiap
"
,
"
cardiomegaly_idiap
"
,
],
],
)
)
def
test_loading
(
database_checkers
,
name
:
str
,
dataset
:
str
):
def
test_loading
(
database_checkers
,
name
:
str
,
dataset
:
str
):
...
@@ -62,20 +62,32 @@ def test_loading(database_checkers, name: str, dataset: str):
...
@@ -62,20 +62,32 @@ def test_loading(database_checkers, name: str, dataset: str):
datamodule
.
model_transforms
=
[]
# should be done before setup()
datamodule
.
model_transforms
=
[]
# should be done before setup()
datamodule
.
setup
(
"
predict
"
)
# sets up all datasets
datamodule
.
setup
(
"
predict
"
)
# sets up all datasets
loader
=
datamodule
.
predict_dataloader
()[
dataset
]
if
dataset
in
datamodule
.
predict_dataloader
():
# Not all datamodules have a test set
try
:
loader
=
datamodule
.
predict_dataloader
()[
dataset
]
except
KeyError
as
e
:
if
str
(
e
)
==
"
test
"
and
name
in
[
"
idiap
"
,
"
no_tb_idiap
"
,
"
cardiomegaly_idiap
"
,
]:
assert
True
else
:
assert
False
limit
=
3
# limit load checking
limit
=
3
# limit load checking
for
batch
in
loader
:
for
batch
in
loader
:
if
limit
==
0
:
if
limit
==
0
:
break
break
database_checkers
.
check_loaded_batch
(
database_checkers
.
check_loaded_batch
(
batch
,
batch
,
batch_size
=
1
,
batch_size
=
1
,
color_planes
=
1
,
color_planes
=
1
,
prefixes
=
(
""
,),
prefixes
=
(
""
,),
possible_labels
=
(
0
,
1
),
possible_labels
=
(
0
,
1
),
)
)
limit
-=
1
limit
-=
1
# TODO: check size 1024x1024
# TODO: check size 1024x1024
...
...
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