Skip to content

Egyptian Car Plate OCR: Developed as part of a Smart Parking System, this project includes a model for recognizing characters on Egyptian car plates. It features an API to serve a React.js web app and a Streamlit app for real-time analysis of images and videos.

License

Notifications You must be signed in to change notification settings

alyalsayed/Graduation_Project

Repository files navigation

Egyptian Car Plate OCR

An end-to-end solution for automatic recognition of Egyptian car plates, developed for Smart Parking Systems. This project features a deep learning model for character recognition, a REST API, a React.js web app, and a Streamlit interface for real-time analysis of images and videos.

Table of Contents

Project Overview

This project automates the detection and recognition of Egyptian car plates using state-of-the-art deep learning models. Designed as part of a Smart Parking System, it supports image and video input and exposes an API which powers both a React.js web frontend and a Streamlit-based real-time dashboard.

Features

  • Accurate detection and OCR of Egyptian car plates in images and videos.
  • RESTful API built with Flask for integration with other systems.
  • Modern React.js web application for easy user interaction.
  • Streamlit app for real-time, interactive analysis.
  • Supports both Arabic and numeric plate characters.
  • Easily extensible and modular codebase.

Demo

Inference on Image

Inference on Video

processed_video.mp4

Full Demo

Demo.Video.1.mp4

Installation

Prerequisites

  • Python 3.8+
  • Node.js & npm (for frontend)
  • pip (Python package manager)
  • (Optional) CUDA-enabled GPU for faster inference

Clone the Repository

git clone https://github.com/alyalsayed/Graduation_Project.git
cd Graduation_Project

Setup Backend (API)

cd api
pip install -r requirements.txt
# Or, if no requirements.txt, list major dependencies:
pip install flask flask-cors ultralytics opencv-python pillow numpy pandas arabic-reshaper python-bidi

Setup Frontend

cd ../frontend
npm install

Setup Streamlit App

cd ../streamlit
pip install -r requirements.txt

Usage

Web App

cd frontend
npm start
# Visit http://localhost:3000

API

cd api
python server.py
# API will be available at http://localhost:5000

Example API Request

curl -X POST -F "image=@path_to_image.jpg" http://localhost:5000/predict

Streamlit App

cd streamlit
streamlit run app.py
# Access via http://localhost:8501

Model Details

  • Plate Detection: YOLOv9, trained and exported to ONNX.
  • Character Recognition: Custom CNN, supports both Arabic and numerical characters and another version with YOLOv9
  • Models are located in the models/ directory.

You can try the hosted model on Roboflow here :

Also the deployed reactjs web page here :

Dataset

The dataset for training the models was collected via Instagram pages and scraped using Python scripts located in the data_collection/ folder. It is labeled and hosted on Roboflow. Access the dataset here:

Project Structure

Graduation_Project/
├── api/               # Flask API server
├── data collection/   # Scripts for web scraping
├── frontend/          # React.js web application
├── streamlit/         # Streamlit dashboard
├── testing/           # Scripts for batch inference and evaluation
├── utils/             # Utility modules (e.g., for drawing, video processing)
├── models/            # Pretrained model files (.onnx, etc.)
├── data_collection/   # Python scripts for scraping and collecting dataset from Instagram
├── requirements.txt   # Python dependencies
└── README.md

Contributing

  1. Fork the repository.
  2. Create your feature branch (git checkout -b feature/feature-name).
  3. Commit your changes (git commit -am 'Add new feature').
  4. Push to the branch (git push origin feature/feature-name).
  5. Open a Pull Request.

For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the MIT License.

Acknowledgements

  • YOLO by Ultralytics
  • Streamlit
  • Create React App
  • Thanks to the contributors and open-source community!

About

Egyptian Car Plate OCR: Developed as part of a Smart Parking System, this project includes a model for recognizing characters on Egyptian car plates. It features an API to serve a React.js web app and a Streamlit app for real-time analysis of images and videos.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages