Manual Installation Steps
Follow the steps below to manually install USDOT OCR On-premises with Docker.
For the commands below, make sure to replace YOUR_LICENSE_KEY with your License Key and YOUR_API_TOKEN with your API Token. Get your token and license key. Use On-premises Licenses.
List of Docker Images
The Docker image is available for linux/amd64 architecture. The image structure is:
platerecognizer/usdot:<version>
<version>: leave blank for latest.- To see the list of tags, select the USDOT image from Docker Hub and then click "Tags".
Examples:
- Specific version:
platerecognizer/usdot:0.1.4 - Latest version:
platerecognizer/usdot:latestorplaterecognizer/usdot
Installation
Installation on an Intel CPU
Abbreviated installation steps below. For a detailed, step-by-step guide, see the Install Docker and SDK on Windows and the associated FAQ.
- Sign up and log in.
- Subscribe to a USDOT OCR On Premise plan.
- Install Docker on your local machine. See requirements.
- Get our On-premises image:
docker pull platerecognizer/usdot - Install and run the Docker container:
docker run --restart="unless-stopped" \
-t \
-p 8001:8001 \
-v license:/license \
-e TOKEN=YOUR_API_TOKEN \
-e LICENSE_KEY=YOUR_LICENSE_KEY \
platerecognizer/usdot
Testing the API
Once the container is running, you can test it by sending a sample image.
- Linux
- Windows
# Get a sample picture
curl -o /tmp/usdot.jpg https://app.platerecognizer.com/static/usdot_demo.jpg
# Read USDOT information
curl -F 'image=@/tmp/usdot.jpg' http://localhost:8001/predict/
# Get a sample picture
curl -o usdot.jpg https://app.platerecognizer.com/static/usdot_demo.jpg
# Read USDOT information
curl -F "image=@usdot.jpg" http://localhost:8001/predict/
If successful, you will receive a JSON response with the extracted DOT number and details. See the output format documentation.
Consuming the API
The On-premises app also exposes Swagger UI at:
http://localhost:8001/docs
From Swagger UI, you can explore endpoints, test parameters, and review available fields.
Example with Parameters
- cURL
- Python
- JavaScript
curl -F 'image=@usdot.jpg' -F 'min_detection_score=0.2' -F 'min_ocr_score=0.6' -F 'camera_id=1' -F 'timestamp=2023-01-01T12:00:00' http://localhost:8001/predict/
import requests
url = "http://localhost:8001/predict/"
files = {"image": open("usdot.jpg", "rb")}
data = {
"min_detection_score": 0.2,
"min_ocr_score": 0.6,
"camera_id": 1,
"timestamp": "2023-01-01T12:00:00"
}
response = requests.post(url, files=files, data=data)
print(response.json())
const fs = require("fs");
const fetch = require("node-fetch");
const FormData = require("form-data");
const form = new FormData();
form.append("image", fs.createReadStream("usdot.jpg"));
form.append("min_detection_score", "0.2");
form.append("min_ocr_score", "0.6");
form.append("camera_id", "1");
form.append("timestamp", "2023-01-01T12:00:00");
fetch("http://localhost:8001/predict/", { method: "POST", body: form })
.then((res) => res.json())
.then((json) => console.log(json));