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

TypeError while running ./docker/run_pose_estimation.bsh #13

Open
mlngan opened this issue May 11, 2022 · 2 comments
Open

TypeError while running ./docker/run_pose_estimation.bsh #13

mlngan opened this issue May 11, 2022 · 2 comments

Comments

@mlngan
Copy link

mlngan commented May 11, 2022

I successfully built a docker container that runs in --cpu-only mode following the instructions here - https://github.com/VisionSystemsInc/pix2face/tree/master/docker. During execution of the ./docker/run_pose_estimation.bsh script, the following python error occurs -- TypeError: Unable to convert function return value to a Python type! The signature was (arg0: face3d.perspective_camera_parameters) -> vgl_rotation_3d. Could there be an issue or mismatch between the python bindings?

./docker/run_pose_estimation.bsh images output --cpu-only
INPUT_DIR=images
OUTPUT_DIR=output
Running pix2face_cpu docker image
Running on CPU
loading /pix2face/pix2face_net/data/models/pix2face_unet_v10_pytorch0.4_cpu.pt ...
...done.
/input_dir/image.jpg
Traceback (most recent call last):
File "/pix2face/scripts/estimate_pose_batch.py", line 49, in
main(input_fname, output_fname)
File "/pix2face/scripts/estimate_pose_batch.py", line 35, in main
pose = pix2face_estimation.camera_estimation.estimate_head_pose(img, pix2face_net, cuda_device=cuda_device)
File "/pix2face/python/pix2face_estimation/camera_estimation.py", line 18, in estimate_head_pose
return extract_head_pose(estimate_camera(image, pix2face_net, cuda_device=cuda_device))
File "/pix2face/python/pix2face_estimation/camera_estimation.py", line 13, in extract_head_pose
yaw, pitch, roll = decompose_camera_rotation(camera_params.rotation.as_matrix(), pitch_offset=-7)
TypeError: Unable to convert function return value to a Python type! The signature was
(arg0: face3d.perspective_camera_parameters) -> vgl_rotation_3d

@scott-vsi
Copy link
Contributor

Sorry about this. I pushed a fix for it (c68b635). It seems to be an issue with the necessary pybind11 overload not being loaded. So I manually loaded it. I have not audited the repo to see if this problem exists anywhere else, but if it does, you can create another issue and it should be easy to fix.

@scott-vsi
Copy link
Contributor

I think we need to do this in the face3d module

  py::module importlib_util = py::module::import("importlib.util");
  if (!importlib_util.attr("find_spec")("vxl.vgl.algo").is_none()) {
    py::module::import("vxl.vgl");
  }

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