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
12f78b94
Commit
12f78b94
authored
Aug 17, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support int in add_moving_summary.
parent
c6a07ecd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
1 deletion
+7
-1
tensorpack/dataflow/image.py
tensorpack/dataflow/image.py
+4
-0
tensorpack/dataflow/imgaug/noname.py
tensorpack/dataflow/imgaug/noname.py
+1
-1
tensorpack/tfutils/summary.py
tensorpack/tfutils/summary.py
+2
-0
No files found.
tensorpack/dataflow/image.py
View file @
12f78b94
...
...
@@ -94,6 +94,7 @@ class AugmentImageComponent(MapDataComponent):
class
AugmentImageCoordinates
(
MapData
):
"""
Apply image augmentors on an image and a list of coordinates.
Coordinates must be a Nx2 floating point array, each row is (x, y).
"""
def
__init__
(
self
,
ds
,
augmentors
,
img_index
=
0
,
coords_index
=
1
,
copy
=
True
):
"""
...
...
@@ -116,6 +117,9 @@ class AugmentImageCoordinates(MapData):
def
func
(
dp
):
try
:
img
,
coords
=
dp
[
img_index
],
dp
[
coords_index
]
assert
coords
.
ndim
==
2
,
coords
.
ndim
assert
coords
.
shape
[
1
]
==
2
,
coords
.
shape
assert
np
.
issubdtype
(
coords
.
dtype
,
np
.
float
),
coords
.
dtype
if
copy
:
img
,
coords
=
copy_mod
.
deepcopy
((
img
,
coords
))
img
,
prms
=
self
.
augs
.
_augment_return_params
(
img
)
...
...
tensorpack/dataflow/imgaug/noname.py
View file @
12f78b94
...
...
@@ -30,7 +30,7 @@ class Flip(ImageAugmentor):
elif
vert
:
self
.
code
=
0
else
:
raise
ValueError
(
"A
re you kidding?
"
)
raise
ValueError
(
"A
t least one of horiz or vert has to be True!
"
)
self
.
prob
=
prob
self
.
_init
()
...
...
tensorpack/tfutils/summary.py
View file @
12f78b94
...
...
@@ -197,6 +197,8 @@ def add_moving_summary(*args, **kwargs):
for
c
in
v
:
name
=
re
.
sub
(
'tower[0-9]+/'
,
''
,
c
.
op
.
name
)
with
G
.
colocate_with
(
c
),
tf
.
name_scope
(
None
):
if
not
c
.
dtype
.
is_floating
:
c
=
tf
.
cast
(
c
,
tf
.
float32
)
# assign_moving_average creates variables with op names, therefore clear ns first.
with
_enter_vs_reuse_ns
(
'EMA'
)
as
vs
:
ema_var
=
tf
.
get_variable
(
name
,
shape
=
c
.
shape
,
dtype
=
c
.
dtype
,
...
...
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