TypeError while running ./docker/run_pose_estimation.bsh
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
./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
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.
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");
}