def log_inv_depth(key, prefix, batch, i=0): """ Converts an inverse depth map from a batch for logging Parameters ---------- key : str Key from data containing the inverse depth map prefix : str Prefix added to the key for logging batch : dict Dictionary containing the key i : int Batch index from which to get the inverse depth map Returns ------- image : wandb.Image Wandb image ready for logging """ inv_depth = batch[key] if is_dict(batch) else batch return prep_image(prefix, key, viz_inv_depth(inv_depth[i]))
def log_rgb(key, prefix, batch, i=0): """ Converts an RGB image from a batch for logging Parameters ---------- key : str Key from data containing the image prefix : str Prefix added to the key for logging batch : dict Dictionary containing the key i : int Batch index from which to get the image Returns ------- image : wandb.Image Wandb image ready for logging """ rgb = batch[key] if is_dict(batch) else batch return prep_image(prefix, key, rgb[i])