Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
4614cf93
Unverified
Commit
4614cf93
authored
Oct 07, 2021
by
vfdev
Committed by
GitHub
Oct 07, 2021
Browse files
Use FX feature extractor for segm model (#4563)
* Use FX feature extractor for segm model * Removed use_fe option
parent
2256b495
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
torchvision/models/segmentation/segmentation.py
torchvision/models/segmentation/segmentation.py
+3
-3
No files found.
torchvision/models/segmentation/segmentation.py
View file @
4614cf93
...
@@ -5,7 +5,7 @@ from torch import nn
...
@@ -5,7 +5,7 @@ from torch import nn
from
..._internally_replaced_utils
import
load_state_dict_from_url
from
..._internally_replaced_utils
import
load_state_dict_from_url
from
..
import
mobilenetv3
from
..
import
mobilenetv3
from
..
import
resnet
from
..
import
resnet
from
..
_utils
import
IntermediateLayerGette
r
from
..
feature_extraction
import
create_feature_extracto
r
from
.deeplabv3
import
DeepLabHead
,
DeepLabV3
from
.deeplabv3
import
DeepLabHead
,
DeepLabV3
from
.fcn
import
FCN
,
FCNHead
from
.fcn
import
FCN
,
FCNHead
from
.lraspp
import
LRASPP
from
.lraspp
import
LRASPP
...
@@ -60,7 +60,7 @@ def _segm_model(
...
@@ -60,7 +60,7 @@ def _segm_model(
return_layers
=
{
out_layer
:
"out"
}
return_layers
=
{
out_layer
:
"out"
}
if
aux
:
if
aux
:
return_layers
[
aux_layer
]
=
"aux"
return_layers
[
aux_layer
]
=
"aux"
backbone
=
IntermediateLayerGetter
(
backbone
,
return_layers
=
return_layers
)
backbone
=
create_feature_extractor
(
backbone
,
return_layers
)
aux_classifier
=
None
aux_classifier
=
None
if
aux
:
if
aux
:
...
@@ -116,7 +116,7 @@ def _segm_lraspp_mobilenetv3(backbone_name: str, num_classes: int, pretrained_ba
...
@@ -116,7 +116,7 @@ def _segm_lraspp_mobilenetv3(backbone_name: str, num_classes: int, pretrained_ba
low_channels
=
backbone
[
low_pos
].
out_channels
low_channels
=
backbone
[
low_pos
].
out_channels
high_channels
=
backbone
[
high_pos
].
out_channels
high_channels
=
backbone
[
high_pos
].
out_channels
backbone
=
IntermediateLayerGetter
(
backbone
,
return_layers
=
{
str
(
low_pos
):
"low"
,
str
(
high_pos
):
"high"
})
backbone
=
create_feature_extractor
(
backbone
,
{
str
(
low_pos
):
"low"
,
str
(
high_pos
):
"high"
})
model
=
LRASPP
(
backbone
,
low_channels
,
high_channels
,
num_classes
)
model
=
LRASPP
(
backbone
,
low_channels
,
high_channels
,
num_classes
)
return
model
return
model
...
...
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