Skip to content
Dockerized YOLO object detection service
Shell Python Dockerfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.
Dockerfile Updated build scripts with repo name and new tags. Aug 26, 2019
swagger.yaml Updated build scripts with repo name and new tags. Aug 26, 2019

YOLO Object Detection Service

Dockerized object detection service using YOLO based on AlexeyAB's darknet fork and exposed as a REST API using connexion. For details see this post.

Quick start

Pull the image from Docker Hub and spin up a container:

docker run -d --rm --name yolo_service -p 8080:8080 johannestang/yolo_service:1.0-yolov3_coco 

This will expose a single endpoint detect that accepts GET and POST requests where the former takes a URL of an image and the latter lets you upload an image for detection. The service provides a user interface at localhost:8080/ui where the endpoint can be tested and the details of the input parameters are listed.

Image variants

You can build the images yourself using the script or pull them from Docker Hub. They come in nine variants based on three different models/data sets and three different configurations of the darknet library. The different models are:

  1. YOLOv3 trained on the COCO dataset covering 80 classes listed here. Tag: yolov3_coco.
  2. YOLOv3 trained on the Open Images dataset covering 601 classes listed here. Tag: yolov3_openimages.
  3. YOLO9000 covering more than 9000 classes listed here. Tag: yolo90000.

The different darknet configurations:

  1. The base configuration set up to run on a CPU. Tag: 1.0
  2. Compiled using CUDA 10.0 and cudNN in order to utilize a GPU. Tag: 1.0_cuda10.0.
  3. Compiled using CUDA 10.0 and cudNN with Tensor Cores enabled in order to utilize a GPU with Tensor Cores. Tag: 1.0_cuda10.0_tc.

When using the CUDA images make sure to use Docker version 19.03 (or newer) and have NVIDIA Container Toolkit installed, then the container can be started by running e.g.:

docker run -d --rm --name yolo_service -p 8080:8080 --gpus all johannestang/yolo_service:1.0_cuda10.0-yolov3_coco 
You can’t perform that action at this time.