img = torch.from_numpy(img).float().to(device)