mani_skill.utils.visualization#
Submodules#
Classes#
Functions#
|
Display images as an animation in jupyter notebook. |
|
Calls imageio to run FFMPEG on a list of images. For more info on |
|
|
|
|
|
Tile multiple images to a single image comprised of nrows and an appropriate number of columns to fit all the images. |
Package Contents#
- class mani_skill.utils.visualization.ImageRenderer(wait_for_button_press=True)[source]#
-
- _image = None#
- last_event = None#
- pressed_keys#
- wait_for_button_press = True#
- mani_skill.utils.visualization.display_images(images, dpi=100.0, format='html5_video', **kwargs)[source]#
Display images as an animation in jupyter notebook.
- Parameters:
images (list[numpy.ndarray]) – images with equal shape.
dpi – resolution (dots per inch).
format (str) – one of [“html5_video”, “jshtml”]
References
https://gist.github.com/foolishflyfox/e30fd8bfbb6a9cee9b1a1fa6144b209c http://louistiao.me/posts/notebooks/embedding-matplotlib-animations-in-jupyter-as-interactive-javascript-widgets/ https://stackoverflow.com/questions/35532498/animation-in-ipython-notebook/46878531#46878531
- mani_skill.utils.visualization.images_to_video(images, output_dir, video_name, fps=10, quality=5, verbose=True, **kwargs)[source]#
Calls imageio to run FFMPEG on a list of images. For more info on parameters, see https://imageio.readthedocs.io/en/stable/format_ffmpeg.html :param images: The list of images. Images should be HxWx3 in RGB order. :param output_dir: The folder to put the video in. :param video_name: The name for the video. :param fps: Frames per second for the video. Not all values work with FFMPEG,
use at your own risk.
- Parameters:
quality (Optional[float]) – Default is 5. Uses variable bit rate. Highest quality is 10, lowest is 0. Set to None to prevent variable bitrate flags to FFMPEG so you can manually specify them using output_params instead. Specifying a fixed bitrate using ‘bitrate’ disables this parameter.
images (list[mani_skill.utils.structs.types.Array]) –
output_dir (str) –
video_name (str) –
fps (int) –
verbose (bool) –
References
- mani_skill.utils.visualization.put_info_on_image(image, info, extras=None, overlay=True)[source]#
- Parameters:
info (dict[str, float]) –
- mani_skill.utils.visualization.put_text_on_image(image, lines)[source]#
- Parameters:
image (numpy.ndarray) –
lines (list[str]) –
- mani_skill.utils.visualization.tile_images(images, nrows=1)[source]#
Tile multiple images to a single image comprised of nrows and an appropriate number of columns to fit all the images. The images can also be batched (e.g. of shape (B, H, W, C)), but give images must all have the same batch size.
if nrows is 1, images can be of different sizes. If nrows > 1, they must all be the same size.
- Parameters:
images (list[mani_skill.utils.structs.types.Array]) –
- Return type:
mani_skill.utils.structs.types.Array