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
27ea2836
Commit
27ea2836
authored
Apr 21, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc for prefetch. brightnessadd -> brightness
parent
3e876599
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
11 additions
and
7 deletions
+11
-7
examples/ResNet/cifar10_resnet.py
examples/ResNet/cifar10_resnet.py
+1
-1
examples/ResNet/svhn_resnet.py
examples/ResNet/svhn_resnet.py
+1
-1
examples/cifar10_convnet.py
examples/cifar10_convnet.py
+1
-1
examples/svhn_digit_convnet.py
examples/svhn_digit_convnet.py
+1
-1
tensorpack/dataflow/base.py
tensorpack/dataflow/base.py
+4
-1
tensorpack/dataflow/imgaug/imgproc.py
tensorpack/dataflow/imgaug/imgproc.py
+2
-2
tensorpack/dataflow/prefetch.py
tensorpack/dataflow/prefetch.py
+1
-0
No files found.
examples/ResNet/cifar10_resnet.py
View file @
27ea2836
...
@@ -131,7 +131,7 @@ def get_data(train_or_test):
...
@@ -131,7 +131,7 @@ def get_data(train_or_test):
imgaug
.
CenterPaste
((
40
,
40
)),
imgaug
.
CenterPaste
((
40
,
40
)),
imgaug
.
RandomCrop
((
32
,
32
)),
imgaug
.
RandomCrop
((
32
,
32
)),
imgaug
.
Flip
(
horiz
=
True
),
imgaug
.
Flip
(
horiz
=
True
),
#imgaug.Brightness
Add
(20),
#imgaug.Brightness(20),
#imgaug.Contrast((0.6,1.4)),
#imgaug.Contrast((0.6,1.4)),
imgaug
.
MapImage
(
lambda
x
:
x
-
pp_mean
),
imgaug
.
MapImage
(
lambda
x
:
x
-
pp_mean
),
]
]
...
...
examples/ResNet/svhn_resnet.py
View file @
27ea2836
...
@@ -134,7 +134,7 @@ def get_data(train_or_test):
...
@@ -134,7 +134,7 @@ def get_data(train_or_test):
imgaug
.
CenterPaste
((
40
,
40
)),
imgaug
.
CenterPaste
((
40
,
40
)),
imgaug
.
RandomCrop
((
32
,
32
)),
imgaug
.
RandomCrop
((
32
,
32
)),
#imgaug.Flip(horiz=True),
#imgaug.Flip(horiz=True),
imgaug
.
Brightness
Add
(
10
),
imgaug
.
Brightness
(
10
),
imgaug
.
Contrast
((
0.8
,
1.2
)),
imgaug
.
Contrast
((
0.8
,
1.2
)),
imgaug
.
GaussianDeform
(
# this is slow
imgaug
.
GaussianDeform
(
# this is slow
[(
0.2
,
0.2
),
(
0.2
,
0.8
),
(
0.8
,
0.8
),
(
0.8
,
0.2
)],
[(
0.2
,
0.2
),
(
0.2
,
0.8
),
(
0.8
,
0.8
),
(
0.8
,
0.2
)],
...
...
examples/cifar10_convnet.py
View file @
27ea2836
...
@@ -82,7 +82,7 @@ def get_data(train_or_test):
...
@@ -82,7 +82,7 @@ def get_data(train_or_test):
augmentors
=
[
augmentors
=
[
imgaug
.
RandomCrop
((
30
,
30
)),
imgaug
.
RandomCrop
((
30
,
30
)),
imgaug
.
Flip
(
horiz
=
True
),
imgaug
.
Flip
(
horiz
=
True
),
imgaug
.
Brightness
Add
(
63
),
imgaug
.
Brightness
(
63
),
imgaug
.
Contrast
((
0.2
,
1.8
)),
imgaug
.
Contrast
((
0.2
,
1.8
)),
imgaug
.
GaussianDeform
(
imgaug
.
GaussianDeform
(
[(
0.2
,
0.2
),
(
0.2
,
0.8
),
(
0.8
,
0.8
),
(
0.8
,
0.2
)],
[(
0.2
,
0.2
),
(
0.2
,
0.8
),
(
0.8
,
0.8
),
(
0.8
,
0.2
)],
...
...
examples/svhn_digit_convnet.py
View file @
27ea2836
...
@@ -76,7 +76,7 @@ def get_config():
...
@@ -76,7 +76,7 @@ def get_config():
augmentors
=
[
augmentors
=
[
imgaug
.
Resize
((
40
,
40
)),
imgaug
.
Resize
((
40
,
40
)),
imgaug
.
Brightness
Add
(
30
),
imgaug
.
Brightness
(
30
),
imgaug
.
Contrast
((
0.5
,
1.5
)),
imgaug
.
Contrast
((
0.5
,
1.5
)),
imgaug
.
GaussianDeform
(
# this is slow
imgaug
.
GaussianDeform
(
# this is slow
[(
0.2
,
0.2
),
(
0.2
,
0.8
),
(
0.8
,
0.8
),
(
0.8
,
0.2
)],
[(
0.2
,
0.2
),
(
0.2
,
0.8
),
(
0.8
,
0.8
),
(
0.8
,
0.2
)],
...
...
tensorpack/dataflow/base.py
View file @
27ea2836
...
@@ -26,7 +26,10 @@ class DataFlow(object):
...
@@ -26,7 +26,10 @@ class DataFlow(object):
def
reset_state
(
self
):
def
reset_state
(
self
):
"""
"""
Reset state of the dataflow (usually the random seed)
Reset state of the dataflow,
for example, RNG **HAS** to be reset here if used in the DataFlow.
Otherwise it may not work well with prefetching, because different
processes will have the same RNG state.
"""
"""
pass
pass
...
...
tensorpack/dataflow/imgaug/imgproc.py
View file @
27ea2836
...
@@ -5,9 +5,9 @@
...
@@ -5,9 +5,9 @@
from
.base
import
ImageAugmentor
from
.base
import
ImageAugmentor
import
numpy
as
np
import
numpy
as
np
__all__
=
[
'Brightness
Add
'
,
'Contrast'
,
'MeanVarianceNormalize'
]
__all__
=
[
'Brightness'
,
'Contrast'
,
'MeanVarianceNormalize'
]
class
Brightness
Add
(
ImageAugmentor
):
class
Brightness
(
ImageAugmentor
):
"""
"""
Random adjust brightness.
Random adjust brightness.
"""
"""
...
...
tensorpack/dataflow/prefetch.py
View file @
27ea2836
...
@@ -20,6 +20,7 @@ class PrefetchProcess(multiprocessing.Process):
...
@@ -20,6 +20,7 @@ class PrefetchProcess(multiprocessing.Process):
self
.
queue
=
queue
self
.
queue
=
queue
def
run
(
self
):
def
run
(
self
):
# reset RNG of ds so each process will produce different data
self
.
ds
.
reset_state
()
self
.
ds
.
reset_state
()
while
True
:
while
True
:
for
dp
in
self
.
ds
.
get_data
():
for
dp
in
self
.
ds
.
get_data
():
...
...
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