nielsr HF staff commited on
Commit
e4ba554
1 Parent(s): 6eaf354

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +17 -10
README.md CHANGED
@@ -101,22 +101,29 @@ inp = jnp.array(inp)
101
  </details>
102
 
103
 
104
- ## Usage
105
 
106
- The pre-trained models can be used via [Hugging Face hub](https://huggingface.co/collections/apple/aim-65aa3ce948c718a574f09eb7) as follows:
107
 
108
  ```python
109
- from PIL import Image
110
-
111
  from aim.torch.models import AIMForImageClassification
112
- from aim.torch.data import val_transforms
113
 
114
- img = Image.open(...)
115
- model = AIMForImageClassification.from_pretrained("apple/aim-7B")
116
- transform = val_transforms()
 
 
117
 
118
- inp = transform(img).unsqueeze(0)
119
- logits, features = model(inp)
 
 
 
 
 
 
 
120
  ```
121
 
122
  ### Pre-trained backbones
 
101
  </details>
102
 
103
 
104
+ ## Pre-trained checkpoints
105
 
106
+ The pre-trained models can be accessed either via [Hugging Face](https://huggingface.co/collections/apple/aim-65aa3ce948c718a574f09eb7):
107
 
108
  ```python
109
+ # after running pip install git+https://[email protected]/apple/ml-aim.git
 
110
  from aim.torch.models import AIMForImageClassification
 
111
 
112
+ aim_600m = AIMForImageClassification.from_pretrained("apple/aim-600M")
113
+ aim_1b = AIMForImageClassification.from_pretrained("apple/aim-1B")
114
+ aim_3b = AIMForImageClassification.from_pretrained("apple/aim-3B")
115
+ aim_7b = AIMForImageClassification.from_pretrained("apple/aim-7B")
116
+ ```
117
 
118
+ or [PyTorch Hub](https://pytorch.org/hub/) as:
119
+
120
+ ```python
121
+ import torch
122
+
123
+ aim_600m = torch.hub.load("apple/ml-aim", "aim_600M")
124
+ aim_1b = torch.hub.load("apple/ml-aim", "aim_1B")
125
+ aim_3b = torch.hub.load("apple/ml-aim", "aim_3B")
126
+ aim_7b = torch.hub.load("apple/ml-aim", "aim_7B")
127
  ```
128
 
129
  ### Pre-trained backbones