Skip to main content

Configuration

Start on Boot#

To run the container automatically on system startup, run the container using the --restart always option. For a complete list of start options see Docker start on boot.

docker run --restart always -t -p 8080:8080 -v license:/license -e TOKEN=YYYYY -e LICENSE_KEY=XXXXX platerecognizer/alpr
danger

For the command above, make sure to change XXXXX to the License Key and YYYYY to your Plate Recognizer Token. Get your Token.

Networking#

  • Add --network=host to use the host's networking directly.
  • You may use a different port if 8080 is already used. For example, to use port 8888 do -p 8888:8080.
  • Add --detach to run container in background.

Speed Optimization#

  • By default the SDK starts a single worker process. To fully use the machine's compute, you can enable multiple workers. For example, adding -e WORKERS=2 to docker run will start 2 worker processes. When this is enabled, it is preferred to call the API in a multi-threaded fashion.
  • When using our GPU image, you can set the environment variable PROCESS_GPU_FRACTION. By default it will use 100% of the GPU RAM. If set to 0.5 it will use 50%. This can be combined with the WORKERS variable. For example, with 2 workers, you would use -e WORKERS=2 -e PROCESS_GPU_FRACTION=0.5.
  • Faster inference can also be achieved using the config parameter. See details in our documentation.
  • When using a compressed image format like JPEG or PNG, the SDK will need to decode the image before processing it. To skip the decoding step, prefer an uncompressed format like BMP, PPM, PNM or SGI.