Skip to content

Inconsistent Normalization Settings Between Generation and Data Processing #152

@xfanhe

Description

@xfanhe

Dear authors,

There's a normalization mismatch in the codebase:

  • Data preprocessing normalizes meshes to [0, 1] space

    def normalize_to_unit_box(V):
    """
    Normalize the vertices V to fit inside a unit bounding box [0,1]^3.
    V: (n,3) numpy array of vertex positions.
    Returns: normalized V
    """
    V_min = V.min(axis=0)
    V_max = V.max(axis=0)
    scale = (V_max - V_min).max() * 1.01
    V_normalized = (V - V_min) / scale
    return V_normalized

  • Latent generation queries points in [-1, 1] space

    # 1. generate query points
    if isinstance(bounds, float):
    bounds = [-bounds, -bounds, -bounds, bounds, bounds, bounds]
    bbox_min, bbox_max = np.array(bounds[0:3]), np.array(bounds[3:6])
    xyz_samples, grid_size, length = generate_dense_grid_points(
    bbox_min=bbox_min,
    bbox_max=bbox_max,
    octree_resolution=octree_resolution,
    indexing="ij"
    )

    and surface_loader normalizes meshes into [-1, 1]
    def normalize_mesh(mesh, scale=0.9999):
    """
    Normalize the mesh to fit inside a centered cube with a specified scale.
    The mesh is translated so that its bounding box center is at the origin,
    then uniformly scaled so that the longest side of the bounding box fits within [-scale, scale].
    Args:
    mesh (trimesh.Trimesh): Input mesh to normalize.
    scale (float, optional): Scaling factor to slightly shrink the mesh inside the unit cube. Default is 0.9999.
    Returns:
    trimesh.Trimesh: The normalized mesh with applied translation and scaling.
    """
    bbox = mesh.bounds
    center = (bbox[1] + bbox[0]) / 2
    scale_ = (bbox[1] - bbox[0]).max()
    mesh.apply_translation(-center)
    mesh.apply_scale(1 / scale_ * 2 * scale)
    return mesh

Which normalization settings were used during training? Should we use [-1, 1] for both vae and diffusion training to maintain consistency?

Thank you for your excellent work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions