-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to find the landmark of a random vector? #122
Comments
@yeluoo What's wrong with this code? Is the rendered result blank? |
There is no problem with the code, I want to get the angled face @icewired-yy |
@yeluoo I see. If you want to get the angled face in the rendered image, you can modify the If you want to export an angled face model(vertex coordinates have been modified), you can try applying the rotation matrix to the vertices, since the model is All the advice above is based on my experience. Hope it will be helpful to you. |
I am currently using the solution you mentioned. Adjusting the RT matrix is equivalent to adjusting the perspective. What I want is for the face to move left and right. These are two different things. @icewired-yy @icewired-yy |
@yeluoo Sorry for misunderstanding your questions. Do you mean moving the face left or right |
@yeluoo If that's right, you can try to modify the vertex coordinates of the model before rendering it. Just like what is used in official implementation. For example in fit demo: mesh_tm = trimesh.Trimesh(vertices = mesh.vertices.copy(),
faces = fs_fitter.fv_indices_front-1,
process = False)
mesh_tm.vertices[:, :2] = mesh_tm.vertices[:, 0:2] - np.array([src_img.shape[1] / 2, src_img.shape[0] / 2])
mesh_tm.vertices = mesh_tm.vertices / src_img.shape[0] * 2
mesh_tm.vertices[:, 2] = mesh_tm.vertices[:, 2] - 10 The above code moves the model from the image space ([0 ~ resolution]) to the OpenGL NDC (-1 ~ 1). And this operation is equivalent to the left or right moving operation you want. |
哈喽,我感觉你没有懂我意思,你有QQ吗,或者你加我1830343214,这里感觉说不清楚 @icewired-yy |
Does the bilinear model have the original 20 expressions? I don’t need many of the expanded 52 expressions. My goal is to use a parametric model to generate landmarks for faces with different fatness, thickness, postures, and expressions. @icewired-yy @icewired-yy @icewired-yy |
@yeluoo The To extract the landmarks from a generated face model, or any FaceScape bilinear model, use the By the way, FaceScape has no The 52-dim expression vector doesn't mean it can only generate 52 expressions, you can generate the expression vector from normal distribution just like what you have done with the identity vector. |
Thank you for your patient answer, I have another question。
The background of the rendering result here is white. I hope the background is black or there is no background. Where should I modify it? @icewired-yy @icewired-yy @icewired-yy |
Glad to hear that my suggestion is helpful to you @yeluoo. The default background of the rendered results from You see, the output of rendering is depth and color. The depth of the background is zero, so we can use: ''' Render scan mesh '''
colorImage, depthImage = scanRenderer(calibratedScanMesh, K, Rt, light)
''' Mask out the face region '''
validRegionMask = depthImage != 0
validRegionMask = validRegionMask[..., np.newaxis]
colorImage = colorImage * validRegionMask This is the part of my code, and you can try my solution. Hope it will be helpful to you. |
Angled faces cannot be produced here.
The text was updated successfully, but these errors were encountered: