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
13e2a3e3
You need to sign in or sign up before continuing.
Commit
13e2a3e3
authored
Jun 21, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
augment with func
parent
caa93135
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
tensorpack/dataflow/imgaug/base.py
tensorpack/dataflow/imgaug/base.py
+11
-1
No files found.
tensorpack/dataflow/imgaug/base.py
View file @
13e2a3e3
...
@@ -6,7 +6,7 @@ from abc import abstractmethod, ABCMeta
...
@@ -6,7 +6,7 @@ from abc import abstractmethod, ABCMeta
from
...utils
import
get_rng
from
...utils
import
get_rng
from
six.moves
import
zip
from
six.moves
import
zip
__all__
=
[
'ImageAugmentor'
,
'AugmentorList'
]
__all__
=
[
'ImageAugmentor'
,
'AugmentorList'
,
'AugmentWithFunc'
]
class
ImageAugmentor
(
object
):
class
ImageAugmentor
(
object
):
""" Base class for an image augmentor"""
""" Base class for an image augmentor"""
...
@@ -63,6 +63,14 @@ class ImageAugmentor(object):
...
@@ -63,6 +63,14 @@ class ImageAugmentor(object):
size
=
[]
size
=
[]
return
low
+
self
.
rng
.
rand
(
*
size
)
*
(
high
-
low
)
return
low
+
self
.
rng
.
rand
(
*
size
)
*
(
high
-
low
)
class
AugmentWithFunc
(
ImageAugmentor
):
""" func: takes an image and return an image"""
def
__init__
(
self
,
func
):
self
.
func
=
func
def
_augment
(
self
,
img
,
_
):
return
self
.
func
(
img
)
class
AugmentorList
(
ImageAugmentor
):
class
AugmentorList
(
ImageAugmentor
):
"""
"""
Augment by a list of augmentors
Augment by a list of augmentors
...
@@ -98,3 +106,5 @@ class AugmentorList(ImageAugmentor):
...
@@ -98,3 +106,5 @@ class AugmentorList(ImageAugmentor):
""" Will reset state of each augmentor """
""" Will reset state of each augmentor """
for
a
in
self
.
augs
:
for
a
in
self
.
augs
:
a
.
reset_state
()
a
.
reset_state
()
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