yolov8n / README.md
nielsr's picture
nielsr HF staff
Update README.md
e9b32eb verified
metadata
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 integration.

Installation

First install the package:

!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 as in the CLI:

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 for more examples.