Object Detection using YOLOv8

Project Goal

This project aims to utilize YOLOv8 for creating custom-trained models in diverse applications, including license plate detection , potholes detection, and Personal Protective Equipment (PPE) detection. Additionally, the trained-models will be utilized
into creating a fully functional object-detection app using Streamlit.

General steps on custom-training a YOLOv8 model

    1. Annotate Images:

    • Annotate dataset with bounding boxes around objects of interest. Tools like RoboFlow or CVAT can be used for this.

    2. Split Data:

    • Divide dataset into training and validation sets. The training set is used to train the model, while the validation set is used to evaluate its performance during training.

    3. Pre-process the images:

    • Standard image pre-processing steps are resizing images to the same size to ensure consistency. Default value used for yolov8 training is 640x640.

    4. Augment Images (if needed):

    • Data augmentation techniques can be applied to artificially increase the diversity
    of your dataset. This helps the model generalize better.

    5. Select YOLOv8 model variant:

    • A model with more parameters will generally perform better in terms of accuracy
    but comes at the cost of slower inference speed.
    table

    6. Train the model: (NOTE: model trained using yolov8's default hyperparameters)

    • Fine-tune the YOLOv8 model on the annotated dataset using the training set. Monitor metrics such as loss and mAP during training.

    7. Validate the Model:

    • Evaluate the trained model on the validation set to ensure it generalizes well
    to new, unseen data.

    8. Inference on Test Set:

    • After training, perform inference on a separate test set to assess the model's performance on completely unseen data.

Custom-trained model's result:

ModelmAP50mAP50-95
Potholes detection (yolov8m)0.7210.407
Car License plate detection (yolov8m)0.9950.828
PPE Detection (yolov8m)0.9910.738

Test out my Streamlit app

icon

Example 1: Detecting car license plate

icon

Example 2: Reading license plate using EasyOCR

icon
  • Learn more about what is EasyOCR and how it works at my github repository.
    • Check out my Github Repository for more info:

      View on GitHub

      Chat Assistant

      Hi! How can I help you today?