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
5e87dfef
Commit
5e87dfef
authored
Sep 08, 2022
by
A. Unique TensorFlower
Browse files
Internal change
PiperOrigin-RevId: 473036323
parent
886e188a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
official/vision/ops/spatial_transform_ops.py
official/vision/ops/spatial_transform_ops.py
+4
-2
No files found.
official/vision/ops/spatial_transform_ops.py
View file @
5e87dfef
...
@@ -14,6 +14,8 @@
...
@@ -14,6 +14,8 @@
"""Spatial transform ops."""
"""Spatial transform ops."""
from
typing
import
Dict
,
Tuple
import
tensorflow
as
tf
import
tensorflow
as
tf
_EPSILON
=
1e-8
_EPSILON
=
1e-8
...
@@ -70,7 +72,7 @@ def _feature_bilinear_interpolation(features: tf.Tensor, kernel_y: tf.Tensor,
...
@@ -70,7 +72,7 @@ def _feature_bilinear_interpolation(features: tf.Tensor, kernel_y: tf.Tensor,
def
_compute_grid_positions
(
def
_compute_grid_positions
(
boxes
:
tf
.
Tensor
,
boundaries
:
tf
.
Tensor
,
output_size
:
int
,
boxes
:
tf
.
Tensor
,
boundaries
:
tf
.
Tensor
,
output_size
:
int
,
sample_offset
:
float
)
->
t
uple
[
tf
.
Tensor
,
tf
.
Tensor
,
tf
.
Tensor
,
tf
.
Tensor
]:
sample_offset
:
float
)
->
T
uple
[
tf
.
Tensor
,
tf
.
Tensor
,
tf
.
Tensor
,
tf
.
Tensor
]:
"""Computes the grid position w.r.t.
"""Computes the grid position w.r.t.
the corresponding feature map.
the corresponding feature map.
...
@@ -140,7 +142,7 @@ def _compute_grid_positions(
...
@@ -140,7 +142,7 @@ def _compute_grid_positions(
return
kernel_y
,
kernel_x
,
box_gridy0y1
,
box_gridx0x1
return
kernel_y
,
kernel_x
,
box_gridy0y1
,
box_gridx0x1
def
multilevel_crop_and_resize
(
features
:
d
ict
[
str
,
tf
.
Tensor
],
def
multilevel_crop_and_resize
(
features
:
D
ict
[
str
,
tf
.
Tensor
],
boxes
:
tf
.
Tensor
,
boxes
:
tf
.
Tensor
,
output_size
:
int
=
7
,
output_size
:
int
=
7
,
sample_offset
:
float
=
0.5
)
->
tf
.
Tensor
:
sample_offset
:
float
=
0.5
)
->
tf
.
Tensor
:
...
...
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