 Define image pre-processing transforms     transform = transforms.Compose([       transforms.Resize(299),       transforms.CenterCrop(299),       transforms.ToTensor(),       transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))     ])     if image_path.startswith('http://') or image_path.startswith('https://'):         import requests         from io import BytesIO         response = requests.get(image_path)         img = Image.open(BytesIO(response.content)).convert('RGB')     else:         img = Image.open(image_path).convert('RGB')     img = transform(img).unsqueeze(0)     img = img.cuda() if device.lower() == "cuda" else img.cpu()     return img  def eval():     model = timm.create_model("hf_hub:FredZhang7/google-safesearch-mini-v2", pretrained=True)     model.to(device)     img = preprocess_image(image_path)      with torch.no_grad():         out = model(img)         _, predicted = torch.max(out.data, 1)         classes = {             0: 'nsfw_gore',             1: 'nsfw_suggestive',             2: 'safe'         }         print('\n\033[1;31m' + classes[predicted.item()] + '\033[0m' if predicted.item() != 2 else '\033[1;32m' + classes[predicted.item()] + '\033[0m\n')  if __name__ == '__main__':     eval() ```