https://github.com/superbo/yolov9-mlx
Yolov9 model in MLX
https://github.com/superbo/yolov9-mlx
Last synced: 10 months ago
JSON representation
Yolov9 model in MLX
- Host: GitHub
- URL: https://github.com/superbo/yolov9-mlx
- Owner: SuperBo
- License: mit
- Created: 2024-03-15T07:46:37.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-17T10:06:32.000Z (about 2 years ago)
- Last Synced: 2025-08-04T03:31:34.692Z (10 months ago)
- Language: Python
- Size: 61.5 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Yolov9 MLX
[Yolov9](https://github.com/WongKinYiu/yolov9) code written in [MLX](https://ml-explore.github.io/mlx/build/html/index.html).

## Installation
You can install using pip
```sh
pip insall .
```
## Load model
Pretrained weights from Yolov9:
- [yolov9-c-converted.safetensors](https://github.com/SuperBo/yolov9-mlx/releases/download/v0.1.0/yolov9-c-converted.safetensors)
- [yolov9-e-converted.safetensors](https://github.com/SuperBo/yolov9-mlx/releases/download/v0.1.0/yolov9-e-converted.safetensors)
- [yolov9-c.safetensors](https://github.com/SuperBo/yolov9-mlx/releases/download/v0.1.0/yolov9-c.safetensors)
- [yolov9-e.safetensors](https://github.com/SuperBo/yolov9-mlx/releases/download/v0.1.0/yolov9-e.safetensors)
Model can be load as following snippet.
```python
from yolov9_mlx.models import yolo
model = yolo.Yolov9CConverted()
model.load_weights("yolov9-c-converted.safetensors")
y, d = model(im)
```
For more details on how to run detect, please refer to [serve.py](src/yolov9_mlx/serve.py)
## Inference service
A model endpoint example is also available in [serve.py](src/yolov9_mlx/serve.py)].
Start service
```sh
pdm sync -G serving
pdm run serve
```
Send request to service
```sh
curl -XPOST -F 'image=@img.jpg' http://localhost:3000/detect
```