INNER CODE UNIT · Python
empty_images
google/break-a-scene · ptp_utils.py:57
empty_images = np.ones(images[0].shape, dtype=np.uint8) * 255
images = [image.astype(np.uint8) for image in images] + [empty_images] * num_empty
num_items = len(images)
h, w, c = images[0].shape
offset = int(h * offset_ratio)
num_cols = num_items // num_rows
image_ = (
np.ones(
(
h * num_rows + offset * (num_rows - 1),
w * num_cols + offset * (num_cols - 1),
3,
),
dtype=np.uint8,
)
* 255
)