Skip to content

mesh prediction is not working!! #1808

Closed Answered by rohit7044
rohit7044 asked this question in Q&A
Discussion options

You must be logged in to vote

Got the answer i forgot to normalize the mesh.

def preprocess_mesh(mesh, device):
    # We scale normalize and center the target mesh to fit in a sphere of radius 1
    # centered at (0,0,0). (scale, center) will be used to bring the predicted mesh
    # to its original center and scale.  Note that normalizing the target mesh,
    # speeds up the optimization but is not necessary!
    verts = mesh.verts_packed()
    N = verts.shape[0]
    center = verts.mean(0)
    scale = max((verts - center).abs().max(0)[0])
    mesh.offset_verts_(-center)
    mesh.scale_verts_((1.0 / float(scale)))
    mesh = mesh.to(device)
    return mesh, scale, center

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rohit7044
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant