PyTorch implementation of YOLOv3, YOLOv3-SPP, and YOLOv3-tiny for real-time object detection with training, validation, inference, and multi-format export.
10,604
stars
2,982
commits
Python
primary language
Sep 10, 2026
updated
中文 | 한국어 | 日本語 | Русский | Deutsch | Français | Español | Português | Türkçe | Tiếng Việt | العربية
Ultralytics YOLOv3 is a PyTorch implementation of the YOLOv3 (You Only Look Once, version 3) real-time object detection model. YOLOv3 frames detection as a single regression problem, predicting bounding boxes and class probabilities directly from full images in one forward pass — making it fast, accurate, and straightforward to train and deploy.
This repository packages the three classic YOLOv3 detection models — YOLOv3, YOLOv3-SPP, and YOLOv3-tiny — with training, validation, inference, and export tooling, and reuses shared utilities from the ultralytics package.
Find detailed guidance in the Ultralytics YOLOv3 Docs. Get support via GitHub Issues, and join the conversation on Discord, Reddit, and the Ultralytics Forums.
For commercial use, request an Enterprise License at Ultralytics Licensing.
See the Ultralytics YOLOv3 Docs for full documentation. The quickstart examples below cover installation, inference, and training with this repository.
Clone the repository and install the dependencies from requirements.txt in a Python>=3.8.0 environment with PyTorch>=1.8.
# Clone the YOLOv3 repository
git clone https://github.com/ultralytics/yolov3
# Navigate to the cloned directory
cd yolov3
# Install required packages
pip install -r requirements.txt
Load YOLOv3 directly through PyTorch Hub. Weights download automatically on first use.
import torch
# Load a YOLOv3 model (choices: 'yolov3', 'yolov3_spp', 'yolov3_tiny')
model = torch.hub.load("ultralytics/yolov3", "yolov3", pretrained=True)
# Run inference on an image (local file, URL, PIL image, OpenCV frame, or numpy array)
results = model("https://ultralytics.com/images/zidane.jpg")
# Inspect the results
results.print() # print detections to the console
results.show() # display the annotated image
results.save() # save the annotated image to runs/detect/exp
detect.py runs inference on a wide range of sources, downloading models automatically and saving results to runs/detect.
python detect.py --weights yolov3.pt --source 0 # webcam
python detect.py --weights yolov3.pt --source img.jpg # image
python detect.py --weights yolov3.pt --source vid.mp4 # video
python detect.py --weights yolov3.pt --source screen # screenshot
python detect.py --weights yolov3.pt --source path/ # directory
python detect.py --weights yolov3.pt --source 'path/*.jpg' # glob
python detect.py --weights yolov3.pt --source 'rtsp://example.com/media.mp4' # RTSP, RTMP, HTTP stream
Train YOLOv3 on the COCO dataset. Models and datasets download automatically. Use the largest --batch-size your hardware allows.
# Train YOLOv3-tiny
python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov3-tiny.yaml --batch-size 64
# Train YOLOv3
python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov3.yaml --batch-size 32
# Train YOLOv3-SPP
python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov3-spp.yaml --batch-size 16
Validate accuracy with python val.py --weights yolov3.pt --data coco.yaml, and export to other formats (TorchScript, ONNX, OpenVINO, TensorRT, CoreML, and PaddlePaddle) with python export.py --weights yolov3.pt --include onnx.
These guides cover the shared Ultralytics training framework and apply to YOLOv3:
YOLOv3 builds detection on a few core ideas that make it both accurate and fast:
The repository ships three variants of this architecture:
Models are defined declaratively in models/*.yaml and built by parse_model() in models/yolo.py, so the architecture can be inspected and modified without writing Python.
All three models are trained on COCO (80 classes) and download automatically from the YOLOv3 release assets on first use.
| Model | Description |
|---|---|
| yolov3-tiny.pt | Lightweight two-scale model — the fastest option, ideal for CPU and edge devices. |
| yolov3.pt | The original Darknet-53 model — a strong balance of speed and accuracy. |
| yolov3-spp.pt | Adds Spatial Pyramid Pooling for a larger receptive field and improved accuracy. |
Ultralytics integrates with leading AI platforms to extend dataset labeling, training, visualization, and model management. Explore how partners such as Weights & Biases, Comet ML, Roboflow, and Intel OpenVINO can streamline your workflow at Ultralytics Integrations.
YOLOv3 was a landmark in real-time object detection and remains a dependable, well-understood baseline:
For the broader family of Ultralytics YOLO models, see the Ultralytics repository.
Get started quickly with pre-configured environments. Click an icon below for setup details.
Contributions are welcome! Please see the Contributing Guide to get started, and share your feedback through the Ultralytics Survey. Thank you to all our contributors!
Ultralytics offers two licensing options:
For bug reports and feature requests, please use GitHub Issues. For questions and discussion, join our Discord, Reddit, and the Ultralytics Forums.
(top 30 of 49)
2,800 commits
68 commits
15 commits
12 commits
Python
95.4%
Jupyter Notebook
3.5%
PyTorch implementation of YOLOv3, YOLOv3-SPP, and YOLOv3-tiny for real-time object detection with training, validation, inference, and multi-format export.
10,604
stars
2,982
commits
Python
primary language
Sep 10, 2026
updated
中文 | 한국어 | 日本語 | Русский | Deutsch | Français | Español | Português | Türkçe | Tiếng Việt | العربية
Ultralytics YOLOv3 is a PyTorch implementation of the YOLOv3 (You Only Look Once, version 3) real-time object detection model. YOLOv3 frames detection as a single regression problem, predicting bounding boxes and class probabilities directly from full images in one forward pass — making it fast, accurate, and straightforward to train and deploy.
This repository packages the three classic YOLOv3 detection models — YOLOv3, YOLOv3-SPP, and YOLOv3-tiny — with training, validation, inference, and export tooling, and reuses shared utilities from the ultralytics package.
Find detailed guidance in the Ultralytics YOLOv3 Docs. Get support via GitHub Issues, and join the conversation on Discord, Reddit, and the Ultralytics Forums.
For commercial use, request an Enterprise License at Ultralytics Licensing.
See the Ultralytics YOLOv3 Docs for full documentation. The quickstart examples below cover installation, inference, and training with this repository.
Clone the repository and install the dependencies from requirements.txt in a Python>=3.8.0 environment with PyTorch>=1.8.
# Clone the YOLOv3 repository
git clone https://github.com/ultralytics/yolov3
# Navigate to the cloned directory
cd yolov3
# Install required packages
pip install -r requirements.txt
Load YOLOv3 directly through PyTorch Hub. Weights download automatically on first use.
import torch
# Load a YOLOv3 model (choices: 'yolov3', 'yolov3_spp', 'yolov3_tiny')
model = torch.hub.load("ultralytics/yolov3", "yolov3", pretrained=True)
# Run inference on an image (local file, URL, PIL image, OpenCV frame, or numpy array)
results = model("https://ultralytics.com/images/zidane.jpg")
# Inspect the results
results.print() # print detections to the console
results.show() # display the annotated image
results.save() # save the annotated image to runs/detect/exp
detect.py runs inference on a wide range of sources, downloading models automatically and saving results to runs/detect.
python detect.py --weights yolov3.pt --source 0 # webcam
python detect.py --weights yolov3.pt --source img.jpg # image
python detect.py --weights yolov3.pt --source vid.mp4 # video
python detect.py --weights yolov3.pt --source screen # screenshot
python detect.py --weights yolov3.pt --source path/ # directory
python detect.py --weights yolov3.pt --source 'path/*.jpg' # glob
python detect.py --weights yolov3.pt --source 'rtsp://example.com/media.mp4' # RTSP, RTMP, HTTP stream
Train YOLOv3 on the COCO dataset. Models and datasets download automatically. Use the largest --batch-size your hardware allows.
# Train YOLOv3-tiny
python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov3-tiny.yaml --batch-size 64
# Train YOLOv3
python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov3.yaml --batch-size 32
# Train YOLOv3-SPP
python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov3-spp.yaml --batch-size 16
Validate accuracy with python val.py --weights yolov3.pt --data coco.yaml, and export to other formats (TorchScript, ONNX, OpenVINO, TensorRT, CoreML, and PaddlePaddle) with python export.py --weights yolov3.pt --include onnx.
These guides cover the shared Ultralytics training framework and apply to YOLOv3:
YOLOv3 builds detection on a few core ideas that make it both accurate and fast:
The repository ships three variants of this architecture:
Models are defined declaratively in models/*.yaml and built by parse_model() in models/yolo.py, so the architecture can be inspected and modified without writing Python.
All three models are trained on COCO (80 classes) and download automatically from the YOLOv3 release assets on first use.
| Model | Description |
|---|---|
| yolov3-tiny.pt | Lightweight two-scale model — the fastest option, ideal for CPU and edge devices. |
| yolov3.pt | The original Darknet-53 model — a strong balance of speed and accuracy. |
| yolov3-spp.pt | Adds Spatial Pyramid Pooling for a larger receptive field and improved accuracy. |
Ultralytics integrates with leading AI platforms to extend dataset labeling, training, visualization, and model management. Explore how partners such as Weights & Biases, Comet ML, Roboflow, and Intel OpenVINO can streamline your workflow at Ultralytics Integrations.
YOLOv3 was a landmark in real-time object detection and remains a dependable, well-understood baseline:
For the broader family of Ultralytics YOLO models, see the Ultralytics repository.
Get started quickly with pre-configured environments. Click an icon below for setup details.
Contributions are welcome! Please see the Contributing Guide to get started, and share your feedback through the Ultralytics Survey. Thank you to all our contributors!
Ultralytics offers two licensing options:
For bug reports and feature requests, please use GitHub Issues. For questions and discussion, join our Discord, Reddit, and the Ultralytics Forums.
(top 30 of 49)
2,800 commits
68 commits
15 commits
12 commits
Python
95.4%
Jupyter Notebook
3.5%