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
fd6d34a7
Commit
fd6d34a7
authored
Aug 01, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix random range in GoogleNetRandomCropAndResize
parent
0a141662
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
tensorpack/dataflow/imgaug/crop.py
tensorpack/dataflow/imgaug/crop.py
+6
-6
No files found.
tensorpack/dataflow/imgaug/crop.py
View file @
fd6d34a7
...
@@ -122,13 +122,13 @@ class GoogleNetRandomCropAndResize(ImageAugmentor):
...
@@ -122,13 +122,13 @@ class GoogleNetRandomCropAndResize(ImageAugmentor):
if
self
.
rng
.
uniform
()
<
0.5
:
if
self
.
rng
.
uniform
()
<
0.5
:
ww
,
hh
=
hh
,
ww
ww
,
hh
=
hh
,
ww
if
hh
<=
h
and
ww
<=
w
:
if
hh
<=
h
and
ww
<=
w
:
x1
=
0
if
w
==
ww
else
self
.
rng
.
randint
(
0
,
w
-
ww
)
x1
=
self
.
rng
.
randint
(
0
,
w
-
ww
+
1
)
y1
=
0
if
h
==
hh
else
self
.
rng
.
randint
(
0
,
h
-
hh
)
y1
=
self
.
rng
.
randint
(
0
,
h
-
hh
+
1
)
return
TransformList
([
return
TransformList
([
CropTransform
(
y1
,
x1
,
hh
,
ww
),
CropTransform
(
y1
,
x1
,
hh
,
ww
),
ResizeTransform
(
hh
,
ww
,
self
.
target_shape
,
self
.
target_shape
,
interp
=
self
.
interp
)
ResizeTransform
(
hh
,
ww
,
self
.
target_shape
,
self
.
target_shape
,
interp
=
self
.
interp
)
])
])
tfm1
=
ResizeShortestEdge
(
self
.
target_shape
,
interp
=
self
.
interp
)
.
get_transform
(
img
)
resize
=
ResizeShortestEdge
(
self
.
target_shape
,
interp
=
self
.
interp
)
.
get_transform
(
img
)
out_shape
=
(
tfm1
.
new_h
,
tfm1
.
new_w
)
out_shape
=
(
resize
.
new_h
,
resize
.
new_w
)
tfm2
=
CenterCrop
(
self
.
target_shape
)
.
get_transform
(
ImagePlaceholder
(
shape
=
out_shape
))
crop
=
CenterCrop
(
self
.
target_shape
)
.
get_transform
(
ImagePlaceholder
(
shape
=
out_shape
))
return
TransformList
([
tfm1
,
tfm2
])
return
TransformList
([
resize
,
crop
])
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