INNER CODE UNIT · Python

scaled_buffer_kernel

fashn-AI/fashn-vton-1.5 · scripts/debug_masks.py:128

    scaled_buffer_kernel = max(1, int(4 * height_scale))
    print(f"Buffer kernel size: {scaled_buffer_kernel}")
    buffer_mask = dilate_mask(mask, kernel=(scaled_buffer_kernel, scaled_buffer_kernel))
    save_mask(buffer_mask, output_dir, "02_buffer_mask")

    # Create bounded mask
    bounded_mask = create_bounded_mask(mask)
    save_mask(bounded_mask, output_dir, "03_bounded_mask")

    # Create contour following mask
    scaled_brush_radius = max(1, int(18 * height_scale))
    print(f"Contour brush radius: {scaled_brush_radius}")
    contour_mask = create_contour_following_mask(mask, brush_radius=scaled_brush_radius)
    save_mask(contour_mask, output_dir, "04_contour_mask")

    # Create hybrid mask
    ca_mask = _create_hybrid_contour_bounded_mask(
        contour_mask, bounded_mask, min_distance_threshold=min_distance_threshold

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…