# \[RLlib\] Visualise custom environment

**URL:** <https://discuss.ray.io/t/rllib-visualise-custom-environment/778>\
**Category:** RLlib\
**Created:** [February 8, 2021, 12:34pm UTC](https://discuss.ray.io/t/rllib-visualise-custom-environment/778 "2021-02-08T12:34:28Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![smorad](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/smorad/32/272_2.png) [@smorad](https://discuss.ray.io/u/smorad)\
**Post date:** [March 5, 2021, 7:35pm UTC](https://discuss.ray.io/t/rllib-visualise-custom-environment/778/16 "2021-03-05T19:35:04Z")

</div>

If your model input is pixel data, this may be of use: [ray/logger.py at 0452a3a435e023eada85f670e70ffef02ceb5943 · ray-project/ray · GitHub](https://github.com/ray-project/ray/blob/0452a3a435e023eada85f670e70ffef02ceb5943/python/ray/tune/logger.py#L212)

It looks like there is tensorboard support for videos in `tune`. Then you could visualize the environment along with the custom data. Using `callbacks` one could do something like:

```auto
from ray.rllib.agents.callbacks import DefaultCallbacks
class TBVideo(DefaultCallbacks):
  def on_train_result(self, *, trainer, result, **kwargs) -> None:
    result['custom_metrics'].update({'my_video': my_model.my_input_images.detach().numpy()})

```

I have not tested this. Perhaps @sven1977 could say if this is a good idea or not.

---

_[View the full topic](https://discuss.ray.io/t/rllib-visualise-custom-environment/778)._
