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
c2902cfb
Commit
c2902cfb
authored
Nov 12, 2019
by
Pengchong Jin
Committed by
A. Unique TensorFlower
Nov 12, 2019
Browse files
Add the sample offset option in mask interpolation.
PiperOrigin-RevId: 280031944
parent
a76237da
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
official/vision/detection/ops/spatial_transform_ops.py
official/vision/detection/ops/spatial_transform_ops.py
+8
-2
No files found.
official/vision/detection/ops/spatial_transform_ops.py
View file @
c2902cfb
...
...
@@ -351,7 +351,11 @@ def single_level_feature_crop(features, level_boxes, detection_prior_levels,
return
crop_features
def
crop_mask_in_target_box
(
masks
,
boxes
,
target_boxes
,
output_size
):
def
crop_mask_in_target_box
(
masks
,
boxes
,
target_boxes
,
output_size
,
sample_offset
=
0
):
"""Crop masks in target boxes.
Args:
...
...
@@ -364,6 +368,8 @@ def crop_mask_in_target_box(masks, boxes, target_boxes, output_size):
coordinates. A box is represented by [ymin, xmin, ymax, xmax].
output_size: A scalar to indicate the output crop size. It currently only
supports to output a square shape outputs.
sample_offset: a float number in [0, 1] indicates the subpixel sample offset
from grid point.
Returns:
A 4-D tensor representing feature crop of shape
...
...
@@ -411,7 +417,7 @@ def crop_mask_in_target_box(masks, boxes, target_boxes, output_size):
levels
,
boundaries
,
output_size
,
sample_offset
=
0
)
sample_offset
=
sample_offset
)
cropped_masks
=
tf
.
squeeze
(
cropped_masks
,
axis
=-
1
)
return
cropped_masks
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