|
|
|
@ -24,10 +24,13 @@ def image_grid(imgs, batch_size=1, rows=None):
|
|
|
|
rows = opts.n_rows
|
|
|
|
rows = opts.n_rows
|
|
|
|
elif opts.n_rows == 0:
|
|
|
|
elif opts.n_rows == 0:
|
|
|
|
rows = batch_size
|
|
|
|
rows = batch_size
|
|
|
|
else:
|
|
|
|
elif opts.grid_prevent_empty_spots:
|
|
|
|
rows = math.floor(math.sqrt(len(imgs)))
|
|
|
|
rows = math.floor(math.sqrt(len(imgs)))
|
|
|
|
while len(imgs) % rows != 0:
|
|
|
|
while len(imgs) % rows != 0:
|
|
|
|
rows -= 1
|
|
|
|
rows -= 1
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
rows = math.sqrt(len(imgs))
|
|
|
|
|
|
|
|
rows = round(rows)
|
|
|
|
|
|
|
|
|
|
|
|
cols = math.ceil(len(imgs) / rows)
|
|
|
|
cols = math.ceil(len(imgs) / rows)
|
|
|
|
|
|
|
|
|
|
|
|
|