Welcome to Our GitHub repository for the Mauritania License Plate Recognition Challenge, hosted by RIMAI. This repository serves as a central hub for all materials, scripts, and notebooks developed during the challenge, which aims to revolutionize the recognition of Mauritanian license plates through innovative AI solutions.
# Mauritanian License Plate Recognition Challenge
This repository contains the code and steps used for the Mauritanian License Plate Recognition Challenge, a Kaggle competition focused on recognizing and processing license plate characters from images. The goal is to preprocess the images, encode the license plate characters, and build a Convolutional Neural Network (CNN) model to accurately predict the characters.
## Table of Contents
- Project Overview
- Dataset
- Preprocessing
- Character Encoding
- Model Architecture
- Training
- Results
- Usage
## Project Overview
The goal of this project is to build a model that can accurately recognize characters from license plate images. The project involves data preprocessing, character encoding, and the development of a Convolutional Neural Network (CNN) model to predict license plate characters.
## Dataset
The dataset used in this project consists of images of license plates from Mauritania. Each image is labeled with the corresponding license plate number in a CSV file.
- *train_labels.csv*: Contains the image ID and the corresponding license plate number.
Example:
| img_id | plate_number |
|--------|--------------|
| img_1 | 8630AB06 |
| img_10 | 5115AM00 |
## Preprocessing
The preprocessing steps involve loading the images, resizing them to a uniform size, and normalizing the pixel values. The preprocessed images are then saved in a new directory and zipped for easy access.
### Example of Preprocessing Code
python
def preprocess_image(img_path, target_size=(416, 416)):
# Load the image
img = cv2.imread(img_path)
# Resize the image
img_resized = cv2.resize(img, target_size)
# Normalize the image (scale pixel values to [0, 1])
img_normalized = img_resized / 255.0
return img_normalized
# Preprocess and save all images
for img_id in train_labels['img_id']:
img_path = os.path.join(img_dir, f'{img_id}.jpg')
preprocessed_img = preprocess_image(img_path)
if preprocessed_img is not None:
output_pa …