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
ModelZoo
ResNet50_tensorflow
Commits
8124922d
Commit
8124922d
authored
Jun 12, 2021
by
Gunho Park
Browse files
Internal change
parent
06000e73
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
official/vision/beta/projects/basnet/modeling/basnet_decoder.py
...al/vision/beta/projects/basnet/modeling/basnet_decoder.py
+7
-4
official/vision/beta/projects/basnet/modeling/basnet_model.py
...cial/vision/beta/projects/basnet/modeling/basnet_model.py
+4
-1
No files found.
official/vision/beta/projects/basnet/modeling/basnet_decoder.py
View file @
8124922d
...
@@ -102,14 +102,17 @@ class BASNet_Decoder(tf.keras.Model):
...
@@ -102,14 +102,17 @@ class BASNet_Decoder(tf.keras.Model):
# Get input feature pyramid from backbone.
# Get input feature pyramid from backbone.
inputs
=
self
.
_build_input_pyramid
(
input_specs
)
inputs
=
self
.
_build_input_pyramid
(
input_specs
)
levels
=
sorted
(
inputs
.
keys
(),
reverse
=
True
)
sup
=
{}
sup
=
{}
for
i
,
spec
in
enumerate
(
BASNET_DECODER_SPECS
):
for
i
,
spec
in
enumerate
(
BASNET_DECODER_SPECS
):
if
i
==
0
:
if
i
==
0
:
x
=
inputs
[
'5'
]
# Bridge input
#x = inputs['5'] # Bridge input
x
=
inputs
[
levels
[
0
]]
# Bridge input
# str(levels[-1]) ??
else
:
else
:
x
=
tf
.
keras
.
layers
.
Concatenate
(
axis
=-
1
)([
x
,
inputs
[
str
(
6
-
i
)
]])
x
=
tf
.
keras
.
layers
.
Concatenate
(
axis
=-
1
)([
x
,
inputs
[
levels
[
i
-
1
]
]])
for
j
in
range
(
3
):
for
j
in
range
(
3
):
x
=
nn_blocks
.
ConvBlock
(
x
=
nn_blocks
.
ConvBlock
(
...
@@ -141,7 +144,7 @@ class BASNet_Decoder(tf.keras.Model):
...
@@ -141,7 +144,7 @@ class BASNet_Decoder(tf.keras.Model):
output
=
tf
.
keras
.
layers
.
Activation
(
output
=
tf
.
keras
.
layers
.
Activation
(
activation
=
'sigmoid'
activation
=
'sigmoid'
)(
output
)
)(
output
)
sup
[
str
(
i
+
1
)]
=
output
sup
[
str
(
i
)]
=
output
if
i
!=
0
:
if
i
!=
0
:
x
=
tf
.
keras
.
layers
.
UpSampling2D
(
x
=
tf
.
keras
.
layers
.
UpSampling2D
(
size
=
2
,
size
=
2
,
...
@@ -150,7 +153,7 @@ class BASNet_Decoder(tf.keras.Model):
...
@@ -150,7 +153,7 @@ class BASNet_Decoder(tf.keras.Model):
self
.
_output_specs
=
{
self
.
_output_specs
=
{
str
(
order
):
sup
[
str
(
order
)].
get_shape
()
str
(
order
):
sup
[
str
(
order
)].
get_shape
()
for
order
in
range
(
1
,
7
)
for
order
in
range
(
0
,
len
(
BASNET_DECODER_SPECS
)
)
}
}
super
(
BASNet_Decoder
,
self
).
__init__
(
inputs
=
inputs
,
outputs
=
sup
,
**
kwargs
)
super
(
BASNet_Decoder
,
self
).
__init__
(
inputs
=
inputs
,
outputs
=
sup
,
**
kwargs
)
...
...
official/vision/beta/projects/basnet/modeling/basnet_model.py
View file @
8124922d
...
@@ -56,8 +56,11 @@ class BASNetModel(tf.keras.Model):
...
@@ -56,8 +56,11 @@ class BASNetModel(tf.keras.Model):
if
self
.
decoder
:
if
self
.
decoder
:
features
=
self
.
decoder
(
features
)
features
=
self
.
decoder
(
features
)
levels
=
sorted
(
features
.
keys
())
new_key
=
str
(
len
(
levels
))
if
self
.
refinement
:
if
self
.
refinement
:
features
[
'ref'
]
=
self
.
refinement
(
features
[
'7'
])
features
[
new_key
]
=
self
.
refinement
(
features
[
levels
[
-
1
]
])
return
features
return
features
...
...
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