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
OpenDAS
vision
Commits
79892d37
"integration-tests/vscode:/vscode.git/clone" did not exist on "26cdea5c0c0c4316b8a2ea4b449da8c4aecbc796"
Unverified
Commit
79892d37
authored
Mar 07, 2022
by
Vasilis Vryniotis
Committed by
GitHub
Mar 07, 2022
Browse files
Make ScaleJitter proportional (#5559)
parent
350a3e8e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
references/detection/transforms.py
references/detection/transforms.py
+4
-3
No files found.
references/detection/transforms.py
View file @
79892d37
...
...
@@ -310,9 +310,10 @@ class ScaleJitter(nn.Module):
_
,
orig_height
,
orig_width
=
F
.
get_dimensions
(
image
)
r
=
self
.
scale_range
[
0
]
+
torch
.
rand
(
1
)
*
(
self
.
scale_range
[
1
]
-
self
.
scale_range
[
0
])
new_width
=
int
(
self
.
target_size
[
1
]
*
r
)
new_height
=
int
(
self
.
target_size
[
0
]
*
r
)
scale
=
self
.
scale_range
[
0
]
+
torch
.
rand
(
1
)
*
(
self
.
scale_range
[
1
]
-
self
.
scale_range
[
0
])
r
=
min
(
self
.
target_size
[
1
]
/
orig_height
,
self
.
target_size
[
0
]
/
orig_width
)
*
scale
new_width
=
int
(
orig_width
*
r
)
new_height
=
int
(
orig_height
*
r
)
image
=
F
.
resize
(
image
,
[
new_height
,
new_width
],
interpolation
=
self
.
interpolation
)
...
...
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