In this project, I've implemented cheque detection using the YOLOv8 model. To train and evaluate the model, I have created a custom dataset consisting of 216 images of cheques, which have been manually annotated and labeled by myself using the Roboflow platform. The dataset is divided into three subsets as follows:
- Training Set: 182 images
- Validation Set: 23 images
- Test Set: 11 images
The goal of this project is to detect the authenticity of cheques in images using the YOLOv8 object detection model. The project includes:
- A custom dataset of cheque images.
- Pre-trained YOLOv8 models.
- Scripts for running inference on new images and videos.
- Scripts for training the model on the custom dataset.
To run this project, you need to have Python 3.7+ and pip
installed. Follow the steps below to set up the environment:
-
Clone the repository:
git clone https://github.com/prabhleenn/Cheque-Detection.git cd Cheque-Detection
-
Install the required dependencies:
pip install "https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml"
To run inference on images using the pre-trained (.pt) model, use the following commands:
- On an image:
python detect.py --source path/to/your/image.jpg --weights path/to/yolov8/weights.pt
To train the model on the custom cheque dataset, follow these steps:
-
Ensure your dataset is in the YOLO format:
dataset/
โโโ images/
โ โโโ train/
โ โ โโโ image1.jpg
โ โ โโโ image2.jpg
โ โ โโโ ...
โ โโโ val/
โ โ โโโ image1.jpg
โ โ โโโ ...
โ โโโ test/
โ โโโ image1.jpg
โ โโโ ...
โโโ labels/
โโโ train/
โ โโโ image1.txt
โ โโโ image2.txt
โ โโโ ...
โโโ val/
โ โโโ image1.txt
โ โโโ ...
โโโ test/
โโโ image1.txt
โโโ ... -
Update the yaml file with your dataset paths and parameters.
-
Run the training script:
python train.py --data path/to/your/data.yaml --cfg path/to/yolov8/config.yaml --weights path/to/yolov8/weights.pt