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

Use your example OBJ file can run the code but use myself have the below error #1

Open
Benson1223 opened this issue Dec 19, 2024 · 3 comments

Comments

@Benson1223
Copy link

(try_mvlm) D:\python_work\mvlm-main>python inference.py
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
W0000 00:00:1734603455.067464 26808 face_landmarker_graph.cc:174] Sets FaceBlendshapesGraph acceleration to xnnpack by default.
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Render [0] - Prepare 0.000000 s
Render [1] - Setup time: 1.582143 s
Render [2] - Render 1.678741 s
Render [Total]: 3.311789 s
Prediction [Total]: 0.020932 s
Landmarks [0] - From Heatmaps: 0.000000 s
Traceback (most recent call last):
File "D:\python_work\mvlm-main\inference.py", line 16, in
landmarks = dm.predict_one_file(file)
File "D:\python_work\mvlm-main\src\mvlm\pipeline\general_pipeline.py", line 82, in predict_one_file
landmarks, error = self.estimator_3d.estimate_landmarks_from_lines(landmark_stack, lines_s, lines_e)
File "D:\python_work\mvlm-main\src\mvlm\utils\estimator3d.py", line 169, in estimate_landmarks_from_lines
pa, pb = self.filter_lines_based_on_heatmap_value_using_quantiles(landmark_stack, lm_no, pa, pb)
File "D:\python_work\mvlm-main\src\mvlm\utils\estimator3d.py", line 142, in filter_lines_based_on_heatmap_value_using_quantiles
threshold = np.quantile(max_values, self.threshold_quantile)
File "C:\Users\user\anaconda3\envs\try_mvlm\lib\site-packages\numpy\lib_function_base_impl.py", line 4663, in quantile
return _quantile_unchecked(
File "C:\Users\user\anaconda3\envs\try_mvlm\lib\site-packages\numpy\lib_function_base_impl.py", line 4676, in _quantile_unchecked
return _ureduce(a,
File "C:\Users\user\anaconda3\envs\try_mvlm\lib\site-packages\numpy\lib_function_base_impl.py", line 3764, in _ureduce
r = func(a, **kwargs)
File "C:\Users\user\anaconda3\envs\try_mvlm\lib\site-packages\numpy\lib_function_base_impl.py", line 4853, in _quantile_ureduce_func
result = _quantile(arr,
File "C:\Users\user\anaconda3\envs\try_mvlm\lib\site-packages\numpy\lib_function_base_impl.py", line 4975, in _quantile
slices_having_nans = np.isnan(arr[-1, ...])
IndexError: index -1 is out of bounds for axis 0 with size 0

@Benson1223
Copy link
Author

Benson1223 commented Dec 19, 2024

My code as below:
from pathlib import Path
import numpy as np
import mvlm
file = Path("./lulu_alignment/texturedMesh.obj")
output_dir = Path("./lulu_alignment/res_point")

dm = mvlm.pipeline.create_pipeline("mediapipe")
landmarks = dm.predict_one_file(file)
np.savetxt((output_dir/f"{file.stem}.txt").as_posix(), landmarks, delimiter=",")

mvlm.utils.VTKViewer(file.as_posix(), landmarks)

@Timozen
Copy link
Member

Timozen commented Dec 22, 2024

Thank you for pointing out this issue. I will take a look into the possible cause.
The underlying error indicates that the landmark prediction somehow failed.

@Benson1223
Copy link
Author

Many thanks for your help! I try to use testmeshA.obj (the example file of Deep-MVLM) to run mediapipe, but can't run. However I use your sample file is available.

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

2 participants