habitat.utils.visualizations.utils module

Functions

def append_text_underneath_image(image: numpy.ndarray, text: str)
Appends text underneath an image of size (height, width, channels).
def draw_collision(view: numpy.ndarray, alpha: float = 0.4) -> numpy.ndarray
def images_to_video(images: typing.List[numpy.ndarray], output_dir: str, video_name: str, fps: int = 10, quality: typing.Optional[float] = 5, verbose: bool = True, **kwargs)
def observations_to_image(observation: typing.Dict, info: typing.Dict) -> numpy.ndarray
Generate image of single frame from observation and info returned from a single environment step().
def overlay_frame(frame, info, additional = None)
Renders text from the info dictionary to the frame image.
def overlay_text_to_image(image: numpy.ndarray, text: typing.List[str], font_size: float = 0.5)
Overlays lines of text on top of an image.
def paste_overlapping_image(background: numpy.ndarray, foreground: numpy.ndarray, location: typing.Tuple[int, int], mask: typing.Optional[numpy.ndarray] = None)
def tile_images(render_obs_images: typing.List[numpy.ndarray]) -> numpy.ndarray
Tiles multiple images of non-equal size to a single image. Images are tiled into columns making the returned image wider than tall.

Function documentation

def habitat.utils.visualizations.utils.append_text_underneath_image(image: numpy.ndarray, text: str)

Appends text underneath an image of size (height, width, channels).

The returned image has white text on a black background. Uses textwrap to split long text into multiple lines.

param image:
The image to appends text underneath.
param text:
The string to display.
return:
A new image with text appended underneath.

def habitat.utils.visualizations.utils.observations_to_image(observation: typing.Dict, info: typing.Dict) -> numpy.ndarray

Generate image of single frame from observation and info returned from a single environment step().

Args:
observation: observation returned from an environment step(). info: info returned from an environment step().
Returns:
generated image of a single frame.

def habitat.utils.visualizations.utils.overlay_text_to_image(image: numpy.ndarray, text: typing.List[str], font_size: float = 0.5)

Overlays lines of text on top of an image.

First this will render to the left-hand side of the image, once that column is full, it will render to the right hand-side of the image.

param image:
The image to put text on top.
param text:
The list of strings which will be rendered (separated by new lines).
param font_size:
Font size.
return:
A new image with text overlaid on top.