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
7956bcdc
Commit
7956bcdc
authored
May 02, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix in create image summary
parent
e35fae5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
tensorpack/tfutils/summary.py
tensorpack/tfutils/summary.py
+3
-2
No files found.
tensorpack/tfutils/summary.py
View file @
7956bcdc
...
...
@@ -35,7 +35,7 @@ def create_image_summary(name, val):
"""
Args:
name(str):
val(np.ndarray): 4D tensor of NHWC
val(np.ndarray): 4D tensor of NHWC
. assume RGB if C==3.
Returns:
tf.Summary:
...
...
@@ -45,7 +45,8 @@ def create_image_summary(name, val):
s
=
tf
.
Summary
()
for
k
in
range
(
n
):
tag
=
name
if
n
==
1
else
'{}/{}'
.
format
(
name
,
k
)
ret
,
buf
=
cv2
.
imencode
(
'.png'
,
val
[
k
])
# imencode assumes BGR
ret
,
buf
=
cv2
.
imencode
(
'.png'
,
val
[
k
,
:,
:,
::
-
1
])
assert
ret
,
"imencode failed!"
img
=
tf
.
Summary
.
Image
()
...
...
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