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 .env file with the following contents. Remember to edit TOKEN and LICENSE_KEY.
Lines beginning with a '#' are comments and are ignored. Refer to configuration options for more details on how to use.

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.

caution

The container captures the values in this file at its initial startup. Any changes made to this file while the container is running will not take effect, requiring a container restart by doing.

docker compose down
docker compose up

or

docker compose restart
# 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

# Path to folder with logos. See https://guides.platerecognizer.com/docs/blur/configuration#logos_dir
LOGOS_DIR=./logos

# 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

3. Use Base compose for Snapshot Cloud.​

Quick setup using Snapshot Cloud API for recognition.
Add a text file named docker-compose.yml file in the same folder with the following content:

docker-compose.yml
version: "3.9"

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

volumes:
logos:
driver: local
driver_opts:
type: none
device: $LOGOS_DIR
o: bind

4. Add Override compose for Snapshot On-premise.​

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 optional if using Snapshot Cloud.

docker-compose.override.yml
version: "3.9"

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

Check here for blur API reference.
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 + .