deep-license-plate-recognition
repository·master·Indexed 20 days ago
https://github.com/parkpow/deep-license-plate-recognitionA collection of example clients, integrations, and operational utilities for Plate Recognizer services, including Snapshot, Stream, Blur, and ParkPow. The repository provides tools for image recognition, plate redaction, and automated workflows, featuring client implementations in C++, C#, and Java, a Docker-based Plate Recognizer Installer extension, and the Rust/Tauri-based GateController application.
What's inside deep-license-plate-recognition
- The Tags Updater is a tool designed to automatically edit or add new vehicle tags within the ParkPow platform. It operates based on a provided configuration file to perform bulk tag management operations.
Access ParkPow application benchmarks
masterThe
benchmark/directory contains performance and benchmarking tools for various ParkPow applications. You can find specific benchmark documentation and scripts for the following components:- Blur: Benchmarking plate redaction/blurring processes.
- ParkPow: Benchmarking the core ParkPow application.
- Snapshot: Benchmarking snapshot-based processing.
- Stream: Benchmarking stream processing via a Python script.
Use the CSV Upload Utility to upload data to ParkPow
masterThe CSV Upload Utility allows you to upload CSV files and associated images to ParkPow. For detailed integration instructions and workflow specifics, refer to the official Plate Recognizer documentation.GateController technology stack overview
masterGateController is a hybrid application designed to receive APIs from external sources and trigger a gate's dry contact to open. It uses the following stack:
- Backend: Rust with Tauri
- Frontend: Next.js (React) with TypeScript
- UI: shadcn/ui and Tailwind CSS
- Package Manager: Bun
Repository Map: Tools and Workflows
masterThis repository is organized into several subprojects. Each subproject has its own dependencies and should be used according to its specific README or requirements file.
Goal Tool or directory Recognize plates in images plate_recognition.pyRedact plates in images number_plate_redaction.pyProcess an FTP or SFTP server ftp_and_sftp_processor.pyMonitor and transfer new images transfer.pyOperate on Stream videos and images stream/Integrate webhook consumers webhooks/Integrate ParkPow and camera systems parkpow/Run Blur or edit video blur/,video-editor/Install or manage an on-premise SDK docker/Run performance benchmarks benchmark/Use another language cpp/,csharp/,java/Control a gate relay gate-controller/How the Stream → ParkPow Proxy works
masterThe worker follows this execution flow:
- Incoming Request: Listens for
POSTrequests from Stream. - Authentication: Validates the
Authorizationheader against the configuredSTREAM_TOKEN. - Forwarding: Forwards the request to the
PARKPOW_ENDPOINT, replacing the original authorization header with thePARKPOW_TOKEN. - Multipart Support: Handles both
application/jsonandmultipart/form-databodies, ensuring binary data integrity is preserved during the proxy process. - Error Handling: Returns error responses for authentication failures, missing configuration, or network issues.
- Incoming Request: Listens for
Understand Snapshot SDK modes: regular vs fast
masterThe Snapshot SDK supports two operational modes that affect the trade-off between speed and accuracy:
- regular: Standard detection mode.
- fast: Optimized for speed. In this mode, the number of detection steps is always set to 1.
Warning: Using
fastmode may result in lower accuracy, particularly when processing images containing small vehicles.Quickstart: Recognize plates in images with Python
masterUse
plate_recognition.pyto perform license plate recognition using either the Plate Recognizer cloud API or a self-hosted Snapshot SDK.Prerequisites
- Python 3.8 or newer
- A Plate Recognizer API token or a running self-hosted Snapshot SDK
Installation
Clone the repository and install the required dependencies:
git clone https://github.com/parkpow/deep-license-plate-recognition.git cd deep-license-plate-recognition python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate python -m pip install requests pillowUsage
Cloud API:
python plate_recognition.py --api-key MY_API_KEY /path/to/vehicle.jpgSelf-hosted SDK:
python plate_recognition.py --sdk-url http://localhost:8080 /path/to/vehicle.jpgOutput Format
The command returns a JSON array containing recognition results. Example:
[ { "version": 1, "results": [ { "box": {"xmin": 85, "ymin": 85, "ymax": 211, "xmax": 331}, "plate": "ABC123", "score": 0.904, "dscore": 0.92 } ], "filename": "car.jpg" } ]Batch upload videos to Stream
masterUse
video_upload.pyto upload all files within a specified directory to the Stream file-upload API. Successful uploads are logged tooutput.jsonl.By default, the script targets
http://localhost:8081. You can override this using the--sdk-urlflag. You can also specify a camera mask using the--maskflag.python -m pip install -r requirements.txt python video_upload.py /path/to/videosRun the Webhook Dashboard with Docker Compose
masterYou can run the entire application and its PostgreSQL database using Docker Compose.
Steps to Run
- Build and start containers:
docker-compose up -d --build - Verify logs:
docker-compose logs -f - Access the app: The application will be available at
http://localhost:3000.
Managing Containers
- Stop containers:
docker-compose down - Stop and remove volumes (deletes all database data):
docker-compose down -v
Important Notes
- Ensure environment variables (R2 credentials and webhook limits) are correctly configured in the
docker-compose.ymlfile. - PostgreSQL data is persisted in a Docker volume named
postgres_data.
docker-compose up -d --build docker-compose logs -f docker-compose down docker-compose down -v- Build and start containers:
Configure the Plate Recognizer API Token
masterTo use the Java client, you must obtain an API key from Plate Recognizer. You need to replace the placeholderMY_API_KEYwith your actual key in therecognize.javafile located atPlateRecognizer/src/main/java/com/mycompany/numberplate/recognize.java.Monitor directories and transfer images with `transfer.py`
masterThe
transfer.pyutility watches a local directory for new images, performs recognition, moves processed images to an archive, and can optionally forward results to ParkPow.Installation
python -m pip install requests watchdog jsonlinesUsage
Refer to
python transfer.py --helpfor specific command-line arguments regarding source directories, archive paths, and camera paths. The help output provides specific examples for both the Cloud API and self-hosted SDK workflows.