ultralytics/yolov3

PyTorch implementation of YOLOv3, YOLOv3-SPP, and YOLOv3-tiny for real-time object detection with training, validation, inference, and multi-format export.

📦 What is Ultralytics YOLOv3?

Ultralytics YOLOv3 is an open‑source PyTorch implementation of the classic YOLOv3 object‑detection model. It lets you train, validate, run inference, and export three ready‑made variants – YOLOv3, YOLOv3‑SPP, and YOLOv3‑tiny – on your own data or on the COCO benchmark.


🚀 Key capabilities (as described in the README)

Capability Details
Real‑time single‑stage detection One forward pass produces bounding boxes and class probabilities.
Three model sizes YOLOv3 – full Darknet‑53 backbone (best speed/accuracy balance)
YOLOv3‑SPP – adds Spatial Pyramid Pooling for a slight accuracy boost
YOLOv3‑tiny – lightweight, two‑scale model for CPU/edge devices.
Multi‑scale predictions Detects small, medium, and large objects via three feature‑map scales.
Multi‑label support Independent logistic classifiers allow overlapping class labels.
Export to many formats TorchScript, ONNX, OpenVINO, TensorRT, CoreML, PaddlePaddle via export.py.
Integrations Works with Weights & Biases, Comet ML, Roboflow, Intel OpenVINO, and cloud notebooks (Colab, Kaggle, Gradient, Docker, SageMaker, GCP, etc.).
Pre‑trained COCO checkpoints Automatically downloaded (yolov3.pt, yolov3‑spp.pt, yolov3‑tiny.pt).
Training utilities train.py, val.py, detect.py scripts; hyper‑parameter tuning, multi‑GPU, test‑time augmentation, ensembling.

🛠️ Getting started (quick‑start from the README)

# Clone and install
git clone https://github.com/ultralytics/yolov3
cd yolov3
pip install -r requirements.txt   # Python ≥3.8, PyTorch ≥1.8

Inference via PyTorch Hub

import torch
model = torch.hub.load('ultralytics/yolov3', 'yolov3', pretrained=True)  # or yolov3_spp / yolov3_tiny
results = model('https://ultralytics.com/images/zidane.jpg')
results.print()   # console output
results.show()    # pop‑up window
results.save()    # saves to runs/detect/exp

Inference with the bundled script

python detect.py --weights yolov3.pt --source 0          # webcam
python detect.py --weights yolov3.pt --source img.jpg    # single image
python detect.py --weights yolov3.pt --source vid.mp4    # video file

Training on COCO (replace --weights '' to start from scratch)

python train.py --data coco.yaml --epochs 300 --weights '' \
    --cfg yolov3.yaml      --batch-size 32   # full model
python train.py --data coco.yaml --epochs 300 --weights '' \
    --cfg yolov3-tiny.yaml --batch-size 64   # tiny model

Validate and export:

python val.py --weights yolov3.pt --data coco.yaml
python export.py --weights yolov3.pt --include onnx   # add torchscript, openvino, etc.

📚 Documentation & help

  • Full docs: https://docs.ultralytics.com/models/yolov3
  • Tutorials (custom data, multi‑GPU, TTA, ensembling, hyper‑parameter tuning, etc.) are linked in the README.
  • Community support via GitHub Issues, Discord, Reddit, and the Ultralytics Forums.

📄 License

  • AGPL‑3.0 for open‑source use (research, non‑commercial).
  • Enterprise License available for commercial products.

🎯 Who might use this?

  • Researchers needing a well‑understood baseline for object detection.
  • Developers building real‑time detection apps on GPUs, CPUs, or edge devices.
  • Teams that want a single code‑base for training, inference, and exporting to deployment formats.

All information above is taken directly from the repository’s README; no additional features have been inferred.

Related

  • Project
  • Project
  • Project
  • Project
  • Project