Skip to content
Snippets Groups Projects
Unverified Commit 1d374383 authored by Oleksandr's avatar Oleksandr Committed by GitHub
Browse files

Made Tensorboard evaluation visualization work for other sensors than RGB (#251)

* Made Tensorboard evaluation visualization work for other sensors than RGB
* Added missing dependency
parent eb2d7746
No related branches found
No related tags found
No related merge requests found
......@@ -164,18 +164,26 @@ def observations_to_image(observation: Dict, info: Dict) -> np.ndarray:
Returns:
generated image of a single frame.
"""
observation_size = observation["rgb"].shape[0]
egocentric_view = observation["rgb"][:, :, :3]
# draw collision
if "collisions" in info and info["collisions"]["is_collision"]:
egocentric_view = draw_collision(egocentric_view)
egocentric_view = []
if "rgb" in observation:
observation_size = observation["rgb"].shape[0]
egocentric_view.append(observation["rgb"][:, :, :3])
# draw depth map if observation has depth info
if "depth" in observation:
observation_size = observation["depth"].shape[0]
depth_map = (observation["depth"].squeeze() * 255).astype(np.uint8)
depth_map = np.stack([depth_map for _ in range(3)], axis=2)
egocentric_view.appned(depth_map)
assert (
len(egocentric_view) > 0
), "Expected at least one visual sensor enabled."
egocentric_view = np.concatenate(egocentric_view, axis=1)
egocentric_view = np.concatenate((egocentric_view, depth_map), axis=1)
# draw collision
if "collisions" in info and info["collisions"]["is_collision"]:
egocentric_view = draw_collision(egocentric_view)
frame = egocentric_view
......
moviepy>=1.0.1
torch==1.1.0
# full tensorflow required for tensorboard video support
tensorflow==1.13.1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment