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
91fa4ecf
Commit
91fa4ecf
authored
9 months ago
by
Daniel CARRON
Committed by
André Anjos
8 months ago
Browse files
Options
Downloads
Patches
Plain Diff
[segmentation.models] Fix DRIU config
parent
f31df6a2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!46
Create common library
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/mednet/libs/segmentation/config/models/driu.py
+8
-6
8 additions, 6 deletions
src/mednet/libs/segmentation/config/models/driu.py
src/mednet/libs/segmentation/models/driu.py
+10
-1
10 additions, 1 deletion
src/mednet/libs/segmentation/models/driu.py
with
18 additions
and
7 deletions
src/mednet/libs/segmentation/config/models/driu.py
+
8
−
6
View file @
91fa4ecf
# SPDX-FileCopyrightText: Copyright © 2024 Idiap Research Institute <contact@idiap.ch>
# SPDX-FileCopyrightText: Copyright © 2024 Idiap Research Institute <contact@idiap.ch>
#
#
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-License-Identifier: GPL-3.0-or-later
"""
Little W-Net for image segmentation.
The Little W-Net architecture contains roughly around 70k parameters and
"""
DRIU Network for Vessel Segmentation.
closely matches (or outperforms) other more complex techniques.
Reference: [GALDRAN-2020]_
Deep Retinal Image Understanding (DRIU), a unified framework of retinal image
analysis that provides both retinal vessel and optic disc segmentation using
deep Convolutional Neural Networks (CNNs).
Reference: [MANINIS-2016]_
"""
"""
from
mednet.libs.segmentation.engine.adabound
import
AdaBound
from
mednet.libs.segmentation.engine.adabound
import
AdaBound
from
mednet.libs.segmentation.models.driu
import
DRIU
from
mednet.libs.segmentation.models.losses
import
SoftJaccardBCELogitsLoss
from
mednet.libs.segmentation.models.losses
import
SoftJaccardBCELogitsLoss
from
mednet.libs.segmentation.models.unet
import
Unet
lr
=
0.001
lr
=
0.001
alpha
=
0.7
alpha
=
0.7
...
@@ -23,7 +25,7 @@ gamma = 1e-3
...
@@ -23,7 +25,7 @@ gamma = 1e-3
eps
=
1e-8
eps
=
1e-8
amsbound
=
False
amsbound
=
False
model
=
Unet
(
model
=
DRIU
(
loss_type
=
SoftJaccardBCELogitsLoss
,
loss_type
=
SoftJaccardBCELogitsLoss
,
loss_arguments
=
dict
(
alpha
=
alpha
),
loss_arguments
=
dict
(
alpha
=
alpha
),
optimizer_type
=
AdaBound
,
optimizer_type
=
AdaBound
,
...
...
This diff is collapsed.
Click to expand it.
src/mednet/libs/segmentation/models/driu.py
+
10
−
1
View file @
91fa4ecf
...
@@ -10,6 +10,7 @@ import torch
...
@@ -10,6 +10,7 @@ import torch
import
torch.nn
import
torch.nn
from
mednet.libs.common.data.typing
import
TransformSequence
from
mednet.libs.common.data.typing
import
TransformSequence
from
mednet.libs.common.models.model
import
Model
from
mednet.libs.common.models.model
import
Model
from
mednet.libs.common.models.transforms
import
ResizeMaxSide
,
SquareCenterPad
from
.backbones.vgg
import
vgg16_for_segmentation
from
.backbones.vgg
import
vgg16_for_segmentation
from
.losses
import
SoftJaccardBCELogitsLoss
from
.losses
import
SoftJaccardBCELogitsLoss
...
@@ -96,6 +97,8 @@ class DRIU(Model):
...
@@ -96,6 +97,8 @@ class DRIU(Model):
Number of outputs (classes) for this model.
Number of outputs (classes) for this model.
pretrained
pretrained
If True, will use VGG16 pretrained weights.
If True, will use VGG16 pretrained weights.
crop_size
The size of the image after center cropping.
Returns
Returns
-------
-------
...
@@ -112,6 +115,7 @@ class DRIU(Model):
...
@@ -112,6 +115,7 @@ class DRIU(Model):
augmentation_transforms
:
TransformSequence
=
[],
augmentation_transforms
:
TransformSequence
=
[],
num_classes
:
int
=
1
,
num_classes
:
int
=
1
,
pretrained
:
bool
=
False
,
pretrained
:
bool
=
False
,
crop_size
:
int
=
1024
,
):
):
super
().
__init__
(
super
().
__init__
(
loss_type
,
loss_type
,
...
@@ -122,7 +126,12 @@ class DRIU(Model):
...
@@ -122,7 +126,12 @@ class DRIU(Model):
num_classes
,
num_classes
,
)
)
self
.
name
=
"
driu
"
self
.
name
=
"
driu
"
self
.
model_transforms
:
TransformSequence
=
[]
resize_transform
=
ResizeMaxSide
(
crop_size
)
self
.
model_transforms
=
[
resize_transform
,
SquareCenterPad
(),
]
self
.
pretrained
=
pretrained
self
.
pretrained
=
pretrained
self
.
backbone
=
vgg16_for_segmentation
(
self
.
backbone
=
vgg16_for_segmentation
(
...
...
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