INNER CODE UNIT · Python
num_cols
google/break-a-scene · ptp_utils.py:63
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
)
for i in range(num_rows):
for j in range(num_cols):
image_[
i * (h + offset) : i * (h + offset) + h :,
j * (w + offset) : j * (w + offset) + w,
] = images[i * num_cols + j]