Skip to content
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

Shape's jaw fit abnormally #4

Open
Allen-lz opened this issue Oct 18, 2022 · 3 comments
Open

Shape's jaw fit abnormally #4

Allen-lz opened this issue Oct 18, 2022 · 3 comments

Comments

@Allen-lz
Copy link

Allen-lz commented Oct 18, 2022

This work is wonderful!!
And I also paid attention to your previous related work
https://github.com/tencent-ailab/hifi3dface,
I directly replaced hifi3dface/3DMM/files/HIFI3D++.mat with hifi3dface/3DMM/files/HIFI3D++.mat
The following error occurred when running:
f_sigma0 = (paras) / sigma # (500, 1)
ValueError: operands could not be broadcast together with shapes (526,1) (500,1)
Then I solved the above error using the following:
In optimization/rgbd/step3_prefit_shape.py
--> AI-NEXT-Shape
datas = h5py.File(os.path.join(modle_base, "shape_ev.mat"), "r")
ev_f = np.asarray(datas.get("ev_f")).reshape(-1, 1)
sigma_shape = np.sqrt(ev_f / np.sum(ev_f))

--> HIFI3D++
sigma_shape = np.sqrt(basis3dmm['EVs']/np.sum(basis3dmm['EVs'])) # (526, 1)

In hifi3dface/optimization/rgbd/RGBD_utils/AddHeadTool.py
--> AI-NEXT-Shape
ev_f = pca_info_h["ev_f"]
sigma_shape = np.sqrt(ev_f / np.sum(ev_f))

--> HIFI3D++
basis3dmm = scipy.io.loadmat("3DMM/files/HIFI3D++.mat")
sigma_shape = np.sqrt(basis3dmm['EVs'] / np.sum(basis3dmm['EVs']))

But the result is much worse:

new_res
Am I using HIFI3D++.mat incorrectly?

@haoxianzGit
Copy link
Collaborator

haoxianzGit commented Oct 19, 2022

Hello,thanks for your interest.
Maybe the wrong 3D keypoints are used when calculating ‘trans_base_2_camera’ (function 'get_trans_base_to_camera') in step2*.py. You can test the following 3D keypoints:
mu_shape = np.reshape(np.float32(basis3dmm['mu_shape']), [-1,3])
mu_shape_kp = mu_shape[basis3dmm['keypoints'][0]]
Please check if the results of step2 and step3 are normal.

@Allen-lz
Copy link
Author

Allen-lz commented Oct 19, 2022

Hello,thanks for your interest.
Maybe the wrong 3D keypoints are used when calculating ‘trans_base_2_camera’ (function 'get_trans_base_to_camera') in step2*.py. You can test the following 3D keypoints:
mu_shape = np.reshape(np.float32(basis3dmm['mu_shape']), [-1,3])
mu_shape_kp = mu_shape[basis3dmm['keypoints'][0]]
Please check if the results of step2 and step3 are normal.

thanks for the tip
I visualized np.reshape(np.float32(basis3dmm['mu_shape']), [-1, 3])
From the visual result, there is no problem.
旋转过后的图片

I guess the problem might be mu_shape[basis3dmm['keypoints'][0]]
what's its role
Is it related to a1, a2, a3 in get_trans_base_to_camera?

@yikai28
Copy link

yikai28 commented Nov 18, 2022

The same concern here, the result become worse after using HIFI3D++.... May we ask how to solve it><?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants