Preview - Vehicle Analytics - Docker¶
This document contains instructions on how to run the Sighthound Cloud API using Docker Compose. Contact support@sighthound.com with any questions.
Requirements¶
Docker¶
Ensure your system has a recent version of Docker Engine and Docker Compose. You can either manually install it for your specific operating system by following the directions on Docker's site, or you can run the convenience script that Docker provides:
NVIDIA (optional)¶
If you have an NVIDIA GPU, install the latest drivers and install the NVIDIA Container Toolkit to give the Docker containers access to the GPU.
Acquire a License¶
A valid sighthound-license file will need to be in the same folder as the docker-compose.yml file. If this doesn't exist, please email support@sighthound.com. The service will not run without it.
Configuration¶
If you are running on an NVIDIA host with properly installed drivers and NVIDIA Container Toolkit, you can edit docker-compose.yml and uncomment the runtime: nvidia line for both the eu and us services.
Pull the Docker Image¶
In order to pull the Docker image from our private repository, you will need to log in to Docker using the sighthound-keyfile.json. If this wasn't provided, please email support@sighthound.com.
Open a terminal, cd into the sighthound-cloud-vehicle folder, and run the following commands:
Note
You may need to append sudo before each of the docker commands in this document depending on your machine's configuration.
cat sighthound-keyfile.json | docker login -u _json_key --password-stdin us-central1-docker.pkg.dev
docker compose pull
Start Sighthound Cloud API¶
Open a terminal, cd into the sighthound-cloud-vehicle folder, and run the following command to start the services:
Sighthound Cloud API Request¶
The following endpoints will return bounding box coordinates and attributes for any vehicles and license plates detected in an image. For vehicles, the attributes include "vehicleType" (make, model, generation) and "color". For license plates, the attributes include the "lpString" (characters from the plate) and "region" (e.g. Florida, Germany, etc.).
Two different endpoints are available in this preview. Use the one ending in "/us" if you'll be testing images with US plates, or use "/eu" if testing images with plates from the EU.
POST http://localhost:8888/vehicle/us (LPR for US)
POST http://localhost:8888/vehicle/eu (LPR for EU)
Request Headers¶
Request Body¶
Note: urlList is limited to 1 item in the preview API
Example Request¶
curl -d '{ "urlList":["https://d1mfcqjbhp6mmy.cloudfront.net/vehicles/audi-sports-car-r8-marlene.jpeg"] }' -H "Content-Type: application/json" -X POST http://localhost:8888/vehicle/eu
Example Response¶
{
"apiVersion": {
"major": 1,
"minor": 1
},
"frameDimensions": {
"w": 900,
"h": 620
},
"frameSource": "/tmp/cloudv3-image-tmpdir-1657205442527/405974750e77460ba3a17d948d0c12ff/__images__audi-sports-car-r8-marlene_2022-05-09T03__50__42.4710000Z.jpeg",
"sourceId": "cloud",
"frameId": "cloud-frame-2-1657205439566",
"analyticsTimestamp": 1657226222767,
"metaClasses": {
"licensePlates": {
"cloud-lp-2-1657205439566": {
"attributes": {
"lpString": {
"value": "RTBB221",
"attributeScore": 1,
"detectionScore": 0.99,
"updated": true
},
"lpRegion": {
"value": "Germany",
"attributeScore": 1,
"detectionScore": 0.99,
"updated": true
}
},
"firstFrameTimestamp": 1657226222767,
"class": "licensePlate",
"bestDetectionTimestamp": 1657226222767,
"box": {
"height": 28,
"width": 120,
"x": 619,
"y": 451
},
"detectionScore": 0.99,
"updated": true,
"links": [
{
"metaClass": "vehicles",
"id": "cloud-car-2-1657205439584"
}
]
}
},
"vehicles": {
"cloud-car-2-1657205439584": {
"attributes": {
"vehicleType": {
"value": "audi r8 2007 2014",
"attributeScore": 0.99,
"detectionScore": 1,
"updated": true
},
"color": {
"value": "white",
"attributeScore": 0.99,
"detectionScore": 1,
"updated": true
}
},
"firstFrameTimestamp": 1657226222767,
"class": "car",
"bestDetectionTimestamp": 1657226222767,
"box": {
"height": 289,
"width": 406,
"x": 435,
"y": 277
},
"detectionScore": 1,
"updated": true,
"links": [
{
"metaClass": "licensePlates",
"id": "cloud-lp-2-1657205439566"
}
]
}
}
},
"request_id": "405974750e77460ba3a17d948d0c12ff",
"engine_version": "",
"time_analytics_start": 1657226222.724,
"time_analytics_complete": 1657226222.834
}