Skip to main content

Plate Recognizer Blur

Install​

info

If looking to Blur Video Files, use this install guide instead.

1. Install Docker and Compose​

Install Docker and Docker Compose

2. Create Configuration File​

Create a folder with a .env file containing the following contents. Remember to edit TOKEN and LICENSE_KEY.

info

TOKEN and LICENSE_KEY can be found here instead.

In case you are using Cloud Snapshot, the LICENSE_KEY must be replaced with your registered email.

# Prefix added to names of docker resources created by compose
COMPOSE_PROJECT_NAME=blur

# Snapshot SDK License Key. See https://guides.platerecognizer.com/docs/blur/configuration#license_key
LICENSE_KEY=6xD#####

# Snapshot SDK token. See https://guides.platerecognizer.com/docs/blur/configuration#token
TOKEN=4805bee1222ce85e0b#####################

# Snapshot SDK url. See https://guides.platerecognizer.com/docs/blur/configuration#sdk_url
# SDK_URL=http://localhost:8080

# Plate blur intensity. See https://guides.platerecognizer.com/docs/blur/configuration#plates
# PLATES=10

# Face blur intensity. See https://guides.platerecognizer.com/docs/blur/configuration#faces
# FACES=10

# Blur with logo. See https://guides.platerecognizer.com/docs/blur/configuration#logo
# LOGO=/logos/logo.png

# Snapshot regions. See https://guides.platerecognizer.com/docs/blur/configuration#regions
# REGIONS=

# Blur shape. See https://guides.platerecognizer.com/docs/blur/configuration#shape
# SHAPE=ellipse

# Snapshot engine config. See https://guides.platerecognizer.com/docs/blur/configuration#config
# CONFIG={\"threshold_d\":0.2,\"threshold_o\":0.6,\"detection_rule\":\"strict\"}

# Skip Plate Regex. See https://guides.platerecognizer.com/docs/blur/configuration#skip_regexp
# SKIP_REGEXP=

# Camera ID forwarded to Snapshot. See https://guides.platerecognizer.com/docs/blur/configuration#camera_id
# CAMERA_ID=camera1

# Webp Image output quality. See https://guides.platerecognizer.com/docs/blur/configuration#webp_quality
# WEBP_QUALITY=100

# Jpeg image output quality. See https://guides.platerecognizer.com/docs/blur/configuration#jpeg_quality
# JPEG_QUALITY=100

# Png image output compression level. See https://guides.platerecognizer.com/docs/blur/configuration#png_compression
# PNG_COMPRESSION=9

# Set logging level. See https://guides.platerecognizer.com/docs/blur/configuration#logging
# LOGGING=20

# Skew correction docker image tag. See https://guides.platerecognizer.com/docs/blur/configuration#skew_correction_image_tag
SKEW_CORRECTION_IMAGE_TAG=latest

# Copy original image metadata to blurred image. See https://guides.platerecognizer.com/docs/blur/configuration#copy_metadata
# COPY_METADATA=false

# Server workers counts. See https://platerecognizer.com/docs/blur/configuration#workers
# WORKERS=1

# Server threads count per worker. See https://platerecognizer.com/docs/blur/configuration#threads
# THREADS=1

Lines beginning with a '#' are comments and so ignored.

Refer to the configuration options for more details on the configuration options.

3. Docker Compose File​

Add a text file named docker-compose.yml in the same folder with the following content. This step is needed for both Snapshot Cloud API and Snapshot On-premise.

docker-compose.yml
x-logging:
&default-logging
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
mode: non-blocking

services:
skew_correction:
image: platerecognizer/skew-correction:${SKEW_CORRECTION_IMAGE_TAG}
logging: *default-logging
ports:
- "8001:8001"
env_file:
- ./.env
volumes:
- ./logos:/logos

4. Snapshot On-premise Configuration​

Create a file named docker-compose.override.yml in the same folder with the following content.

caution

The docker-compose.yml file from the previous step must also be present. This step is not needed if using Snapshot Cloud.

docker-compose.override.yml

x-logging:
&default-logging
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
mode: non-blocking

services:
skew_correction:
environment:
- SDK_URL=http://snapshot_sdk:8080
depends_on:
snapshot_sdk:
condition: service_healthy

snapshot_sdk:
image: platerecognizer/alpr
volumes:
- snapshot_license:/license
logging: *default-logging
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/info" ]
interval: 5s
timeout: 2s
retries: 10
env_file:
- ./.env

volumes:
snapshot_license:

Run​

Start containers by running the following commands in the same folder with the compose files.

docker compose pull
docker compose up -d
caution

The container captures the values in the .env file on each startup. Any changes made while the container is running will not take effect and require a container restart by running below command.

docker compose restart

Check here for blur API reference used to upload images.
Check here for how to blur bulk images.

Upgrade​

Open a terminal in the folder with the Compose file and run the following commands:

docker compose pull
docker compose restart
note

An internet connection is required for license verification to run Blur.
If your firewall is blocking connections, Whitelist these IPs.

Floating button icon
CTRL + .