Thanks @ptrblck the key part that you mentioned is “.float()” in:

lbp = torch.from_numpy(lbp).float()

After you said on your machine works fine, I thought the problem is my Jupyter Notebook because when I run it in IDLE python or Google colab I get the correct answer
But when in the Jupyter Notebook I get this error:

TypeError: pic should be Tensor or ndarray. Got <class ‘torch.Tensor’>.

do you have any idea that works on Jupyter as well?