Getting Started

How to get started with YOLOv5

1

Install YOLOv5

Run `pip install -U ultralytics` ensuring Python >=3.8 and PyTorch >=1.7 are installed.

2

Clone Repository

Clone the GitHub repo with `git clone https://github.com/ultralytics/yolov5` and install dependencies using `pip install -r requirements.txt`.

3

Run Inference

Load a pretrained model via PyTorch Hub using `model = torch.hub.load('ultralytics/yolov5', 'yolov5s')`.

4

Detect Objects

Perform detection on images or videos with `results = model('image.jpg')`.

5

Train Custom Models

Train models using the CLI command `yolov5 train --data data.yaml --weights yolov5s.pt`.