1adrianb / face-alignment

:fire: 2D and 3D Face alignment library build using pytorch
https://www.adrianbulat.com
BSD 3-Clause "New" or "Revised" License
6.94k stars 1.33k forks source link

Fix GPU issue on the blazeface detector. #200

Closed bdvllrs closed 3 years ago

bdvllrs commented 3 years ago

When using the BlazeFace Detector on a CUDA device, the error

face_alignment/detection/blazeface/net_blazeface.py", line 288, in _decode_boxes
    x_center = raw_boxes[..., 0] / self.x_scale * \
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!

would be triggered.

This fixes this issue and allows to use the BlazeFace detector on a cuda device.

1adrianb commented 3 years ago

Thanks!