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
6593f5c1
Commit
6593f5c1
authored
8 months ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[tests.test_transforms] Remove unused test
parent
3172ede6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!46
Create common library
Pipeline
#89351
failed
8 months ago
Stage: qa
Stage: doc
Stage: dist
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_transforms.py
+1
-27
1 addition, 27 deletions
tests/test_transforms.py
with
1 addition
and
27 deletions
tests/test_transforms.py
+
1
−
27
View file @
6593f5c1
...
...
@@ -8,10 +8,7 @@ import PIL.Image
import
torch
import
torchvision.transforms.functional
as
F
# noqa: N812
from
mednet.libs.common.data.augmentations
import
ElasticDeformation
from
mednet.libs.common.models.transforms
import
(
crop_image_to_mask
,
resize_max_side
,
)
from
mednet.libs.common.models.transforms
import
crop_image_to_mask
def
test_crop_mask
():
...
...
@@ -29,29 +26,6 @@ def test_crop_mask():
assert
torch
.
all
(
cropped_tensor
.
eq
(
tensor
[
slice_
]))
def
test_resize_max_size
():
original_size
=
(
3
,
50
,
100
)
original_ratio
=
original_size
[
1
]
/
original_size
[
2
]
new_max_side
=
120
tensor
=
torch
.
rand
(
original_size
)
resized_tensor
=
resize_max_side
(
tensor
,
new_max_side
)
resized_ratio
=
resized_tensor
.
shape
[
1
]
/
resized_tensor
.
shape
[
2
]
assert
original_ratio
==
resized_ratio
transposed_tensor
=
tensor
.
transpose
(
1
,
2
)
resized_transposed_tensor
=
resize_max_side
(
transposed_tensor
,
new_max_side
)
inv_ratio
=
1
/
(
resized_transposed_tensor
.
shape
[
1
]
/
resized_transposed_tensor
.
shape
[
2
]
)
assert
original_ratio
==
inv_ratio
assert
resized_tensor
.
shape
[
1
]
==
resized_transposed_tensor
.
shape
[
2
]
assert
resized_tensor
.
shape
[
2
]
==
resized_transposed_tensor
.
shape
[
1
]
def
test_elastic_deformation
(
datadir
):
# Get a raw sample without deformation
data_file
=
str
(
datadir
/
"
raw_without_elastic_deformation.png
"
)
...
...
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