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