|
--- |
|
license: agpl-3.0 |
|
pipeline_tag: object-detection |
|
tags: |
|
- ultralytics |
|
- yolo |
|
- yolov8 |
|
- pytorch_model_hub_mixin |
|
- model_hub_mixin |
|
--- |
|
|
|
This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration. |
|
|
|
## Installation |
|
|
|
First install the package: |
|
|
|
```bash |
|
!pip install -q git+https://github.com/nielsrogge/ultralytics.git@feature/add_hf |
|
``` |
|
|
|
## Usage |
|
|
|
YOLOv8 may also be used directly in a Python environment, and accepts the same [arguments](https://docs.ultralytics.com/usage/cfg/) as in the CLI: |
|
|
|
```python |
|
from ultralytics import YOLO |
|
|
|
# Load a model |
|
model = YOLO.from_pretrained("nielsr/yolov8n") |
|
|
|
# Use the model |
|
model.train(data="coco128.yaml", epochs=3) # train the model |
|
metrics = model.val() # evaluate model performance on the validation set |
|
results = model("https://ultralytics.com/images/bus.jpg") # predict on an image |
|
path = model.export(format="onnx") # export the model to ONNX format |
|
``` |
|
|
|
See YOLOv8 [Python Docs](https://docs.ultralytics.com/usage/python) for more examples. |