Traffic RecognitionΒΆ

The traffic recognition API classifies an image into one of the following

Sparse traffic

Dense traffic



With this, from images of live traffic, you can tell if an accident has occured, if their is traffic gridlock or if a vehicle is on fire.

To use this API, you need to set VISION-TRAFFIC=True when starting DeepStack

sudo docker run -e VISION-TRAFFIC=True -v localstorage:/datastore \
-p 80:5000 deepquestai/deepstack

If using the GPU Version, run

sudo docker run --rm --runtime=nvidia -e VISION-TRAFFIC=True -v localstorage:/datastore \
-p 80:5000 deepquestai/deepstack:gpu

Note also that you can have multiple endpoints activated, for example, both traffic and object detection are activated below

sudo docker run -e VISION-TRAFFIC=True  -e VISION-DETECTION=True -v localstorage:/datastore \
-p 80:5000 deepquestai/deepstack


const request = require("request")
const fs = require("fs")

image_stream = fs.createReadStream("test-image4.jpg")

var form = {"image":image_stream}{url:"http://localhost:80/v1/vision/traffic", formData:form},function(err,res,body){

    response = JSON.parse(body)


{ success: true, label: 'accident', confidence: 0.9488776 }