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
5dfe788d
Commit
5dfe788d
authored
May 27, 2021
by
anivegesana
Browse files
Merge branch 'linting2' into linting
parents
725b8c8c
9dd1c2c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
official/vision/beta/projects/yolo/modeling/decoders/yolo_decoder.py
...sion/beta/projects/yolo/modeling/decoders/yolo_decoder.py
+6
-6
official/vision/beta/projects/yolo/modeling/layers/nn_blocks.py
...al/vision/beta/projects/yolo/modeling/layers/nn_blocks.py
+3
-3
No files found.
official/vision/beta/projects/yolo/modeling/decoders/yolo_decoder.py
View file @
5dfe788d
...
@@ -331,13 +331,13 @@ class YoloPAN(tf.keras.layers.Layer):
...
@@ -331,13 +331,13 @@ class YoloPAN(tf.keras.layers.Layer):
Args:
Args:
minimum_depth: `int` depth of the smallest branch of the FPN.
minimum_depth: `int` depth of the smallest branch of the FPN.
inputs: `dict[str, tf.InputSpec]` of the shape of input args as a
dictionary of
inputs: `dict[str, tf.InputSpec]` of the shape of input args as a
lists.
dictionary of
lists.
Returns:
Returns:
The unscaled depths of the FPN branches.
The unscaled depths of the FPN branches.
"""
"""
depths
=
[]
depths
=
[]
if
len
(
inputs
.
keys
())
>
3
or
self
.
_fpn_filter_scale
>
1
:
if
len
(
inputs
.
keys
())
>
3
or
self
.
_fpn_filter_scale
>
1
:
for
i
in
range
(
self
.
_min_level
,
self
.
_max_level
+
1
):
for
i
in
range
(
self
.
_min_level
,
self
.
_max_level
+
1
):
...
@@ -386,8 +386,8 @@ class YoloDecoder(tf.keras.Model):
...
@@ -386,8 +386,8 @@ class YoloDecoder(tf.keras.Model):
kernel_regularizer
=
None
,
kernel_regularizer
=
None
,
bias_regularizer
=
None
,
bias_regularizer
=
None
,
**
kwargs
):
**
kwargs
):
"""Yolo Decoder initialization function. A unified model that ties all
decoder
"""Yolo Decoder initialization function. A unified model that ties all
components into a conditionally build YOLO decder.
decoder
components into a conditionally build YOLO dec
o
der.
Args:
Args:
input_specs: `dict[str, tf.InputSpec]`: input specs of each of the inputs
input_specs: `dict[str, tf.InputSpec]`: input specs of each of the inputs
...
@@ -409,7 +409,7 @@ class YoloDecoder(tf.keras.Model):
...
@@ -409,7 +409,7 @@ class YoloDecoder(tf.keras.Model):
zero.
zero.
kernel_initializer: kernel_initializer for convolutional layers.
kernel_initializer: kernel_initializer for convolutional layers.
kernel_regularizer: tf.keras.regularizers.Regularizer object for Conv2D.
kernel_regularizer: tf.keras.regularizers.Regularizer object for Conv2D.
bias_regularizer: tf.keras.regularizers.Regularizer object for Conv2
d
.
bias_regularizer: tf.keras.regularizers.Regularizer object for Conv2
D
.
**kwargs: keyword arguments to be passed.
**kwargs: keyword arguments to be passed.
"""
"""
...
...
official/vision/beta/projects/yolo/modeling/layers/nn_blocks.py
View file @
5dfe788d
...
@@ -1152,8 +1152,8 @@ class SAM(tf.keras.layers.Layer):
...
@@ -1152,8 +1152,8 @@ class SAM(tf.keras.layers.Layer):
def
call
(
self
,
inputs
,
training
=
None
):
def
call
(
self
,
inputs
,
training
=
None
):
if
self
.
_use_pooling
:
if
self
.
_use_pooling
:
depth_max
=
tf
.
reduce_max
(
inputs
,
axis
=-
1
,
keep
_
dims
=
True
)
depth_max
=
tf
.
reduce_max
(
inputs
,
axis
=-
1
,
keepdims
=
True
)
depth_avg
=
tf
.
reduce_mean
(
inputs
,
axis
=-
1
,
keep
_
dims
=
True
)
depth_avg
=
tf
.
reduce_mean
(
inputs
,
axis
=-
1
,
keepdims
=
True
)
input_maps
=
tf
.
concat
([
depth_avg
,
depth_max
],
axis
=-
1
)
input_maps
=
tf
.
concat
([
depth_avg
,
depth_max
],
axis
=-
1
)
else
:
else
:
input_maps
=
inputs
input_maps
=
inputs
...
@@ -1545,7 +1545,7 @@ class DarkRouteProcess(tf.keras.layers.Layer):
...
@@ -1545,7 +1545,7 @@ class DarkRouteProcess(tf.keras.layers.Layer):
elif
layer
==
'spp'
:
elif
layer
==
'spp'
:
self
.
layers
.
append
(
self
.
_spp
(
self
.
_filters
,
dark_conv_args
))
self
.
layers
.
append
(
self
.
_spp
(
self
.
_filters
,
dark_conv_args
))
elif
layer
==
'sam'
:
elif
layer
==
'sam'
:
self
.
layers
.
append
(
self
.
_sam
(
-
1
,
_args
))
self
.
layers
.
append
(
self
.
_sam
(
-
1
,
dark_conv
_args
))
self
.
_lim
=
len
(
self
.
layers
)
self
.
_lim
=
len
(
self
.
layers
)
super
().
build
(
input_shape
)
super
().
build
(
input_shape
)
...
...
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