Route clothing choices through clothing seed
This commit is contained in:
+21
-4
@@ -116,15 +116,19 @@ def build_direct_builtin_row(
|
||||
minimal_clothing_ratio: float | None,
|
||||
standard_pose_ratio: float | None,
|
||||
seed: int,
|
||||
seed_config: dict[str, int] | None = None,
|
||||
) -> dict[str, Any]:
|
||||
rng = random.Random(seed_policy.row_seed(seed, row_number))
|
||||
clothing_rng = None
|
||||
if seed_config is not None:
|
||||
clothing_rng = seed_policy.axis_rng(seed_config, "clothing", seed, row_number)
|
||||
expr_deck = g.ExpressionDeck(
|
||||
g.EXPRESSIONS,
|
||||
random.Random(seed_policy.row_seed(g.EXPRESSION_SEED + seed, row_number)),
|
||||
)
|
||||
batch = max(1, ((row_number - 1) // g.BATCH_SIZE) + 1)
|
||||
index = start_index + row_number - 1
|
||||
row_clothing = pick_clothing_mode(rng, clothing, minimal_clothing_ratio)
|
||||
row_clothing = pick_clothing_mode(clothing_rng or rng, clothing, minimal_clothing_ratio)
|
||||
row_poses = pick_pose_mode(rng, poses, standard_pose_ratio)
|
||||
|
||||
if category == "woman":
|
||||
@@ -141,13 +145,26 @@ def build_direct_builtin_row(
|
||||
figure,
|
||||
no_plus_women,
|
||||
no_black,
|
||||
clothing_rng=clothing_rng,
|
||||
)
|
||||
elif category == "man":
|
||||
row = g.make_single(index, batch, rng, "man", expr_deck, row_clothing, ethnicity, row_poses, backside_bias, figure)
|
||||
row = g.make_single(
|
||||
index,
|
||||
batch,
|
||||
rng,
|
||||
"man",
|
||||
expr_deck,
|
||||
row_clothing,
|
||||
ethnicity,
|
||||
row_poses,
|
||||
backside_bias,
|
||||
figure,
|
||||
clothing_rng=clothing_rng,
|
||||
)
|
||||
elif category == "couple":
|
||||
row = g.make_couple(index, batch, rng, expr_deck, row_clothing, ethnicity, no_plus_women)
|
||||
row = g.make_couple(index, batch, rng, expr_deck, row_clothing, ethnicity, no_plus_women, clothing_rng=clothing_rng)
|
||||
elif category == "group_or_layout":
|
||||
row = g.make_group_or_layout(index, batch, rng, expr_deck, row_clothing, ethnicity, no_plus_women)
|
||||
row = g.make_group_or_layout(index, batch, rng, expr_deck, row_clothing, ethnicity, no_plus_women, clothing_rng=clothing_rng)
|
||||
else:
|
||||
raise ValueError(f"Unknown built-in category: {category}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user