添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Repository files navigation

Ultralytics YOLOv8 is a cutting-edge, state-of-the-art (SOTA) model that builds upon the success of previous YOLO versions and introduces new features and improvements to further boost performance and flexibility. YOLOv8 is designed to be fast, accurate, and easy to use, making it an excellent choice for a wide range of object detection and tracking, instance segmentation, image classification and pose estimation tasks.

We hope that the resources here will help you get the most out of YOLOv8. Please browse the YOLOv8 Docs for details, raise an issue on GitHub for support, questions, or discussions, become a member of the Ultralytics Discord , Reddit and Forums !

To request an Enterprise License please complete the form at Ultralytics Licensing .

Documentation

See below for a quickstart installation and usage example, and see the YOLOv8 Docs for full documentation on training, validation, prediction and deployment.

Install

Pip install the ultralytics package including all requirements in a Python>=3.8 environment with PyTorch>=1.8 .

pip install ultralytics

For alternative installation methods including Conda , Docker , and Git, please refer to the Quickstart Guide .

Usage

YOLOv8 may be used directly in the Command Line Interface (CLI) with a yolo command:

yolo predict model=yolov8n.pt source='https://ultralytics.com/images/bus.jpg'

yolo can be used for a variety of tasks and modes and accepts additional arguments, i.e. imgsz=640 . See the YOLOv8 CLI Docs for examples.

Python

YOLOv8 may also be used directly in a Python environment, and accepts the same arguments as in the CLI example above:

from ultralytics import YOLO
# Load a model
model = YOLO("yolov8n.pt")
# Train the model
train_results = model.train(
    data="coco8.yaml",  # path to dataset YAML
    epochs=100,  # number of training epochs
    imgsz=640,  # training image size
    device="cpu",  # device to run on, i.e. device=0 or device=0,1,2,3 or device=cpu
# Evaluate model performance on the validation set
metrics = model.val()
# Perform object detection on an image
results = model("path/to/image.jpg")
results[0].show()
# Export the model to ONNX format
path = model.export(format="onnx")  # return path to exported model

See YOLOv8 Python Docs for more examples.

Notebooks

Ultralytics provides interactive notebooks for YOLOv8, covering training, validation, tracking, and more. Each notebook is paired with a YouTube tutorial, making it easy to learn and implement advanced YOLOv8 features.

Notebook YouTube

Models

YOLOv8 Detect , Segment and Pose models pretrained on the COCO dataset are available here, as well as YOLOv8 Classify models pretrained on the ImageNet dataset. Track mode is available for all Detect, Segment and Pose models.

All Models download automatically from the latest Ultralytics release on first use.

Detection (COCO)

See Detection Docs for usage examples with these models trained on COCO , which include 80 pre-trained classes.

Model size
(pixels) mAP val
50-95
Speed
CPU ONNX
(ms)
Speed
A100 TensorRT
(ms)
params
(M) FLOPs
(B)
  • mAP val values are for single-model single-scale on COCO val2017 dataset.
    Reproduce by yolo val detect data=coco.yaml device=0
  • Speed averaged over COCO val images using an Amazon EC2 P4d instance.
    Reproduce by yolo val detect data=coco.yaml batch=1 device=0|cpu
  • Segmentation (COCO)

    See Segmentation Docs for usage examples with these models trained on COCO-Seg , which include 80 pre-trained classes.

    Model size
    (pixels) mAP box
    50-95
    mAP mask
    50-95
    Speed
    CPU ONNX
    (ms)
    Speed
    A100 TensorRT
    (ms)
    params
    (M) FLOPs
    (B)
  • mAP val values are for single-model single-scale on COCO val2017 dataset.
    Reproduce by yolo val segment data=coco-seg.yaml device=0
  • Speed averaged over COCO val images using an Amazon EC2 P4d instance.
    Reproduce by yolo val segment data=coco-seg.yaml batch=1 device=0|cpu
  • Pose (COCO)

    See Pose Docs for usage examples with these models trained on COCO-Pose , which include 1 pre-trained class, person.

    Model size
    (pixels) mAP pose
    50-95
    mAP pose
    50
    Speed
    CPU ONNX
    (ms)
    Speed
    A100 TensorRT
    (ms)
    params
    (M) FLOPs
    (B)
  • mAP val values are for single-model single-scale on COCO Keypoints val2017 dataset.
    Reproduce by yolo val pose data=coco-pose.yaml device=0
  • Speed averaged over COCO val images using an Amazon EC2 P4d instance.
    Reproduce by yolo val pose data=coco-pose.yaml batch=1 device=0|cpu
  • OBB (DOTAv1)

    See OBB Docs for usage examples with these models trained on DOTAv1 , which include 15 pre-trained classes.

    Model size
    (pixels) mAP test
    50
    Speed
    CPU ONNX
    (ms)
    Speed
    A100 TensorRT
    (ms)
    params
    (M) FLOPs
    (B)
  • mAP test values are for single-model multiscale on DOTAv1 dataset.
    Reproduce by yolo val obb data=DOTAv1.yaml device=0 split=test and submit merged results to DOTA evaluation .
  • Speed averaged over DOTAv1 val images using an Amazon EC2 P4d instance.
    Reproduce by yolo val obb data=DOTAv1.yaml batch=1 device=0|cpu
  • Classification (ImageNet)

    See Classification Docs for usage examples with these models trained on ImageNet , which include 1000 pretrained classes.

    Model size
    (pixels) acc
    top1 acc
    top5 Speed
    CPU ONNX
    (ms)
    Speed
    A100 TensorRT
    (ms)
    params
    (M) FLOPs
    (B) at 640
  • acc values are model accuracies on the ImageNet dataset validation set.
    Reproduce by yolo val classify data=path/to/ImageNet device=0
  • Speed averaged over ImageNet val images using an Amazon EC2 P4d instance.
    Reproduce by yolo val classify data=path/to/ImageNet batch=1 device=0|cpu
  • Integrations

    Our key integrations with leading AI platforms extend the functionality of Ultralytics' offerings, enhancing tasks like dataset labeling, training, visualization, and model management. Discover how Ultralytics, in collaboration with Roboflow , ClearML, Comet , Neural Magic and OpenVINO , can optimize your AI workflow.

    Label and export your custom datasets directly to YOLOv8 for training with Roboflow Automatically track, visualize and even remotely train YOLOv8 using ClearML (open-source!) Free forever, Comet lets you save YOLOv8 models, resume training, and interactively visualize and debug predictions Run YOLOv8 inference up to 6x faster with Neural Magic DeepSparse

    Ultralytics HUB

    Experience seamless AI with Ultralytics HUB ⭐, the all-in-one solution for data visualization, YOLOv5 and YOLOv8 🚀 model training and deployment, without any coding. Transform images into actionable insights and bring your AI visions to life with ease using our cutting-edge platform and user-friendly Ultralytics App . Start your journey for Free now!

    Contribute

    We love your input! YOLOv5 and YOLOv8 would not be possible without help from our community. Please see our Contributing Guide to get started, and fill out our Survey to send us feedback on your experience. Thank you 🙏 to all our contributors!

    License

    Ultralytics offers two licensing options to accommodate diverse use cases:

  • AGPL-3.0 License : This OSI-approved open-source license is ideal for students and enthusiasts, promoting open collaboration and knowledge sharing. See the LICENSE file for more details.
  • Enterprise License : Designed for commercial use, this license permits seamless integration of Ultralytics software and AI models into commercial goods and services, bypassing the open-source requirements of AGPL-3.0. If your scenario involves embedding our solutions into a commercial offering, reach out through Ultralytics Licensing .
  • Contact

    For Ultralytics bug reports and feature requests please visit GitHub Issues . Become a member of the Ultralytics Discord , Reddit , or Forums for asking questions, sharing projects, learning discussions, or for help with all things Ultralytics!

    v8.2.96 - `ultralytics 8.2.96` new `results[0].to_df` Pandas, XML and CSV methods (#16267) Latest
    Sep 18, 2024
    + 69 releases