Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
0e5299bb
Commit
0e5299bb
authored
Feb 05, 2018
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[imgaug] check xrange==yrange only when using ratio (fix #628)
parent
fe049874
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
tensorpack/dataflow/imgaug/misc.py
tensorpack/dataflow/imgaug/misc.py
+4
-2
No files found.
tensorpack/dataflow/imgaug/misc.py
View file @
0e5299bb
...
@@ -121,15 +121,17 @@ class RandomResize(TransformAugmentorBase):
...
@@ -121,15 +121,17 @@ class RandomResize(TransformAugmentorBase):
"""
"""
super
(
RandomResize
,
self
)
.
__init__
()
super
(
RandomResize
,
self
)
.
__init__
()
assert
aspect_ratio_thres
>=
0
assert
aspect_ratio_thres
>=
0
if
aspect_ratio_thres
==
0
:
assert
xrange
==
yrange
self
.
_init
(
locals
())
self
.
_init
(
locals
())
def
is_float
(
tp
):
def
is_float
(
tp
):
return
isinstance
(
tp
[
0
],
float
)
or
isinstance
(
tp
[
1
],
float
)
return
isinstance
(
tp
[
0
],
float
)
or
isinstance
(
tp
[
1
],
float
)
assert
is_float
(
xrange
)
==
is_float
(
yrange
),
"xrange and yrange has different type!"
assert
is_float
(
xrange
)
==
is_float
(
yrange
),
"xrange and yrange has different type!"
self
.
_is_scale
=
is_float
(
xrange
)
self
.
_is_scale
=
is_float
(
xrange
)
if
self
.
_is_scale
and
aspect_ratio_thres
==
0
:
assert
xrange
==
yrange
def
_get_augment_params
(
self
,
img
):
def
_get_augment_params
(
self
,
img
):
cnt
=
0
cnt
=
0
h
,
w
=
img
.
shape
[:
2
]
h
,
w
=
img
.
shape
[:
2
]
...
...
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