deep-license-plate-recognition

repository·master·Indexed 20 days ago

https://github.com/parkpow/deep-license-plate-recognition

A 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.

Tokens
33.6K
Snippets
121
Records
170
Agent score
71%

What's inside deep-license-plate-recognition

  1. Access ParkPow application benchmarks

    master

    The 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.
  2. Repository Map: Tools and Workflows

    master

    This repository is organized into several subprojects. Each subproject has its own dependencies and should be used according to its specific README or requirements file.

    GoalTool or directory
    Recognize plates in imagesplate_recognition.py
    Redact plates in imagesnumber_plate_redaction.py
    Process an FTP or SFTP serverftp_and_sftp_processor.py
    Monitor and transfer new imagestransfer.py
    Operate on Stream videos and imagesstream/
    Integrate webhook consumerswebhooks/
    Integrate ParkPow and camera systemsparkpow/
    Run Blur or edit videoblur/, video-editor/
    Install or manage an on-premise SDKdocker/
    Run performance benchmarksbenchmark/
    Use another languagecpp/, csharp/, java/
    Control a gate relaygate-controller/
  3. How the Stream → ParkPow Proxy works

    master

    The worker follows this execution flow:

    1. Incoming Request: Listens for POST requests from Stream.
    2. Authentication: Validates the Authorization header against the configured STREAM_TOKEN.
    3. Forwarding: Forwards the request to the PARKPOW_ENDPOINT, replacing the original authorization header with the PARKPOW_TOKEN.
    4. Multipart Support: Handles both application/json and multipart/form-data bodies, ensuring binary data integrity is preserved during the proxy process.
    5. Error Handling: Returns error responses for authentication failures, missing configuration, or network issues.
  4. Quickstart: Recognize plates in images with Python

    master

    Use plate_recognition.py to 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 pillow

    Usage

    Cloud API:

    python plate_recognition.py --api-key MY_API_KEY /path/to/vehicle.jpg

    Self-hosted SDK:

    python plate_recognition.py --sdk-url http://localhost:8080 /path/to/vehicle.jpg

    Output 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"
      }
    ]
  5. Batch upload videos to Stream

    master

    Use video_upload.py to upload all files within a specified directory to the Stream file-upload API. Successful uploads are logged to output.jsonl.

    By default, the script targets http://localhost:8081. You can override this using the --sdk-url flag. You can also specify a camera mask using the --mask flag.

    python -m pip install -r requirements.txt
    python video_upload.py /path/to/videos
  6. Run the Webhook Dashboard with Docker Compose

    master

    You can run the entire application and its PostgreSQL database using Docker Compose.

    Steps to Run

    1. Build and start containers:
      docker-compose up -d --build
    2. Verify logs:
      docker-compose logs -f
    3. 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.yml file.
    • 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
  7. Monitor directories and transfer images with `transfer.py`

    master

    The transfer.py utility 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 jsonlines

    Usage

    Refer to python transfer.py --help for 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.