In the doc, it's written that we can pass a tensor to the function get_landmarks_from_image.
It's working perfectly fine with numpy.arrays but when trying to pass a tensor (or even a tensor.data) it fails because Tensor has no attribute 'ndim' (l.165) which is uniquely an attribute of numpy.arrays.
It can be fixed with :
if isinstance(img, torch.Tensor) : img = img.detach().cpu().numpy()
In the doc, it's written that we can pass a tensor to the function
get_landmarks_from_image
.It's working perfectly fine with numpy.arrays but when trying to pass a tensor (or even a tensor.data) it fails because Tensor has no attribute 'ndim' (l.165) which is uniquely an attribute of numpy.arrays.
It can be fixed with :
if isinstance(img, torch.Tensor) : img = img.detach().cpu().numpy()
which convert back the tensor to a numpy array