Update README.md
Browse files
README.md
CHANGED
@@ -36,36 +36,12 @@ image = Image.open(requests.get(url, stream=True).raw)
|
|
36 |
processor = AutoImageProcessor.from_pretrained(
|
37 |
"apple/aimv2-large-patch14-native",
|
38 |
)
|
39 |
-
model = AutoModel.from_pretrained(
|
40 |
-
"apple/aimv2-large-patch14-native",
|
41 |
-
trust_remote_code=True,
|
42 |
-
)
|
43 |
|
44 |
inputs = processor(images=image, return_tensors="pt")
|
45 |
outputs = model(**inputs)
|
46 |
```
|
47 |
|
48 |
-
### JAX
|
49 |
-
```python
|
50 |
-
import requests
|
51 |
-
from PIL import Image
|
52 |
-
from transformers import AutoImageProcessor, FlaxAutoModel
|
53 |
-
|
54 |
-
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
55 |
-
image = Image.open(requests.get(url, stream=True).raw)
|
56 |
-
|
57 |
-
processor = AutoImageProcessor.from_pretrained(
|
58 |
-
"apple/aimv2-large-patch14-native",
|
59 |
-
)
|
60 |
-
model = FlaxAutoModel.from_pretrained(
|
61 |
-
"apple/aimv2-large-patch14-native",
|
62 |
-
trust_remote_code=True,
|
63 |
-
)
|
64 |
-
|
65 |
-
inputs = processor(images=image, return_tensors="jax")
|
66 |
-
outputs = model(**inputs)
|
67 |
-
```
|
68 |
-
|
69 |
## Citation
|
70 |
If you find our work useful, please consider citing us as:
|
71 |
```bibtex
|
|
|
36 |
processor = AutoImageProcessor.from_pretrained(
|
37 |
"apple/aimv2-large-patch14-native",
|
38 |
)
|
39 |
+
model = AutoModel.from_pretrained("apple/aimv2-large-patch14-native")
|
|
|
|
|
|
|
40 |
|
41 |
inputs = processor(images=image, return_tensors="pt")
|
42 |
outputs = model(**inputs)
|
43 |
```
|
44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
## Citation
|
46 |
If you find our work useful, please consider citing us as:
|
47 |
```bibtex
|