MHanzl commited on
Commit
8d667ad
1 Parent(s): 3133469

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +2 -3
README.md CHANGED
@@ -29,11 +29,11 @@ from PIL import Image
29
  from urllib.request import urlopen
30
  model = timm.create_model("hf-hub:BVRA/vit_large_patch16_224.ft_df20m_224", pretrained=True)
31
  model = model.eval()
32
- train_transforms = T.Compose([T.Resize(224),
33
  T.ToTensor(),
34
  T.Normalize([0.5, 0.5, 0.5], [0.5, 0.5, 0.5])])
35
  img = Image.open(PATH_TO_YOUR_IMAGE)
36
- output = model(train_transforms(img).unsqueeze(0)) # output is (batch_size, num_features) shaped tensor
37
  # output is a (1, num_features) shaped tensor
38
  ```
39
 
@@ -60,4 +60,3 @@ output = model(train_transforms(img).unsqueeze(0)) # output is (batch_size, num
60
  publisher={Multidisciplinary Digital Publishing Institute}
61
  }
62
  ```
63
-
 
29
  from urllib.request import urlopen
30
  model = timm.create_model("hf-hub:BVRA/vit_large_patch16_224.ft_df20m_224", pretrained=True)
31
  model = model.eval()
32
+ train_transforms = T.Compose([T.Resize((224, 224)),
33
  T.ToTensor(),
34
  T.Normalize([0.5, 0.5, 0.5], [0.5, 0.5, 0.5])])
35
  img = Image.open(PATH_TO_YOUR_IMAGE)
36
+ output = model(train_transforms(img).unsqueeze(0))
37
  # output is a (1, num_features) shaped tensor
38
  ```
39
 
 
60
  publisher={Multidisciplinary Digital Publishing Institute}
61
  }
62
  ```