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
740ef06b
Commit
740ef06b
authored
Jul 26, 2020
by
syiming
Browse files
merge
parent
9d6d3cfb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
research/object_detection/meta_architectures/faster_rcnn_meta_arch.py
...ect_detection/meta_architectures/faster_rcnn_meta_arch.py
+8
-3
No files found.
research/object_detection/meta_architectures/faster_rcnn_meta_arch.py
View file @
740ef06b
...
@@ -453,6 +453,7 @@ class FasterRCNNMetaArch(model.DetectionModel):
...
@@ -453,6 +453,7 @@ class FasterRCNNMetaArch(model.DetectionModel):
self
.
_is_training
=
is_training
self
.
_is_training
=
is_training
self
.
_image_resizer_fn
=
image_resizer_fn
self
.
_image_resizer_fn
=
image_resizer_fn
self
.
_resize_shape
=
None
self
.
_resize_masks
=
resize_masks
self
.
_resize_masks
=
resize_masks
self
.
_feature_extractor
=
feature_extractor
self
.
_feature_extractor
=
feature_extractor
if
isinstance
(
feature_extractor
,
FasterRCNNKerasFeatureExtractor
):
if
isinstance
(
feature_extractor
,
FasterRCNNKerasFeatureExtractor
):
...
@@ -687,6 +688,8 @@ class FasterRCNNMetaArch(model.DetectionModel):
...
@@ -687,6 +688,8 @@ class FasterRCNNMetaArch(model.DetectionModel):
true_image_shapes
)
=
shape_utils
.
resize_images_and_return_shapes
(
true_image_shapes
)
=
shape_utils
.
resize_images_and_return_shapes
(
inputs
,
self
.
_image_resizer_fn
)
inputs
,
self
.
_image_resizer_fn
)
self
.
_resize_shape
=
resized_inputs
.
shape
.
as_list
()
return
(
self
.
_feature_extractor
.
preprocess
(
resized_inputs
),
return
(
self
.
_feature_extractor
.
preprocess
(
resized_inputs
),
true_image_shapes
)
true_image_shapes
)
...
@@ -1953,8 +1956,10 @@ class FasterRCNNMetaArch(model.DetectionModel):
...
@@ -1953,8 +1956,10 @@ class FasterRCNNMetaArch(model.DetectionModel):
box_levels
=
None
box_levels
=
None
if
num_levels
!=
1
:
if
num_levels
!=
1
:
# If there are mutiple levels to select, get the box levels
# If there are mutiple levels to select, get the box levels
box_levels
=
ops
.
fpn_feature_levels
(
num_levels
,
num_levels
-
1
,
box_levels
=
ops
.
fpn_feature_levels
(
num_levels
,
num_levels
-
2
,
1.0
/
224
,
proposal_boxes_normalized
)
tf
.
sqrt
(
self
.
_resize_shape
[
1
]
*
self
.
_resize_shape
[
2
]
*
1.0
)
/
224.0
,
proposal_boxes_normalized
)
cropped_regions
=
self
.
_flatten_first_two_dimensions
(
cropped_regions
=
self
.
_flatten_first_two_dimensions
(
self
.
_crop_and_resize_fn
(
self
.
_crop_and_resize_fn
(
features_to_crop
,
proposal_boxes_normalized
,
box_levels
,
features_to_crop
,
proposal_boxes_normalized
,
box_levels
,
...
...
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