-
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
Docker Quickstart
To get started with YOLOv5 ๐ in a Docker image follow the instructions below. Other quickstart options for YOLOv5 include our Colab Notebook
and a Google and Amazon cloud instances. UPDATED 21 May 2022.
Docker images come with all dependencies preinstalled, however Docker itself requires installation, and relies of nvidia driver installations in order to interact properly with local GPU resources. The requirements are:
- Nvidia Driver >= 455.23 https://www.nvidia.com/Download/index.aspx
- Nvidia-Docker https://github.com/NVIDIA/nvidia-docker
- Docker Engine - CE >= 19.03 https://docs.docker.com/install/
The Ultralytics YOLOv5 DockerHub is https://hub.docker.com/r/ultralytics/yolov5 . Docker Autobuild is used to automatically build images from the latest repository commits, so the
ultralytics/yolov5:latest
image hosted on the DockerHub will always be in sync with the most recent repository commit. To pull this image:
sudo docker pull ultralytics/yolov5:latest
Run an interactive instance of this image (called a "container") using -it
:
sudo docker run --ipc=host -it ultralytics/yolov5:latest
Run a container with local file access (like COCO training data in /datasets
) using -v
:
sudo docker run --ipc=host -it -v "$(pwd)"/datasets:/usr/src/datasets ultralytics/yolov5:latest
Run a container with GPU access using --gpus all
:
sudo docker run --ipc=host -it --gpus all ultralytics/yolov5:latest
Start training, testing, detecting and exporting YOLOv5 models within the running Docker container!
python train.py # train a model
python val.py --weights yolov5s.pt # validate a model for Precision, Recall and mAP
python detect.py --weights yolov5s.pt --source path/to/images # run inference on images and videos
python export.py --weights yolov5s.pt --include onnx coreml tflite # export models to other formats
ยฉ 2025 Ultralytics Inc. All rights reserved.
https://ultralytics.com