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
48646927
Commit
48646927
authored
8 months ago
by
Daniel CARRON
Browse files
Options
Downloads
Patches
Plain Diff
[tests] Remove outdated tests
parent
87bd101d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!46
Create common library
Pipeline
#89597
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/classify/test_saliencymap_interpretability.py
+0
-65
0 additions, 65 deletions
tests/classify/test_saliencymap_interpretability.py
with
0 additions
and
65 deletions
tests/classify/test_saliencymap_interpretability.py
+
0
−
65
View file @
48646927
...
...
@@ -9,76 +9,11 @@ from mednet.classify.config.data.tbx11k.datamodule import (
from
mednet.classify.engine.saliency.interpretability
import
(
_compute_avg_saliency_focus
,
_compute_binary_mask
,
_compute_max_iou_and_ioda
,
_compute_proportional_energy
,
_compute_simultaneous_iou_and_ioda
,
_process_sample
,
)
def
test_compute_max_iou_and_ioda
():
detected_box
=
BoundingBox
(
-
1
,
10
,
10
,
100
,
100
)
gt_box_dict
=
BoundingBox
(
1
,
50
,
50
,
50
,
50
)
gt_box_dict2
=
BoundingBox
(
1
,
20
,
20
,
60
,
60
)
gt_boxes
=
BoundingBoxes
([
gt_box_dict
,
gt_box_dict2
])
iou
,
ioda
=
_compute_max_iou_and_ioda
(
detected_box
,
gt_boxes
)
expected_iou
=
0.36
expected_ioda
=
0.36
assert
iou
==
expected_iou
assert
ioda
==
expected_ioda
def
test_compute_max_iou_and_ioda_zero_detected_area
():
detected_box
=
BoundingBox
(
-
1
,
10
,
10
,
0
,
0
)
gt_box_dict
=
BoundingBox
(
1
,
50
,
50
,
50
,
50
)
gt_boxes
=
BoundingBoxes
([
gt_box_dict
])
iou
,
ioda
=
_compute_max_iou_and_ioda
(
detected_box
,
gt_boxes
)
# Should be zero as the detected box has no area
assert
iou
==
0
assert
ioda
==
0
def
test_compute_max_iou_and_ioda_zero_gt_area
():
detected_box
=
BoundingBox
(
-
1
,
10
,
10
,
100
,
100
)
gt_box_dict
=
BoundingBox
(
1
,
50
,
50
,
0
,
0
)
gt_boxes
=
BoundingBoxes
([
gt_box_dict
])
iou
,
ioda
=
_compute_max_iou_and_ioda
(
detected_box
,
gt_boxes
)
# Should be zero as there is no ground truth box
assert
iou
==
0
assert
ioda
==
0
def
test_compute_max_iou_and_ioda_zero_intersection
():
detected_box
=
BoundingBox
(
-
1
,
10
,
10
,
100
,
100
)
gt_box_dict
=
BoundingBox
(
1
,
0
,
0
,
5
,
5
)
gt_boxes
=
BoundingBoxes
([
gt_box_dict
])
iou
,
ioda
=
_compute_max_iou_and_ioda
(
detected_box
,
gt_boxes
)
assert
iou
==
0
assert
ioda
==
0
def
test_compute_simultaneous_iou_and_ioda
():
detected_box
=
BoundingBox
(
-
1
,
10
,
10
,
100
,
100
)
gt_box_dict
=
BoundingBox
(
1
,
50
,
50
,
50
,
50
)
gt_box_dict2
=
BoundingBox
(
1
,
70
,
70
,
30
,
30
)
gt_boxes
=
BoundingBoxes
([
gt_box_dict
,
gt_box_dict2
])
iou
,
ioda
=
_compute_simultaneous_iou_and_ioda
(
detected_box
,
gt_boxes
)
assert
iou
==
0.34
assert
ioda
==
0.34
def
test_compute_avg_saliency_focus
():
grayscale_cams
=
np
.
ones
((
200
,
200
))
grayscale_cams2
=
np
.
full
((
512
,
512
),
0.5
)
...
...
This diff is collapsed.
Click to expand it.
Daniel CARRON
@dcarron
mentioned in issue
#50 (closed)
·
8 months ago
mentioned in issue
#50 (closed)
mentioned in issue #50
Toggle commit list
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