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
81bc290f
Commit
81bc290f
authored
Jun 29, 2020
by
syiming
Browse files
Modify scope for multilevel crop and resize function
parent
c63169b2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
13 deletions
+14
-13
research/object_detection/utils/spatial_transform_ops.py
research/object_detection/utils/spatial_transform_ops.py
+14
-13
No files found.
research/object_detection/utils/spatial_transform_ops.py
View file @
81bc290f
...
@@ -444,6 +444,7 @@ def multilevel_native_crop_and_resize(images, boxes, box_levels,
...
@@ -444,6 +444,7 @@ def multilevel_native_crop_and_resize(images, boxes, box_levels,
"""
"""
if
box_levels
is
None
:
if
box_levels
is
None
:
return
native_crop_and_resize
(
images
[
0
],
boxes
,
crop_size
,
scope
)
return
native_crop_and_resize
(
images
[
0
],
boxes
,
crop_size
,
scope
)
with
tf
.
name_scope
(
'MultiLevelNativeCropAndResize'
):
cropped_feature_list
=
[]
cropped_feature_list
=
[]
for
level
,
image
in
enumerate
(
images
):
for
level
,
image
in
enumerate
(
images
):
# For each level, crop the feature according to all boxes
# For each level, crop the feature according to all boxes
...
@@ -510,7 +511,7 @@ def multilevel_matmul_crop_and_resize(images, boxes, box_levels, crop_size,
...
@@ -510,7 +511,7 @@ def multilevel_matmul_crop_and_resize(images, boxes, box_levels, crop_size,
Returns:
Returns:
A 5-D tensor of shape `[batch, num_boxes, crop_height, crop_width, depth]`
A 5-D tensor of shape `[batch, num_boxes, crop_height, crop_width, depth]`
"""
"""
with
tf
.
name_scope
(
scope
,
'MatMulCropAndResize'
):
with
tf
.
name_scope
(
scope
,
'
MultiLevel
MatMulCropAndResize'
):
if
box_levels
is
None
:
if
box_levels
is
None
:
box_levels
=
tf
.
zeros
(
tf
.
shape
(
boxes
)[:
2
],
dtype
=
tf
.
int32
)
box_levels
=
tf
.
zeros
(
tf
.
shape
(
boxes
)[:
2
],
dtype
=
tf
.
int32
)
return
multilevel_roi_align
(
images
,
return
multilevel_roi_align
(
images
,
...
...
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