INNER CODE UNIT · Python
text_y
google/break-a-scene · ptp_utils.py:37
text_x, text_y = (w - textsize[0]) // 2, h + offset - textsize[1] // 2
cv2.putText(img, text, (text_x, text_y), font, 1, text_color, 2)
return img
def view_images(
images: Union[np.ndarray, List],
num_rows: int = 1,
offset_ratio: float = 0.02,
display_image: bool = True,
) -> Image.Image:
"""Displays a list of images in a grid."""
if type(images) is list:
num_empty = len(images) % num_rows
elif images.ndim == 4:
num_empty = images.shape[0] % num_rows
else:
images = [images]