hhj1897 / face_pose_augmentation

MIT License
116 stars 19 forks source link

Error when runnning test #1

Closed 54DL0V3 closed 2 years ago

54DL0V3 commented 2 years ago

When I try running face_pose_augmentation_test.py , an error was thrown as bellow: """ Traceback (most recent call last): File "face_pose_augmentation_test.py", line 153, in main() File "face_pose_augmentation_test.py", line 119, in main np.array([40.0, -45.0, 0.0]) / 180.0 * np.pi) File "/media/jiooum/Data/FTech/2.SourceCode/0.Aphrodite/0.Research/face_pose_augmentation/ibug/face_pose_augmentation/face_pose_augmentor.py", line 89, in call return self.call(image, tddfa_result, delta_poses[np.newaxis, ...], landmarks)[0] File "/media/jiooum/Data/FTech/2.SourceCode/0.Aphrodite/0.Research/face_pose_augmentation/ibug/face_pose_augmentation/face_pose_augmentor.py", line 78, in call self.fpa_models, True, landmarks=landmarks)): File "/media/jiooum/Data/FTech/2.SourceCode/0.Aphrodite/0.Research/face_pose_augmentation/ibug/face_pose_augmentation/fpa/face_pose_augmentation.py", line 40, in generate_profile_faces new_img, face_models['layer_width'], eliminate_inner_tri=further_adjust_z) File "/media/jiooum/Data/FTech/2.SourceCode/0.Aphrodite/0.Research/face_pose_augmentation/ibug/face_pose_augmentation/fpa/pytUtils.py", line 639, in ImageMeshing np.zeros((height, width, 1))) File "/media/jiooum/Data/FTech/2.SourceCode/0.Aphrodite/0.Research/face_pose_augmentation/ibug/face_pose_augmentation/fpa/pytUtils.py", line 211, in z_buffer num_triangles, num_vertices, width, height, num_channels) File "ibug/face_pose_augmentation/fpa/pyMM3D.pyx", line 13, in ibug.face_pose_augmentation.fpa.pyMM3D.ZBuffer def ZBuffer(cnp.ndarray[double, ndim=2, mode="c"] vertex not None, ValueError: Buffer dtype mismatch, expected 'int' but got 'long'

"""

How can I fix it? I'm waiting for your help. Thanh you for hard working on this repo.

hhj1897 commented 2 years ago

Thanks for the bug report! This data type mismatch is a good catch, I'll fix it in the next version. Actually I'm cleaning this repo at the moment, so the code you tested may not be self consistent. I'll write a note here once this is done (hopefully in the next few days).

mamunctg commented 2 years ago
/home/XXX/anaconda3/envs/pose_aug_3DDFA/bin/python /home/XXX/Documents/github/face_pose_augmentation/face_pose_augmentation_test.py
Face detector created.
Landmark detector created.
3DDFA initialised.
Face pose augmentor created.
Input video "trudea_0.5min.mp4" opened.
Processing started, press 'Q' to quit.
Traceback (most recent call last):
  File "/home/XXX/Documents/github/face_pose_augmentation/face_pose_augmentation_test.py", line 153, in <module>
    main()
  File "/home/XXX/Documents/github/face_pose_augmentation/face_pose_augmentation_test.py", line 84, in main
    landmarks, scores = landmark_detector(frame, faces, rgb=False)
  File "/home/XXX/anaconda3/envs/pose_aug_3DDFA/lib/python3.6/site-packages/torch/autograd/grad_mode.py", line 49, in decorate_no_grad
    return func(*args, **kwargs)
  File "/home/XXX/Documents/github/face_pose_augmentation/ibug/face_alignment/ibug/face_alignment/fan/fan_predictor.py", line 100, in __call__
    landmarks, landmark_scores = self._decode(heatmaps)
  File "/home/XXX/Documents/github/face_pose_augmentation/ibug/face_alignment/ibug/face_alignment/fan/fan_predictor.py", line 130, in _decode
    [(m / heatmaps.shape[3]).trunc().view(-1, 1), (m % heatmaps.shape[3]).view(-1, 1)], dim=1
RuntimeError: _th_trunc_out not supported on CUDAType for Long
All done.

Process finished with exit code 1

I am facing above problem while i try to run face_pose_augmentation_test.py