Smart Parking Inspection System

Using AI to Revolutionize Parking Management

Developed by Nyabiosi Sydiney Nyabiosi - 2024 Capstone Project

Inference Video/Live Stream

The provided Python script implements a robust system for license plate detection in videos using deep learning models and computer vision techniques. By leveraging pretrained models, Tesseract OCR, and OpenCV functionalities, the script efficiently identifies license plates in video frames, extracts plate numbers, and annotates bounding boxes, culminating in a comprehensive solution for automated license plate recognition.

Imports

  1. os This module provides a portable way of interacting with the operating system. It's used for file path operations.
  2. torch This is the main PyTorch library used for deep learning.
  3. cv2 This is the OpenCV library used for image and video processing.
  4. read_image This function from `torchvision.io` is used for reading images.
  5. draw_bounding_boxes This function from `torchvision.utils` is used for drawing bounding boxes on images.
  6. numpy as np NumPy is used for numerical operations in Python.
  7. pytesseract This is a wrapper for Google's Tesseract-OCR Engine, used for text recognition.

LicensePlateDetector Class

This class encapsulates the functionality for detecting license plates in a video.

__init__(self, model_paths, device='cpu')

detect_plate(self, frame)

extract_plate_number(self, frame, box)

draw_bounding_boxes(self, frame, pred_labels_all, pred_boxes_all)

process_video(self, video_file, output_video_path, video_title)

play_video(self, video_file)

Execute Script

Overall, this script demonstrates a comprehensive pipeline for detecting license plates in a video using deep learning models and various image processing techniques.