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
2bceb1b7
Commit
2bceb1b7
authored
Oct 21, 2019
by
Yeqing Li
Committed by
A. Unique TensorFlower
Oct 21, 2019
Browse files
Move sptial_transforms to ops folder.
PiperOrigin-RevId: 275940140
parent
bd0d5692
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
official/vision/detection/modeling/architecture/fpn.py
official/vision/detection/modeling/architecture/fpn.py
+2
-2
official/vision/detection/modeling/architecture/heads.py
official/vision/detection/modeling/architecture/heads.py
+4
-4
official/vision/detection/ops/spatial_transform_ops.py
official/vision/detection/ops/spatial_transform_ops.py
+0
-0
No files found.
official/vision/detection/modeling/architecture/fpn.py
View file @
2bceb1b7
...
...
@@ -28,7 +28,7 @@ import tensorflow.compat.v2 as tf
from
tensorflow.python.keras
import
backend
from
official.vision.detection.modeling.architecture
import
nn_ops
from
official.vision.detection.
util
s
import
spatial_transform
from
official.vision.detection.
op
s
import
spatial_transform
_ops
class
Fpn
(
object
):
...
...
@@ -91,7 +91,7 @@ class Fpn(object):
# Adds top-down path.
feats
=
{
backbone_max_level
:
feats_lateral
[
backbone_max_level
]}
for
level
in
range
(
backbone_max_level
-
1
,
self
.
_min_level
-
1
,
-
1
):
feats
[
level
]
=
spatial_transform
.
nearest_upsampling
(
feats
[
level
]
=
spatial_transform
_ops
.
nearest_upsampling
(
feats
[
level
+
1
],
2
)
+
feats_lateral
[
level
]
# Adds post-hoc 3x3 convolution kernel.
...
...
official/vision/detection/modeling/architecture/heads.py
View file @
2bceb1b7
...
...
@@ -25,7 +25,7 @@ import numpy as np
import
tensorflow.compat.v2
as
tf
from
tensorflow.python.keras
import
backend
from
official.vision.detection.modeling.architecture
import
nn_ops
from
official.vision.detection.
util
s
import
spatial_transform
from
official.vision.detection.
op
s
import
spatial_transform
_ops
class
RpnHead
(
object
):
...
...
@@ -542,7 +542,7 @@ class ShapemaskPriorHead(object):
level_outer_boxes
=
outer_boxes
/
tf
.
pow
(
2.
,
tf
.
expand_dims
(
detection_prior_levels
,
-
1
))
detection_prior_levels
=
tf
.
cast
(
detection_prior_levels
,
tf
.
int32
)
uniform_priors
=
spatial_transform
.
crop_mask_in_target_box
(
uniform_priors
=
spatial_transform
_ops
.
crop_mask_in_target_box
(
tf
.
ones
([
batch_size
,
self
.
_num_of_instances
,
self
.
_mask_crop_size
,
self
.
_mask_crop_size
...
...
@@ -550,7 +550,7 @@ class ShapemaskPriorHead(object):
# Prepare crop features.
multi_level_features
=
self
.
_get_multilevel_features
(
fpn_features
)
crop_features
=
spatial_transform
.
single_level_feature_crop
(
crop_features
=
spatial_transform
_ops
.
single_level_feature_crop
(
multi_level_features
,
level_outer_boxes
,
detection_prior_levels
,
self
.
_min_mask_level
,
self
.
_mask_crop_size
)
...
...
@@ -562,7 +562,7 @@ class ShapemaskPriorHead(object):
batch_size
,
self
.
_num_of_instances
,
self
.
_mask_crop_size
,
self
.
_mask_crop_size
])
predicted_detection_priors
=
spatial_transform
.
crop_mask_in_target_box
(
predicted_detection_priors
=
spatial_transform
_ops
.
crop_mask_in_target_box
(
fused_shape_priors
,
boxes
,
outer_boxes
,
self
.
_mask_crop_size
)
predicted_detection_priors
=
tf
.
reshape
(
predicted_detection_priors
,
...
...
official/vision/detection/
util
s/spatial_transform.py
→
official/vision/detection/
op
s/spatial_transform
_ops
.py
View file @
2bceb1b7
File moved
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