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
0aa87984
Commit
0aa87984
authored
Aug 13, 2020
by
Kaushik Shivakumar
Browse files
context R-CNN bugfix and documentation fix
parent
88253ce5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
research/object_detection/meta_architectures/context_rcnn_lib_tf2.py
...ject_detection/meta_architectures/context_rcnn_lib_tf2.py
+5
-4
No files found.
research/object_detection/meta_architectures/context_rcnn_lib_tf2.py
View file @
0aa87984
...
...
@@ -35,14 +35,15 @@ class ContextProjection(tf.keras.layers.Layer):
self
.
projection
=
tf
.
keras
.
layers
.
Dense
(
units
=
projection_dimension
,
activation
=
tf
.
nn
.
relu6
,
use_bias
=
True
)
self
.
projection_dimension
=
projection_dimension
super
(
ContextProjection
,
self
).
__init__
(
**
kwargs
)
def
build
(
self
,
input_shape
):
self
.
batch_norm
.
build
(
input_shape
)
self
.
projection
.
build
(
input_shape
)
self
.
batch_norm
.
build
(
input_shape
[:
1
]
+
[
self
.
projection_dimension
])
def
call
(
self
,
input_features
,
is_training
=
False
):
return
self
.
projection
(
self
.
batch_norm
(
input_features
,
is_training
)
)
return
self
.
batch_norm
(
self
.
projection
(
input_features
)
,
is_training
)
class
AttentionBlock
(
tf
.
keras
.
layers
.
Layer
):
...
...
@@ -92,8 +93,8 @@ class AttentionBlock(tf.keras.layers.Layer):
"""Handles a call by performing attention.
Args:
box_features: A float Tensor of shape [batch_size, input_size,
num_input_features].
box_features: A float Tensor of shape [batch_size, input_size,
height,
width,
num_input_features].
context_features: A float Tensor of shape [batch_size, context_size,
num_context_features].
valid_context_size: A int32 Tensor of shape [batch_size].
...
...
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