Skip to content


To get started with YOLOv5 🚀 in a Docker image follow the instructions below. Other quickstart options for YOLOv5 include our Colab Notebook Open In Colab Open In Kaggle and a GCP Deep Learning VM.

1. Install Docker and Nvidia-Docker

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 - Nvidia-Docker - Docker Engine - CE >= 19.03

2. Pull Image

The Ultralytics YOLOv5 DockerHub is Docker Pulls. 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

3. Run Container

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 /coco) using -v:

sudo docker run --ipc=host -it -v "$(pwd)"/coco:/usr/src/coco ultralytics/yolov5:latest

Run a container with GPU access using --gpus all:

sudo docker run --ipc=host --gpus all -it ultralytics/yolov5:latest

4. Run Commands

Run commands from within the running Docker container, i.e.:

$ python  # train a model
$ python --weights  # test a model for Precision, Recall and mAP
$ python --weights --source path/to/images  # run inference on images and videos