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
4fa66545
Commit
4fa66545
authored
Aug 23, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix Shift & Rotation (fix #394)
parent
e891b9e7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
docs/Makefile
docs/Makefile
+1
-0
tensorpack/dataflow/imgaug/geometry.py
tensorpack/dataflow/imgaug/geometry.py
+6
-2
No files found.
docs/Makefile
View file @
4fa66545
...
@@ -16,6 +16,7 @@ help:
...
@@ -16,6 +16,7 @@ help:
docset
:
html
docset
:
html
doc2dash
-d
./
-n
$(SPHINXPROJ)
--enable-js
--force
$(BUILDDIR)
/html/
-I
tutorial/index.html
doc2dash
-d
./
-n
$(SPHINXPROJ)
--enable-js
--force
$(BUILDDIR)
/html/
-I
tutorial/index.html
tar
czvf tensorpack.docset.tgz tensorpack.docset
# Catch-all target: route all unknown targets to Sphinx using the new
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
...
...
tensorpack/dataflow/imgaug/geometry.py
View file @
4fa66545
...
@@ -36,7 +36,9 @@ class Shift(TransformAugmentorBase):
...
@@ -36,7 +36,9 @@ class Shift(TransformAugmentorBase):
dy
=
np
.
round
(
self
.
_rand_range
(
-
max_dy
,
max_dy
))
dy
=
np
.
round
(
self
.
_rand_range
(
-
max_dy
,
max_dy
))
mat
=
np
.
array
([[
1
,
0
,
dx
],
[
0
,
1
,
dy
]],
dtype
=
'float32'
)
mat
=
np
.
array
([[
1
,
0
,
dx
],
[
0
,
1
,
dy
]],
dtype
=
'float32'
)
return
WarpAffineTransform
(
mat
,
img
.
shape
[
1
::
-
1
],
self
.
border
,
self
.
border_value
)
return
WarpAffineTransform
(
mat
,
img
.
shape
[
1
::
-
1
],
borderMode
=
self
.
border
,
borderValue
=
self
.
border_value
)
class
Rotation
(
TransformAugmentorBase
):
class
Rotation
(
TransformAugmentorBase
):
...
@@ -80,7 +82,9 @@ class Rotation(TransformAugmentorBase):
...
@@ -80,7 +82,9 @@ class Rotation(TransformAugmentorBase):
assert np.all(arr == orig)
assert np.all(arr == orig)
"""
"""
mat
=
cv2
.
getRotationMatrix2D
(
tuple
(
center
-
0.5
),
deg
,
1
)
mat
=
cv2
.
getRotationMatrix2D
(
tuple
(
center
-
0.5
),
deg
,
1
)
return
WarpAffineTransform
(
mat
,
img
.
shape
[
1
::
-
1
],
self
.
border
,
self
.
border_value
)
return
WarpAffineTransform
(
mat
,
img
.
shape
[
1
::
-
1
],
interp
=
self
.
interp
,
borderMode
=
self
.
border
,
borderValue
=
self
.
border_value
)
class
RotationAndCropValid
(
ImageAugmentor
):
class
RotationAndCropValid
(
ImageAugmentor
):
...
...
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