From 60b45b0915cf17ad016bbbe3f7cf1f4b98a2d4a3 Mon Sep 17 00:00:00 2001 From: Niels Date: Sat, 1 Jun 2024 14:52:18 +0200 Subject: [PATCH] First draft --- README.md | 17 ++++++++--------- app.py | 4 ++-- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index fe1b5bd7..92ab5b64 100644 --- a/README.md +++ b/README.md @@ -43,12 +43,12 @@ COCO | Model | Test Size | #Params | FLOPs | APval | Latency | |:---------------|:----:|:---:|:--:|:--:|:--:| -| [YOLOv10-N](https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10n.pt) | 640 | 2.3M | 6.7G | 38.5% | 1.84ms | -| [YOLOv10-S](https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10s.pt) | 640 | 7.2M | 21.6G | 46.3% | 2.49ms | -| [YOLOv10-M](https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10m.pt) | 640 | 15.4M | 59.1G | 51.1% | 4.74ms | -| [YOLOv10-B](https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10b.pt) | 640 | 19.1M | 92.0G | 52.5% | 5.74ms | -| [YOLOv10-L](https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10l.pt) | 640 | 24.4M | 120.3G | 53.2% | 7.28ms | -| [YOLOv10-X](https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10x.pt) | 640 | 29.5M | 160.4G | 54.4% | 10.70ms | +| [YOLOv10-N](https://huggingface.co/jameslahm/yolov10n) | 640 | 2.3M | 6.7G | 38.5% | 1.84ms | +| [YOLOv10-S](https://huggingface.co/jameslahm/yolov10s) | 640 | 7.2M | 21.6G | 46.3% | 2.49ms | +| [YOLOv10-M](https://huggingface.co/jameslahm/yolov10m) | 640 | 15.4M | 59.1G | 51.1% | 4.74ms | +| [YOLOv10-B](https://huggingface.co/jameslahm/yolov10b) | 640 | 19.1M | 92.0G | 52.5% | 5.74ms | +| [YOLOv10-L](https://huggingface.co/jameslahm/yolov10l) | 640 | 24.4M | 120.3G | 53.2% | 7.28ms | +| [YOLOv10-X](https://huggingface.co/jameslahm/yolov10x) | 640 | 29.5M | 160.4G | 54.4% | 10.70ms | ## Installation `conda` virtual environment is recommended. @@ -60,15 +60,14 @@ pip install -e . ``` ## Demo ``` -wget https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10s.pt python app.py # Please visit http://127.0.0.1:7860 ``` ## Validation -[`yolov10n.pt`](https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10n.pt) [`yolov10s.pt`](https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10s.pt) [`yolov10m.pt`](https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10m.pt) [`yolov10b.pt`](https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10b.pt) [`yolov10l.pt`](https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10l.pt) [`yolov10x.pt`](https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10x.pt) +[`yolov10n.pt`](https://huggingface.co/jameslahm/yolov10n) [`yolov10s.pt`](https://huggingface.co/jameslahm/yolov10s) [`yolov10m.pt`](https://huggingface.co/jameslahm/yolov10m) [`yolov10b.pt`](https://huggingface.co/jameslahm/yolov10b) [`yolov10l.pt`](https://huggingface.co/jameslahm/yolov10l) [`yolov10x.pt`](https://huggingface.co/jameslahm/yolov10x) ``` -yolo val model=yolov10n/s/m/b/l/x.pt data=coco.yaml batch=256 +yolo val size="nano" data=coco.yaml batch=256 ``` ## Training diff --git a/app.py b/app.py index 5830e8dc..e40cc846 100644 --- a/app.py +++ b/app.py @@ -4,8 +4,8 @@ import gradio as gr from ultralytics import YOLOv10 -def yolov10_inference(image, model_path, image_size, conf_threshold): - model = YOLOv10(model_path) +def yolov10_inference(image, image_size, conf_threshold): + model = YOLOv10.from_pretrained("jameslahm/yolov10n") model.predict(source=image, imgsz=image_size, conf=conf_threshold, save=True)