Spaces:
Running
Running
Update README.md
Browse files
README.md
CHANGED
|
@@ -16,22 +16,32 @@ GitHub link: https://github.com/riccardomusmeci/mlx-image
|
|
| 16 |
These are weights converted from timm/torchvision and ready to be used.
|
| 17 |
|
| 18 |
## How to install
|
|
|
|
| 19 |
```
|
| 20 |
pip install mlx-image
|
| 21 |
```
|
| 22 |
|
| 23 |
## Models
|
| 24 |
|
| 25 |
-
To
|
| 26 |
```python
|
| 27 |
from mlxim.model import create_model
|
| 28 |
|
| 29 |
-
# loading weights from mlx-vision
|
| 30 |
-
model = create_model("resnet18")
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
# loading weights from local file
|
| 33 |
-
model = create_model("resnet18", weights="path/to/
|
| 34 |
```
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
> [!WARNING]
|
| 37 |
-
> More models will be uploaded aligned with MLX improvement by Apple team
|
|
|
|
| 16 |
These are weights converted from timm/torchvision and ready to be used.
|
| 17 |
|
| 18 |
## How to install
|
| 19 |
+
|
| 20 |
```
|
| 21 |
pip install mlx-image
|
| 22 |
```
|
| 23 |
|
| 24 |
## Models
|
| 25 |
|
| 26 |
+
To load a model with pre-trained weights:
|
| 27 |
```python
|
| 28 |
from mlxim.model import create_model
|
| 29 |
|
| 30 |
+
# loading weights from HuggingFace (https://huggingface.co/mlx-vision/resnet18-mlxim)
|
| 31 |
+
model = create_model("resnet18") # pretrained weights loaded from HF
|
| 32 |
+
|
| 33 |
+
# loading weights from another HuggingFace model
|
| 34 |
+
model = create_model("resnet18", weights="hf://repo_id/filename")
|
| 35 |
|
| 36 |
# loading weights from local file
|
| 37 |
+
model = create_model("resnet18", weights="path/to/resnet18/model.npz")
|
| 38 |
```
|
| 39 |
|
| 40 |
+
## **ImageNet-1K Results**
|
| 41 |
+
|
| 42 |
+
Go to https://github.com/riccardomusmeci/mlx-image/blob/main/results/results-imagenet-1k.csv to check every model converted and its performance on ImageNet-1K with different settings.
|
| 43 |
+
|
| 44 |
+
> **TL;DR** performance is comparable to the original models from PyTorch implementations.
|
| 45 |
+
|
| 46 |
> [!WARNING]
|
| 47 |
+
> More models will be uploaded aligned with MLX improvement by the Apple team.
|