Skip to content

Commit

Permalink
fix #459 (#461)
Browse files Browse the repository at this point in the history
  • Loading branch information
lanpa committed Jun 27, 2019
1 parent 96b86b7 commit e0b8b67
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions tensorboardX/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,15 +487,15 @@ def mesh(tag, vertices, colors, faces, config_dict=None):
import json
summaries = []
tensors = [
(make_np(vertices), 1),
(make_np(faces), 2),
(make_np(colors), 3)
(vertices, 1),
(faces, 2),
(colors, 3)
]

for tensor, content_type in tensors:
if tensor is None:
continue
summaries.append(
_get_tensor_summary(tag, tensor, content_type, json.dumps(config_dict, sort_keys=True)))
_get_tensor_summary(tag, make_np(tensor), content_type, json.dumps(config_dict, sort_keys=True)))

return Summary(value=summaries)
5 changes: 3 additions & 2 deletions tensorboardX/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,9 +969,10 @@ def add_mesh(self, tag, vertices, colors=None, faces=None, config_dict=None, glo
seconds after epoch of event
Shape:
vertices: :math:`(B, N, 3)`. (batch, number_of_vertices, channels)
vertices: :math:`(B, N, 3)`. (batch, number_of_vertices, channels). If you see nothing on
tensorboard, try normalizing the values to [-1, 1].
colors: :math:`(B, N, 3)`. The values should lie in [0, 255] for type `uint8` or [0, 1] for type `float`.
colors: :math:`(B, N, 3)`. The values should lie in [0, 255].
faces: :math:`(B, N, 3)`. The values should lie in [0, number_of_vertices] for type `uint8`.
Expand Down

0 comments on commit e0b8b67

Please sign in to comment.