├── docs
├── en
│ ├── CNAME
│ ├── reference
│ │ ├── data
│ │ │ ├── base.md
│ │ │ ├── annotator.md
│ │ │ ├── explorer
│ │ │ │ ├── explorer.md
│ │ │ │ ├── utils.md
│ │ │ │ └── gui
│ │ │ │ │ └── dash.md
│ │ │ ├── dataset.md
│ │ │ ├── build.md
│ │ │ ├── converter.md
│ │ │ ├── loaders.md
│ │ │ ├── split_dota.md
│ │ │ └── utils.md
│ │ ├── hub
│ │ │ ├── auth.md
│ │ │ ├── session.md
│ │ │ ├── utils.md
│ │ │ └── __init__.md
│ │ ├── engine
│ │ │ ├── trainer.md
│ │ │ ├── predictor.md
│ │ │ ├── model.md
│ │ │ ├── validator.md
│ │ │ ├── tuner.md
│ │ │ ├── exporter.md
│ │ │ └── results.md
│ │ ├── utils
│ │ │ ├── tuner.md
│ │ │ ├── triton.md
│ │ │ ├── errors.md
│ │ │ ├── callbacks
│ │ │ │ ├── raytune.md
│ │ │ │ ├── mlflow.md
│ │ │ │ ├── wb.md
│ │ │ │ ├── tensorboard.md
│ │ │ │ ├── clearml.md
│ │ │ │ ├── hub.md
│ │ │ │ ├── neptune.md
│ │ │ │ └── dvc.md
│ │ │ ├── benchmarks.md
│ │ │ ├── instance.md
│ │ │ ├── autobatch.md
│ │ │ ├── patches.md
│ │ │ ├── dist.md
│ │ │ ├── tal.md
│ │ │ ├── files.md
│ │ │ ├── loss.md
│ │ │ ├── downloads.md
│ │ │ └── plotting.md
│ │ ├── models
│ │ │ ├── nas
│ │ │ │ ├── model.md
│ │ │ │ ├── val.md
│ │ │ │ └── predict.md
│ │ │ ├── sam
│ │ │ │ ├── model.md
│ │ │ │ ├── modules
│ │ │ │ │ ├── sam.md
│ │ │ │ │ ├── decoders.md
│ │ │ │ │ ├── transformer.md
│ │ │ │ │ └── encoders.md
│ │ │ │ ├── predict.md
│ │ │ │ ├── build.md
│ │ │ │ └── amg.md
│ │ │ ├── fastsam
│ │ │ │ ├── val.md
│ │ │ │ ├── model.md
│ │ │ │ ├── prompt.md
│ │ │ │ ├── predict.md
│ │ │ │ └── utils.md
│ │ │ ├── yolo
│ │ │ │ ├── pose
│ │ │ │ │ ├── val.md
│ │ │ │ │ ├── predict.md
│ │ │ │ │ └── train.md
│ │ │ │ ├── detect
│ │ │ │ │ ├── val.md
│ │ │ │ │ ├── predict.md
│ │ │ │ │ └── train.md
│ │ │ │ ├── segment
│ │ │ │ │ ├── predict.md
│ │ │ │ │ ├── train.md
│ │ │ │ │ └── val.md
│ │ │ │ ├── model.md
│ │ │ │ ├── classify
│ │ │ │ │ ├── predict.md
│ │ │ │ │ ├── train.md
│ │ │ │ │ └── val.md
│ │ │ │ └── obb
│ │ │ │ │ ├── val.md
│ │ │ │ │ ├── predict.md
│ │ │ │ │ └── train.md
│ │ │ ├── rtdetr
│ │ │ │ ├── model.md
│ │ │ │ ├── predict.md
│ │ │ │ ├── train.md
│ │ │ │ └── val.md
│ │ │ └── utils
│ │ │ │ ├── ops.md
│ │ │ │ └── loss.md
│ │ ├── trackers
│ │ │ ├── utils
│ │ │ │ ├── gmc.md
│ │ │ │ ├── kalman_filter.md
│ │ │ │ └── matching.md
│ │ │ ├── basetrack.md
│ │ │ ├── bot_sort.md
│ │ │ ├── byte_tracker.md
│ │ │ └── track.md
│ │ ├── nn
│ │ │ ├── autobackend.md
│ │ │ └── modules
│ │ │ │ ├── utils.md
│ │ │ │ ├── head.md
│ │ │ │ ├── transformer.md
│ │ │ │ └── conv.md
│ │ ├── solutions
│ │ │ ├── ai_gym.md
│ │ │ ├── heatmap.md
│ │ │ ├── distance_calculation.md
│ │ │ ├── speed_estimation.md
│ │ │ └── object_counter.md
│ │ └── cfg
│ │ │ └── __init__.md
│ ├── robots.txt
│ ├── datasets
│ │ └── track
│ │ │ └── index.md
│ └── hub
│ │ ├── api
│ │ └── index.md
│ │ └── on-premise
│ │ └── index.md
├── overrides
│ ├── assets
│ │ └── favicon.ico
│ ├── main.html
│ ├── partials
│ │ └── source-file.html
│ └── stylesheets
│ │ └── style.css
├── mkdocs_github_authors.yaml
└── coming_soon_template.md
├── ultralytics
├── engine
│ └── __init__.py
├── solutions
│ └── __init__.py
├── models
│ ├── utils
│ │ └── __init__.py
│ ├── sam
│ │ ├── modules
│ │ │ └── __init__.py
│ │ └── __init__.py
│ ├── nas
│ │ ├── __init__.py
│ │ └── val.py
│ ├── yolo
│ │ ├── obb
│ │ │ ├── __init__.py
│ │ │ └── train.py
│ │ ├── pose
│ │ │ └── __init__.py
│ │ ├── __init__.py
│ │ ├── detect
│ │ │ ├── __init__.py
│ │ │ └── predict.py
│ │ ├── segment
│ │ │ └── __init__.py
│ │ └── classify
│ │ │ └── __init__.py
│ ├── yolov10
│ │ ├── __init__.py
│ │ ├── model.py
│ │ ├── val.py
│ │ ├── train.py
│ │ └── predict.py
│ ├── rtdetr
│ │ └── __init__.py
│ ├── __init__.py
│ └── fastsam
│ │ ├── __init__.py
│ │ └── model.py
├── trackers
│ ├── utils
│ │ └── __init__.py
│ └── __init__.py
├── data
│ ├── explorer
│ │ ├── gui
│ │ │ └── __init__.py
│ │ └── __init__.py
│ ├── __init__.py
│ └── scripts
│ │ ├── download_weights.sh
│ │ ├── get_coco128.sh
│ │ ├── get_imagenet.sh
│ │ └── get_coco.sh
├── assets
│ ├── bus.jpg
│ └── zidane.jpg
├── utils
│ ├── callbacks
│ │ ├── __init__.py
│ │ └── raytune.py
│ └── errors.py
├── nn
│ └── __init__.py
├── cfg
│ ├── trackers
│ │ ├── bytetrack.yaml
│ │ └── botsort.yaml
│ ├── datasets
│ │ ├── crack-seg.yaml
│ │ ├── brain-tumor.yaml
│ │ ├── package-seg.yaml
│ │ ├── tiger-pose.yaml
│ │ ├── african-wildlife.yaml
│ │ ├── coco8-pose.yaml
│ │ ├── dota8.yaml
│ │ ├── DOTAv1.yaml
│ │ ├── DOTAv1.5.yaml
│ │ ├── carparts-seg.yaml
│ │ └── coco-pose.yaml
│ └── models
│ │ ├── v8
│ │ ├── yolov8-cls-resnet101.yaml
│ │ ├── yolov8-cls-resnet50.yaml
│ │ ├── yolov8-cls.yaml
│ │ ├── yolov8-seg.yaml
│ │ ├── yolov8-pose.yaml
│ │ └── yolov8-p2.yaml
│ │ ├── v9
│ │ └── yolov9c.yaml
│ │ ├── v3
│ │ ├── yolov3-tiny.yaml
│ │ ├── yolov3.yaml
│ │ └── yolov3-spp.yaml
│ │ ├── v10
│ │ ├── yolov10s.yaml
│ │ ├── yolov10n.yaml
│ │ ├── yolov10b.yaml
│ │ ├── yolov10x.yaml
│ │ ├── yolov10l.yaml
│ │ └── yolov10m.yaml
│ │ ├── rt-detr
│ │ ├── rtdetr-resnet101.yaml
│ │ └── rtdetr-resnet50.yaml
│ │ ├── v5
│ │ └── yolov5.yaml
│ │ └── v6
│ │ └── yolov6.yaml
└── __init__.py
├── requirements.txt
├── examples
├── YOLOv8-OpenCV-ONNX-Python
│ └── README.md
├── YOLOv8-CPP-Inference
│ └── CMakeLists.txt
├── YOLOv8-ONNXRuntime-Rust
│ ├── src
│ │ └── main.rs
│ └── Cargo.toml
├── YOLOv8-LibTorch-CPP-Inference
│ ├── README.md
│ └── CMakeLists.txt
└── YOLOv8-ONNXRuntime
│ └── README.md
├── RKNN_README_CN.md
├── RKNN_README_EN.md
└── docker
└── Dockerfile-runner
/docs/en/CNAME:
--------------------------------------------------------------------------------
1 | docs.ultralytics.com
2 |
--------------------------------------------------------------------------------
/ultralytics/engine/__init__.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
--------------------------------------------------------------------------------
/ultralytics/solutions/__init__.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
--------------------------------------------------------------------------------
/ultralytics/models/utils/__init__.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
--------------------------------------------------------------------------------
/ultralytics/trackers/utils/__init__.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
--------------------------------------------------------------------------------
/ultralytics/data/explorer/gui/__init__.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
--------------------------------------------------------------------------------
/ultralytics/models/sam/modules/__init__.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
--------------------------------------------------------------------------------
/ultralytics/assets/bus.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airockchip/yolov10/HEAD/ultralytics/assets/bus.jpg
--------------------------------------------------------------------------------
/ultralytics/assets/zidane.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airockchip/yolov10/HEAD/ultralytics/assets/zidane.jpg
--------------------------------------------------------------------------------
/docs/overrides/assets/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airockchip/yolov10/HEAD/docs/overrides/assets/favicon.ico
--------------------------------------------------------------------------------
/ultralytics/data/explorer/__init__.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
3 | from .utils import plot_query_result
4 |
5 | __all__ = ["plot_query_result"]
6 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | torch==2.0.1
2 | torchvision==0.15.2
3 | onnx==1.14.0
4 | onnxruntime==1.15.1
5 | pycocotools==2.0.7
6 | PyYAML==6.0.1
7 | scipy==1.13.0
8 | onnxsim==0.4.36
9 | onnxruntime-gpu==1.18.0
--------------------------------------------------------------------------------
/ultralytics/models/sam/__init__.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
3 | from .model import SAM
4 | from .predict import Predictor
5 |
6 | __all__ = "SAM", "Predictor" # tuple or list
7 |
--------------------------------------------------------------------------------
/ultralytics/models/nas/__init__.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
3 | from .model import NAS
4 | from .predict import NASPredictor
5 | from .val import NASValidator
6 |
7 | __all__ = "NASPredictor", "NASValidator", "NAS"
8 |
--------------------------------------------------------------------------------
/ultralytics/models/yolo/obb/__init__.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
3 | from .predict import OBBPredictor
4 | from .train import OBBTrainer
5 | from .val import OBBValidator
6 |
7 | __all__ = "OBBPredictor", "OBBTrainer", "OBBValidator"
8 |
--------------------------------------------------------------------------------
/ultralytics/models/yolov10/__init__.py:
--------------------------------------------------------------------------------
1 | from .model import YOLOv10
2 | from .predict import YOLOv10DetectionPredictor
3 | from .val import YOLOv10DetectionValidator
4 |
5 | __all__ = "YOLOv10DetectionPredictor", "YOLOv10DetectionValidator", "YOLOv10"
6 |
--------------------------------------------------------------------------------
/ultralytics/models/rtdetr/__init__.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
3 | from .model import RTDETR
4 | from .predict import RTDETRPredictor
5 | from .val import RTDETRValidator
6 |
7 | __all__ = "RTDETRPredictor", "RTDETRValidator", "RTDETR"
8 |
--------------------------------------------------------------------------------
/ultralytics/models/yolo/pose/__init__.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
3 | from .predict import PosePredictor
4 | from .train import PoseTrainer
5 | from .val import PoseValidator
6 |
7 | __all__ = "PoseTrainer", "PoseValidator", "PosePredictor"
8 |
--------------------------------------------------------------------------------
/ultralytics/utils/callbacks/__init__.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
3 | from .base import add_integration_callbacks, default_callbacks, get_default_callbacks
4 |
5 | __all__ = "add_integration_callbacks", "default_callbacks", "get_default_callbacks"
6 |
--------------------------------------------------------------------------------
/ultralytics/trackers/__init__.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
3 | from .bot_sort import BOTSORT
4 | from .byte_tracker import BYTETracker
5 | from .track import register_tracker
6 |
7 | __all__ = "register_tracker", "BOTSORT", "BYTETracker" # allow simpler import
8 |
--------------------------------------------------------------------------------
/ultralytics/models/yolo/__init__.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
3 | from ultralytics.models.yolo import classify, detect, obb, pose, segment
4 |
5 | from .model import YOLO, YOLOWorld
6 |
7 | __all__ = "classify", "segment", "detect", "pose", "obb", "YOLO", "YOLOWorld"
8 |
--------------------------------------------------------------------------------
/ultralytics/models/__init__.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
3 | from .rtdetr import RTDETR
4 | from .sam import SAM
5 | from .yolo import YOLO, YOLOWorld
6 | from .yolov10 import YOLOv10
7 |
8 | __all__ = "YOLO", "RTDETR", "SAM", "YOLOWorld", "YOLOv10" # allow simpler import
9 |
--------------------------------------------------------------------------------
/ultralytics/models/yolo/detect/__init__.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
3 | from .predict import DetectionPredictor
4 | from .train import DetectionTrainer
5 | from .val import DetectionValidator
6 |
7 | __all__ = "DetectionPredictor", "DetectionTrainer", "DetectionValidator"
8 |
--------------------------------------------------------------------------------
/ultralytics/models/yolo/segment/__init__.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
3 | from .predict import SegmentationPredictor
4 | from .train import SegmentationTrainer
5 | from .val import SegmentationValidator
6 |
7 | __all__ = "SegmentationPredictor", "SegmentationTrainer", "SegmentationValidator"
8 |
--------------------------------------------------------------------------------
/ultralytics/models/fastsam/__init__.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
3 | from .model import FastSAM
4 | from .predict import FastSAMPredictor
5 | from .prompt import FastSAMPrompt
6 | from .val import FastSAMValidator
7 |
8 | __all__ = "FastSAMPredictor", "FastSAM", "FastSAMPrompt", "FastSAMValidator"
9 |
--------------------------------------------------------------------------------
/ultralytics/models/yolo/classify/__init__.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
3 | from ultralytics.models.yolo.classify.predict import ClassificationPredictor
4 | from ultralytics.models.yolo.classify.train import ClassificationTrainer
5 | from ultralytics.models.yolo.classify.val import ClassificationValidator
6 |
7 | __all__ = "ClassificationPredictor", "ClassificationTrainer", "ClassificationValidator"
8 |
--------------------------------------------------------------------------------
/examples/YOLOv8-OpenCV-ONNX-Python/README.md:
--------------------------------------------------------------------------------
1 | # YOLOv8 - OpenCV
2 |
3 | Implementation YOLOv8 on OpenCV using ONNX Format.
4 |
5 | Just simply clone and run
6 |
7 | ```bash
8 | pip install -r requirements.txt
9 | python main.py --model yolov8n.onnx --img image.jpg
10 | ```
11 |
12 | If you start from scratch:
13 |
14 | ```bash
15 | pip install ultralytics
16 | yolo export model=yolov8n.pt imgsz=640 format=onnx opset=12
17 | ```
18 |
19 | _\*Make sure to include "opset=12"_
20 |
--------------------------------------------------------------------------------
/ultralytics/data/__init__.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
3 | from .base import BaseDataset
4 | from .build import build_dataloader, build_yolo_dataset, load_inference_source
5 | from .dataset import ClassificationDataset, SemanticDataset, YOLODataset
6 |
7 | __all__ = (
8 | "BaseDataset",
9 | "ClassificationDataset",
10 | "SemanticDataset",
11 | "YOLODataset",
12 | "build_yolo_dataset",
13 | "build_dataloader",
14 | "load_inference_source",
15 | )
16 |
--------------------------------------------------------------------------------
/docs/overrides/main.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | {% extends "base.html" %}
4 |
5 | {% block announce %}
6 |
12 | {% endblock %}
13 |
--------------------------------------------------------------------------------
/ultralytics/data/scripts/download_weights.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Ultralytics YOLO 🚀, AGPL-3.0 license
3 | # Download latest models from https://github.com/ultralytics/assets/releases
4 | # Example usage: bash ultralytics/data/scripts/download_weights.sh
5 | # parent
6 | # └── weights
7 | # ├── yolov8n.pt ← downloads here
8 | # ├── yolov8s.pt
9 | # └── ...
10 |
11 | python - < Result<(), Box> {
6 | let args = Args::parse();
7 |
8 | // 1. load image
9 | let x = image::io::Reader::open(&args.source)?
10 | .with_guessed_format()?
11 | .decode()?;
12 |
13 | // 2. model support dynamic batch inference, so input should be a Vec
14 | let xs = vec![x];
15 |
16 | // You can test `--batch 2` with this
17 | // let xs = vec![x.clone(), x];
18 |
19 | // 3. build yolov8 model
20 | let mut model = YOLOv8::new(args)?;
21 | model.summary(); // model info
22 |
23 | // 4. run
24 | let ys = model.run(&xs)?;
25 | println!("{:?}", ys);
26 |
27 | Ok(())
28 | }
29 |
--------------------------------------------------------------------------------
/ultralytics/utils/callbacks/raytune.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
3 | from ultralytics.utils import SETTINGS
4 |
5 | try:
6 | assert SETTINGS["raytune"] is True # verify integration is enabled
7 | import ray
8 | from ray import tune
9 | from ray.air import session
10 |
11 | except (ImportError, AssertionError):
12 | tune = None
13 |
14 |
15 | def on_fit_epoch_end(trainer):
16 | """Sends training metrics to Ray Tune at end of each epoch."""
17 | if ray.tune.is_session_enabled():
18 | metrics = trainer.metrics
19 | metrics["epoch"] = trainer.epoch
20 | session.report(metrics)
21 |
22 |
23 | callbacks = (
24 | {
25 | "on_fit_epoch_end": on_fit_epoch_end,
26 | }
27 | if tune
28 | else {}
29 | )
30 |
--------------------------------------------------------------------------------
/examples/YOLOv8-LibTorch-CPP-Inference/README.md:
--------------------------------------------------------------------------------
1 | # YOLOv8 LibTorch Inference C++
2 |
3 | This example demonstrates how to perform inference using YOLOv8 models in C++ with LibTorch API.
4 |
5 | ## Dependencies
6 |
7 | | Dependency | Version |
8 | | ------------ | -------- |
9 | | OpenCV | >=4.0.0 |
10 | | C++ Standard | >=17 |
11 | | Cmake | >=3.18 |
12 | | Libtorch | >=1.12.1 |
13 |
14 | ## Usage
15 |
16 | ```bash
17 | git clone ultralytics
18 | cd ultralytics
19 | pip install .
20 | cd examples/YOLOv8-LibTorch-CPP-Inference
21 |
22 | mkdir build
23 | cd build
24 | cmake ..
25 | make
26 | ./yolov8_libtorch_inference
27 | ```
28 |
29 | ## Exporting YOLOv8
30 |
31 | To export YOLOv8 models:
32 |
33 | ```commandline
34 | yolo export model=yolov8s.pt imgsz=640 format=torchscript
35 | ```
36 |
--------------------------------------------------------------------------------
/docs/en/reference/data/base.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore BaseDataset in Ultralytics docs. Learn how this implementation simplifies dataset creation and manipulation.
3 | keywords: Ultralytics, docs, BaseDataset, data manipulation, dataset creation
4 | ---
5 |
6 | # Reference for `ultralytics/data/base.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/base.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/base.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/data/base.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.data.base.BaseDataset
15 |
16 |
17 |
--------------------------------------------------------------------------------
/ultralytics/models/yolov10/val.py:
--------------------------------------------------------------------------------
1 | from ultralytics.models.yolo.detect import DetectionValidator
2 | from ultralytics.utils import ops
3 | import torch
4 |
5 | class YOLOv10DetectionValidator(DetectionValidator):
6 | def __init__(self, *args, **kwargs):
7 | super().__init__(*args, **kwargs)
8 | self.args.save_json |= self.is_coco
9 |
10 | def postprocess(self, preds):
11 | if isinstance(preds, dict):
12 | preds = preds["one2one"]
13 |
14 | if isinstance(preds, (list, tuple)):
15 | preds = preds[0]
16 |
17 | preds = preds.transpose(-1, -2)
18 | boxes, scores, labels = ops.v10postprocess(preds, self.args.max_det, self.nc)
19 | bboxes = ops.xywh2xyxy(boxes)
20 | return torch.cat([bboxes, scores.unsqueeze(-1), labels.unsqueeze(-1)], dim=-1)
--------------------------------------------------------------------------------
/docs/en/reference/hub/auth.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Dive into the Ultralytics Auth API documentation & learn how to manage authentication in your AI & ML projects easily and effectively.
3 | keywords: Ultralytics, Auth, API documentation, User Authentication, AI, Machine Learning
4 | ---
5 |
6 | # Reference for `ultralytics/hub/auth.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/hub/auth.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/hub/auth.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/hub/auth.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.hub.auth.Auth
15 |
16 |
17 |
--------------------------------------------------------------------------------
/RKNN_README_CN.md:
--------------------------------------------------------------------------------
1 | # 导出 RKNPU2 适配模型说明
2 |
3 | ## Source
4 |
5 | 本仓库基于 https://github.com/THU-MIG/yolov10 仓库的 62aaafb3a0bcc17224b797ae4e9af65d7f29773f commit 进行修改,验证.
6 |
7 |
8 |
9 | ## 模型差异
10 |
11 | 在不影响输出结果, 不需要重新训练模型的条件下, 有以下改动:
12 |
13 | - 模型输出中置信度分支增加sigmoid算子(修改 `ultralytics/nn/modules/head.py`)
14 |
15 | - 因后处理算子对推理性能和量化精度不友好,修改输出结构, 移除后处理结构(修改`ultralytics/nn/modules/head.py`)
16 |
17 | - 为提升推理性能,移动 DFL 结构到模型外部的后处理阶段(修改`ultralytics/nn/modules/head.py`)
18 |
19 |
20 | ## 导出onnx模型
21 |
22 | 在满足`yolov10`原仓库中导出模型的安装环境后,执行以下语句导出模型
23 |
24 | ``` sh
25 | yolo export model=model/yolov10{n/s/m/b/l/x} format=rknn opset=13 simplify
26 |
27 | # model 为原始模型文件
28 | # format 为模型导出格式
29 | # 执行完毕后,会生成 ONNX 模型. 假如原始模型为 yolov10n.pt,则生成 yolo10n.onnx 模型。
30 | ```
31 |
32 | ## 转RKNN模型、Python demo、C demo
33 |
34 | 请参考 https://github.com/airockchip/rknn_model_zoo
35 |
36 |
--------------------------------------------------------------------------------
/docs/en/reference/engine/trainer.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Learn about the BaseTrainer class in the Ultralytics library. From training control, customization to advanced usage.
3 | keywords: Ultralytics, BaseTrainer, Machine Learning, Training Control, Python library
4 | ---
5 |
6 | # Reference for `ultralytics/engine/trainer.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/trainer.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/trainer.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/engine/trainer.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.engine.trainer.BaseTrainer
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/utils/tuner.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Learn to utilize the run_ray_tune function with Ultralytics. Make your machine learning tuning process easier and more efficient.
3 | keywords: Ultralytics, run_ray_tune, machine learning tuning, machine learning efficiency
4 | ---
5 |
6 | # Reference for `ultralytics/utils/tuner.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/tuner.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/tuner.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/tuner.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.utils.tuner.run_ray_tune
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/engine/predictor.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Learn about Ultralytics BasePredictor, an essential component of our engine that serves as the foundation for all prediction operations.
3 | keywords: Ultralytics, BasePredictor, YOLO, prediction, engine
4 | ---
5 |
6 | # Reference for `ultralytics/engine/predictor.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/predictor.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/predictor.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/engine/predictor.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.engine.predictor.BasePredictor
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Sitemap: https://docs.ultralytics.com/sitemap.xml
3 | Sitemap: https://docs.ultralytics.com/ar/sitemap.xml
4 | Sitemap: https://docs.ultralytics.com/de/sitemap.xml
5 | Sitemap: https://docs.ultralytics.com/es/sitemap.xml
6 | Sitemap: https://docs.ultralytics.com/fr/sitemap.xml
7 | Sitemap: https://docs.ultralytics.com/hi/sitemap.xml
8 | Sitemap: https://docs.ultralytics.com/it/sitemap.xml
9 | Sitemap: https://docs.ultralytics.com/ja/sitemap.xml
10 | Sitemap: https://docs.ultralytics.com/ko/sitemap.xml
11 | Sitemap: https://docs.ultralytics.com/nl/sitemap.xml
12 | Sitemap: https://docs.ultralytics.com/pt/sitemap.xml
13 | Sitemap: https://docs.ultralytics.com/ru/sitemap.xml
14 | Sitemap: https://docs.ultralytics.com/tr/sitemap.xml
15 | Sitemap: https://docs.ultralytics.com/vi/sitemap.xml
16 | Sitemap: https://docs.ultralytics.com/zh/sitemap.xml
17 |
--------------------------------------------------------------------------------
/docs/en/reference/engine/model.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore the detailed guide on using the Ultralytics YOLO Engine Model. Learn better ways to implement, train and evaluate YOLO models.
3 | keywords: Ultralytics, YOLO, engine model, documentation, guide, implementation, training, evaluation
4 | ---
5 |
6 | # Reference for `ultralytics/engine/model.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/model.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/model.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/engine/model.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.engine.model.Model
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/engine/validator.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Learn about the Ultralytics BaseValidator module. Understand its principles, uses, and how it interacts with other components.
3 | keywords: Ultralytics, BaseValidator, Ultralytics engine, module, components
4 | ---
5 |
6 | # Reference for `ultralytics/engine/validator.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/validator.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/validator.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/engine/validator.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.engine.validator.BaseValidator
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/models/nas/model.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Learn how our NAS model operates in Ultralytics. Comprehensive guide with detailed examples. Master the nuances of Ultralytics NAS model.
3 | keywords: Ultralytics, NAS model, NAS guide, machine learning, model documentation
4 | ---
5 |
6 | # Reference for `ultralytics/models/nas/model.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/nas/model.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/nas/model.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/nas/model.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.nas.model.NAS
15 |
16 |
17 |
--------------------------------------------------------------------------------
/ultralytics/cfg/datasets/crack-seg.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # Crack-seg dataset by Ultralytics
3 | # Documentation: https://docs.ultralytics.com/datasets/segment/crack-seg/
4 | # Example usage: yolo train data=crack-seg.yaml
5 | # parent
6 | # ├── ultralytics
7 | # └── datasets
8 | # └── crack-seg ← downloads here (91.2 MB)
9 |
10 | # Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
11 | path: ../datasets/crack-seg # dataset root dir
12 | train: train/images # train images (relative to 'path') 3717 images
13 | val: valid/images # val images (relative to 'path') 112 images
14 | test: test/images # test images (relative to 'path') 200 images
15 |
16 | # Classes
17 | names:
18 | 0: crack
19 |
20 | # Download script/URL (optional)
21 | download: https://ultralytics.com/assets/crack-seg.zip
22 |
--------------------------------------------------------------------------------
/docs/en/reference/hub/session.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore details about the HUBTrainingSession in Ultralytics framework. Learn to utilize this functionality for effective model training.
3 | keywords: Ultralytics, HUBTrainingSession, Documentation, Model Training, AI, Machine Learning, YOLO
4 | ---
5 |
6 | # Reference for `ultralytics/hub/session.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/hub/session.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/hub/session.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/hub/session.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.hub.session.HUBTrainingSession
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/utils/triton.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Deploy ML models effortlessly with Ultralytics TritonRemoteModel. Simplify serving with our comprehensive utils guide.
3 | keywords: Ultralytics, YOLO, TritonRemoteModel, machine learning, model serving, deployment, utils, documentation
4 | ---
5 |
6 | # Reference for `ultralytics/utils/triton.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/triton.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/triton.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/triton.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.utils.triton.TritonRemoteModel
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/models/sam/model.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Dive into the SAM model details in the Ultralytics YOLO documentation. Understand, implement, and optimize your model use.
3 | keywords: Ultralytics, YOLO, SAM Model, Documentations, Machine Learning, AI, Convolutional neural network
4 | ---
5 |
6 | # Reference for `ultralytics/models/sam/model.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/model.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/model.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/sam/model.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.sam.model.SAM
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/utils/errors.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Learn about the HUBModelError in Ultralytics. Enhance your understanding, troubleshoot errors and optimize your machine learning projects.
3 | keywords: Ultralytics, HUBModelError, Machine Learning, Error troubleshooting, Ultralytics documentation
4 | ---
5 |
6 | # Reference for `ultralytics/utils/errors.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/errors.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/errors.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/errors.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.utils.errors.HUBModelError
15 |
16 |
17 |
--------------------------------------------------------------------------------
/ultralytics/cfg/datasets/brain-tumor.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # Brain-tumor dataset by Ultralytics
3 | # Documentation: https://docs.ultralytics.com/datasets/detect/brain-tumor/
4 | # Example usage: yolo train data=brain-tumor.yaml
5 | # parent
6 | # ├── ultralytics
7 | # └── datasets
8 | # └── brain-tumor ← downloads here (4.05 MB)
9 |
10 | # Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
11 | path: ../datasets/brain-tumor # dataset root dir
12 | train: train/images # train images (relative to 'path') 893 images
13 | val: valid/images # val images (relative to 'path') 223 images
14 | test: # test images (relative to 'path')
15 |
16 | # Classes
17 | names:
18 | 0: negative
19 | 1: positive
20 |
21 | # Download script/URL (optional)
22 | download: https://ultralytics.com/assets/brain-tumor.zip
23 |
--------------------------------------------------------------------------------
/ultralytics/cfg/datasets/package-seg.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # Package-seg dataset by Ultralytics
3 | # Documentation: https://docs.ultralytics.com/datasets/segment/package-seg/
4 | # Example usage: yolo train data=package-seg.yaml
5 | # parent
6 | # ├── ultralytics
7 | # └── datasets
8 | # └── package-seg ← downloads here (102 MB)
9 |
10 | # Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
11 | path: ../datasets/package-seg # dataset root dir
12 | train: images/train # train images (relative to 'path') 1920 images
13 | val: images/val # val images (relative to 'path') 89 images
14 | test: test/images # test images (relative to 'path') 188 images
15 |
16 | # Classes
17 | names:
18 | 0: package
19 |
20 | # Download script/URL (optional)
21 | download: https://ultralytics.com/assets/package-seg.zip
22 |
--------------------------------------------------------------------------------
/docs/en/reference/data/annotator.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Enhance your machine learning model with Ultralytics’ auto_annotate function. Simplify data annotation for improved model training.
3 | keywords: Ultralytics, Auto-Annotate, Machine Learning, AI, Annotation, Data Processing, Model Training
4 | ---
5 |
6 | # Reference for `ultralytics/data/annotator.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/annotator.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/annotator.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/data/annotator.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.data.annotator.auto_annotate
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/models/fastsam/val.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Learn about FastSAMValidator in Ultralytics models. Comprehensive guide to enhancing AI capabilities with Ultralytics.
3 | keywords: Ultralytics, FastSAMValidator, model, synthetic, AI, machine learning, validation
4 | ---
5 |
6 | # Reference for `ultralytics/models/fastsam/val.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/fastsam/val.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/fastsam/val.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/fastsam/val.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.fastsam.val.FastSAMValidator
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/models/nas/val.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore the utilities and functions of the Ultralytics NASValidator. Find out how it benefits allocation and optimization in AI models.
3 | keywords: Ultralytics, NASValidator, models.nas.val.NASValidator, AI models, allocation, optimization
4 | ---
5 |
6 | # Reference for `ultralytics/models/nas/val.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/nas/val.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/nas/val.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/nas/val.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.nas.val.NASValidator
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/models/yolo/pose/val.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore the PoseValidator—review how Ultralytics YOLO validates poses for object detection. Improve your understanding of YOLO.
3 | keywords: PoseValidator, Ultralytics, YOLO, Object detection, Pose validation
4 | ---
5 |
6 | # Reference for `ultralytics/models/yolo/pose/val.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/pose/val.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/pose/val.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/yolo/pose/val.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.yolo.pose.val.PoseValidator
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/models/fastsam/model.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Learn all about Ultralytics FastSAM model. Dive into our comprehensive guide for seamless integration and efficient model training.
3 | keywords: Ultralytics, FastSAM model, Model documentation, Efficient model training
4 | ---
5 |
6 | # Reference for `ultralytics/models/fastsam/model.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/fastsam/model.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/fastsam/model.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/fastsam/model.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.fastsam.model.FastSAM
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/models/rtdetr/model.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore the specifics of using the RTDETR model in Ultralytics. Detailed documentation layered with explanations and examples.
3 | keywords: Ultralytics, RTDETR model, Ultralytics models, object detection, Ultralytics documentation
4 | ---
5 |
6 | # Reference for `ultralytics/models/rtdetr/model.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/rtdetr/model.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/rtdetr/model.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/rtdetr/model.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.rtdetr.model.RTDETR
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/trackers/utils/gmc.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore the Ultralytics GMC tool in our comprehensive documentation. Learn how it works, best practices, and implementation advice.
3 | keywords: Ultralytics, GMC utility, Ultralytics documentation, Ultralytics tracker, machine learning tools
4 | ---
5 |
6 | # Reference for `ultralytics/trackers/utils/gmc.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/utils/gmc.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/utils/gmc.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/trackers/utils/gmc.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.trackers.utils.gmc.GMC
15 |
16 |
17 |
--------------------------------------------------------------------------------
/examples/YOLOv8-ONNXRuntime-Rust/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "yolov8-rs"
3 | version = "0.1.0"
4 | edition = "2021"
5 |
6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7 |
8 | [dependencies]
9 | clap = { version = "4.2.4", features = ["derive"] }
10 | image = { version = "0.24.7", default-features = false, features = ["jpeg", "png", "webp-encoder"] }
11 | imageproc = { version = "0.23.0", default-features = false }
12 | ndarray = { version = "0.15.6" }
13 | ort = {version = "1.16.3", default-features = false, features = ["load-dynamic", "copy-dylibs", "half"]}
14 | rusttype = { version = "0.9", default-features = false }
15 | anyhow = { version = "1.0.75"}
16 | regex = { version = "1.5.4" }
17 | rand = { version ="0.8.5" }
18 | chrono = { version = "0.4.30" }
19 | half = { version = "2.3.1" }
20 | dirs = { version = "5.0.1" }
21 | ureq = { version = "2.9.1" }
22 |
--------------------------------------------------------------------------------
/docs/en/reference/models/nas/predict.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore Ultralytics NASPredictor. Understand high-level architecture of the model for effective implementation and efficient predictions.
3 | keywords: NASPredictor, Ultralytics, Ultralytics model, model architecture, efficient predictions
4 | ---
5 |
6 | # Reference for `ultralytics/models/nas/predict.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/nas/predict.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/nas/predict.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/nas/predict.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.nas.predict.NASPredictor
15 |
16 |
17 |
--------------------------------------------------------------------------------
/ultralytics/utils/errors.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
3 | from ultralytics.utils import emojis
4 |
5 |
6 | class HUBModelError(Exception):
7 | """
8 | Custom exception class for handling errors related to model fetching in Ultralytics YOLO.
9 |
10 | This exception is raised when a requested model is not found or cannot be retrieved.
11 | The message is also processed to include emojis for better user experience.
12 |
13 | Attributes:
14 | message (str): The error message displayed when the exception is raised.
15 |
16 | Note:
17 | The message is automatically processed through the 'emojis' function from the 'ultralytics.utils' package.
18 | """
19 |
20 | def __init__(self, message="Model not found. Please check model URL and try again."):
21 | """Create an exception for when a model is not found."""
22 | super().__init__(emojis(message))
23 |
--------------------------------------------------------------------------------
/docs/en/reference/models/rtdetr/predict.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Learn how to use the RTDETRPredictor model of the Ultralytics package. Detailed documentation, usage instructions, and advice.
3 | keywords: Ultralytics, RTDETRPredictor, model documentation, guide, real-time object detection
4 | ---
5 |
6 | # Reference for `ultralytics/models/rtdetr/predict.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/rtdetr/predict.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/rtdetr/predict.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/rtdetr/predict.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.rtdetr.predict.RTDETRPredictor
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/models/sam/modules/sam.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore the Sam module of Ultralytics. Discover detailed methods, classes, and information for efficient deep-learning model training!.
3 | keywords: Ultralytics, Sam module, deep learning, model training, Ultralytics documentation
4 | ---
5 |
6 | # Reference for `ultralytics/models/sam/modules/sam.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/sam.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/sam.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/sam/modules/sam.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.sam.modules.sam.Sam
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/models/sam/predict.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Master the ultralytics.models.sam.predict.Predictor class with our comprehensive guide. Discover techniques to enhance your model predictions.
3 | keywords: Ultralytics, predictor, models, sam.predict.Predictor, AI, machine learning, predictive models
4 | ---
5 |
6 | # Reference for `ultralytics/models/sam/predict.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/predict.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/predict.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/sam/predict.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.sam.predict.Predictor
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/models/yolo/pose/predict.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Discover how to use PosePredictor in the Ultralytics YOLO model. Includes detailed guides, code examples, and explanations.
3 | keywords: Ultralytics, YOLO, PosePredictor, machine learning, AI, predictive models
4 | ---
5 |
6 | # Reference for `ultralytics/models/yolo/pose/predict.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/pose/predict.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/pose/predict.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/yolo/pose/predict.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.yolo.pose.predict.PosePredictor
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/models/fastsam/prompt.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Learn to effectively utilize FastSAMPrompt model from Ultralytics. Detailed guide to help you get the most out of your machine learning models.
3 | keywords: Ultralytics, FastSAMPrompt, machine learning, model, guide, documentation
4 | ---
5 |
6 | # Reference for `ultralytics/models/fastsam/prompt.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/fastsam/prompt.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/fastsam/prompt.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/fastsam/prompt.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.fastsam.prompt.FastSAMPrompt
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/models/yolo/detect/val.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Discover function valuation of your YOLO models with the Ultralytics Detection Validator. Enhance precision and recall rates today.
3 | keywords: Ultralytics, YOLO, Detection Validator, model valuation, precision, recall
4 | ---
5 |
6 | # Reference for `ultralytics/models/yolo/detect/val.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/detect/val.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/detect/val.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/yolo/detect/val.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.yolo.detect.val.DetectionValidator
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/models/yolo/pose/train.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore Ultralytics PoseTrainer for YOLO models. Get a step-by-step guide on how to train on custom pose data for more accurate AI modeling.
3 | keywords: Ultralytics, YOLO, PoseTrainer, pose training, AI modeling, custom data training
4 | ---
5 |
6 | # Reference for `ultralytics/models/yolo/pose/train.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/pose/train.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/pose/train.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/yolo/pose/train.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.yolo.pose.train.PoseTrainer
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/models/yolo/segment/predict.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Discover how to utilize the YOLO Segmentation Predictor in Ultralytics. Enhance your objects detection skills with us.
3 | keywords: YOLO, Ultralytics, object detection, segmentation predictor
4 | ---
5 |
6 | # Reference for `ultralytics/models/yolo/segment/predict.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/segment/predict.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/segment/predict.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/yolo/segment/predict.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.yolo.segment.predict.SegmentationPredictor
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/models/yolo/model.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Discover the Ultralytics YOLO model class. Learn advanced techniques, tips, and tricks for training.
3 | keywords: Ultralytics YOLO, YOLO, YOLO model, Model Training, Machine Learning, Deep Learning, Computer Vision
4 | ---
5 |
6 | # Reference for `ultralytics/models/yolo/model.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/model.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/model.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/yolo/model.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.yolo.model.YOLO
15 |
16 |
17 |
18 | ## ::: ultralytics.models.yolo.model.YOLOWorld
19 |
20 |
21 |
--------------------------------------------------------------------------------
/docs/en/reference/models/yolo/detect/predict.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore the guide to using the DetectionPredictor in Ultralytics YOLO. Learn how to predict, detect and analyze objects accurately.
3 | keywords: Ultralytics, YOLO, DetectionPredictor, detect, predict, object detection, analysis
4 | ---
5 |
6 | # Reference for `ultralytics/models/yolo/detect/predict.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/detect/predict.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/detect/predict.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/yolo/detect/predict.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.yolo.detect.predict.DetectionPredictor
15 |
16 |
17 |
--------------------------------------------------------------------------------
/ultralytics/cfg/datasets/tiger-pose.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # Tiger Pose dataset by Ultralytics
3 | # Documentation: https://docs.ultralytics.com/datasets/pose/tiger-pose/
4 | # Example usage: yolo train data=tiger-pose.yaml
5 | # parent
6 | # ├── ultralytics
7 | # └── datasets
8 | # └── tiger-pose ← downloads here (75.3 MB)
9 |
10 | # Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
11 | path: ../datasets/tiger-pose # dataset root dir
12 | train: train # train images (relative to 'path') 210 images
13 | val: val # val images (relative to 'path') 53 images
14 |
15 | # Keypoints
16 | kpt_shape: [12, 2] # number of keypoints, number of dims (2 for x,y or 3 for x,y,visible)
17 | flip_idx: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
18 |
19 | # Classes
20 | names:
21 | 0: tiger
22 |
23 | # Download script/URL (optional)
24 | download: https://ultralytics.com/assets/tiger-pose.zip
25 |
--------------------------------------------------------------------------------
/docs/en/reference/models/rtdetr/train.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Get insights into RTDETRTrainer, a crucial component of Ultralytics for effective model training. Explore detailed documentation at Ultralytics.
3 | keywords: Ultralytics, RTDETRTrainer, model training, Ultralytics models, PyTorch models, neural networks, machine learning, deep learning
4 | ---
5 |
6 | # Reference for `ultralytics/models/rtdetr/train.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/rtdetr/train.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/rtdetr/train.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/rtdetr/train.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.rtdetr.train.RTDETRTrainer
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/models/yolo/detect/train.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Maximize your model's potential with Ultralytics YOLO Detection Trainer. Learn advanced techniques, tips, and tricks for training.
3 | keywords: Ultralytics YOLO, YOLO, Detection Trainer, Model Training, Machine Learning, Deep Learning, Computer Vision
4 | ---
5 |
6 | # Reference for `ultralytics/models/yolo/detect/train.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/detect/train.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/detect/train.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/yolo/detect/train.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.yolo.detect.train.DetectionTrainer
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/utils/callbacks/raytune.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Discover the functionality of the on_fit_epoch_end callback in the Ultralytics YOLO framework. Learn how to end an epoch in your deep learning projects.
3 | keywords: Ultralytics, YOLO, on_fit_epoch_end, callbacks, documentation, deep learning, YOLO framework
4 | ---
5 |
6 | # Reference for `ultralytics/utils/callbacks/raytune.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/raytune.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/raytune.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/callbacks/raytune.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.utils.callbacks.raytune.on_fit_epoch_end
15 |
16 |
17 |
--------------------------------------------------------------------------------
/ultralytics/models/yolov10/train.py:
--------------------------------------------------------------------------------
1 | from ultralytics.models.yolo.detect import DetectionTrainer
2 | from .val import YOLOv10DetectionValidator
3 | from .model import YOLOv10DetectionModel
4 | from copy import copy
5 | from ultralytics.utils import RANK
6 |
7 | class YOLOv10DetectionTrainer(DetectionTrainer):
8 | def get_validator(self):
9 | """Returns a DetectionValidator for YOLO model validation."""
10 | self.loss_names = "box_om", "cls_om", "dfl_om", "box_oo", "cls_oo", "dfl_oo",
11 | return YOLOv10DetectionValidator(
12 | self.test_loader, save_dir=self.save_dir, args=copy(self.args), _callbacks=self.callbacks
13 | )
14 |
15 | def get_model(self, cfg=None, weights=None, verbose=True):
16 | """Return a YOLO detection model."""
17 | model = YOLOv10DetectionModel(cfg, nc=self.data["nc"], verbose=verbose and RANK == -1)
18 | if weights:
19 | model.load(weights)
20 | return model
21 |
--------------------------------------------------------------------------------
/docs/en/reference/models/yolo/classify/predict.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore the Ultralytics ClassificationPredictor guide for model prediction and visualization. Build powerful AI models with YOLO.
3 | keywords: Ultralytics, classification predictor, predict, YOLO, AI models, model visualization
4 | ---
5 |
6 | # Reference for `ultralytics/models/yolo/classify/predict.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/classify/predict.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/classify/predict.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/yolo/classify/predict.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.yolo.classify.predict.ClassificationPredictor
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/models/yolo/segment/train.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Maximize your YOLO model's performance with our SegmentationTrainer. Explore comprehensive guides and tutorials on ultralytics.com.
3 | keywords: Ultralytics, YOLO, SegmentationTrainer, image segmentation, object detection, model training, YOLO model
4 | ---
5 |
6 | # Reference for `ultralytics/models/yolo/segment/train.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/segment/train.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/segment/train.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/yolo/segment/train.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.yolo.segment.train.SegmentationTrainer
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/models/yolo/segment/val.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Get practical insights about our SegmentationValidator in YOLO Ultralytics models. Discover functionality details, methods, inputs, and outputs.
3 | keywords: Ultralytics, YOLO, SegmentationValidator, model segmentation, image classification, object detection
4 | ---
5 |
6 | # Reference for `ultralytics/models/yolo/segment/val.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/segment/val.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/segment/val.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/yolo/segment/val.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.yolo.segment.val.SegmentationValidator
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/utils/benchmarks.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Discover how to profile your models using Ultralytics utilities. Enhance performance, optimize your benchmarks, and learn best practices.
3 | keywords: Ultralytics, ProfileModels, benchmarks, model profiling, performance optimization
4 | ---
5 |
6 | # Reference for `ultralytics/utils/benchmarks.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/benchmarks.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/benchmarks.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/benchmarks.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.utils.benchmarks.ProfileModels
15 |
16 |
17 |
18 | ## ::: ultralytics.utils.benchmarks.benchmark
19 |
20 |
21 |
--------------------------------------------------------------------------------
/ultralytics/cfg/trackers/botsort.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # Default YOLO tracker settings for BoT-SORT tracker https://github.com/NirAharon/BoT-SORT
3 |
4 | tracker_type: botsort # tracker type, ['botsort', 'bytetrack']
5 | track_high_thresh: 0.5 # threshold for the first association
6 | track_low_thresh: 0.1 # threshold for the second association
7 | new_track_thresh: 0.6 # threshold for init new track if the detection does not match any tracks
8 | track_buffer: 30 # buffer to calculate the time when to remove tracks
9 | match_thresh: 0.8 # threshold for matching tracks
10 | # min_box_area: 10 # threshold for min box areas(for tracker evaluation, not used for now)
11 | # mot20: False # for tracker evaluation(not used for now)
12 |
13 | # BoT-SORT settings
14 | gmc_method: sparseOptFlow # method of global motion compensation
15 | # ReID model related thresh (not supported yet)
16 | proximity_thresh: 0.5
17 | appearance_thresh: 0.25
18 | with_reid: False
19 |
--------------------------------------------------------------------------------
/ultralytics/cfg/datasets/african-wildlife.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # African-wildlife dataset by Ultralytics
3 | # Documentation: https://docs.ultralytics.com/datasets/detect/african-wildlife/
4 | # Example usage: yolo train data=african-wildlife.yaml
5 | # parent
6 | # ├── ultralytics
7 | # └── datasets
8 | # └── african-wildlife ← downloads here (100 MB)
9 |
10 | # Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
11 | path: ../datasets/african-wildlife # dataset root dir
12 | train: train/images # train images (relative to 'path') 1052 images
13 | val: valid/images # val images (relative to 'path') 225 images
14 | test: test/images # test images (relative to 'path') 227 images
15 |
16 | # Classes
17 | names:
18 | 0: buffalo
19 | 1: elephant
20 | 2: rhino
21 | 3: zebra
22 |
23 | # Download script/URL (optional)
24 | download: https://ultralytics.com/assets/african-wildlife.zip
25 |
--------------------------------------------------------------------------------
/docs/en/reference/models/yolo/classify/train.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Delve into Classification Trainer at Ultralytics YOLO docs and optimize your model's training process with insights from the masters!.
3 | keywords: Ultralytics, YOLO, Classification Trainer, deep learning, training process, AI models, documentation
4 | ---
5 |
6 | # Reference for `ultralytics/models/yolo/classify/train.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/classify/train.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/classify/train.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/yolo/classify/train.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.yolo.classify.train.ClassificationTrainer
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/models/yolo/classify/val.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore YOLO ClassificationValidator, a key element of Ultralytics YOLO models. Learn how it validates and fine-tunes model outputs.
3 | keywords: Ultralytics, YOLO, ClassificationValidator, model validation, model fine-tuning, deep learning, computer vision
4 | ---
5 |
6 | # Reference for `ultralytics/models/yolo/classify/val.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/classify/val.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/classify/val.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/yolo/classify/val.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.yolo.classify.val.ClassificationValidator
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/overrides/partials/source-file.html:
--------------------------------------------------------------------------------
1 | {% import "partials/language.html" as lang with context %}
2 |
3 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | {% if page.meta.git_revision_date_localized %}
12 | 📅 {{ lang.t("source.file.date.updated") }}:
13 | {{ page.meta.git_revision_date_localized }}
14 | {% if page.meta.git_creation_date_localized %}
15 |
16 | 🎂 {{ lang.t("source.file.date.created") }}:
17 | {{ page.meta.git_creation_date_localized }}
18 | {% endif %}
19 |
20 |
21 | {% elif page.meta.revision_date %}
22 | 📅 {{ lang.t("source.file.date.updated") }}:
23 | {{ page.meta.revision_date }}
24 | {% endif %}
25 |
26 |
27 |
--------------------------------------------------------------------------------
/docs/en/reference/models/fastsam/predict.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Get detailed insights about Ultralytics FastSAMPredictor. Learn to predict and optimize your AI models with our properly documented guidelines.
3 | keywords: Ultralytics, FastSAMPredictor, predictive modeling, AI optimization, machine learning, deep learning, Ultralytics documentation
4 | ---
5 |
6 | # Reference for `ultralytics/models/fastsam/predict.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/fastsam/predict.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/fastsam/predict.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/fastsam/predict.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.fastsam.predict.FastSAMPredictor
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/models/utils/ops.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Discover details for "HungarianMatcher" & "inverse_sigmoid" functions in Ultralytics YOLO, advanced tools supporting detection models.
3 | keywords: Ultralytics, YOLO, HungarianMatcher, inverse_sigmoid, detection models, model utilities, ops
4 | ---
5 |
6 | # Reference for `ultralytics/models/utils/ops.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/utils/ops.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/utils/ops.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/utils/ops.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.utils.ops.HungarianMatcher
15 |
16 |
17 |
18 | ## ::: ultralytics.models.utils.ops.get_cdn_group
19 |
20 |
21 |
--------------------------------------------------------------------------------
/docs/en/reference/trackers/basetrack.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Get familiar with TrackState in Ultralytics. Learn how it is used in the BaseTrack of the Ultralytics tracker for enhanced functionality.
3 | keywords: Ultralytics, TrackState, BaseTrack, Ultralytics tracker, Ultralytics documentation
4 | ---
5 |
6 | # Reference for `ultralytics/trackers/basetrack.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/basetrack.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/basetrack.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/trackers/basetrack.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.trackers.basetrack.TrackState
15 |
16 |
17 |
18 | ## ::: ultralytics.trackers.basetrack.BaseTrack
19 |
20 |
21 |
--------------------------------------------------------------------------------
/docs/en/reference/utils/instance.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Dive into Ultralytics detailed utility guide. Learn about Bboxes, _ntuple and more from Ultralytics utils.instance module.
3 | keywords: Ultralytics, Bboxes, _ntuple, utility, ultralytics utils.instance
4 | ---
5 |
6 | # Reference for `ultralytics/utils/instance.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/instance.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/instance.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/instance.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.utils.instance.Bboxes
15 |
16 |
17 |
18 | ## ::: ultralytics.utils.instance.Instances
19 |
20 |
21 |
22 | ## ::: ultralytics.utils.instance._ntuple
23 |
24 |
25 |
--------------------------------------------------------------------------------
/docs/en/reference/models/rtdetr/val.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore RTDETRDataset in Ultralytics Models. Learn about the RTDETRValidator function, understand its usage in real-time object detection.
3 | keywords: Ultralytics, RTDETRDataset, RTDETRValidator, real-time object detection, models documentation
4 | ---
5 |
6 | # Reference for `ultralytics/models/rtdetr/val.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/rtdetr/val.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/rtdetr/val.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/rtdetr/val.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.rtdetr.val.RTDETRDataset
15 |
16 |
17 |
18 | ## ::: ultralytics.models.rtdetr.val.RTDETRValidator
19 |
20 |
21 |
--------------------------------------------------------------------------------
/docs/en/reference/utils/autobatch.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore Ultralytics documentation for check_train_batch_size utility in the autobatch module. Understand how it could improve your machine learning process.
3 | keywords: Ultralytics, check_train_batch_size, autobatch, utility, machine learning, documentation
4 | ---
5 |
6 | # Reference for `ultralytics/utils/autobatch.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/autobatch.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/autobatch.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/autobatch.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.utils.autobatch.check_train_batch_size
15 |
16 |
17 |
18 | ## ::: ultralytics.utils.autobatch.autobatch
19 |
20 |
21 |
--------------------------------------------------------------------------------
/docs/en/reference/engine/tuner.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore the Ultralytics Tuner, a powerful tool designed for hyperparameter tuning of YOLO models to optimize performance across various tasks like object detection, image classification, and more.
3 | keywords: Ultralytics, Tuner, YOLO, hyperparameter tuning, optimization, object detection, image classification, instance segmentation, pose estimation, multi-object tracking
4 | ---
5 |
6 | # Reference for `ultralytics/engine/tuner.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/tuner.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/tuner.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/engine/tuner.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.engine.tuner.Tuner
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/trackers/bot_sort.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Master the use of Ultralytics BOTrack, a key component of the powerful Ultralytics tracking system. Learn to integrate and use BOTSORT in your projects.
3 | keywords: Ultralytics, BOTSORT, BOTrack, tracking system, official documentation, machine learning, AI tracking
4 | ---
5 |
6 | # Reference for `ultralytics/trackers/bot_sort.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/bot_sort.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/bot_sort.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/trackers/bot_sort.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.trackers.bot_sort.BOTrack
15 |
16 |
17 |
18 | ## ::: ultralytics.trackers.bot_sort.BOTSORT
19 |
20 |
21 |
--------------------------------------------------------------------------------
/docs/en/reference/models/yolo/obb/val.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Learn about Ultralytics' advanced OBBValidator, an extension of YOLO object detection for oriented bounding box validation.
3 | keywords: Ultralytics, YOLO, OBBValidator, object detection, oriented bounding box, OBB, machine learning, AI, deep learning, Python, YOLO model, image processing, computer vision, YOLO object detection
4 | ---
5 |
6 | # Reference for `ultralytics/models/yolo/obb/val.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/obb/val.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/obb/val.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/yolo/obb/val.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.yolo.obb.val.OBBValidator
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/models/utils/loss.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Learn to use the DETRLoss function provided by Ultralytics YOLO. Understand how to utilize loss in RTDETR detection models to improve accuracy.
3 | keywords: Ultralytics, YOLO, Documentation, DETRLoss, Detection Loss, Loss function, DETR, RTDETR Detection Models
4 | ---
5 |
6 | # Reference for `ultralytics/models/utils/loss.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/utils/loss.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/utils/loss.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/utils/loss.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.utils.loss.DETRLoss
15 |
16 |
17 |
18 | ## ::: ultralytics.models.utils.loss.RTDETRDetectionLoss
19 |
20 |
21 |
--------------------------------------------------------------------------------
/ultralytics/cfg/models/v8/yolov8-cls-resnet101.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # YOLOv8-cls image classification model. For Usage examples see https://docs.ultralytics.com/tasks/classify
3 |
4 | # Parameters
5 | nc: 1000 # number of classes
6 | scales: # model compound scaling constants, i.e. 'model=yolov8n-cls.yaml' will call yolov8-cls.yaml with scale 'n'
7 | # [depth, width, max_channels]
8 | n: [0.33, 0.25, 1024]
9 | s: [0.33, 0.50, 1024]
10 | m: [0.67, 0.75, 1024]
11 | l: [1.00, 1.00, 1024]
12 | x: [1.00, 1.25, 1024]
13 |
14 | # YOLOv8.0n backbone
15 | backbone:
16 | # [from, repeats, module, args]
17 | - [-1, 1, ResNetLayer, [3, 64, 1, True, 1]] # 0-P1/2
18 | - [-1, 1, ResNetLayer, [64, 64, 1, False, 3]] # 1-P2/4
19 | - [-1, 1, ResNetLayer, [256, 128, 2, False, 4]] # 2-P3/8
20 | - [-1, 1, ResNetLayer, [512, 256, 2, False, 23]] # 3-P4/16
21 | - [-1, 1, ResNetLayer, [1024, 512, 2, False, 3]] # 4-P5/32
22 |
23 | # YOLOv8.0n head
24 | head:
25 | - [-1, 1, Classify, [nc]] # Classify
26 |
--------------------------------------------------------------------------------
/ultralytics/cfg/models/v8/yolov8-cls-resnet50.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # YOLOv8-cls image classification model. For Usage examples see https://docs.ultralytics.com/tasks/classify
3 |
4 | # Parameters
5 | nc: 1000 # number of classes
6 | scales: # model compound scaling constants, i.e. 'model=yolov8n-cls.yaml' will call yolov8-cls.yaml with scale 'n'
7 | # [depth, width, max_channels]
8 | n: [0.33, 0.25, 1024]
9 | s: [0.33, 0.50, 1024]
10 | m: [0.67, 0.75, 1024]
11 | l: [1.00, 1.00, 1024]
12 | x: [1.00, 1.25, 1024]
13 |
14 | # YOLOv8.0n backbone
15 | backbone:
16 | # [from, repeats, module, args]
17 | - [-1, 1, ResNetLayer, [3, 64, 1, True, 1]] # 0-P1/2
18 | - [-1, 1, ResNetLayer, [64, 64, 1, False, 3]] # 1-P2/4
19 | - [-1, 1, ResNetLayer, [256, 128, 2, False, 4]] # 2-P3/8
20 | - [-1, 1, ResNetLayer, [512, 256, 2, False, 6]] # 3-P4/16
21 | - [-1, 1, ResNetLayer, [1024, 512, 2, False, 3]] # 4-P5/32
22 |
23 | # YOLOv8.0n head
24 | head:
25 | - [-1, 1, Classify, [nc]] # Classify
26 |
--------------------------------------------------------------------------------
/docs/en/reference/nn/autobackend.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Get to know more about Ultralytics nn.autobackend.check_class_names functionality. Optimize your YOLO models seamlessly.
3 | keywords: Ultralytics, AutoBackend, check_class_names, YOLO, YOLO models, optimization
4 | ---
5 |
6 | # Reference for `ultralytics/nn/autobackend.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/autobackend.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/autobackend.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/nn/autobackend.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.nn.autobackend.AutoBackend
15 |
16 |
17 |
18 | ## ::: ultralytics.nn.autobackend.check_class_names
19 |
20 |
21 |
22 | ## ::: ultralytics.nn.autobackend.default_class_names
23 |
24 |
25 |
--------------------------------------------------------------------------------
/docs/en/reference/solutions/ai_gym.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore Ultralytics YOLO's advanced AI Gym feature for real-time pose estimation and gym exercise tracking using cutting-edge machine learning technology.
3 | keywords: Ultralytics, YOLO, AI Gym, pose estimation, real-time tracking, machine learning, exercise counting, AI fitness, computer vision, gym workout analysis, YOLOv8, artificial intelligence, fitness technology
4 | ---
5 |
6 | # Reference for `ultralytics/solutions/ai_gym.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/ai_gym.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/ai_gym.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/solutions/ai_gym.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.solutions.ai_gym.AIGym
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/trackers/byte_tracker.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Step-in to explore in-depth the functionalities of Ultralytics BYTETracker under STrack. Gain advanced feature insights to streamline your operations.
3 | keywords: STrack, Ultralytics, BYTETracker, documentation, Ultralytics tracker, object tracking, YOLO
4 | ---
5 |
6 | # Reference for `ultralytics/trackers/byte_tracker.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/byte_tracker.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/byte_tracker.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/trackers/byte_tracker.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.trackers.byte_tracker.STrack
15 |
16 |
17 |
18 | ## ::: ultralytics.trackers.byte_tracker.BYTETracker
19 |
20 |
21 |
--------------------------------------------------------------------------------
/docs/en/reference/solutions/heatmap.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore Ultralytics YOLO's advanced Heatmaps feature designed to highlight areas of interest, providing an immediate, impactful way to interpret spatial information.
3 | keywords: Ultralytics, YOLO, heatmaps, object tracking, data visualization, real-time tracking, machine learning, object counting, computer vision, retail analytics, YOLOv8, artificial intelligence
4 | ---
5 |
6 | # Reference for `ultralytics/solutions/heatmap.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/heatmap.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/heatmap.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/solutions/heatmap.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.solutions.heatmap.Heatmap
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/models/fastsam/utils.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Learn how to adjust bounding boxes to image borders in Ultralytics models using the bbox_iou utility. Enhance your object detection performance.
3 | keywords: Ultralytics, bounding boxes, Bboxes, image borders, object detection, bbox_iou, model utilities
4 | ---
5 |
6 | # Reference for `ultralytics/models/fastsam/utils.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/fastsam/utils.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/fastsam/utils.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/fastsam/utils.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.fastsam.utils.adjust_bboxes_to_image_border
15 |
16 |
17 |
18 | ## ::: ultralytics.models.fastsam.utils.bbox_iou
19 |
20 |
21 |
--------------------------------------------------------------------------------
/docs/en/reference/models/yolo/obb/predict.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Discover OBBPredictor for YOLO, specializing in Oriented Bounding Box predictions. Essential for advanced object detection with Ultralytics YOLO.
3 | keywords: Ultralytics, OBBPredictor, YOLO, Oriented Bounding Box, object detection, advanced object detection, YOLO model, deep learning, AI, machine learning, computer vision, OBB detection
4 | ---
5 |
6 | # Reference for `ultralytics/models/yolo/obb/predict.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/obb/predict.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/obb/predict.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/yolo/obb/predict.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.yolo.obb.predict.OBBPredictor
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/trackers/utils/kalman_filter.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore KalmanFilterXYAH, a key component of Ultralytics trackers. Understand its utilities and learn to leverage it in your own projects.
3 | keywords: Ultralytics, KalmanFilterXYAH, tracker, documentation, guide
4 | ---
5 |
6 | # Reference for `ultralytics/trackers/utils/kalman_filter.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/utils/kalman_filter.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/utils/kalman_filter.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/trackers/utils/kalman_filter.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.trackers.utils.kalman_filter.KalmanFilterXYAH
15 |
16 |
17 |
18 | ## ::: ultralytics.trackers.utils.kalman_filter.KalmanFilterXYWH
19 |
20 |
21 |
--------------------------------------------------------------------------------
/docs/en/datasets/track/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | comments: true
3 | description: Understand multi-object tracking datasets, upcoming features and how to use them with YOLO in Python and CLI. Dive in now!.
4 | keywords: Ultralytics, YOLO, multi-object tracking, datasets, detection, segmentation, pose models, Python, CLI
5 | ---
6 |
7 | # Multi-object Tracking Datasets Overview
8 |
9 | ## Dataset Format (Coming Soon)
10 |
11 | Multi-Object Detector doesn't need standalone training and directly supports pre-trained detection, segmentation or Pose models. Support for training trackers alone is coming soon
12 |
13 | ## Usage
14 |
15 | !!! Example
16 |
17 | === "Python"
18 |
19 | ```python
20 | from ultralytics import YOLO
21 |
22 | model = YOLO('yolov8n.pt')
23 | results = model.track(source="https://youtu.be/LNwODJXcvt4", conf=0.3, iou=0.5, show=True)
24 | ```
25 | === "CLI"
26 |
27 | ```bash
28 | yolo track model=yolov8n.pt source="https://youtu.be/LNwODJXcvt4" conf=0.3, iou=0.5 show
29 | ```
30 |
--------------------------------------------------------------------------------
/docs/en/reference/models/sam/modules/decoders.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore MaskDecoder, a part of the Ultralytics models. Gain insights on how to utilize it effectively in the SAM modules decoders MLP.
3 | keywords: Ultralytics, MaskDecoder, SAM modules, decoders, MLP, YOLO, machine learning, image recognition
4 | ---
5 |
6 | # Reference for `ultralytics/models/sam/modules/decoders.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/decoders.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/decoders.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/sam/modules/decoders.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.sam.modules.decoders.MaskDecoder
15 |
16 |
17 |
18 | ## ::: ultralytics.models.sam.modules.decoders.MLP
19 |
20 |
21 |
--------------------------------------------------------------------------------
/ultralytics/cfg/models/v8/yolov8-cls.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # YOLOv8-cls image classification model. For Usage examples see https://docs.ultralytics.com/tasks/classify
3 |
4 | # Parameters
5 | nc: 1000 # number of classes
6 | scales: # model compound scaling constants, i.e. 'model=yolov8n-cls.yaml' will call yolov8-cls.yaml with scale 'n'
7 | # [depth, width, max_channels]
8 | n: [0.33, 0.25, 1024]
9 | s: [0.33, 0.50, 1024]
10 | m: [0.67, 0.75, 1024]
11 | l: [1.00, 1.00, 1024]
12 | x: [1.00, 1.25, 1024]
13 |
14 | # YOLOv8.0n backbone
15 | backbone:
16 | # [from, repeats, module, args]
17 | - [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
18 | - [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
19 | - [-1, 3, C2f, [128, True]]
20 | - [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
21 | - [-1, 6, C2f, [256, True]]
22 | - [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
23 | - [-1, 6, C2f, [512, True]]
24 | - [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
25 | - [-1, 3, C2f, [1024, True]]
26 |
27 | # YOLOv8.0n head
28 | head:
29 | - [-1, 1, Classify, [nc]] # Classify
30 |
--------------------------------------------------------------------------------
/docs/en/reference/utils/patches.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Learn about Ultralytics utils patches including imread, imshow and torch_save. Enhance your image processing skills.
3 | keywords: Ultralytics, Utils, Patches, imread, imshow, torch_save, image processing
4 | ---
5 |
6 | # Reference for `ultralytics/utils/patches.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/patches.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/patches.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/patches.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.utils.patches.imread
15 |
16 |
17 |
18 | ## ::: ultralytics.utils.patches.imwrite
19 |
20 |
21 |
22 | ## ::: ultralytics.utils.patches.imshow
23 |
24 |
25 |
26 | ## ::: ultralytics.utils.patches.torch_save
27 |
28 |
29 |
--------------------------------------------------------------------------------
/docs/en/reference/trackers/track.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore Ultralytics documentation on prediction function starters & register trackers. Understand our code & its applications better.
3 | keywords: Ultralytics, YOLO, on predict start, register tracker, prediction functions, documentation
4 | ---
5 |
6 | # Reference for `ultralytics/trackers/track.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/track.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/track.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/trackers/track.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.trackers.track.on_predict_start
15 |
16 |
17 |
18 | ## ::: ultralytics.trackers.track.on_predict_postprocess_end
19 |
20 |
21 |
22 | ## ::: ultralytics.trackers.track.register_tracker
23 |
24 |
25 |
--------------------------------------------------------------------------------
/ultralytics/cfg/datasets/coco8-pose.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # COCO8-pose dataset (first 8 images from COCO train2017) by Ultralytics
3 | # Documentation: https://docs.ultralytics.com/datasets/pose/coco8-pose/
4 | # Example usage: yolo train data=coco8-pose.yaml
5 | # parent
6 | # ├── ultralytics
7 | # └── datasets
8 | # └── coco8-pose ← downloads here (1 MB)
9 |
10 | # Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
11 | path: ../datasets/coco8-pose # dataset root dir
12 | train: images/train # train images (relative to 'path') 4 images
13 | val: images/val # val images (relative to 'path') 4 images
14 | test: # test images (optional)
15 |
16 | # Keypoints
17 | kpt_shape: [17, 3] # number of keypoints, number of dims (2 for x,y or 3 for x,y,visible)
18 | flip_idx: [0, 2, 1, 4, 3, 6, 5, 8, 7, 10, 9, 12, 11, 14, 13, 16, 15]
19 |
20 | # Classes
21 | names:
22 | 0: person
23 |
24 | # Download script/URL (optional)
25 | download: https://ultralytics.com/assets/coco8-pose.zip
26 |
--------------------------------------------------------------------------------
/docs/en/reference/models/yolo/obb/train.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Master the Ultralytics YOLO OBB Trainer: A specialized tool for training YOLO models using Oriented Bounding Boxes. Features detailed usage, model initialization, and training processes.
3 | keywords: Ultralytics, YOLO OBB Trainer, Oriented Bounding Box, OBB model training, YOLO model training, computer vision, deep learning, machine learning, YOLO object detection, model initialization, YOLO training process
4 | ---
5 |
6 | # Reference for `ultralytics/models/yolo/obb/train.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/obb/train.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/obb/train.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/yolo/obb/train.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.yolo.obb.train.OBBTrainer
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/solutions/distance_calculation.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore Ultralytics YOLO's distance calculation feature designed for advance analytics, providing an immediate, impactful way to interpret computer vision data.
3 | keywords: Ultralytics, YOLO, distance calculation, object tracking, data visualization, real-time tracking, machine learning, object counting, computer vision, vehicle analytics, YOLOv8, artificial intelligence
4 | ---
5 |
6 | # Reference for `ultralytics/solutions/distance_calculation.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/distance_calculation.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/distance_calculation.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/solutions/distance_calculation.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.solutions.distance_calculation.DistanceCalculation
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/solutions/speed_estimation.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Transform speed estimation with Ultralytics YOLO speed estimation featuring cutting-edge technology for precise real-time counting in video streams.
3 | keywords: Ultralytics YOLO, speed estimation software, real-time vehicle tracking solutions, video stream analysis, YOLOv8 object detection, smart counting technology, computer vision, AI-powered tracking, video analytics tools, automated monitoring.
4 | ---
5 |
6 | # Reference for `ultralytics/solutions/speed_estimation.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/speed_estimation.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/speed_estimation.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/solutions/speed_estimation.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.solutions.speed_estimation.SpeedEstimator
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/hub/utils.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore Ultralytics docs for various Events, including "request_with_credentials" and "requests_with_progress". Also, understand the use of the "smart_request".
3 | keywords: Ultralytics, Events, request_with_credentials, smart_request, Ultralytics hub utils, requests_with_progress
4 | ---
5 |
6 | # Reference for `ultralytics/hub/utils.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/hub/utils.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/hub/utils.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/hub/utils.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.hub.utils.Events
15 |
16 |
17 |
18 | ## ::: ultralytics.hub.utils.request_with_credentials
19 |
20 |
21 |
22 | ## ::: ultralytics.hub.utils.requests_with_progress
23 |
24 |
25 |
26 | ## ::: ultralytics.hub.utils.smart_request
27 |
28 |
29 |
--------------------------------------------------------------------------------
/docs/en/reference/models/sam/modules/transformer.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Learn about TwoWayTransformer and Attention modules in Ultralytics. Leverage these tools to enhance your AI models.
3 | keywords: Ultralytics, TwoWayTransformer, Attention, AI models, transformers
4 | ---
5 |
6 | # Reference for `ultralytics/models/sam/modules/transformer.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/transformer.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/transformer.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/sam/modules/transformer.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.sam.modules.transformer.TwoWayTransformer
15 |
16 |
17 |
18 | ## ::: ultralytics.models.sam.modules.transformer.TwoWayAttentionBlock
19 |
20 |
21 |
22 | ## ::: ultralytics.models.sam.modules.transformer.Attention
23 |
24 |
25 |
--------------------------------------------------------------------------------
/docs/en/reference/solutions/object_counter.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Transform object tracking with Ultralytics YOLO Object Counter featuring cutting-edge technology for precise real-time counting in video streams.
3 | keywords: Ultralytics YOLO, object tracking software, real-time counting solutions, video stream analysis, YOLOv8 object detection, AI surveillance, smart counting technology, computer vision, AI-powered tracking, object counting accuracy, video analytics tools, automated monitoring.
4 | ---
5 |
6 | # Reference for `ultralytics/solutions/object_counter.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/object_counter.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/object_counter.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/solutions/object_counter.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.solutions.object_counter.ObjectCounter
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/en/reference/utils/dist.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Discover the role of dist.find_free_network_port & dist.generate_ddp_command in Ultralytics DDP utilities. Use our guide for efficient deployment.
3 | keywords: Ultralytics, DDP, DDP utility functions, Distributed Data Processing, find free network port, generate DDP command
4 | ---
5 |
6 | # Reference for `ultralytics/utils/dist.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/dist.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/dist.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/dist.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.utils.dist.find_free_network_port
15 |
16 |
17 |
18 | ## ::: ultralytics.utils.dist.generate_ddp_file
19 |
20 |
21 |
22 | ## ::: ultralytics.utils.dist.generate_ddp_command
23 |
24 |
25 |
26 | ## ::: ultralytics.utils.dist.ddp_cleanup
27 |
28 |
29 |
--------------------------------------------------------------------------------
/docs/en/reference/data/explorer/explorer.md:
--------------------------------------------------------------------------------
1 | ---
2 | comments: true
3 | description: Comprehensive reference for the Explorer API. Get a brief description of all the main classes utilised for creating and handling the data in the Ultralytics data explorer project.
4 | keywords: Ultralytics, explorer.py, data explorer, Semantic search, vector similarity search, class reference, documentation, ExplorerDataset, Explorer, data handling
5 | ---
6 |
7 | # Reference for `ultralytics/data/explorer/explorer.py`
8 |
9 | !!! Note
10 |
11 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/explorer/explorer.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/explorer/explorer.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/data/explorer/explorer.py) 🛠️. Thank you 🙏!
12 |
13 |
14 |
15 | ## ::: ultralytics.data.explorer.explorer.ExplorerDataset
16 |
17 |
18 |
19 | ## ::: ultralytics.data.explorer.explorer.Explorer
20 |
21 |
22 |
--------------------------------------------------------------------------------
/docs/en/reference/engine/exporter.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore the exporter functionality of Ultralytics. Learn about exporting formats, IOSDetectModel, and try exporting with examples.
3 | keywords: Ultralytics, Exporter, IOSDetectModel, Export Formats, Try export
4 | ---
5 |
6 | # Reference for `ultralytics/engine/exporter.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/exporter.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/exporter.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/engine/exporter.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.engine.exporter.Exporter
15 |
16 |
17 |
18 | ## ::: ultralytics.engine.exporter.IOSDetectModel
19 |
20 |
21 |
22 | ## ::: ultralytics.engine.exporter.export_formats
23 |
24 |
25 |
26 | ## ::: ultralytics.engine.exporter.gd_outputs
27 |
28 |
29 |
30 | ## ::: ultralytics.engine.exporter.try_export
31 |
32 |
33 |
--------------------------------------------------------------------------------
/docs/mkdocs_github_authors.yaml:
--------------------------------------------------------------------------------
1 | 1185102784@qq.com: Laughing-q
2 | 1579093407@qq.com: null
3 | 17216799+ouphi@users.noreply.github.com: ouphi
4 | 17316848+maianumerosky@users.noreply.github.com: maianumerosky
5 | 34196005+fcakyon@users.noreply.github.com: fcakyon
6 | 37276661+capjamesg@users.noreply.github.com: capjamesg
7 | 39910262+ChaoningZhang@users.noreply.github.com: ChaoningZhang
8 | 40165666+berry-ding@users.noreply.github.com: berry-ding
9 | 47978446+sergiuwaxmann@users.noreply.github.com: sergiuwaxmann
10 | 61612323+Laughing-q@users.noreply.github.com: Laughing-q
11 | 62214284+Burhan-Q@users.noreply.github.com: Burhan-Q
12 | 75611662+tensorturtle@users.noreply.github.com: tensorturtle
13 | 78843978+Skillnoob@users.noreply.github.com: Skillnoob
14 | 79740115+0xSynapse@users.noreply.github.com: 0xSynapse
15 | abirami.vina@gmail.com: abirami-vina
16 | ayush.chaurarsia@gmail.com: AyushExel
17 | chr043416@gmail.com: RizwanMunawar
18 | glenn.jocher@ultralytics.com: glenn-jocher
19 | muhammadrizwanmunawar123@gmail.com: RizwanMunawar
20 | not.committed.yet: null
21 | priytosh.revolution@live.com: priytosh-tripathi
22 | shuizhuyuanluo@126.com: null
23 | xinwang614@gmail.com: GreatV
24 |
--------------------------------------------------------------------------------
/ultralytics/cfg/datasets/dota8.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # DOTA8 dataset 8 images from split DOTAv1 dataset by Ultralytics
3 | # Documentation: https://docs.ultralytics.com/datasets/obb/dota8/
4 | # Example usage: yolo train model=yolov8n-obb.pt data=dota8.yaml
5 | # parent
6 | # ├── ultralytics
7 | # └── datasets
8 | # └── dota8 ← downloads here (1MB)
9 |
10 | # Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
11 | path: ../datasets/dota8 # dataset root dir
12 | train: images/train # train images (relative to 'path') 4 images
13 | val: images/val # val images (relative to 'path') 4 images
14 |
15 | # Classes for DOTA 1.0
16 | names:
17 | 0: plane
18 | 1: ship
19 | 2: storage tank
20 | 3: baseball diamond
21 | 4: tennis court
22 | 5: basketball court
23 | 6: ground track field
24 | 7: harbor
25 | 8: bridge
26 | 9: large vehicle
27 | 10: small vehicle
28 | 11: helicopter
29 | 12: roundabout
30 | 13: soccer ball field
31 | 14: swimming pool
32 |
33 | # Download script/URL (optional)
34 | download: https://github.com/ultralytics/yolov5/releases/download/v1.0/dota8.zip
35 |
--------------------------------------------------------------------------------
/docs/en/reference/utils/callbacks/mlflow.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Understand routines at the end of pre-training and training in Ultralytics. Elevate your MLflow callbacks expertise.
3 | keywords: Ultralytics, MLflow, Callbacks, on_pretrain_routine_end, on_train_end, Machine Learning, Training
4 | ---
5 |
6 | # Reference for `ultralytics/utils/callbacks/mlflow.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/mlflow.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/mlflow.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/callbacks/mlflow.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.utils.callbacks.mlflow.on_pretrain_routine_end
15 |
16 |
17 |
18 | ## ::: ultralytics.utils.callbacks.mlflow.on_train_epoch_end
19 |
20 |
21 |
22 | ## ::: ultralytics.utils.callbacks.mlflow.on_fit_epoch_end
23 |
24 |
25 |
26 | ## ::: ultralytics.utils.callbacks.mlflow.on_train_end
27 |
28 |
29 |
--------------------------------------------------------------------------------
/docs/en/reference/data/dataset.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore the YOLODataset and SemanticDataset classes in YOLO data. Learn how to efficiently handle and manipulate your data with Ultralytics.
3 | keywords: Ultralytics, YOLO, YOLODataset, SemanticDataset, data handling, data manipulation
4 | ---
5 |
6 | # Reference for `ultralytics/data/dataset.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/dataset.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/dataset.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/data/dataset.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.data.dataset.YOLODataset
15 |
16 |
17 |
18 | ## ::: ultralytics.data.dataset.ClassificationDataset
19 |
20 |
21 |
22 | ## ::: ultralytics.data.dataset.SemanticDataset
23 |
24 |
25 |
26 | ## ::: ultralytics.data.dataset.load_dataset_cache_file
27 |
28 |
29 |
30 | ## ::: ultralytics.data.dataset.save_dataset_cache_file
31 |
32 |
33 |
--------------------------------------------------------------------------------
/ultralytics/models/fastsam/model.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
3 | from pathlib import Path
4 |
5 | from ultralytics.engine.model import Model
6 | from .predict import FastSAMPredictor
7 | from .val import FastSAMValidator
8 |
9 |
10 | class FastSAM(Model):
11 | """
12 | FastSAM model interface.
13 |
14 | Example:
15 | ```python
16 | from ultralytics import FastSAM
17 |
18 | model = FastSAM('last.pt')
19 | results = model.predict('ultralytics/assets/bus.jpg')
20 | ```
21 | """
22 |
23 | def __init__(self, model="FastSAM-x.pt"):
24 | """Call the __init__ method of the parent class (YOLO) with the updated default model."""
25 | if str(model) == "FastSAM.pt":
26 | model = "FastSAM-x.pt"
27 | assert Path(model).suffix not in (".yaml", ".yml"), "FastSAM models only support pre-trained models."
28 | super().__init__(model=model, task="segment")
29 |
30 | @property
31 | def task_map(self):
32 | """Returns a dictionary mapping segment task to corresponding predictor and validator classes."""
33 | return {"segment": {"predictor": FastSAMPredictor, "validator": FastSAMValidator}}
34 |
--------------------------------------------------------------------------------
/docs/en/reference/hub/__init__.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore Ultralytics hub functions for model resetting, checking datasets, model exporting and more. Easy-to-follow instructions provided.
3 | keywords: Ultralytics, hub functions, model export, dataset check, reset model, YOLO Docs
4 | ---
5 |
6 | # Reference for `ultralytics/hub/__init__.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/hub/__init__.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/hub/__init__.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/hub/__init__.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.hub.login
15 |
16 |
17 |
18 | ## ::: ultralytics.hub.logout
19 |
20 |
21 |
22 | ## ::: ultralytics.hub.reset_model
23 |
24 |
25 |
26 | ## ::: ultralytics.hub.export_fmts_hub
27 |
28 |
29 |
30 | ## ::: ultralytics.hub.export_model
31 |
32 |
33 |
34 | ## ::: ultralytics.hub.get_export
35 |
36 |
37 |
38 | ## ::: ultralytics.hub.check_dataset
39 |
40 |
41 |
--------------------------------------------------------------------------------
/docs/en/reference/engine/results.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Master Ultralytics engine results including base tensors, boxes, and keypoints with our thorough documentation.
3 | keywords: Ultralytics, engine, results, base tensor, boxes, keypoints
4 | ---
5 |
6 | # Reference for `ultralytics/engine/results.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/results.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/results.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/engine/results.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.engine.results.BaseTensor
15 |
16 |
17 |
18 | ## ::: ultralytics.engine.results.Results
19 |
20 |
21 |
22 | ## ::: ultralytics.engine.results.Boxes
23 |
24 |
25 |
26 | ## ::: ultralytics.engine.results.Masks
27 |
28 |
29 |
30 | ## ::: ultralytics.engine.results.Keypoints
31 |
32 |
33 |
34 | ## ::: ultralytics.engine.results.Probs
35 |
36 |
37 |
38 | ## ::: ultralytics.engine.results.OBB
39 |
40 |
41 |
--------------------------------------------------------------------------------
/docs/en/reference/utils/tal.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore Ultralytics utilities for optimized task assignment, bounding box creation, and distance calculation. Learn more about algorithm implementations.
3 | keywords: Ultralytics, task aligned assigner, select highest overlaps, make anchors, dist2bbox, bbox2dist, utilities, algorithm
4 | ---
5 |
6 | # Reference for `ultralytics/utils/tal.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/tal.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/tal.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/tal.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.utils.tal.TaskAlignedAssigner
15 |
16 |
17 |
18 | ## ::: ultralytics.utils.tal.RotatedTaskAlignedAssigner
19 |
20 |
21 |
22 | ## ::: ultralytics.utils.tal.make_anchors
23 |
24 |
25 |
26 | ## ::: ultralytics.utils.tal.dist2bbox
27 |
28 |
29 |
30 | ## ::: ultralytics.utils.tal.bbox2dist
31 |
32 |
33 |
34 | ## ::: ultralytics.utils.tal.dist2rbox
35 |
36 |
37 |
--------------------------------------------------------------------------------
/docs/en/reference/nn/modules/utils.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore Ultralytics neural network utils, such as bias_init_with_prob, inverse_sigmoid and multi_scale_deformable_attn_pytorch functions.
3 | keywords: Ultralytics, neural network, nn.modules.utils, bias_init_with_prob, inverse_sigmoid, multi_scale_deformable_attn_pytorch
4 | ---
5 |
6 | # Reference for `ultralytics/nn/modules/utils.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/modules/utils.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/modules/utils.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/nn/modules/utils.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.nn.modules.utils._get_clones
15 |
16 |
17 |
18 | ## ::: ultralytics.nn.modules.utils.bias_init_with_prob
19 |
20 |
21 |
22 | ## ::: ultralytics.nn.modules.utils.linear_init
23 |
24 |
25 |
26 | ## ::: ultralytics.nn.modules.utils.inverse_sigmoid
27 |
28 |
29 |
30 | ## ::: ultralytics.nn.modules.utils.multi_scale_deformable_attn_pytorch
31 |
32 |
33 |
--------------------------------------------------------------------------------
/docs/en/reference/models/sam/build.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Master building SAM ViT models with Ultralytics. Discover steps to leverage the power of SAM and Vision Transformer sessions.
3 | keywords: Ultralytics, SAM, build sam, vision transformer, vits, build_sam_vit_l, build_sam_vit_b, build_sam
4 | ---
5 |
6 | # Reference for `ultralytics/models/sam/build.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/build.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/build.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/sam/build.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.sam.build.build_sam_vit_h
15 |
16 |
17 |
18 | ## ::: ultralytics.models.sam.build.build_sam_vit_l
19 |
20 |
21 |
22 | ## ::: ultralytics.models.sam.build.build_sam_vit_b
23 |
24 |
25 |
26 | ## ::: ultralytics.models.sam.build.build_mobile_sam
27 |
28 |
29 |
30 | ## ::: ultralytics.models.sam.build._build_sam
31 |
32 |
33 |
34 | ## ::: ultralytics.models.sam.build.build_sam
35 |
36 |
37 |
--------------------------------------------------------------------------------
/docs/en/reference/trackers/utils/matching.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore in-depth guidance for using Ultralytics trackers utils matching, including merge_matches, linear_assignment, iou_distance, embedding_distance, fuse_motion, and fuse_score.
3 | keywords: Ultralytics, Trackers Utils, Matching, merge_matches, linear_assignment, iou_distance, embedding_distance, fuse_motion, fuse_score, documentation
4 | ---
5 |
6 | # Reference for `ultralytics/trackers/utils/matching.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/utils/matching.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/utils/matching.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/trackers/utils/matching.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.trackers.utils.matching.linear_assignment
15 |
16 |
17 |
18 | ## ::: ultralytics.trackers.utils.matching.iou_distance
19 |
20 |
21 |
22 | ## ::: ultralytics.trackers.utils.matching.embedding_distance
23 |
24 |
25 |
26 | ## ::: ultralytics.trackers.utils.matching.fuse_score
27 |
28 |
29 |
--------------------------------------------------------------------------------
/ultralytics/cfg/datasets/DOTAv1.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # DOTA 1.0 dataset https://captain-whu.github.io/DOTA/index.html for object detection in aerial images by Wuhan University
3 | # Documentation: https://docs.ultralytics.com/datasets/obb/dota-v2/
4 | # Example usage: yolo train model=yolov8n-obb.pt data=DOTAv1.yaml
5 | # parent
6 | # ├── ultralytics
7 | # └── datasets
8 | # └── dota1 ← downloads here (2GB)
9 |
10 | # Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
11 | path: ../datasets/DOTAv1 # dataset root dir
12 | train: images/train # train images (relative to 'path') 1411 images
13 | val: images/val # val images (relative to 'path') 458 images
14 | test: images/test # test images (optional) 937 images
15 |
16 | # Classes for DOTA 1.0
17 | names:
18 | 0: plane
19 | 1: ship
20 | 2: storage tank
21 | 3: baseball diamond
22 | 4: tennis court
23 | 5: basketball court
24 | 6: ground track field
25 | 7: harbor
26 | 8: bridge
27 | 9: large vehicle
28 | 10: small vehicle
29 | 11: helicopter
30 | 12: roundabout
31 | 13: soccer ball field
32 | 14: swimming pool
33 |
34 | # Download script/URL (optional)
35 | download: https://github.com/ultralytics/yolov5/releases/download/v1.0/DOTAv1.zip
36 |
--------------------------------------------------------------------------------
/docs/en/reference/nn/modules/head.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore docs covering Ultralytics YOLO detection, pose & RTDETRDecoder. Comprehensive guides to help you understand Ultralytics nn modules.
3 | keywords: Ultralytics, YOLO, Detection, Pose, RTDETRDecoder, nn modules, guides
4 | ---
5 |
6 | # Reference for `ultralytics/nn/modules/head.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/modules/head.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/modules/head.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/nn/modules/head.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.nn.modules.head.Detect
15 |
16 |
17 |
18 | ## ::: ultralytics.nn.modules.head.Segment
19 |
20 |
21 |
22 | ## ::: ultralytics.nn.modules.head.OBB
23 |
24 |
25 |
26 | ## ::: ultralytics.nn.modules.head.Pose
27 |
28 |
29 |
30 | ## ::: ultralytics.nn.modules.head.Classify
31 |
32 |
33 |
34 | ## ::: ultralytics.nn.modules.head.WorldDetect
35 |
36 |
37 |
38 | ## ::: ultralytics.nn.modules.head.RTDETRDecoder
39 |
40 |
41 |
--------------------------------------------------------------------------------
/ultralytics/cfg/models/v9/yolov9c.yaml:
--------------------------------------------------------------------------------
1 | # YOLOv9
2 |
3 | # parameters
4 | nc: 80 # number of classes
5 |
6 | # gelan backbone
7 | backbone:
8 | - [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
9 | - [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
10 | - [-1, 1, RepNCSPELAN4, [256, 128, 64, 1]] # 2
11 | - [-1, 1, ADown, [256]] # 3-P3/8
12 | - [-1, 1, RepNCSPELAN4, [512, 256, 128, 1]] # 4
13 | - [-1, 1, ADown, [512]] # 5-P4/16
14 | - [-1, 1, RepNCSPELAN4, [512, 512, 256, 1]] # 6
15 | - [-1, 1, ADown, [512]] # 7-P5/32
16 | - [-1, 1, RepNCSPELAN4, [512, 512, 256, 1]] # 8
17 | - [-1, 1, SPPELAN, [512, 256]] # 9
18 |
19 | head:
20 | - [-1, 1, nn.Upsample, [None, 2, 'nearest']]
21 | - [[-1, 6], 1, Concat, [1]] # cat backbone P4
22 | - [-1, 1, RepNCSPELAN4, [512, 512, 256, 1]] # 12
23 |
24 | - [-1, 1, nn.Upsample, [None, 2, 'nearest']]
25 | - [[-1, 4], 1, Concat, [1]] # cat backbone P3
26 | - [-1, 1, RepNCSPELAN4, [256, 256, 128, 1]] # 15 (P3/8-small)
27 |
28 | - [-1, 1, ADown, [256]]
29 | - [[-1, 12], 1, Concat, [1]] # cat head P4
30 | - [-1, 1, RepNCSPELAN4, [512, 512, 256, 1]] # 18 (P4/16-medium)
31 |
32 | - [-1, 1, ADown, [512]]
33 | - [[-1, 9], 1, Concat, [1]] # cat head P5
34 | - [-1, 1, RepNCSPELAN4, [512, 512, 256, 1]] # 21 (P5/32-large)
35 |
36 | - [[15, 18, 21], 1, Detect, [nc]] # DDetect(P3, P4, P5)
37 |
--------------------------------------------------------------------------------
/ultralytics/cfg/datasets/DOTAv1.5.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # DOTA 1.5 dataset https://captain-whu.github.io/DOTA/index.html for object detection in aerial images by Wuhan University
3 | # Documentation: https://docs.ultralytics.com/datasets/obb/dota-v2/
4 | # Example usage: yolo train model=yolov8n-obb.pt data=DOTAv1.5.yaml
5 | # parent
6 | # ├── ultralytics
7 | # └── datasets
8 | # └── dota1.5 ← downloads here (2GB)
9 |
10 | # Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
11 | path: ../datasets/DOTAv1.5 # dataset root dir
12 | train: images/train # train images (relative to 'path') 1411 images
13 | val: images/val # val images (relative to 'path') 458 images
14 | test: images/test # test images (optional) 937 images
15 |
16 | # Classes for DOTA 1.5
17 | names:
18 | 0: plane
19 | 1: ship
20 | 2: storage tank
21 | 3: baseball diamond
22 | 4: tennis court
23 | 5: basketball court
24 | 6: ground track field
25 | 7: harbor
26 | 8: bridge
27 | 9: large vehicle
28 | 10: small vehicle
29 | 11: helicopter
30 | 12: roundabout
31 | 13: soccer ball field
32 | 14: swimming pool
33 | 15: container crane
34 |
35 | # Download script/URL (optional)
36 | download: https://github.com/ultralytics/yolov5/releases/download/v1.0/DOTAv1.5.zip
37 |
--------------------------------------------------------------------------------
/docs/en/reference/data/build.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore the Ultralytics YOLO v3 data build procedures, including the InfiniteDataLoader, seed_worker, build_dataloader, and load_inference_source.
3 | keywords: Ultralytics, YOLO v3, Data build, DataLoader, InfiniteDataLoader, seed_worker, build_dataloader, load_inference_source
4 | ---
5 |
6 | # Reference for `ultralytics/data/build.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/build.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/build.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/data/build.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.data.build.InfiniteDataLoader
15 |
16 |
17 |
18 | ## ::: ultralytics.data.build._RepeatSampler
19 |
20 |
21 |
22 | ## ::: ultralytics.data.build.seed_worker
23 |
24 |
25 |
26 | ## ::: ultralytics.data.build.build_yolo_dataset
27 |
28 |
29 |
30 | ## ::: ultralytics.data.build.build_dataloader
31 |
32 |
33 |
34 | ## ::: ultralytics.data.build.check_source
35 |
36 |
37 |
38 | ## ::: ultralytics.data.build.load_inference_source
39 |
40 |
41 |
--------------------------------------------------------------------------------
/docs/en/reference/data/converter.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore Ultralytics data converter functions like coco91_to_coco80_class, merge_multi_segment, rle2polygon for efficient data handling.
3 | keywords: Ultralytics, Data Converter, coco91_to_coco80_class, merge_multi_segment, rle2polygon
4 | ---
5 |
6 | # Reference for `ultralytics/data/converter.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/converter.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/converter.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/data/converter.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.data.converter.coco91_to_coco80_class
15 |
16 |
17 |
18 | ## ::: ultralytics.data.converter.coco80_to_coco91_class
19 |
20 |
21 |
22 | ## ::: ultralytics.data.converter.convert_coco
23 |
24 |
25 |
26 | ## ::: ultralytics.data.converter.convert_dota_to_yolo_obb
27 |
28 |
29 |
30 | ## ::: ultralytics.data.converter.min_index
31 |
32 |
33 |
34 | ## ::: ultralytics.data.converter.merge_multi_segment
35 |
36 |
37 |
38 | ## ::: ultralytics.data.converter.yolo_bbox2segment
39 |
40 |
41 |
--------------------------------------------------------------------------------
/docs/en/reference/utils/callbacks/wb.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Deep dive into Ultralytics callbacks. Learn how to use the _log_plots, on_fit_epoch_end, and on_train_end functions effectively.
3 | keywords: Ultralytics, callbacks, _log_plots, on_fit_epoch_end, on_train_end
4 | ---
5 |
6 | # Reference for `ultralytics/utils/callbacks/wb.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/wb.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/wb.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/callbacks/wb.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.utils.callbacks.wb._custom_table
15 |
16 |
17 |
18 | ## ::: ultralytics.utils.callbacks.wb._plot_curve
19 |
20 |
21 |
22 | ## ::: ultralytics.utils.callbacks.wb._log_plots
23 |
24 |
25 |
26 | ## ::: ultralytics.utils.callbacks.wb.on_pretrain_routine_start
27 |
28 |
29 |
30 | ## ::: ultralytics.utils.callbacks.wb.on_fit_epoch_end
31 |
32 |
33 |
34 | ## ::: ultralytics.utils.callbacks.wb.on_train_epoch_end
35 |
36 |
37 |
38 | ## ::: ultralytics.utils.callbacks.wb.on_train_end
39 |
40 |
41 |
--------------------------------------------------------------------------------
/ultralytics/cfg/datasets/carparts-seg.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # Carparts-seg dataset by Ultralytics
3 | # Documentation: https://docs.ultralytics.com/datasets/segment/carparts-seg/
4 | # Example usage: yolo train data=carparts-seg.yaml
5 | # parent
6 | # ├── ultralytics
7 | # └── datasets
8 | # └── carparts-seg ← downloads here (132 MB)
9 |
10 | # Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
11 | path: ../datasets/carparts-seg # dataset root dir
12 | train: train/images # train images (relative to 'path') 3516 images
13 | val: valid/images # val images (relative to 'path') 276 images
14 | test: test/images # test images (relative to 'path') 401 images
15 |
16 | # Classes
17 | names:
18 | 0: back_bumper
19 | 1: back_door
20 | 2: back_glass
21 | 3: back_left_door
22 | 4: back_left_light
23 | 5: back_light
24 | 6: back_right_door
25 | 7: back_right_light
26 | 8: front_bumper
27 | 9: front_door
28 | 10: front_glass
29 | 11: front_left_door
30 | 12: front_left_light
31 | 13: front_light
32 | 14: front_right_door
33 | 15: front_right_light
34 | 16: hood
35 | 17: left_mirror
36 | 18: object
37 | 19: right_mirror
38 | 20: tailgate
39 | 21: trunk
40 | 22: wheel
41 |
42 | # Download script/URL (optional)
43 | download: https://ultralytics.com/assets/carparts-seg.zip
44 |
--------------------------------------------------------------------------------
/docs/en/reference/data/explorer/utils.md:
--------------------------------------------------------------------------------
1 | ---
2 | comments: true
3 | description: Detailed reference for the Explorer utils. Provides descriptions and details on important utility functions for managing and interacting with data in the Ultralytics explorer project.
4 | keywords: Ultralytics, data explorer, function reference, documentation, get table schema, get sim index schema, sanitize batch, plot query result, prompt SQL query
5 | ---
6 |
7 | # Reference for `ultralytics/data/explorer/utils.py`
8 |
9 | !!! Note
10 |
11 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/explorer/utils.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/explorer/utils.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/data/explorer/utils.py) 🛠️. Thank you 🙏!
12 |
13 |
14 |
15 | ## ::: ultralytics.data.explorer.utils.get_table_schema
16 |
17 |
18 |
19 | ## ::: ultralytics.data.explorer.utils.get_sim_index_schema
20 |
21 |
22 |
23 | ## ::: ultralytics.data.explorer.utils.sanitize_batch
24 |
25 |
26 |
27 | ## ::: ultralytics.data.explorer.utils.plot_query_result
28 |
29 |
30 |
31 | ## ::: ultralytics.data.explorer.utils.prompt_sql_query
32 |
33 |
34 |
--------------------------------------------------------------------------------
/ultralytics/cfg/models/v3/yolov3-tiny.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # YOLOv3-tiny object detection model with P4-P5 outputs. For details see https://docs.ultralytics.com/models/yolov3
3 |
4 | # Parameters
5 | nc: 80 # number of classes
6 | depth_multiple: 1.0 # model depth multiple
7 | width_multiple: 1.0 # layer channel multiple
8 |
9 | # YOLOv3-tiny backbone
10 | backbone:
11 | # [from, number, module, args]
12 | - [-1, 1, Conv, [16, 3, 1]] # 0
13 | - [-1, 1, nn.MaxPool2d, [2, 2, 0]] # 1-P1/2
14 | - [-1, 1, Conv, [32, 3, 1]]
15 | - [-1, 1, nn.MaxPool2d, [2, 2, 0]] # 3-P2/4
16 | - [-1, 1, Conv, [64, 3, 1]]
17 | - [-1, 1, nn.MaxPool2d, [2, 2, 0]] # 5-P3/8
18 | - [-1, 1, Conv, [128, 3, 1]]
19 | - [-1, 1, nn.MaxPool2d, [2, 2, 0]] # 7-P4/16
20 | - [-1, 1, Conv, [256, 3, 1]]
21 | - [-1, 1, nn.MaxPool2d, [2, 2, 0]] # 9-P5/32
22 | - [-1, 1, Conv, [512, 3, 1]]
23 | - [-1, 1, nn.ZeroPad2d, [[0, 1, 0, 1]]] # 11
24 | - [-1, 1, nn.MaxPool2d, [2, 1, 0]] # 12
25 |
26 | # YOLOv3-tiny head
27 | head:
28 | - [-1, 1, Conv, [1024, 3, 1]]
29 | - [-1, 1, Conv, [256, 1, 1]]
30 | - [-1, 1, Conv, [512, 3, 1]] # 15 (P5/32-large)
31 |
32 | - [-2, 1, Conv, [128, 1, 1]]
33 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
34 | - [[-1, 8], 1, Concat, [1]] # cat backbone P4
35 | - [-1, 1, Conv, [256, 3, 1]] # 19 (P4/16-medium)
36 |
37 | - [[19, 15], 1, Detect, [nc]] # Detect(P4, P5)
38 |
--------------------------------------------------------------------------------
/docs/en/reference/data/loaders.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Find detailed guides on Ultralytics YOLO data loaders, including LoadStreams, LoadImages and LoadTensor. Learn how to get the best YouTube URLs.
3 | keywords: Ultralytics, data loaders, LoadStreams, LoadImages, LoadTensor, YOLO, YouTube URLs
4 | ---
5 |
6 | # Reference for `ultralytics/data/loaders.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/loaders.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/loaders.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/data/loaders.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.data.loaders.SourceTypes
15 |
16 |
17 |
18 | ## ::: ultralytics.data.loaders.LoadStreams
19 |
20 |
21 |
22 | ## ::: ultralytics.data.loaders.LoadScreenshots
23 |
24 |
25 |
26 | ## ::: ultralytics.data.loaders.LoadImagesAndVideos
27 |
28 |
29 |
30 | ## ::: ultralytics.data.loaders.LoadPilAndNumpy
31 |
32 |
33 |
34 | ## ::: ultralytics.data.loaders.LoadTensor
35 |
36 |
37 |
38 | ## ::: ultralytics.data.loaders.autocast_list
39 |
40 |
41 |
42 | ## ::: ultralytics.data.loaders.get_best_youtube_url
43 |
44 |
45 |
--------------------------------------------------------------------------------
/docs/en/reference/utils/files.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Discover how to use Ultralytics utility functions for file-related operations including incrementing paths, finding file age, checking file size and creating directories.
3 | keywords: Ultralytics, utility functions, file operations, working directory, file age, file size, create directories
4 | ---
5 |
6 | # Reference for `ultralytics/utils/files.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/files.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/files.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/files.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.utils.files.WorkingDirectory
15 |
16 |
17 |
18 | ## ::: ultralytics.utils.files.spaces_in_path
19 |
20 |
21 |
22 | ## ::: ultralytics.utils.files.increment_path
23 |
24 |
25 |
26 | ## ::: ultralytics.utils.files.file_age
27 |
28 |
29 |
30 | ## ::: ultralytics.utils.files.file_date
31 |
32 |
33 |
34 | ## ::: ultralytics.utils.files.file_size
35 |
36 |
37 |
38 | ## ::: ultralytics.utils.files.get_latest_run
39 |
40 |
41 |
42 | ## ::: ultralytics.utils.files.update_models
43 |
44 |
45 |
--------------------------------------------------------------------------------
/ultralytics/cfg/models/v10/yolov10s.yaml:
--------------------------------------------------------------------------------
1 | # Parameters
2 | nc: 80 # number of classes
3 | scales: # model compound scaling constants, i.e. 'model=yolov8n.yaml' will call yolov8.yaml with scale 'n'
4 | # [depth, width, max_channels]
5 | s: [0.33, 0.50, 1024]
6 |
7 | backbone:
8 | # [from, repeats, module, args]
9 | - [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
10 | - [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
11 | - [-1, 3, C2f, [128, True]]
12 | - [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
13 | - [-1, 6, C2f, [256, True]]
14 | - [-1, 1, SCDown, [512, 3, 2]] # 5-P4/16
15 | - [-1, 6, C2f, [512, True]]
16 | - [-1, 1, SCDown, [1024, 3, 2]] # 7-P5/32
17 | - [-1, 3, C2fCIB, [1024, True, True]]
18 | - [-1, 1, SPPF, [1024, 5]] # 9
19 | - [-1, 1, PSA, [1024]] # 10
20 |
21 | # YOLOv8.0n head
22 | head:
23 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
24 | - [[-1, 6], 1, Concat, [1]] # cat backbone P4
25 | - [-1, 3, C2f, [512]] # 13
26 |
27 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
28 | - [[-1, 4], 1, Concat, [1]] # cat backbone P3
29 | - [-1, 3, C2f, [256]] # 16 (P3/8-small)
30 |
31 | - [-1, 1, Conv, [256, 3, 2]]
32 | - [[-1, 13], 1, Concat, [1]] # cat head P4
33 | - [-1, 3, C2f, [512]] # 19 (P4/16-medium)
34 |
35 | - [-1, 1, SCDown, [512, 3, 2]]
36 | - [[-1, 10], 1, Concat, [1]] # cat head P5
37 | - [-1, 3, C2fCIB, [1024, True, True]] # 22 (P5/32-large)
38 |
39 | - [[16, 19, 22], 1, v10Detect, [nc]] # Detect(P3, P4, P5)
40 |
--------------------------------------------------------------------------------
/ultralytics/cfg/models/v10/yolov10n.yaml:
--------------------------------------------------------------------------------
1 | # Parameters
2 | nc: 80 # number of classes
3 | scales: # model compound scaling constants, i.e. 'model=yolov8n.yaml' will call yolov8.yaml with scale 'n'
4 | # [depth, width, max_channels]
5 | n: [0.33, 0.25, 1024]
6 |
7 | # YOLOv8.0n backbone
8 | backbone:
9 | # [from, repeats, module, args]
10 | - [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
11 | - [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
12 | - [-1, 3, C2f, [128, True]]
13 | - [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
14 | - [-1, 6, C2f, [256, True]]
15 | - [-1, 1, SCDown, [512, 3, 2]] # 5-P4/16
16 | - [-1, 6, C2f, [512, True]]
17 | - [-1, 1, SCDown, [1024, 3, 2]] # 7-P5/32
18 | - [-1, 3, C2f, [1024, True]]
19 | - [-1, 1, SPPF, [1024, 5]] # 9
20 | - [-1, 1, PSA, [1024]] # 10
21 |
22 | # YOLOv8.0n head
23 | head:
24 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
25 | - [[-1, 6], 1, Concat, [1]] # cat backbone P4
26 | - [-1, 3, C2f, [512]] # 13
27 |
28 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
29 | - [[-1, 4], 1, Concat, [1]] # cat backbone P3
30 | - [-1, 3, C2f, [256]] # 16 (P3/8-small)
31 |
32 | - [-1, 1, Conv, [256, 3, 2]]
33 | - [[-1, 13], 1, Concat, [1]] # cat head P4
34 | - [-1, 3, C2f, [512]] # 19 (P4/16-medium)
35 |
36 | - [-1, 1, SCDown, [512, 3, 2]]
37 | - [[-1, 10], 1, Concat, [1]] # cat head P5
38 | - [-1, 3, C2fCIB, [1024, True, True]] # 22 (P5/32-large)
39 |
40 | - [[16, 19, 22], 1, v10Detect, [nc]] # Detect(P3, P4, P5)
41 |
--------------------------------------------------------------------------------
/docs/en/reference/utils/callbacks/tensorboard.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore Ultralytics YOLO Docs for a deep understanding of log_scalars, on_batch_end & other callback utilities embedded in the tensorboard module.
3 | keywords: Ultralytics, YOLO, documentation, callback utilities, log_scalars, on_batch_end, tensorboard
4 | ---
5 |
6 | # Reference for `ultralytics/utils/callbacks/tensorboard.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/tensorboard.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/tensorboard.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/callbacks/tensorboard.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.utils.callbacks.tensorboard._log_scalars
15 |
16 |
17 |
18 | ## ::: ultralytics.utils.callbacks.tensorboard._log_tensorboard_graph
19 |
20 |
21 |
22 | ## ::: ultralytics.utils.callbacks.tensorboard.on_pretrain_routine_start
23 |
24 |
25 |
26 | ## ::: ultralytics.utils.callbacks.tensorboard.on_train_start
27 |
28 |
29 |
30 | ## ::: ultralytics.utils.callbacks.tensorboard.on_train_epoch_end
31 |
32 |
33 |
34 | ## ::: ultralytics.utils.callbacks.tensorboard.on_fit_epoch_end
35 |
36 |
37 |
--------------------------------------------------------------------------------
/ultralytics/cfg/models/v10/yolov10b.yaml:
--------------------------------------------------------------------------------
1 | # Parameters
2 | nc: 80 # number of classes
3 | scales: # model compound scaling constants, i.e. 'model=yolov8n.yaml' will call yolov8.yaml with scale 'n'
4 | # [depth, width, max_channels]
5 | b: [0.67, 1.00, 512]
6 |
7 | # YOLOv8.0n backbone
8 | backbone:
9 | # [from, repeats, module, args]
10 | - [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
11 | - [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
12 | - [-1, 3, C2f, [128, True]]
13 | - [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
14 | - [-1, 6, C2f, [256, True]]
15 | - [-1, 1, SCDown, [512, 3, 2]] # 5-P4/16
16 | - [-1, 6, C2f, [512, True]]
17 | - [-1, 1, SCDown, [1024, 3, 2]] # 7-P5/32
18 | - [-1, 3, C2fCIB, [1024, True]]
19 | - [-1, 1, SPPF, [1024, 5]] # 9
20 | - [-1, 1, PSA, [1024]] # 10
21 |
22 | # YOLOv8.0n head
23 | head:
24 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
25 | - [[-1, 6], 1, Concat, [1]] # cat backbone P4
26 | - [-1, 3, C2fCIB, [512, True]] # 13
27 |
28 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
29 | - [[-1, 4], 1, Concat, [1]] # cat backbone P3
30 | - [-1, 3, C2f, [256]] # 16 (P3/8-small)
31 |
32 | - [-1, 1, Conv, [256, 3, 2]]
33 | - [[-1, 13], 1, Concat, [1]] # cat head P4
34 | - [-1, 3, C2fCIB, [512, True]] # 19 (P4/16-medium)
35 |
36 | - [-1, 1, SCDown, [512, 3, 2]]
37 | - [[-1, 10], 1, Concat, [1]] # cat head P5
38 | - [-1, 3, C2fCIB, [1024, True]] # 22 (P5/32-large)
39 |
40 | - [[16, 19, 22], 1, v10Detect, [nc]] # Detect(P3, P4, P5)
41 |
--------------------------------------------------------------------------------
/ultralytics/cfg/models/v10/yolov10x.yaml:
--------------------------------------------------------------------------------
1 | # Parameters
2 | nc: 80 # number of classes
3 | scales: # model compound scaling constants, i.e. 'model=yolov8n.yaml' will call yolov8.yaml with scale 'n'
4 | # [depth, width, max_channels]
5 | x: [1.00, 1.25, 512]
6 |
7 | # YOLOv8.0n backbone
8 | backbone:
9 | # [from, repeats, module, args]
10 | - [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
11 | - [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
12 | - [-1, 3, C2f, [128, True]]
13 | - [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
14 | - [-1, 6, C2f, [256, True]]
15 | - [-1, 1, SCDown, [512, 3, 2]] # 5-P4/16
16 | - [-1, 6, C2fCIB, [512, True]]
17 | - [-1, 1, SCDown, [1024, 3, 2]] # 7-P5/32
18 | - [-1, 3, C2fCIB, [1024, True]]
19 | - [-1, 1, SPPF, [1024, 5]] # 9
20 | - [-1, 1, PSA, [1024]] # 10
21 |
22 | # YOLOv8.0n head
23 | head:
24 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
25 | - [[-1, 6], 1, Concat, [1]] # cat backbone P4
26 | - [-1, 3, C2fCIB, [512, True]] # 13
27 |
28 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
29 | - [[-1, 4], 1, Concat, [1]] # cat backbone P3
30 | - [-1, 3, C2f, [256]] # 16 (P3/8-small)
31 |
32 | - [-1, 1, Conv, [256, 3, 2]]
33 | - [[-1, 13], 1, Concat, [1]] # cat head P4
34 | - [-1, 3, C2fCIB, [512, True]] # 19 (P4/16-medium)
35 |
36 | - [-1, 1, SCDown, [512, 3, 2]]
37 | - [[-1, 10], 1, Concat, [1]] # cat head P5
38 | - [-1, 3, C2fCIB, [1024, True]] # 22 (P5/32-large)
39 |
40 | - [[16, 19, 22], 1, v10Detect, [nc]] # Detect(P3, P4, P5)
41 |
--------------------------------------------------------------------------------
/docs/en/reference/utils/callbacks/clearml.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Uncover the specifics of Ultralytics ClearML callbacks, from pretrain routine start to training end. Boost your ML model performance.
3 | keywords: Ultralytics, clearML, callbacks, pretrain routine start, validation end, train epoch end, training end
4 | ---
5 |
6 | # Reference for `ultralytics/utils/callbacks/clearml.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/clearml.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/clearml.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/callbacks/clearml.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.utils.callbacks.clearml._log_debug_samples
15 |
16 |
17 |
18 | ## ::: ultralytics.utils.callbacks.clearml._log_plot
19 |
20 |
21 |
22 | ## ::: ultralytics.utils.callbacks.clearml.on_pretrain_routine_start
23 |
24 |
25 |
26 | ## ::: ultralytics.utils.callbacks.clearml.on_train_epoch_end
27 |
28 |
29 |
30 | ## ::: ultralytics.utils.callbacks.clearml.on_fit_epoch_end
31 |
32 |
33 |
34 | ## ::: ultralytics.utils.callbacks.clearml.on_val_end
35 |
36 |
37 |
38 | ## ::: ultralytics.utils.callbacks.clearml.on_train_end
39 |
40 |
41 |
--------------------------------------------------------------------------------
/RKNN_README_EN.md:
--------------------------------------------------------------------------------
1 | # RKNN optimization for exporting model
2 |
3 | ## Source
4 | Base on https://github.com/THU-MIG/yolov10 with commit id as 62aaafb3a0bcc17224b797ae4e9af65d7f29773f
5 |
6 |
7 | ## What different
8 | With inference result values unchanged, the following optimizations were applied:
9 |
10 | - Added a sigmoid operator to the confidence branch in the model output (Modify `ultralytics/nn/modules/head.py`).
11 |
12 | - Removed the post-processing structure from the output to improve inference performance and quantization precision, as the original post-processing operators were not friendly to these aspects (Modify `ultralytics/nn/modules/head.py`).
13 |
14 | - To enhance inference performance, the DFL (Distribution Focal Loss) structure has been moved to the post-processing stage outside of the model (Modify `ultralytics/nn/modules/head.py`).
15 |
16 |
17 | ## Export ONNX model
18 |
19 | After meeting the installation environment requirements in the original `yolov10` repository for exporting the model, execute the following command to export the model:
20 |
21 |
22 | ``` sh
23 | yolo export model=model/yolov10{n/s/m/b/l/x} format=rknn opset=13 simplify
24 |
25 | # model refers to the original model file.
26 | # format refers to the model weight file.
27 | # After execution, an ONNX model will be generated. If the original model is yolov10n.pt, the generated ONNX model will be yolo10n.onnx.
28 | ```
29 |
30 | ## Convert to RKNN model, Python demo, C demo
31 |
32 | Please refer to https://github.com/airockchip/rknn_model_zoo.
33 |
--------------------------------------------------------------------------------
/docs/en/reference/data/split_dota.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Detailed guide on using YOLO with DOTA dataset for object detection, including dataset preparation, image splitting, and label handling.
3 | keywords: Ultralytics, YOLO, DOTA dataset, object detection, image processing, python, dataset preparation, image splitting, label handling, YOLO with DOTA, computer vision, AI, machine learning
4 | ---
5 |
6 | # Reference for `ultralytics/data/split_dota.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/split_dota.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/split_dota.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/data/split_dota.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.data.split_dota.bbox_iof
15 |
16 |
17 |
18 | ## ::: ultralytics.data.split_dota.load_yolo_dota
19 |
20 |
21 |
22 | ## ::: ultralytics.data.split_dota.get_windows
23 |
24 |
25 |
26 | ## ::: ultralytics.data.split_dota.get_window_obj
27 |
28 |
29 |
30 | ## ::: ultralytics.data.split_dota.crop_and_save
31 |
32 |
33 |
34 | ## ::: ultralytics.data.split_dota.split_images_and_labels
35 |
36 |
37 |
38 | ## ::: ultralytics.data.split_dota.split_trainval
39 |
40 |
41 |
42 | ## ::: ultralytics.data.split_dota.split_test
43 |
44 |
45 |
--------------------------------------------------------------------------------
/docs/en/reference/utils/callbacks/hub.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore the detailed information on key Ultralytics callbacks such as on_pretrain_routine_end, on_model_save, on_train_start, and on_predict_start.
3 | keywords: Ultralytics, callbacks, on_pretrain_routine_end, on_model_save, on_train_start, on_predict_start, hub, training
4 | ---
5 |
6 | # Reference for `ultralytics/utils/callbacks/hub.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/hub.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/hub.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/callbacks/hub.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.utils.callbacks.hub.on_pretrain_routine_end
15 |
16 |
17 |
18 | ## ::: ultralytics.utils.callbacks.hub.on_fit_epoch_end
19 |
20 |
21 |
22 | ## ::: ultralytics.utils.callbacks.hub.on_model_save
23 |
24 |
25 |
26 | ## ::: ultralytics.utils.callbacks.hub.on_train_end
27 |
28 |
29 |
30 | ## ::: ultralytics.utils.callbacks.hub.on_train_start
31 |
32 |
33 |
34 | ## ::: ultralytics.utils.callbacks.hub.on_val_start
35 |
36 |
37 |
38 | ## ::: ultralytics.utils.callbacks.hub.on_predict_start
39 |
40 |
41 |
42 | ## ::: ultralytics.utils.callbacks.hub.on_export_start
43 |
44 |
45 |
--------------------------------------------------------------------------------
/ultralytics/cfg/models/v10/yolov10l.yaml:
--------------------------------------------------------------------------------
1 | # Parameters
2 | nc: 80 # number of classes
3 | scales: # model compound scaling constants, i.e. 'model=yolov8n.yaml' will call yolov8.yaml with scale 'n'
4 | # [depth, width, max_channels]
5 | l: [1.00, 1.00, 512] # YOLOv8l summary: 365 layers, 43691520 parameters, 43691504 gradients, 165.7 GFLOPs
6 |
7 | # YOLOv8.0n backbone
8 | backbone:
9 | # [from, repeats, module, args]
10 | - [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
11 | - [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
12 | - [-1, 3, C2f, [128, True]]
13 | - [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
14 | - [-1, 6, C2f, [256, True]]
15 | - [-1, 1, SCDown, [512, 3, 2]] # 5-P4/16
16 | - [-1, 6, C2f, [512, True]]
17 | - [-1, 1, SCDown, [1024, 3, 2]] # 7-P5/32
18 | - [-1, 3, C2fCIB, [1024, True]]
19 | - [-1, 1, SPPF, [1024, 5]] # 9
20 | - [-1, 1, PSA, [1024]] # 10
21 |
22 | # YOLOv8.0n head
23 | head:
24 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
25 | - [[-1, 6], 1, Concat, [1]] # cat backbone P4
26 | - [-1, 3, C2fCIB, [512, True]] # 13
27 |
28 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
29 | - [[-1, 4], 1, Concat, [1]] # cat backbone P3
30 | - [-1, 3, C2f, [256]] # 16 (P3/8-small)
31 |
32 | - [-1, 1, Conv, [256, 3, 2]]
33 | - [[-1, 13], 1, Concat, [1]] # cat head P4
34 | - [-1, 3, C2fCIB, [512, True]] # 19 (P4/16-medium)
35 |
36 | - [-1, 1, SCDown, [512, 3, 2]]
37 | - [[-1, 10], 1, Concat, [1]] # cat head P5
38 | - [-1, 3, C2fCIB, [1024, True]] # 22 (P5/32-large)
39 |
40 | - [[16, 19, 22], 1, v10Detect, [nc]] # Detect(P3, P4, P5)
41 |
--------------------------------------------------------------------------------
/docs/en/reference/utils/loss.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore Ultralytics' versatile loss functions - VarifocalLoss, BboxLoss, v8DetectionLoss, v8PoseLoss. Improve your accuracy on YOLO implementations.
3 | keywords: Ultralytics, Loss functions, VarifocalLoss, BboxLoss, v8DetectionLoss, v8PoseLoss, YOLO, Ultralytics Documentation
4 | ---
5 |
6 | # Reference for `ultralytics/utils/loss.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/loss.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/loss.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/loss.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.utils.loss.VarifocalLoss
15 |
16 |
17 |
18 | ## ::: ultralytics.utils.loss.FocalLoss
19 |
20 |
21 |
22 | ## ::: ultralytics.utils.loss.BboxLoss
23 |
24 |
25 |
26 | ## ::: ultralytics.utils.loss.RotatedBboxLoss
27 |
28 |
29 |
30 | ## ::: ultralytics.utils.loss.KeypointLoss
31 |
32 |
33 |
34 | ## ::: ultralytics.utils.loss.v8DetectionLoss
35 |
36 |
37 |
38 | ## ::: ultralytics.utils.loss.v8SegmentationLoss
39 |
40 |
41 |
42 | ## ::: ultralytics.utils.loss.v8PoseLoss
43 |
44 |
45 |
46 | ## ::: ultralytics.utils.loss.v8ClassificationLoss
47 |
48 |
49 |
50 | ## ::: ultralytics.utils.loss.v8OBBLoss
51 |
52 |
53 |
--------------------------------------------------------------------------------
/examples/YOLOv8-ONNXRuntime/README.md:
--------------------------------------------------------------------------------
1 | # YOLOv8 - ONNX Runtime
2 |
3 | This project implements YOLOv8 using ONNX Runtime.
4 |
5 | ## Installation
6 |
7 | To run this project, you need to install the required dependencies. The following instructions will guide you through the installation process.
8 |
9 | ### Installing Required Dependencies
10 |
11 | You can install the required dependencies by running the following command:
12 |
13 | ```bash
14 | pip install -r requirements.txt
15 | ```
16 |
17 | ### Installing `onnxruntime-gpu`
18 |
19 | If you have an NVIDIA GPU and want to leverage GPU acceleration, you can install the onnxruntime-gpu package using the following command:
20 |
21 | ```bash
22 | pip install onnxruntime-gpu
23 | ```
24 |
25 | Note: Make sure you have the appropriate GPU drivers installed on your system.
26 |
27 | ### Installing `onnxruntime` (CPU version)
28 |
29 | If you don't have an NVIDIA GPU or prefer to use the CPU version of onnxruntime, you can install the onnxruntime package using the following command:
30 |
31 | ```bash
32 | pip install onnxruntime
33 | ```
34 |
35 | ### Usage
36 |
37 | After successfully installing the required packages, you can run the YOLOv8 implementation using the following command:
38 |
39 | ```bash
40 | python main.py --model yolov8n.onnx --img image.jpg --conf-thres 0.5 --iou-thres 0.5
41 | ```
42 |
43 | Make sure to replace yolov8n.onnx with the path to your YOLOv8 ONNX model file, image.jpg with the path to your input image, and adjust the confidence threshold (conf-thres) and IoU threshold (iou-thres) values as needed.
44 |
--------------------------------------------------------------------------------
/docs/en/reference/utils/callbacks/neptune.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore exhaustive details about Ultralytics callbacks in Neptune, with specifics about scalar logging, routine start, and more.
3 | keywords: Ultralytics, Neptune callbacks, on_train_epoch_end, on_val_end, _log_plot, _log_images, on_pretrain_routine_start, on_fit_epoch_end, on_train_end
4 | ---
5 |
6 | # Reference for `ultralytics/utils/callbacks/neptune.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/neptune.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/neptune.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/callbacks/neptune.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.utils.callbacks.neptune._log_scalars
15 |
16 |
17 |
18 | ## ::: ultralytics.utils.callbacks.neptune._log_images
19 |
20 |
21 |
22 | ## ::: ultralytics.utils.callbacks.neptune._log_plot
23 |
24 |
25 |
26 | ## ::: ultralytics.utils.callbacks.neptune.on_pretrain_routine_start
27 |
28 |
29 |
30 | ## ::: ultralytics.utils.callbacks.neptune.on_train_epoch_end
31 |
32 |
33 |
34 | ## ::: ultralytics.utils.callbacks.neptune.on_fit_epoch_end
35 |
36 |
37 |
38 | ## ::: ultralytics.utils.callbacks.neptune.on_val_end
39 |
40 |
41 |
42 | ## ::: ultralytics.utils.callbacks.neptune.on_train_end
43 |
44 |
45 |
--------------------------------------------------------------------------------
/docs/en/reference/utils/callbacks/dvc.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Browse through Ultralytics YOLO docs to learn about important logging and callback functions used in training and pretraining models.
3 | keywords: Ultralytics, YOLO, callbacks, logger, training, pretraining, machine learning, models
4 | ---
5 |
6 | # Reference for `ultralytics/utils/callbacks/dvc.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/dvc.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/dvc.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/callbacks/dvc.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.utils.callbacks.dvc._log_images
15 |
16 |
17 |
18 | ## ::: ultralytics.utils.callbacks.dvc._log_plots
19 |
20 |
21 |
22 | ## ::: ultralytics.utils.callbacks.dvc._log_confusion_matrix
23 |
24 |
25 |
26 | ## ::: ultralytics.utils.callbacks.dvc.on_pretrain_routine_start
27 |
28 |
29 |
30 | ## ::: ultralytics.utils.callbacks.dvc.on_pretrain_routine_end
31 |
32 |
33 |
34 | ## ::: ultralytics.utils.callbacks.dvc.on_train_start
35 |
36 |
37 |
38 | ## ::: ultralytics.utils.callbacks.dvc.on_train_epoch_start
39 |
40 |
41 |
42 | ## ::: ultralytics.utils.callbacks.dvc.on_fit_epoch_end
43 |
44 |
45 |
46 | ## ::: ultralytics.utils.callbacks.dvc.on_train_end
47 |
48 |
49 |
--------------------------------------------------------------------------------
/docs/en/reference/utils/downloads.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Learn about the download utilities in Ultralytics YOLO, featuring functions like is_url, check_disk_space, get_github_assets, and download.
3 | keywords: Ultralytics, YOLO, download utilities, is_url, check_disk_space, get_github_assets, download, documentation
4 | ---
5 |
6 | # Reference for `ultralytics/utils/downloads.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/downloads.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/downloads.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/downloads.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.utils.downloads.is_url
15 |
16 |
17 |
18 | ## ::: ultralytics.utils.downloads.delete_dsstore
19 |
20 |
21 |
22 | ## ::: ultralytics.utils.downloads.zip_directory
23 |
24 |
25 |
26 | ## ::: ultralytics.utils.downloads.unzip_file
27 |
28 |
29 |
30 | ## ::: ultralytics.utils.downloads.check_disk_space
31 |
32 |
33 |
34 | ## ::: ultralytics.utils.downloads.get_google_drive_file_info
35 |
36 |
37 |
38 | ## ::: ultralytics.utils.downloads.safe_download
39 |
40 |
41 |
42 | ## ::: ultralytics.utils.downloads.get_github_assets
43 |
44 |
45 |
46 | ## ::: ultralytics.utils.downloads.attempt_download_asset
47 |
48 |
49 |
50 | ## ::: ultralytics.utils.downloads.download
51 |
52 |
53 |
--------------------------------------------------------------------------------
/ultralytics/models/yolo/obb/train.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
3 | from copy import copy
4 |
5 | from ultralytics.models import yolo
6 | from ultralytics.nn.tasks import OBBModel
7 | from ultralytics.utils import DEFAULT_CFG, RANK
8 |
9 |
10 | class OBBTrainer(yolo.detect.DetectionTrainer):
11 | """
12 | A class extending the DetectionTrainer class for training based on an Oriented Bounding Box (OBB) model.
13 |
14 | Example:
15 | ```python
16 | from ultralytics.models.yolo.obb import OBBTrainer
17 |
18 | args = dict(model='yolov8n-obb.pt', data='dota8.yaml', epochs=3)
19 | trainer = OBBTrainer(overrides=args)
20 | trainer.train()
21 | ```
22 | """
23 |
24 | def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None):
25 | """Initialize a OBBTrainer object with given arguments."""
26 | if overrides is None:
27 | overrides = {}
28 | overrides["task"] = "obb"
29 | super().__init__(cfg, overrides, _callbacks)
30 |
31 | def get_model(self, cfg=None, weights=None, verbose=True):
32 | """Return OBBModel initialized with specified config and weights."""
33 | model = OBBModel(cfg, ch=3, nc=self.data["nc"], verbose=verbose and RANK == -1)
34 | if weights:
35 | model.load(weights)
36 |
37 | return model
38 |
39 | def get_validator(self):
40 | """Return an instance of OBBValidator for validation of YOLO model."""
41 | self.loss_names = "box_loss", "cls_loss", "dfl_loss"
42 | return yolo.obb.OBBValidator(self.test_loader, save_dir=self.save_dir, args=copy(self.args))
43 |
--------------------------------------------------------------------------------
/docs/en/reference/utils/plotting.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Master advanced plotting utils from Ultralytics including color annotations, label and image plotting, and feature visualization.
3 | keywords: Ultralytics, plotting, utils, color annotation, label plotting, image plotting, feature visualization
4 | ---
5 |
6 | # Reference for `ultralytics/utils/plotting.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/plotting.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/plotting.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/plotting.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.utils.plotting.Colors
15 |
16 |
17 |
18 | ## ::: ultralytics.utils.plotting.Annotator
19 |
20 |
21 |
22 | ## ::: ultralytics.utils.plotting.plot_labels
23 |
24 |
25 |
26 | ## ::: ultralytics.utils.plotting.save_one_box
27 |
28 |
29 |
30 | ## ::: ultralytics.utils.plotting.plot_images
31 |
32 |
33 |
34 | ## ::: ultralytics.utils.plotting.plot_results
35 |
36 |
37 |
38 | ## ::: ultralytics.utils.plotting.plt_color_scatter
39 |
40 |
41 |
42 | ## ::: ultralytics.utils.plotting.plot_tune_results
43 |
44 |
45 |
46 | ## ::: ultralytics.utils.plotting.output_to_target
47 |
48 |
49 |
50 | ## ::: ultralytics.utils.plotting.output_to_rotated_target
51 |
52 |
53 |
54 | ## ::: ultralytics.utils.plotting.feature_visualization
55 |
56 |
57 |
--------------------------------------------------------------------------------
/ultralytics/cfg/models/v8/yolov8-seg.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # YOLOv8-seg instance segmentation model. For Usage examples see https://docs.ultralytics.com/tasks/segment
3 |
4 | # Parameters
5 | nc: 80 # number of classes
6 | scales: # model compound scaling constants, i.e. 'model=yolov8n-seg.yaml' will call yolov8-seg.yaml with scale 'n'
7 | # [depth, width, max_channels]
8 | n: [0.33, 0.25, 1024]
9 | s: [0.33, 0.50, 1024]
10 | m: [0.67, 0.75, 768]
11 | l: [1.00, 1.00, 512]
12 | x: [1.00, 1.25, 512]
13 |
14 | # YOLOv8.0n backbone
15 | backbone:
16 | # [from, repeats, module, args]
17 | - [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
18 | - [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
19 | - [-1, 3, C2f, [128, True]]
20 | - [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
21 | - [-1, 6, C2f, [256, True]]
22 | - [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
23 | - [-1, 6, C2f, [512, True]]
24 | - [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
25 | - [-1, 3, C2f, [1024, True]]
26 | - [-1, 1, SPPF, [1024, 5]] # 9
27 |
28 | # YOLOv8.0n head
29 | head:
30 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
31 | - [[-1, 6], 1, Concat, [1]] # cat backbone P4
32 | - [-1, 3, C2f, [512]] # 12
33 |
34 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
35 | - [[-1, 4], 1, Concat, [1]] # cat backbone P3
36 | - [-1, 3, C2f, [256]] # 15 (P3/8-small)
37 |
38 | - [-1, 1, Conv, [256, 3, 2]]
39 | - [[-1, 12], 1, Concat, [1]] # cat head P4
40 | - [-1, 3, C2f, [512]] # 18 (P4/16-medium)
41 |
42 | - [-1, 1, Conv, [512, 3, 2]]
43 | - [[-1, 9], 1, Concat, [1]] # cat head P5
44 | - [-1, 3, C2f, [1024]] # 21 (P5/32-large)
45 |
46 | - [[15, 18, 21], 1, Segment, [nc, 32, 256]] # Segment(P3, P4, P5)
47 |
--------------------------------------------------------------------------------
/ultralytics/models/yolo/detect/predict.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
3 | from ultralytics.engine.predictor import BasePredictor
4 | from ultralytics.engine.results import Results
5 | from ultralytics.utils import ops
6 |
7 |
8 | class DetectionPredictor(BasePredictor):
9 | """
10 | A class extending the BasePredictor class for prediction based on a detection model.
11 |
12 | Example:
13 | ```python
14 | from ultralytics.utils import ASSETS
15 | from ultralytics.models.yolo.detect import DetectionPredictor
16 |
17 | args = dict(model='yolov8n.pt', source=ASSETS)
18 | predictor = DetectionPredictor(overrides=args)
19 | predictor.predict_cli()
20 | ```
21 | """
22 |
23 | def postprocess(self, preds, img, orig_imgs):
24 | """Post-processes predictions and returns a list of Results objects."""
25 | preds = ops.non_max_suppression(
26 | preds,
27 | self.args.conf,
28 | self.args.iou,
29 | agnostic=self.args.agnostic_nms,
30 | max_det=self.args.max_det,
31 | classes=self.args.classes,
32 | )
33 |
34 | if not isinstance(orig_imgs, list): # input images are a torch.Tensor, not a list
35 | orig_imgs = ops.convert_torch2numpy_batch(orig_imgs)
36 |
37 | results = []
38 | for i, pred in enumerate(preds):
39 | orig_img = orig_imgs[i]
40 | pred[:, :4] = ops.scale_boxes(img.shape[2:], pred[:, :4], orig_img.shape)
41 | img_path = self.batch[0][i]
42 | results.append(Results(orig_img, path=img_path, names=self.model.names, boxes=pred))
43 | return results
44 |
--------------------------------------------------------------------------------
/ultralytics/models/yolov10/predict.py:
--------------------------------------------------------------------------------
1 | from ultralytics.models.yolo.detect import DetectionPredictor
2 | import torch
3 | from ultralytics.utils import ops
4 | from ultralytics.engine.results import Results
5 |
6 |
7 | class YOLOv10DetectionPredictor(DetectionPredictor):
8 | def postprocess(self, preds, img, orig_imgs):
9 | if isinstance(preds, dict):
10 | preds = preds["one2one"]
11 |
12 | if isinstance(preds, (list, tuple)):
13 | preds = preds[0]
14 |
15 | if preds.shape[-1] == 6:
16 | pass
17 | else:
18 | preds = preds.transpose(-1, -2)
19 | bboxes, scores, labels = ops.v10postprocess(preds, self.args.max_det, preds.shape[-1]-4)
20 | bboxes = ops.xywh2xyxy(bboxes)
21 | preds = torch.cat([bboxes, scores.unsqueeze(-1), labels.unsqueeze(-1)], dim=-1)
22 |
23 | mask = preds[..., 4] > self.args.conf
24 | if self.args.classes is not None:
25 | mask = mask & (preds[..., 5:6] == torch.tensor(self.args.classes, device=preds.device).unsqueeze(0)).any(2)
26 |
27 | preds = [p[mask[idx]] for idx, p in enumerate(preds)]
28 |
29 | if not isinstance(orig_imgs, list): # input images are a torch.Tensor, not a list
30 | orig_imgs = ops.convert_torch2numpy_batch(orig_imgs)
31 |
32 | results = []
33 | for i, pred in enumerate(preds):
34 | orig_img = orig_imgs[i]
35 | pred[:, :4] = ops.scale_boxes(img.shape[2:], pred[:, :4], orig_img.shape)
36 | img_path = self.batch[0][i]
37 | results.append(Results(orig_img, path=img_path, names=self.model.names, boxes=pred))
38 | return results
39 |
--------------------------------------------------------------------------------
/ultralytics/cfg/models/rt-detr/rtdetr-resnet101.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # RT-DETR-ResNet101 object detection model with P3-P5 outputs.
3 |
4 | # Parameters
5 | nc: 80 # number of classes
6 | scales: # model compound scaling constants, i.e. 'model=yolov8n-cls.yaml' will call yolov8-cls.yaml with scale 'n'
7 | # [depth, width, max_channels]
8 | l: [1.00, 1.00, 1024]
9 |
10 | backbone:
11 | # [from, repeats, module, args]
12 | - [-1, 1, ResNetLayer, [3, 64, 1, True, 1]] # 0
13 | - [-1, 1, ResNetLayer, [64, 64, 1, False, 3]] # 1
14 | - [-1, 1, ResNetLayer, [256, 128, 2, False, 4]] # 2
15 | - [-1, 1, ResNetLayer, [512, 256, 2, False, 23]] # 3
16 | - [-1, 1, ResNetLayer, [1024, 512, 2, False, 3]] # 4
17 |
18 | head:
19 | - [-1, 1, Conv, [256, 1, 1, None, 1, 1, False]] # 5
20 | - [-1, 1, AIFI, [1024, 8]]
21 | - [-1, 1, Conv, [256, 1, 1]] # 7
22 |
23 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
24 | - [3, 1, Conv, [256, 1, 1, None, 1, 1, False]] # 9
25 | - [[-2, -1], 1, Concat, [1]]
26 | - [-1, 3, RepC3, [256]] # 11
27 | - [-1, 1, Conv, [256, 1, 1]] # 12
28 |
29 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
30 | - [2, 1, Conv, [256, 1, 1, None, 1, 1, False]] # 14
31 | - [[-2, -1], 1, Concat, [1]] # cat backbone P4
32 | - [-1, 3, RepC3, [256]] # X3 (16), fpn_blocks.1
33 |
34 | - [-1, 1, Conv, [256, 3, 2]] # 17, downsample_convs.0
35 | - [[-1, 12], 1, Concat, [1]] # cat Y4
36 | - [-1, 3, RepC3, [256]] # F4 (19), pan_blocks.0
37 |
38 | - [-1, 1, Conv, [256, 3, 2]] # 20, downsample_convs.1
39 | - [[-1, 7], 1, Concat, [1]] # cat Y5
40 | - [-1, 3, RepC3, [256]] # F5 (22), pan_blocks.1
41 |
42 | - [[16, 19, 22], 1, RTDETRDecoder, [nc]] # Detect(P3, P4, P5)
43 |
--------------------------------------------------------------------------------
/ultralytics/cfg/models/rt-detr/rtdetr-resnet50.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # RT-DETR-ResNet50 object detection model with P3-P5 outputs.
3 |
4 | # Parameters
5 | nc: 80 # number of classes
6 | scales: # model compound scaling constants, i.e. 'model=yolov8n-cls.yaml' will call yolov8-cls.yaml with scale 'n'
7 | # [depth, width, max_channels]
8 | l: [1.00, 1.00, 1024]
9 |
10 | backbone:
11 | # [from, repeats, module, args]
12 | - [-1, 1, ResNetLayer, [3, 64, 1, True, 1]] # 0
13 | - [-1, 1, ResNetLayer, [64, 64, 1, False, 3]] # 1
14 | - [-1, 1, ResNetLayer, [256, 128, 2, False, 4]] # 2
15 | - [-1, 1, ResNetLayer, [512, 256, 2, False, 6]] # 3
16 | - [-1, 1, ResNetLayer, [1024, 512, 2, False, 3]] # 4
17 |
18 | head:
19 | - [-1, 1, Conv, [256, 1, 1, None, 1, 1, False]] # 5
20 | - [-1, 1, AIFI, [1024, 8]]
21 | - [-1, 1, Conv, [256, 1, 1]] # 7
22 |
23 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
24 | - [3, 1, Conv, [256, 1, 1, None, 1, 1, False]] # 9
25 | - [[-2, -1], 1, Concat, [1]]
26 | - [-1, 3, RepC3, [256]] # 11
27 | - [-1, 1, Conv, [256, 1, 1]] # 12
28 |
29 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
30 | - [2, 1, Conv, [256, 1, 1, None, 1, 1, False]] # 14
31 | - [[-2, -1], 1, Concat, [1]] # cat backbone P4
32 | - [-1, 3, RepC3, [256]] # X3 (16), fpn_blocks.1
33 |
34 | - [-1, 1, Conv, [256, 3, 2]] # 17, downsample_convs.0
35 | - [[-1, 12], 1, Concat, [1]] # cat Y4
36 | - [-1, 3, RepC3, [256]] # F4 (19), pan_blocks.0
37 |
38 | - [-1, 1, Conv, [256, 3, 2]] # 20, downsample_convs.1
39 | - [[-1, 7], 1, Concat, [1]] # cat Y5
40 | - [-1, 3, RepC3, [256]] # F5 (22), pan_blocks.1
41 |
42 | - [[16, 19, 22], 1, RTDETRDecoder, [nc]] # Detect(P3, P4, P5)
43 |
--------------------------------------------------------------------------------
/ultralytics/cfg/models/v10/yolov10m.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # YOLOv8 object detection model with P3-P5 outputs. For Usage examples see https://docs.ultralytics.com/tasks/detect
3 |
4 | # Parameters
5 | nc: 80 # number of classes
6 | scales: # model compound scaling constants, i.e. 'model=yolov8n.yaml' will call yolov8.yaml with scale 'n'
7 | # [depth, width, max_channels]
8 | m: [0.67, 0.75, 768] # YOLOv8m summary: 295 layers, 25902640 parameters, 25902624 gradients, 79.3 GFLOPs
9 |
10 | # YOLOv8.0n backbone
11 | backbone:
12 | # [from, repeats, module, args]
13 | - [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
14 | - [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
15 | - [-1, 3, C2f, [128, True]]
16 | - [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
17 | - [-1, 6, C2f, [256, True]]
18 | - [-1, 1, SCDown, [512, 3, 2]] # 5-P4/16
19 | - [-1, 6, C2f, [512, True]]
20 | - [-1, 1, SCDown, [1024, 3, 2]] # 7-P5/32
21 | - [-1, 3, C2fCIB, [1024, True]]
22 | - [-1, 1, SPPF, [1024, 5]] # 9
23 | - [-1, 1, PSA, [1024]] # 10
24 |
25 | # YOLOv8.0n head
26 | head:
27 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
28 | - [[-1, 6], 1, Concat, [1]] # cat backbone P4
29 | - [-1, 3, C2f, [512]] # 13
30 |
31 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
32 | - [[-1, 4], 1, Concat, [1]] # cat backbone P3
33 | - [-1, 3, C2f, [256]] # 16 (P3/8-small)
34 |
35 | - [-1, 1, Conv, [256, 3, 2]]
36 | - [[-1, 13], 1, Concat, [1]] # cat head P4
37 | - [-1, 3, C2fCIB, [512, True]] # 19 (P4/16-medium)
38 |
39 | - [-1, 1, SCDown, [512, 3, 2]]
40 | - [[-1, 10], 1, Concat, [1]] # cat head P5
41 | - [-1, 3, C2fCIB, [1024, True]] # 22 (P5/32-large)
42 |
43 | - [[16, 19, 22], 1, v10Detect, [nc]] # Detect(P3, P4, P5)
44 |
--------------------------------------------------------------------------------
/ultralytics/cfg/models/v3/yolov3.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # YOLOv3 object detection model with P3-P5 outputs. For details see https://docs.ultralytics.com/models/yolov3
3 |
4 | # Parameters
5 | nc: 80 # number of classes
6 | depth_multiple: 1.0 # model depth multiple
7 | width_multiple: 1.0 # layer channel multiple
8 |
9 | # darknet53 backbone
10 | backbone:
11 | # [from, number, module, args]
12 | - [-1, 1, Conv, [32, 3, 1]] # 0
13 | - [-1, 1, Conv, [64, 3, 2]] # 1-P1/2
14 | - [-1, 1, Bottleneck, [64]]
15 | - [-1, 1, Conv, [128, 3, 2]] # 3-P2/4
16 | - [-1, 2, Bottleneck, [128]]
17 | - [-1, 1, Conv, [256, 3, 2]] # 5-P3/8
18 | - [-1, 8, Bottleneck, [256]]
19 | - [-1, 1, Conv, [512, 3, 2]] # 7-P4/16
20 | - [-1, 8, Bottleneck, [512]]
21 | - [-1, 1, Conv, [1024, 3, 2]] # 9-P5/32
22 | - [-1, 4, Bottleneck, [1024]] # 10
23 |
24 | # YOLOv3 head
25 | head:
26 | - [-1, 1, Bottleneck, [1024, False]]
27 | - [-1, 1, Conv, [512, 1, 1]]
28 | - [-1, 1, Conv, [1024, 3, 1]]
29 | - [-1, 1, Conv, [512, 1, 1]]
30 | - [-1, 1, Conv, [1024, 3, 1]] # 15 (P5/32-large)
31 |
32 | - [-2, 1, Conv, [256, 1, 1]]
33 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
34 | - [[-1, 8], 1, Concat, [1]] # cat backbone P4
35 | - [-1, 1, Bottleneck, [512, False]]
36 | - [-1, 1, Bottleneck, [512, False]]
37 | - [-1, 1, Conv, [256, 1, 1]]
38 | - [-1, 1, Conv, [512, 3, 1]] # 22 (P4/16-medium)
39 |
40 | - [-2, 1, Conv, [128, 1, 1]]
41 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
42 | - [[-1, 6], 1, Concat, [1]] # cat backbone P3
43 | - [-1, 1, Bottleneck, [256, False]]
44 | - [-1, 2, Bottleneck, [256, False]] # 27 (P3/8-small)
45 |
46 | - [[27, 22, 15], 1, Detect, [nc]] # Detect(P3, P4, P5)
47 |
--------------------------------------------------------------------------------
/ultralytics/cfg/models/v3/yolov3-spp.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # YOLOv3-SPP object detection model with P3-P5 outputs. For details see https://docs.ultralytics.com/models/yolov3
3 |
4 | # Parameters
5 | nc: 80 # number of classes
6 | depth_multiple: 1.0 # model depth multiple
7 | width_multiple: 1.0 # layer channel multiple
8 |
9 | # darknet53 backbone
10 | backbone:
11 | # [from, number, module, args]
12 | - [-1, 1, Conv, [32, 3, 1]] # 0
13 | - [-1, 1, Conv, [64, 3, 2]] # 1-P1/2
14 | - [-1, 1, Bottleneck, [64]]
15 | - [-1, 1, Conv, [128, 3, 2]] # 3-P2/4
16 | - [-1, 2, Bottleneck, [128]]
17 | - [-1, 1, Conv, [256, 3, 2]] # 5-P3/8
18 | - [-1, 8, Bottleneck, [256]]
19 | - [-1, 1, Conv, [512, 3, 2]] # 7-P4/16
20 | - [-1, 8, Bottleneck, [512]]
21 | - [-1, 1, Conv, [1024, 3, 2]] # 9-P5/32
22 | - [-1, 4, Bottleneck, [1024]] # 10
23 |
24 | # YOLOv3-SPP head
25 | head:
26 | - [-1, 1, Bottleneck, [1024, False]]
27 | - [-1, 1, SPP, [512, [5, 9, 13]]]
28 | - [-1, 1, Conv, [1024, 3, 1]]
29 | - [-1, 1, Conv, [512, 1, 1]]
30 | - [-1, 1, Conv, [1024, 3, 1]] # 15 (P5/32-large)
31 |
32 | - [-2, 1, Conv, [256, 1, 1]]
33 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
34 | - [[-1, 8], 1, Concat, [1]] # cat backbone P4
35 | - [-1, 1, Bottleneck, [512, False]]
36 | - [-1, 1, Bottleneck, [512, False]]
37 | - [-1, 1, Conv, [256, 1, 1]]
38 | - [-1, 1, Conv, [512, 3, 1]] # 22 (P4/16-medium)
39 |
40 | - [-2, 1, Conv, [128, 1, 1]]
41 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
42 | - [[-1, 6], 1, Concat, [1]] # cat backbone P3
43 | - [-1, 1, Bottleneck, [256, False]]
44 | - [-1, 2, Bottleneck, [256, False]] # 27 (P3/8-small)
45 |
46 | - [[27, 22, 15], 1, Detect, [nc]] # Detect(P3, P4, P5)
47 |
--------------------------------------------------------------------------------
/ultralytics/cfg/models/v5/yolov5.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # YOLOv5 object detection model with P3-P5 outputs. For details see https://docs.ultralytics.com/models/yolov5
3 |
4 | # Parameters
5 | nc: 80 # number of classes
6 | scales: # model compound scaling constants, i.e. 'model=yolov5n.yaml' will call yolov5.yaml with scale 'n'
7 | # [depth, width, max_channels]
8 | n: [0.33, 0.25, 1024]
9 | s: [0.33, 0.50, 1024]
10 | m: [0.67, 0.75, 1024]
11 | l: [1.00, 1.00, 1024]
12 | x: [1.33, 1.25, 1024]
13 |
14 | # YOLOv5 v6.0 backbone
15 | backbone:
16 | # [from, number, module, args]
17 | - [-1, 1, Conv, [64, 6, 2, 2]] # 0-P1/2
18 | - [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
19 | - [-1, 3, C3, [128]]
20 | - [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
21 | - [-1, 6, C3, [256]]
22 | - [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
23 | - [-1, 9, C3, [512]]
24 | - [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
25 | - [-1, 3, C3, [1024]]
26 | - [-1, 1, SPPF, [1024, 5]] # 9
27 |
28 | # YOLOv5 v6.0 head
29 | head:
30 | - [-1, 1, Conv, [512, 1, 1]]
31 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
32 | - [[-1, 6], 1, Concat, [1]] # cat backbone P4
33 | - [-1, 3, C3, [512, False]] # 13
34 |
35 | - [-1, 1, Conv, [256, 1, 1]]
36 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
37 | - [[-1, 4], 1, Concat, [1]] # cat backbone P3
38 | - [-1, 3, C3, [256, False]] # 17 (P3/8-small)
39 |
40 | - [-1, 1, Conv, [256, 3, 2]]
41 | - [[-1, 14], 1, Concat, [1]] # cat head P4
42 | - [-1, 3, C3, [512, False]] # 20 (P4/16-medium)
43 |
44 | - [-1, 1, Conv, [512, 3, 2]]
45 | - [[-1, 10], 1, Concat, [1]] # cat head P5
46 | - [-1, 3, C3, [1024, False]] # 23 (P5/32-large)
47 |
48 | - [[17, 20, 23], 1, Detect, [nc]] # Detect(P3, P4, P5)
49 |
--------------------------------------------------------------------------------
/docs/overrides/stylesheets/style.css:
--------------------------------------------------------------------------------
1 | /* Table format like GitHub ----------------------------------------------------------------------------------------- */
2 | th,
3 | td {
4 | border: 1px solid var(--md-typeset-table-color);
5 | border-spacing: 0;
6 | border-bottom: none;
7 | border-left: none;
8 | border-top: none;
9 | }
10 |
11 | .md-typeset__table {
12 | line-height: 1;
13 | }
14 |
15 | .md-typeset__table table:not([class]) {
16 | font-size: 0.74rem;
17 | border-right: none;
18 | }
19 |
20 | .md-typeset__table table:not([class]) td,
21 | .md-typeset__table table:not([class]) th {
22 | padding: 9px;
23 | }
24 |
25 | /* light mode alternating table bg colors */
26 | .md-typeset__table tr:nth-child(2n) {
27 | background-color: #f6f8fa;
28 | }
29 |
30 | /* dark mode alternating table bg colors */
31 | [data-md-color-scheme="slate"] .md-typeset__table tr:nth-child(2n) {
32 | background-color: #161b22;
33 | }
34 | /* Table format like GitHub ----------------------------------------------------------------------------------------- */
35 |
36 | /* Code block vertical scroll */
37 | div.highlight {
38 | max-height: 20rem;
39 | overflow-y: auto; /* for adding a scrollbar when needed */
40 | }
41 |
42 | /* Set content width */
43 | .md-grid {
44 | max-width: 1440px;
45 | }
46 |
47 | /* Set language dropdown maximum height to screen height */
48 | .md-header .md-select:hover .md-select__inner {
49 | max-height: 75vh;
50 | }
51 |
52 | /* Update the background of the banner (same as the one on the Ultralytics website) */
53 | .md-banner {
54 | background-image: url(https://uploads-ssl.webflow.com/646dd1f1a3703e451ba81ecc/65e60cd6a4080bba757850a3_banner_ct.webp);
55 | background-size: cover;
56 | background-position: center;
57 | }
58 |
--------------------------------------------------------------------------------
/ultralytics/cfg/datasets/coco-pose.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # COCO 2017 dataset https://cocodataset.org by Microsoft
3 | # Documentation: https://docs.ultralytics.com/datasets/pose/coco/
4 | # Example usage: yolo train data=coco-pose.yaml
5 | # parent
6 | # ├── ultralytics
7 | # └── datasets
8 | # └── coco-pose ← downloads here (20.1 GB)
9 |
10 | # Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
11 | path: ../datasets/coco-pose # dataset root dir
12 | train: train2017.txt # train images (relative to 'path') 118287 images
13 | val: val2017.txt # val images (relative to 'path') 5000 images
14 | test: test-dev2017.txt # 20288 of 40670 images, submit to https://competitions.codalab.org/competitions/20794
15 |
16 | # Keypoints
17 | kpt_shape: [17, 3] # number of keypoints, number of dims (2 for x,y or 3 for x,y,visible)
18 | flip_idx: [0, 2, 1, 4, 3, 6, 5, 8, 7, 10, 9, 12, 11, 14, 13, 16, 15]
19 |
20 | # Classes
21 | names:
22 | 0: person
23 |
24 | # Download script/URL (optional)
25 | download: |
26 | from ultralytics.utils.downloads import download
27 | from pathlib import Path
28 |
29 | # Download labels
30 | dir = Path(yaml['path']) # dataset root dir
31 | url = 'https://github.com/ultralytics/yolov5/releases/download/v1.0/'
32 | urls = [url + 'coco2017labels-pose.zip'] # labels
33 | download(urls, dir=dir.parent)
34 | # Download data
35 | urls = ['http://images.cocodataset.org/zips/train2017.zip', # 19G, 118k images
36 | 'http://images.cocodataset.org/zips/val2017.zip', # 1G, 5k images
37 | 'http://images.cocodataset.org/zips/test2017.zip'] # 7G, 41k images (optional)
38 | download(urls, dir=dir / 'images', threads=3)
39 |
--------------------------------------------------------------------------------
/docs/en/reference/models/sam/amg.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore Ultralytics methods for mask data processing, transformation and encoding. Deepen your understanding of RLE encoding, image cropping and more.
3 | keywords: Ultralytics, Mask Data, Transformation, Encoding, RLE encoding, Image cropping, Pytorch, SAM, AMG, Ultralytics model
4 | ---
5 |
6 | # Reference for `ultralytics/models/sam/amg.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/amg.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/amg.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/sam/amg.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.sam.amg.is_box_near_crop_edge
15 |
16 |
17 |
18 | ## ::: ultralytics.models.sam.amg.batch_iterator
19 |
20 |
21 |
22 | ## ::: ultralytics.models.sam.amg.calculate_stability_score
23 |
24 |
25 |
26 | ## ::: ultralytics.models.sam.amg.build_point_grid
27 |
28 |
29 |
30 | ## ::: ultralytics.models.sam.amg.build_all_layer_point_grids
31 |
32 |
33 |
34 | ## ::: ultralytics.models.sam.amg.generate_crop_boxes
35 |
36 |
37 |
38 | ## ::: ultralytics.models.sam.amg.uncrop_boxes_xyxy
39 |
40 |
41 |
42 | ## ::: ultralytics.models.sam.amg.uncrop_points
43 |
44 |
45 |
46 | ## ::: ultralytics.models.sam.amg.uncrop_masks
47 |
48 |
49 |
50 | ## ::: ultralytics.models.sam.amg.remove_small_regions
51 |
52 |
53 |
54 | ## ::: ultralytics.models.sam.amg.batched_mask_to_box
55 |
56 |
57 |
--------------------------------------------------------------------------------
/ultralytics/cfg/models/v8/yolov8-pose.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # YOLOv8-pose keypoints/pose estimation model. For Usage examples see https://docs.ultralytics.com/tasks/pose
3 |
4 | # Parameters
5 | nc: 1 # number of classes
6 | kpt_shape: [17, 3] # number of keypoints, number of dims (2 for x,y or 3 for x,y,visible)
7 | scales: # model compound scaling constants, i.e. 'model=yolov8n-pose.yaml' will call yolov8-pose.yaml with scale 'n'
8 | # [depth, width, max_channels]
9 | n: [0.33, 0.25, 1024]
10 | s: [0.33, 0.50, 1024]
11 | m: [0.67, 0.75, 768]
12 | l: [1.00, 1.00, 512]
13 | x: [1.00, 1.25, 512]
14 |
15 | # YOLOv8.0n backbone
16 | backbone:
17 | # [from, repeats, module, args]
18 | - [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
19 | - [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
20 | - [-1, 3, C2f, [128, True]]
21 | - [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
22 | - [-1, 6, C2f, [256, True]]
23 | - [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
24 | - [-1, 6, C2f, [512, True]]
25 | - [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
26 | - [-1, 3, C2f, [1024, True]]
27 | - [-1, 1, SPPF, [1024, 5]] # 9
28 |
29 | # YOLOv8.0n head
30 | head:
31 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
32 | - [[-1, 6], 1, Concat, [1]] # cat backbone P4
33 | - [-1, 3, C2f, [512]] # 12
34 |
35 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
36 | - [[-1, 4], 1, Concat, [1]] # cat backbone P3
37 | - [-1, 3, C2f, [256]] # 15 (P3/8-small)
38 |
39 | - [-1, 1, Conv, [256, 3, 2]]
40 | - [[-1, 12], 1, Concat, [1]] # cat head P4
41 | - [-1, 3, C2f, [512]] # 18 (P4/16-medium)
42 |
43 | - [-1, 1, Conv, [512, 3, 2]]
44 | - [[-1, 9], 1, Concat, [1]] # cat head P5
45 | - [-1, 3, C2f, [1024]] # 21 (P5/32-large)
46 |
47 | - [[15, 18, 21], 1, Pose, [nc, kpt_shape]] # Pose(P3, P4, P5)
48 |
--------------------------------------------------------------------------------
/docs/en/reference/cfg/__init__.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore Ultralytics cfg functions like cfg2dict, handle_deprecation, merge_equal_args & more to handle YOLO settings and configurations efficiently.
3 | keywords: Ultralytics, YOLO, Configuration, cfg2dict, handle_deprecation, merge_equals_args, handle_yolo_settings, copy_default_cfg, Image Detection
4 | ---
5 |
6 | # Reference for `ultralytics/cfg/__init__.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/__init__.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/__init__.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/cfg/__init__.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.cfg.cfg2dict
15 |
16 |
17 |
18 | ## ::: ultralytics.cfg.get_cfg
19 |
20 |
21 |
22 | ## ::: ultralytics.cfg.check_cfg
23 |
24 |
25 |
26 | ## ::: ultralytics.cfg.get_save_dir
27 |
28 |
29 |
30 | ## ::: ultralytics.cfg._handle_deprecation
31 |
32 |
33 |
34 | ## ::: ultralytics.cfg.check_dict_alignment
35 |
36 |
37 |
38 | ## ::: ultralytics.cfg.merge_equals_args
39 |
40 |
41 |
42 | ## ::: ultralytics.cfg.handle_yolo_hub
43 |
44 |
45 |
46 | ## ::: ultralytics.cfg.handle_yolo_settings
47 |
48 |
49 |
50 | ## ::: ultralytics.cfg.handle_explorer
51 |
52 |
53 |
54 | ## ::: ultralytics.cfg.parse_key_value_pair
55 |
56 |
57 |
58 | ## ::: ultralytics.cfg.smart_value
59 |
60 |
61 |
62 | ## ::: ultralytics.cfg.entrypoint
63 |
64 |
65 |
66 | ## ::: ultralytics.cfg.copy_default_cfg
67 |
68 |
69 |
--------------------------------------------------------------------------------
/docs/en/reference/nn/modules/transformer.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Learn about Ultralytics transformer encoder, layer, MLP block, LayerNorm2d and the deformable transformer decoder layer. Expand your understanding of these crucial AI modules.
3 | keywords: Ultralytics, Ultralytics documentation, TransformerEncoderLayer, TransformerLayer, MLPBlock, LayerNorm2d, DeformableTransformerDecoderLayer
4 | ---
5 |
6 | # Reference for `ultralytics/nn/modules/transformer.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/modules/transformer.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/modules/transformer.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/nn/modules/transformer.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.nn.modules.transformer.TransformerEncoderLayer
15 |
16 |
17 |
18 | ## ::: ultralytics.nn.modules.transformer.AIFI
19 |
20 |
21 |
22 | ## ::: ultralytics.nn.modules.transformer.TransformerLayer
23 |
24 |
25 |
26 | ## ::: ultralytics.nn.modules.transformer.TransformerBlock
27 |
28 |
29 |
30 | ## ::: ultralytics.nn.modules.transformer.MLPBlock
31 |
32 |
33 |
34 | ## ::: ultralytics.nn.modules.transformer.MLP
35 |
36 |
37 |
38 | ## ::: ultralytics.nn.modules.transformer.LayerNorm2d
39 |
40 |
41 |
42 | ## ::: ultralytics.nn.modules.transformer.MSDeformAttn
43 |
44 |
45 |
46 | ## ::: ultralytics.nn.modules.transformer.DeformableTransformerDecoderLayer
47 |
48 |
49 |
50 | ## ::: ultralytics.nn.modules.transformer.DeformableTransformerDecoder
51 |
52 |
53 |
--------------------------------------------------------------------------------
/docs/en/reference/models/sam/modules/encoders.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Discover detailed information on ImageEncoderViT, PositionEmbeddingRandom, Attention, window_partition, get_rel_pos and more in Ultralytics models encoders documentation.
3 | keywords: Ultralytics, Encoders, Modules, Documentation, ImageEncoderViT, PositionEmbeddingRandom, Attention, window_partition, get_rel_pos
4 | ---
5 |
6 | # Reference for `ultralytics/models/sam/modules/encoders.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/encoders.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/encoders.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/sam/modules/encoders.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.models.sam.modules.encoders.ImageEncoderViT
15 |
16 |
17 |
18 | ## ::: ultralytics.models.sam.modules.encoders.PromptEncoder
19 |
20 |
21 |
22 | ## ::: ultralytics.models.sam.modules.encoders.PositionEmbeddingRandom
23 |
24 |
25 |
26 | ## ::: ultralytics.models.sam.modules.encoders.Block
27 |
28 |
29 |
30 | ## ::: ultralytics.models.sam.modules.encoders.Attention
31 |
32 |
33 |
34 | ## ::: ultralytics.models.sam.modules.encoders.PatchEmbed
35 |
36 |
37 |
38 | ## ::: ultralytics.models.sam.modules.encoders.window_partition
39 |
40 |
41 |
42 | ## ::: ultralytics.models.sam.modules.encoders.window_unpartition
43 |
44 |
45 |
46 | ## ::: ultralytics.models.sam.modules.encoders.get_rel_pos
47 |
48 |
49 |
50 | ## ::: ultralytics.models.sam.modules.encoders.add_decomposed_rel_pos
51 |
52 |
53 |
--------------------------------------------------------------------------------
/docs/en/reference/nn/modules/conv.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explore various Ultralytics convolution modules including Conv2, DWConv, ConvTranspose, GhostConv, Channel Attention and more.
3 | keywords: Ultralytics, Convolution Modules, Conv2, DWConv, ConvTranspose, GhostConv, ChannelAttention, CBAM, autopad
4 | ---
5 |
6 | # Reference for `ultralytics/nn/modules/conv.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/modules/conv.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/modules/conv.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/nn/modules/conv.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.nn.modules.conv.Conv
15 |
16 |
17 |
18 | ## ::: ultralytics.nn.modules.conv.Conv2
19 |
20 |
21 |
22 | ## ::: ultralytics.nn.modules.conv.LightConv
23 |
24 |
25 |
26 | ## ::: ultralytics.nn.modules.conv.DWConv
27 |
28 |
29 |
30 | ## ::: ultralytics.nn.modules.conv.DWConvTranspose2d
31 |
32 |
33 |
34 | ## ::: ultralytics.nn.modules.conv.ConvTranspose
35 |
36 |
37 |
38 | ## ::: ultralytics.nn.modules.conv.Focus
39 |
40 |
41 |
42 | ## ::: ultralytics.nn.modules.conv.GhostConv
43 |
44 |
45 |
46 | ## ::: ultralytics.nn.modules.conv.RepConv
47 |
48 |
49 |
50 | ## ::: ultralytics.nn.modules.conv.ChannelAttention
51 |
52 |
53 |
54 | ## ::: ultralytics.nn.modules.conv.SpatialAttention
55 |
56 |
57 |
58 | ## ::: ultralytics.nn.modules.conv.CBAM
59 |
60 |
61 |
62 | ## ::: ultralytics.nn.modules.conv.Concat
63 |
64 |
65 |
66 | ## ::: ultralytics.nn.modules.conv.autopad
67 |
68 |
69 |
--------------------------------------------------------------------------------
/docker/Dockerfile-runner:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # Builds GitHub actions CI runner image for deployment to DockerHub https://hub.docker.com/r/ultralytics/ultralytics
3 | # Image is CUDA-optimized for YOLOv8 single/multi-GPU training and inference tests
4 |
5 | # Start FROM Ultralytics GPU image
6 | FROM ultralytics/ultralytics:latest
7 |
8 | # Set the working directory
9 | WORKDIR /actions-runner
10 |
11 | # Download and unpack the latest runner from https://github.com/actions/runner
12 | RUN FILENAME=actions-runner-linux-x64-2.309.0.tar.gz && \
13 | curl -o $FILENAME -L https://github.com/actions/runner/releases/download/v2.309.0/$FILENAME && \
14 | tar xzf $FILENAME && \
15 | rm $FILENAME
16 |
17 | # Install runner dependencies
18 | ENV RUNNER_ALLOW_RUNASROOT=1
19 | ENV DEBIAN_FRONTEND=noninteractive
20 | RUN ./bin/installdependencies.sh && \
21 | apt-get -y install libicu-dev
22 |
23 | # Inline ENTRYPOINT command to configure and start runner with default TOKEN and NAME
24 | ENTRYPOINT sh -c './config.sh --url https://github.com/ultralytics/ultralytics \
25 | --token ${GITHUB_RUNNER_TOKEN:-TOKEN} \
26 | --name ${GITHUB_RUNNER_NAME:-NAME} \
27 | --labels gpu-latest \
28 | --replace && \
29 | ./run.sh'
30 |
31 |
32 | # Usage Examples -------------------------------------------------------------------------------------------------------
33 |
34 | # Build and Push
35 | # t=ultralytics/ultralytics:latest-runner && sudo docker build -f docker/Dockerfile-runner -t $t . && sudo docker push $t
36 |
37 | # Pull and Run in detached mode with access to GPUs 0 and 1
38 | # t=ultralytics/ultralytics:latest-runner && sudo docker run -d -e GITHUB_RUNNER_TOKEN=TOKEN -e GITHUB_RUNNER_NAME=NAME --ipc=host --gpus '"device=0,1"' $t
39 |
--------------------------------------------------------------------------------
/docs/en/reference/data/explorer/gui/dash.md:
--------------------------------------------------------------------------------
1 | ---
2 | comments: true
3 | description: Detailed reference for the Explorer GUI. Includes brief descriptions for all the major functions used in the dashboard demo of Explorer API.
4 | keywords: Ultralytics, data explorer, gui, function reference, documentation, AI queries, image similarity, SQL queries, streamlit, semantic search
5 | ---
6 |
7 | # Reference for `ultralytics/data/explorer/gui/dash.py`
8 |
9 | !!! Note
10 |
11 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/explorer/gui/dash.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/explorer/gui/dash.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/data/explorer/gui/dash.py) 🛠️. Thank you 🙏!
12 |
13 |
14 |
15 | ## ::: ultralytics.data.explorer.gui.dash._get_explorer
16 |
17 |
18 |
19 | ## ::: ultralytics.data.explorer.gui.dash.init_explorer_form
20 |
21 |
22 |
23 | ## ::: ultralytics.data.explorer.gui.dash.query_form
24 |
25 |
26 |
27 | ## ::: ultralytics.data.explorer.gui.dash.ai_query_form
28 |
29 |
30 |
31 | ## ::: ultralytics.data.explorer.gui.dash.find_similar_imgs
32 |
33 |
34 |
35 | ## ::: ultralytics.data.explorer.gui.dash.similarity_form
36 |
37 |
38 |
39 | ## ::: ultralytics.data.explorer.gui.dash.run_sql_query
40 |
41 |
42 |
43 | ## ::: ultralytics.data.explorer.gui.dash.run_ai_query
44 |
45 |
46 |
47 | ## ::: ultralytics.data.explorer.gui.dash.reset_explorer
48 |
49 |
50 |
51 | ## ::: ultralytics.data.explorer.gui.dash.utralytics_explorer_docs_callback
52 |
53 |
54 |
55 | ## ::: ultralytics.data.explorer.gui.dash.layout
56 |
57 |
58 |
--------------------------------------------------------------------------------
/ultralytics/data/scripts/get_imagenet.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Ultralytics YOLO 🚀, AGPL-3.0 license
3 | # Download ILSVRC2012 ImageNet dataset https://image-net.org
4 | # Example usage: bash data/scripts/get_imagenet.sh
5 | # parent
6 | # ├── ultralytics
7 | # └── datasets
8 | # └── imagenet ← downloads here
9 |
10 | # Arguments (optional) Usage: bash data/scripts/get_imagenet.sh --train --val
11 | if [ "$#" -gt 0 ]; then
12 | for opt in "$@"; do
13 | case "${opt}" in
14 | --train) train=true ;;
15 | --val) val=true ;;
16 | esac
17 | done
18 | else
19 | train=true
20 | val=true
21 | fi
22 |
23 | # Make dir
24 | d='../datasets/imagenet' # unzip directory
25 | mkdir -p $d && cd $d
26 |
27 | # Download/unzip train
28 | if [ "$train" == "true" ]; then
29 | wget https://image-net.org/data/ILSVRC/2012/ILSVRC2012_img_train.tar # download 138G, 1281167 images
30 | mkdir train && mv ILSVRC2012_img_train.tar train/ && cd train
31 | tar -xf ILSVRC2012_img_train.tar && rm -f ILSVRC2012_img_train.tar
32 | find . -name "*.tar" | while read NAME; do
33 | mkdir -p "${NAME%.tar}"
34 | tar -xf "${NAME}" -C "${NAME%.tar}"
35 | rm -f "${NAME}"
36 | done
37 | cd ..
38 | fi
39 |
40 | # Download/unzip val
41 | if [ "$val" == "true" ]; then
42 | wget https://image-net.org/data/ILSVRC/2012/ILSVRC2012_img_val.tar # download 6.3G, 50000 images
43 | mkdir val && mv ILSVRC2012_img_val.tar val/ && cd val && tar -xf ILSVRC2012_img_val.tar
44 | wget -qO- https://raw.githubusercontent.com/soumith/imagenetloader.torch/master/valprep.sh | bash # move into subdirs
45 | fi
46 |
47 | # Delete corrupted image (optional: PNG under JPEG name that may cause dataloaders to fail)
48 | # rm train/n04266014/n04266014_10835.JPEG
49 |
50 | # TFRecords (optional)
51 | # wget https://raw.githubusercontent.com/tensorflow/models/master/research/slim/datasets/imagenet_lsvrc_2015_synsets.txt
52 |
--------------------------------------------------------------------------------
/ultralytics/models/nas/val.py:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 |
3 | import torch
4 |
5 | from ultralytics.models.yolo.detect import DetectionValidator
6 | from ultralytics.utils import ops
7 |
8 | __all__ = ["NASValidator"]
9 |
10 |
11 | class NASValidator(DetectionValidator):
12 | """
13 | Ultralytics YOLO NAS Validator for object detection.
14 |
15 | Extends `DetectionValidator` from the Ultralytics models package and is designed to post-process the raw predictions
16 | generated by YOLO NAS models. It performs non-maximum suppression to remove overlapping and low-confidence boxes,
17 | ultimately producing the final detections.
18 |
19 | Attributes:
20 | args (Namespace): Namespace containing various configurations for post-processing, such as confidence and IoU thresholds.
21 | lb (torch.Tensor): Optional tensor for multilabel NMS.
22 |
23 | Example:
24 | ```python
25 | from ultralytics import NAS
26 |
27 | model = NAS('yolo_nas_s')
28 | validator = model.validator
29 | # Assumes that raw_preds are available
30 | final_preds = validator.postprocess(raw_preds)
31 | ```
32 |
33 | Note:
34 | This class is generally not instantiated directly but is used internally within the `NAS` class.
35 | """
36 |
37 | def postprocess(self, preds_in):
38 | """Apply Non-maximum suppression to prediction outputs."""
39 | boxes = ops.xyxy2xywh(preds_in[0][0])
40 | preds = torch.cat((boxes, preds_in[0][1]), -1).permute(0, 2, 1)
41 | return ops.non_max_suppression(
42 | preds,
43 | self.args.conf,
44 | self.args.iou,
45 | labels=self.lb,
46 | multi_label=False,
47 | agnostic=self.args.single_cls,
48 | max_det=self.args.max_det,
49 | max_time_img=0.5,
50 | )
51 |
--------------------------------------------------------------------------------
/docs/en/reference/data/utils.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Uncover a detailed guide to Ultralytics data utilities. Learn functions from img2label_paths to autosplit, all boosting your YOLO model’s efficiency.
3 | keywords: Ultralytics, data utils, YOLO, img2label_paths, exif_size, polygon2mask, polygons2masks_overlap, check_cls_dataset, delete_dsstore, autosplit
4 | ---
5 |
6 | # Reference for `ultralytics/data/utils.py`
7 |
8 | !!! Note
9 |
10 | This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/utils.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/utils.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/data/utils.py) 🛠️. Thank you 🙏!
11 |
12 |
13 |
14 | ## ::: ultralytics.data.utils.HUBDatasetStats
15 |
16 |
17 |
18 | ## ::: ultralytics.data.utils.img2label_paths
19 |
20 |
21 |
22 | ## ::: ultralytics.data.utils.get_hash
23 |
24 |
25 |
26 | ## ::: ultralytics.data.utils.exif_size
27 |
28 |
29 |
30 | ## ::: ultralytics.data.utils.verify_image
31 |
32 |
33 |
34 | ## ::: ultralytics.data.utils.verify_image_label
35 |
36 |
37 |
38 | ## ::: ultralytics.data.utils.polygon2mask
39 |
40 |
41 |
42 | ## ::: ultralytics.data.utils.polygons2masks
43 |
44 |
45 |
46 | ## ::: ultralytics.data.utils.polygons2masks_overlap
47 |
48 |
49 |
50 | ## ::: ultralytics.data.utils.find_dataset_yaml
51 |
52 |
53 |
54 | ## ::: ultralytics.data.utils.check_det_dataset
55 |
56 |
57 |
58 | ## ::: ultralytics.data.utils.check_cls_dataset
59 |
60 |
61 |
62 | ## ::: ultralytics.data.utils.compress_one_image
63 |
64 |
65 |
66 | ## ::: ultralytics.data.utils.autosplit
67 |
68 |
69 |
--------------------------------------------------------------------------------
/examples/YOLOv8-LibTorch-CPP-Inference/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
2 |
3 | project(yolov8_libtorch_example)
4 |
5 | set(CMAKE_CXX_STANDARD 17)
6 | set(CMAKE_CXX_STANDARD_REQUIRED ON)
7 | set(CMAKE_CXX_EXTENSIONS OFF)
8 |
9 |
10 | # -------------- OpenCV --------------
11 | set(OpenCV_DIR "/path/to/opencv/lib/cmake/opencv4")
12 | find_package(OpenCV REQUIRED)
13 |
14 | message(STATUS "OpenCV library status:")
15 | message(STATUS " config: ${OpenCV_DIR}")
16 | message(STATUS " version: ${OpenCV_VERSION}")
17 | message(STATUS " libraries: ${OpenCV_LIBS}")
18 | message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")
19 |
20 | include_directories(${OpenCV_INCLUDE_DIRS})
21 |
22 | # -------------- libtorch --------------
23 | list(APPEND CMAKE_PREFIX_PATH "/path/to/libtorch")
24 | set(Torch_DIR "/path/to/libtorch/share/cmake/Torch")
25 |
26 | find_package(Torch REQUIRED)
27 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")
28 | message("${TORCH_LIBRARIES}")
29 | message("${TORCH_INCLUDE_DIRS}")
30 |
31 | # The following code block is suggested to be used on Windows.
32 | # According to https://github.com/pytorch/pytorch/issues/25457,
33 | # the DLLs need to be copied to avoid memory errors.
34 | # if (MSVC)
35 | # file(GLOB TORCH_DLLS "${TORCH_INSTALL_PREFIX}/lib/*.dll")
36 | # add_custom_command(TARGET yolov8_libtorch_example
37 | # POST_BUILD
38 | # COMMAND ${CMAKE_COMMAND} -E copy_if_different
39 | # ${TORCH_DLLS}
40 | # $)
41 | # endif (MSVC)
42 |
43 | include_directories(${TORCH_INCLUDE_DIRS})
44 |
45 | add_executable(yolov8_libtorch_inference "${CMAKE_CURRENT_SOURCE_DIR}/main.cc")
46 | target_link_libraries(yolov8_libtorch_inference ${TORCH_LIBRARIES} ${OpenCV_LIBS})
47 | set_property(TARGET yolov8_libtorch_inference PROPERTY CXX_STANDARD 17)
48 |
--------------------------------------------------------------------------------
/docs/en/hub/api/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Discover what's next for Ultralytics with our under-construction page, previewing new, groundbreaking AI and ML features coming soon.
3 | keywords: Ultralytics, coming soon, under construction, new features, AI updates, ML advancements, YOLO, technology preview
4 | ---
5 |
6 | # Under Construction 🏗️🌟
7 |
8 | Welcome to the Ultralytics "Under Construction" page! Here, we're hard at work developing the next generation of AI and ML innovations. This page serves as a teaser for the exciting updates and new features we're eager to share with you!
9 |
10 | ## Exciting New Features on the Way 🎉
11 |
12 | - **Innovative Breakthroughs:** Get ready for advanced features and services that will transform your AI and ML experience.
13 | - **New Horizons:** Anticipate novel products that redefine AI and ML capabilities.
14 | - **Enhanced Services:** We're upgrading our services for greater efficiency and user-friendliness.
15 |
16 | ## Stay Updated 🚧
17 |
18 | This placeholder page is your first stop for upcoming developments. Keep an eye out for:
19 |
20 | - **Newsletter:** Subscribe [here](https://ultralytics.com/#newsletter) for the latest news.
21 | - **Social Media:** Follow us [here](https://www.linkedin.com/company/ultralytics) for updates and teasers.
22 | - **Blog:** Visit our [blog](https://ultralytics.com/blog) for detailed insights.
23 |
24 | ## We Value Your Input 🗣️
25 |
26 | Your feedback shapes our future releases. Share your thoughts and suggestions [here](https://ultralytics.com/contact).
27 |
28 | ## Thank You, Community! 🌍
29 |
30 | Your [contributions](https://docs.ultralytics.com/help/contributing) inspire our continuous [innovation](https://github.com/ultralytics/ultralytics). Stay tuned for the big reveal of what's next in AI and ML at Ultralytics!
31 |
32 | ---
33 |
34 | Excited for what's coming? Bookmark this page and get ready for a transformative AI and ML journey with Ultralytics! 🛠️🤖
35 |
--------------------------------------------------------------------------------
/docs/coming_soon_template.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Discover what's next for Ultralytics with our under-construction page, previewing new, groundbreaking AI and ML features coming soon.
3 | keywords: Ultralytics, coming soon, under construction, new features, AI updates, ML advancements, YOLO, technology preview
4 | ---
5 |
6 | # Under Construction 🏗️🌟
7 |
8 | Welcome to the Ultralytics "Under Construction" page! Here, we're hard at work developing the next generation of AI and ML innovations. This page serves as a teaser for the exciting updates and new features we're eager to share with you!
9 |
10 | ## Exciting New Features on the Way 🎉
11 |
12 | - **Innovative Breakthroughs:** Get ready for advanced features and services that will transform your AI and ML experience.
13 | - **New Horizons:** Anticipate novel products that redefine AI and ML capabilities.
14 | - **Enhanced Services:** We're upgrading our services for greater efficiency and user-friendliness.
15 |
16 | ## Stay Updated 🚧
17 |
18 | This placeholder page is your first stop for upcoming developments. Keep an eye out for:
19 |
20 | - **Newsletter:** Subscribe [here](https://ultralytics.com/#newsletter) for the latest news.
21 | - **Social Media:** Follow us [here](https://www.linkedin.com/company/ultralytics) for updates and teasers.
22 | - **Blog:** Visit our [blog](https://ultralytics.com/blog) for detailed insights.
23 |
24 | ## We Value Your Input 🗣️
25 |
26 | Your feedback shapes our future releases. Share your thoughts and suggestions [here](https://ultralytics.com/contact).
27 |
28 | ## Thank You, Community! 🌍
29 |
30 | Your [contributions](https://docs.ultralytics.com/help/contributing) inspire our continuous [innovation](https://github.com/ultralytics/ultralytics). Stay tuned for the big reveal of what's next in AI and ML at Ultralytics!
31 |
32 | ---
33 |
34 | Excited for what's coming? Bookmark this page and get ready for a transformative AI and ML journey with Ultralytics! 🛠️🤖
35 |
--------------------------------------------------------------------------------
/docs/en/hub/on-premise/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Discover what's next for Ultralytics with our under-construction page, previewing new, groundbreaking AI and ML features coming soon.
3 | keywords: Ultralytics, coming soon, under construction, new features, AI updates, ML advancements, YOLO, technology preview
4 | ---
5 |
6 | # Under Construction 🏗️🌟
7 |
8 | Welcome to the Ultralytics "Under Construction" page! Here, we're hard at work developing the next generation of AI and ML innovations. This page serves as a teaser for the exciting updates and new features we're eager to share with you!
9 |
10 | ## Exciting New Features on the Way 🎉
11 |
12 | - **Innovative Breakthroughs:** Get ready for advanced features and services that will transform your AI and ML experience.
13 | - **New Horizons:** Anticipate novel products that redefine AI and ML capabilities.
14 | - **Enhanced Services:** We're upgrading our services for greater efficiency and user-friendliness.
15 |
16 | ## Stay Updated 🚧
17 |
18 | This placeholder page is your first stop for upcoming developments. Keep an eye out for:
19 |
20 | - **Newsletter:** Subscribe [here](https://ultralytics.com/#newsletter) for the latest news.
21 | - **Social Media:** Follow us [here](https://www.linkedin.com/company/ultralytics) for updates and teasers.
22 | - **Blog:** Visit our [blog](https://ultralytics.com/blog) for detailed insights.
23 |
24 | ## We Value Your Input 🗣️
25 |
26 | Your feedback shapes our future releases. Share your thoughts and suggestions [here](https://ultralytics.com/contact).
27 |
28 | ## Thank You, Community! 🌍
29 |
30 | Your [contributions](https://docs.ultralytics.com/help/contributing) inspire our continuous [innovation](https://github.com/ultralytics/ultralytics). Stay tuned for the big reveal of what's next in AI and ML at Ultralytics!
31 |
32 | ---
33 |
34 | Excited for what's coming? Bookmark this page and get ready for a transformative AI and ML journey with Ultralytics! 🛠️🤖
35 |
--------------------------------------------------------------------------------
/ultralytics/cfg/models/v6/yolov6.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # YOLOv6 object detection model with P3-P5 outputs. For Usage examples see https://docs.ultralytics.com/models/yolov6
3 |
4 | # Parameters
5 | nc: 80 # number of classes
6 | activation: nn.ReLU() # (optional) model default activation function
7 | scales: # model compound scaling constants, i.e. 'model=yolov6n.yaml' will call yolov8.yaml with scale 'n'
8 | # [depth, width, max_channels]
9 | n: [0.33, 0.25, 1024]
10 | s: [0.33, 0.50, 1024]
11 | m: [0.67, 0.75, 768]
12 | l: [1.00, 1.00, 512]
13 | x: [1.00, 1.25, 512]
14 |
15 | # YOLOv6-3.0s backbone
16 | backbone:
17 | # [from, repeats, module, args]
18 | - [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
19 | - [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
20 | - [-1, 6, Conv, [128, 3, 1]]
21 | - [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
22 | - [-1, 12, Conv, [256, 3, 1]]
23 | - [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
24 | - [-1, 18, Conv, [512, 3, 1]]
25 | - [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
26 | - [-1, 6, Conv, [1024, 3, 1]]
27 | - [-1, 1, SPPF, [1024, 5]] # 9
28 |
29 | # YOLOv6-3.0s head
30 | head:
31 | - [-1, 1, Conv, [256, 1, 1]]
32 | - [-1, 1, nn.ConvTranspose2d, [256, 2, 2, 0]]
33 | - [[-1, 6], 1, Concat, [1]] # cat backbone P4
34 | - [-1, 1, Conv, [256, 3, 1]]
35 | - [-1, 9, Conv, [256, 3, 1]] # 14
36 |
37 | - [-1, 1, Conv, [128, 1, 1]]
38 | - [-1, 1, nn.ConvTranspose2d, [128, 2, 2, 0]]
39 | - [[-1, 4], 1, Concat, [1]] # cat backbone P3
40 | - [-1, 1, Conv, [128, 3, 1]]
41 | - [-1, 9, Conv, [128, 3, 1]] # 19
42 |
43 | - [-1, 1, Conv, [128, 3, 2]]
44 | - [[-1, 15], 1, Concat, [1]] # cat head P4
45 | - [-1, 1, Conv, [256, 3, 1]]
46 | - [-1, 9, Conv, [256, 3, 1]] # 23
47 |
48 | - [-1, 1, Conv, [256, 3, 2]]
49 | - [[-1, 10], 1, Concat, [1]] # cat head P5
50 | - [-1, 1, Conv, [512, 3, 1]]
51 | - [-1, 9, Conv, [512, 3, 1]] # 27
52 |
53 | - [[19, 23, 27], 1, Detect, [nc]] # Detect(P3, P4, P5)
54 |
--------------------------------------------------------------------------------
/ultralytics/cfg/models/v8/yolov8-p2.yaml:
--------------------------------------------------------------------------------
1 | # Ultralytics YOLO 🚀, AGPL-3.0 license
2 | # YOLOv8 object detection model with P2-P5 outputs. For Usage examples see https://docs.ultralytics.com/tasks/detect
3 |
4 | # Parameters
5 | nc: 80 # number of classes
6 | scales: # model compound scaling constants, i.e. 'model=yolov8n.yaml' will call yolov8.yaml with scale 'n'
7 | # [depth, width, max_channels]
8 | n: [0.33, 0.25, 1024]
9 | s: [0.33, 0.50, 1024]
10 | m: [0.67, 0.75, 768]
11 | l: [1.00, 1.00, 512]
12 | x: [1.00, 1.25, 512]
13 |
14 | # YOLOv8.0 backbone
15 | backbone:
16 | # [from, repeats, module, args]
17 | - [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
18 | - [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
19 | - [-1, 3, C2f, [128, True]]
20 | - [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
21 | - [-1, 6, C2f, [256, True]]
22 | - [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
23 | - [-1, 6, C2f, [512, True]]
24 | - [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
25 | - [-1, 3, C2f, [1024, True]]
26 | - [-1, 1, SPPF, [1024, 5]] # 9
27 |
28 | # YOLOv8.0-p2 head
29 | head:
30 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
31 | - [[-1, 6], 1, Concat, [1]] # cat backbone P4
32 | - [-1, 3, C2f, [512]] # 12
33 |
34 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
35 | - [[-1, 4], 1, Concat, [1]] # cat backbone P3
36 | - [-1, 3, C2f, [256]] # 15 (P3/8-small)
37 |
38 | - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
39 | - [[-1, 2], 1, Concat, [1]] # cat backbone P2
40 | - [-1, 3, C2f, [128]] # 18 (P2/4-xsmall)
41 |
42 | - [-1, 1, Conv, [128, 3, 2]]
43 | - [[-1, 15], 1, Concat, [1]] # cat head P3
44 | - [-1, 3, C2f, [256]] # 21 (P3/8-small)
45 |
46 | - [-1, 1, Conv, [256, 3, 2]]
47 | - [[-1, 12], 1, Concat, [1]] # cat head P4
48 | - [-1, 3, C2f, [512]] # 24 (P4/16-medium)
49 |
50 | - [-1, 1, Conv, [512, 3, 2]]
51 | - [[-1, 9], 1, Concat, [1]] # cat head P5
52 | - [-1, 3, C2f, [1024]] # 27 (P5/32-large)
53 |
54 | - [[18, 21, 24, 27], 1, Detect, [nc]] # Detect(P2, P3, P4, P5)
55 |
--------------------------------------------------------------------------------
/ultralytics/data/scripts/get_coco.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Ultralytics YOLO 🚀, AGPL-3.0 license
3 | # Download COCO 2017 dataset https://cocodataset.org
4 | # Example usage: bash data/scripts/get_coco.sh
5 | # parent
6 | # ├── ultralytics
7 | # └── datasets
8 | # └── coco ← downloads here
9 |
10 | # Arguments (optional) Usage: bash data/scripts/get_coco.sh --train --val --test --segments
11 | if [ "$#" -gt 0 ]; then
12 | for opt in "$@"; do
13 | case "${opt}" in
14 | --train) train=true ;;
15 | --val) val=true ;;
16 | --test) test=true ;;
17 | --segments) segments=true ;;
18 | --sama) sama=true ;;
19 | esac
20 | done
21 | else
22 | train=true
23 | val=true
24 | test=false
25 | segments=false
26 | sama=false
27 | fi
28 |
29 | # Download/unzip labels
30 | d='../datasets' # unzip directory
31 | url=https://github.com/ultralytics/yolov5/releases/download/v1.0/
32 | if [ "$segments" == "true" ]; then
33 | f='coco2017labels-segments.zip' # 169 MB
34 | elif [ "$sama" == "true" ]; then
35 | f='coco2017labels-segments-sama.zip' # 199 MB https://www.sama.com/sama-coco-dataset/
36 | else
37 | f='coco2017labels.zip' # 46 MB
38 | fi
39 | echo 'Downloading' $url$f ' ...'
40 | curl -L $url$f -o $f -# && unzip -q $f -d $d && rm $f &
41 |
42 | # Download/unzip images
43 | d='../datasets/coco/images' # unzip directory
44 | url=http://images.cocodataset.org/zips/
45 | if [ "$train" == "true" ]; then
46 | f='train2017.zip' # 19G, 118k images
47 | echo 'Downloading' $url$f '...'
48 | curl -L $url$f -o $f -# && unzip -q $f -d $d && rm $f &
49 | fi
50 | if [ "$val" == "true" ]; then
51 | f='val2017.zip' # 1G, 5k images
52 | echo 'Downloading' $url$f '...'
53 | curl -L $url$f -o $f -# && unzip -q $f -d $d && rm $f &
54 | fi
55 | if [ "$test" == "true" ]; then
56 | f='test2017.zip' # 7G, 41k images (optional)
57 | echo 'Downloading' $url$f '...'
58 | curl -L $url$f -o $f -# && unzip -q $f -d $d && rm $f &
59 | fi
60 | wait # finish background tasks
61 |
--------------------------------------------------------------------------------