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
e22d7d82
Commit
e22d7d82
authored
Jul 25, 2022
by
A. Unique TensorFlower
Browse files
Internal change
PiperOrigin-RevId: 463193774
parent
dab5ff9d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
10 deletions
+3
-10
official/vision/ops/preprocess_ops.py
official/vision/ops/preprocess_ops.py
+3
-10
No files found.
official/vision/ops/preprocess_ops.py
View file @
e22d7d82
...
...
@@ -24,6 +24,9 @@ from official.vision.ops import box_ops
CENTER_CROP_FRACTION
=
0.875
# Alias for convenience. PLEASE use `box_ops.horizontal_flip_boxes` directly.
horizontal_flip_boxes
=
box_ops
.
horizontal_flip_boxes
def
clip_or_pad_to_fixed_size
(
input_tensor
,
size
,
constant_values
=
0
):
"""Pads data to a fixed length at the first dimension.
...
...
@@ -598,16 +601,6 @@ def horizontal_flip_image(image):
return
tf
.
image
.
flip_left_right
(
image
)
def
horizontal_flip_boxes
(
normalized_boxes
):
"""Flips normalized boxes horizontally."""
ymin
,
xmin
,
ymax
,
xmax
=
tf
.
split
(
value
=
normalized_boxes
,
num_or_size_splits
=
4
,
axis
=
1
)
flipped_xmin
=
tf
.
subtract
(
1.0
,
xmax
)
flipped_xmax
=
tf
.
subtract
(
1.0
,
xmin
)
flipped_boxes
=
tf
.
concat
([
ymin
,
flipped_xmin
,
ymax
,
flipped_xmax
],
1
)
return
flipped_boxes
def
horizontal_flip_masks
(
masks
):
"""Flips masks horizontally."""
return
masks
[:,
:,
::
-
1
]
...
...
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