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
70ae1916
"git@developer.sourcefind.cn:OpenDAS/torch-scatter.git" did not exist on "fdb9300d51591b64b26f8b18b636ab61b420e98b"
Commit
70ae1916
authored
Sep 21, 2021
by
Vishnu Banna
Browse files
datapipeline update
parent
e01e3c4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
official/vision/beta/projects/yolo/ops/preprocessing_ops.py
official/vision/beta/projects/yolo/ops/preprocessing_ops.py
+2
-0
No files found.
official/vision/beta/projects/yolo/ops/preprocessing_ops.py
View file @
70ae1916
...
@@ -320,6 +320,7 @@ def resize_and_jitter_image(image,
...
@@ -320,6 +320,7 @@ def resize_and_jitter_image(image,
"""WIP"""
"""WIP"""
def
intersection
(
a
,
b
):
def
intersection
(
a
,
b
):
"""Find the intersection of 2 crop boxes."""
minx
=
tf
.
maximum
(
a
[
0
],
b
[
0
])
minx
=
tf
.
maximum
(
a
[
0
],
b
[
0
])
miny
=
tf
.
maximum
(
a
[
1
],
b
[
1
])
miny
=
tf
.
maximum
(
a
[
1
],
b
[
1
])
maxx
=
tf
.
minimum
(
a
[
2
],
b
[
2
])
maxx
=
tf
.
minimum
(
a
[
2
],
b
[
2
])
...
@@ -327,6 +328,7 @@ def resize_and_jitter_image(image,
...
@@ -327,6 +328,7 @@ def resize_and_jitter_image(image,
return
tf
.
convert_to_tensor
([
minx
,
miny
,
maxx
,
maxy
])
return
tf
.
convert_to_tensor
([
minx
,
miny
,
maxx
,
maxy
])
def
cast
(
values
,
dtype
):
def
cast
(
values
,
dtype
):
"""Cast a list of items to a givne data type to reduce lines of code"""
return
[
tf
.
cast
(
value
,
dtype
)
for
value
in
values
]
return
[
tf
.
cast
(
value
,
dtype
)
for
value
in
values
]
if
jitter
>
0.5
or
jitter
<
0
:
if
jitter
>
0.5
or
jitter
<
0
:
...
...
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