Skip to content

ube09/PlateVision

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mini License Reader

AI-powered license plate recognition for EU/Balkan vehicles, built with OpenAI Vision.

Overview

Mini License Reader is a Streamlit web application that reads license plates and country codes from uploaded vehicle images using the OpenAI Vision API. It was built for a logistics/warehouse access-control use case where vehicles arriving on site need their plates identified quickly and consistently, including plates from countries (Bulgaria, Hungary, Slovakia, North Macedonia, Serbia, Romania, Turkey, Ukraine and more) that are easy to confuse.

The app uploads one or more images, sends them to a vision-capable model with a carefully engineered prompt, validates the structured JSON response, and returns the country code and plate number. A lightweight in-memory cache and request rate-limiting keep API usage efficient.

Features

  • Upload and process one or many images at once (JPG, JPEG, PNG, JFIF)
  • Vision-based plate and country-code extraction via the OpenAI API
  • Two selectable prompt strategies: a detailed rule-based prompt (with country-specific disambiguation rules) and a simple prompt
  • Strict JSON response validation against a whitelist of valid EU/Balkan country codes
  • Flash/glare detection on uploaded images to flag unreadable scans
  • In-memory caching with a configurable lifetime and max size
  • Per-request rate limiting to control API throughput
  • Side-by-side UI showing the image and the analysis result

Tech Stack

  • Language: Python 3.11
  • UI: Streamlit
  • AI/Vision: OpenAI API (vision-capable chat completions)
  • Image processing: Pillow, NumPy
  • Config: python-dotenv
  • Deployment: Render (render.yaml)

Setup / Run

  1. Clone the repository.
  2. Copy .env.example to .env and add your OpenAI API key:
    OPENAI_API_KEY=your_openai_api_key_here
    PROMPT_TEMPLATE=your_prompt_template_here
    
  3. Install dependencies:
    pip install -r requirements.txt
  4. Run the app:
    streamlit run app-mini.py

app-mini.py targets the latest vision model; app-mini-4.py is an earlier GPT-4o-mini variant kept for reference.

Author

Usama Bin Ejaz — AI/ML Engineer | Data Scientist | Founder, UBE Labs ("AI that ships.")

About

Vision-AI web app reading license plates and country codes from vehicle photos for warehouse access control

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages