Configuration
LICENSE_KEY​
Specify Snapshot SDK License Key.
Example: LICENSE_KEY=3ar#######
This is a required parameter
TOKEN​
Provide your API Token.
Example: TOKEN=22333f3e33r3##################
This is a required parameter
PLATES​
Control the blur intensity applied to plates.
- Don't Blur, Set
PLATES=0
- Min Intensity, Set
PLATES=1
- Max Intensity, Set
PLATES=10
- Skip Plates entirely. Set
PLATES=-1
. Improves processing time
PLATES=0
is the default value, ensure to set it to a value from 1 to 10 to get plates in your file blurred.
FACES​
Control the blur intensity applied to faces.
- Don't Blur, Set
FACES=0
- Min Intensity, Set
FACES=1
- Max Intensity, Set
FACES=10
- Skip Faces entirely. Set
FACES=-1
. Improves processing time
FACES=0
is the default value, ensure to set it to a value from 1 to 10 to get faces in your file blurred.
LOGO​
Use a different image to cover the plate area instead of just blurring. Default image used is Platerecognizer logo.
Using a custom logo:
- Add your logo into the logos directory created in the same folder as the compose files on the initial run.
- Update LOGO so that the filename is the desired logo
LOGO='/logos/logo2.png'
. Do not remove the starting path -/logos/
- Any file named logo.png in your logos directory will act as the default.
- Override the LOGO config using the
logo
param in your API call.
REGIONS​
Specify the regions used in detection.
Format: REGIONS=<region1,region2,region3>
Example: REGIONS=gb
Multiple regions: REGIONS=in,us
SHAPE​
Used with FACES
. Specify the shape used for blurring.
Format: SHAPE=<shape>
Shape can be any of the below options
- ellipse (default)
- circle
- square
Example: SHAPE=circle
SDK_URL​
Use Snapshot SDK rather than the default Cloud API.
Example: SDK_URL='http://localhost:8080'
CONFIG​
Extra engine config forwarded to Snapshot.
Default: {"mode": "redaction"}
.
Example CONFIG='{"threshold_o":"0.5"}'
SKIP_REGEXP​
Exclude plates that match a list of regexes from the results.
Example SKIP_REGEXP=adwdwd,3344ff,sds33
How it works:
Example detected plate = KAXZ 7226882
Regexes that will exclude this plate:
KAXZ 7226882
KAX
K
7226882
Z 72268
Regexes that won't exclude this plate:
KXZ
KAXZ 7226882555
AX 82
CAMERA_ID​
Specify the camera ID sent to Snapshot
Example CAMERA_ID=camera1
WEBP_QUALITY​
Control WEBP quality. Affects output image size and quality
Range is 1 to 100, default is 100, higher is better quality and larger file size.
Example WEBP_QUALITY=50
JPEG_QUALITY​
Control JPEG and JPG quality. Affects output image size and quality.
Range is 0 to 100, default is 100, higher is better quality and larger file size.
Example JPEG_QUALITY=50
PNG_COMPRESSION​
Control PNG compression. Affects output image size and quality.
Range 0 to 9, default is 9, higher value means a smaller file size and longer compression time.
Example PNG_COMPRESSION=3
LOGGING​
Set log level default is 20. Example: LOGGING=10
. Available log levels:
- 10 DEBUG
- 20 INFO
- 30 WARN
- 40 ERROR
- 50 CRITICAL
SKEW_CORRECTION_IMAGE_TAG​
Skew correction docker image tag. Set to no-avx if your CPU doesn't have AVX instructions. Default is latest.
COPY_METADATA​
If this flag is set to true
, 1
or yes
, Input image metadata (EXIF and XMP) is copied from the original image to the blurred image.
WORKERS​
Set the number of workers created by API server (Gunicorn). Default is 1
Gunicorn should only need 4-12 worker processes to handle hundreds or thousands of requests per second.
We recommend $num_cpu_cores
as the number of workers to start off with.
While not overly scientific, the formula is based on the assumption that for a given core, one worker will be reading or writing from the socket while the other worker is processing a request.
Setting a very high value for WORKERS while using a Snapshot cloud API will make requests to fail if a 429 response is got after 10 retries.
THREADS​
Set number of threads created by API server per worker. Default is 1
Threads option can be used to process requests in multiple threads. We recommend modifying only WORKERS and leaving THREADS as the default unless Snapshot SDK is in a different location such as Cloud instead of on the same host as Blur
FACE_MAX_RESOLUTION​
By default images larger than 1280,720 will be resized before running face detection. This improves performance but might reduce accuracy for very large images. This config controls the default resolution size. Set to a very large value to disable resizing.