nb_colors=5,
pruner=None,
):
-
assert nb_colors >= max_nb_squares and nb_colors <= len(color_name2rgb) - 1
descr = []
for n in range(nb):
-
nb_squares = torch.randint(max_nb_squares, (1,)) + 1
square_position = torch.randperm(height * width)[:nb_squares]
def descr2img(descr, height, width):
-
result = []
def token2color(t):
def descr2properties(descr, height, width):
-
if type(descr) == list:
return [descr2properties(d, height, width) for d in descr]
def nb_properties(descr, height, width, pruner=None):
-
if type(descr) == list:
return [nb_properties(d, height, width, pruner) for d in descr]