Instructions to use mlx-vision/swin_tiny_patch4_window7_224-mlxim with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- mlx-image
How to use mlx-vision/swin_tiny_patch4_window7_224-mlxim with mlx-image:
from mlxim.model import create_model model = create_model(mlx-vision/swin_tiny_patch4_window7_224-mlxim)
- MLX
How to use mlx-vision/swin_tiny_patch4_window7_224-mlxim with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir swin_tiny_patch4_window7_224-mlxim mlx-vision/swin_tiny_patch4_window7_224-mlxim
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- LM Studio
Update README.md
Browse files
README.md
CHANGED
|
@@ -32,7 +32,7 @@ transform = ImageNetTransform(train=False, img_size=224)
|
|
| 32 |
x = transform(read_rgb("cat.png"))
|
| 33 |
x = mx.expand_dims(x, 0)
|
| 34 |
|
| 35 |
-
model = create_model("swin_tiny_patch4_window7_224
|
| 36 |
model.eval()
|
| 37 |
|
| 38 |
logits = model(x)
|
|
@@ -49,13 +49,13 @@ x = transform(read_rgb("cat.png"))
|
|
| 49 |
x = mx.expand_dims(x, 0)
|
| 50 |
|
| 51 |
# first option
|
| 52 |
-
model = create_model("swin_tiny_patch4_window7_224
|
| 53 |
model.eval()
|
| 54 |
|
| 55 |
embeds = model(x)
|
| 56 |
|
| 57 |
# second option
|
| 58 |
-
model = create_model("swin_tiny_patch4_window7_224
|
| 59 |
model.eval()
|
| 60 |
|
| 61 |
embeds = model.get_features(x)
|
|
|
|
| 32 |
x = transform(read_rgb("cat.png"))
|
| 33 |
x = mx.expand_dims(x, 0)
|
| 34 |
|
| 35 |
+
model = create_model("swin_tiny_patch4_window7_224")
|
| 36 |
model.eval()
|
| 37 |
|
| 38 |
logits = model(x)
|
|
|
|
| 49 |
x = mx.expand_dims(x, 0)
|
| 50 |
|
| 51 |
# first option
|
| 52 |
+
model = create_model("swin_tiny_patch4_window7_224", num_classes=0)
|
| 53 |
model.eval()
|
| 54 |
|
| 55 |
embeds = model(x)
|
| 56 |
|
| 57 |
# second option
|
| 58 |
+
model = create_model("swin_tiny_patch4_window7_224")
|
| 59 |
model.eval()
|
| 60 |
|
| 61 |
embeds = model.get_features(x)
|