INNER CODE UNIT · Python
scaled_down
fashn-AI/fashn-vton-1.5 · scripts/debug_masks.py:153
scaled_down = int(16 * height_scale)
print(f"Asymmetric dilation: R={scaled_right}, L={scaled_left}, U={scaled_up}, D={scaled_down}")
ca_mask_dilated = asymmetric_dilate_mask(ca_mask, right=scaled_right, left=scaled_left, up=scaled_up, down=scaled_down)
save_mask(ca_mask_dilated, output_dir, "06_ca_mask_dilated")
# Create exclusion mask (regions to preserve)
identity_ids = [labels_ids_dict[label] for label in IDENTITY_FASHN_LABELS]
print(f"Identity labels: {IDENTITY_FASHN_LABELS}")
print(f"Identity IDs: {identity_ids}")
# Conditional identity based on coverage
if body_coverage == "upper":
identity_ids.append(labels_ids_dict["legs"])
elif body_coverage == "lower":
identity_ids.append(labels_ids_dict["arms"])
exclusion_mask = np.isin(seg_pred, identity_ids)
save_mask(exclusion_mask, output_dir, "07_exclusion_mask_base")