Giter Site home page Giter Site logo

jordan-coin-detector-yolov8-based-object-detection-and-counting's Introduction

Jordan Coins Detection (Tracking & Counting)

Overview

Jordanian Coins Vision is a computer vision project focused on detecting and recognizing Jordanian coins using YOLOv8, powered by the Roboflow platform. The project aims to achieve accurate real-time object detection and counting of various denominations of Jordanian coins.

Dataset:

The dataset for this project was created by capturing photos of Jordanian coins and then uploading them to the Roboflow platform. dataset

Data Collection:

The dataset consists of images with the following 9 classes:

  • 5-Piastres
  • 10-Piastres
  • 1-4-dinar
  • 1-2-dinar
  • 1-dinar
  • 5-dinars
  • 10-dinar
  • 20-dinar
  • 50-dinar
Example Annotated Image 1 Example Annotated Image 2
Example Annotated Image 3 Example Annotated Image 4

Data Annotation:

Roboflow was used for annotation, making the dataset ready for training the YOLOv8 model.

Example Annotated Images:

Example Annotated Image 1 Example Annotated Image 2

Preprocessing :

Preprocessing ensures the dataset is in a standard format (e.g. all images are the same size). This step is essential to ensure the dataset is consistent before training a model. Preprocessing applies to all images in the Train, Valid, and Test set (unlike Augmentations, which only apply to the Train set).

We used Auto-Orient and Resize to standardize dimensions. Auto-Orient: Auto-orient strips your images of their EXIF data so that you see images displayed the same way they are stored on disk. Resize changes your image size and, optionally, scale to a desired set of dimensions. Annotations are adjusted proportionally (except in the case of “fill” below).

Data Augmentation :

To enhance the diversity and robustness of our dataset, we applied the following augmentation techniques during the training process:

  • Flip: Horizontal and Vertical
  • Crop: Minimum Zoom of 0%, Maximum Zoom of 20%
  • Rotation: Random rotation between -15° and +15°
  • Hue: Random adjustment between -15° and +15°
  • Exposure: Random adjustment between -10% and +10%

By utilizing these augmentation techniques, each training example was transformed into multiple variations, exposing the model to a broader range of scenarios. This contributed to improved performance and generalization during the object detection and counting tasks.

Training

The YOLOv8 model was trained on the annotated dataset using the Roboflow platform. The training process involved optimizing the model to accurately detect and classify the various denominations of Jordanian coins.The model was trained with the following configuration:

  • Number of Epochs: 200

  • Training Configuration: Default configurations provided by Roboflow, including data augmentation techniques to improve generalization.

  • Training Graphs:

Example Annotated Image 1 Example Annotated Image 2

Inference

Once trained, the model can be used to perform inference on new images containing Jordanian coins. Inference can be done either locally using the provided scripts or through Roboflow's inference API. The model outputs bounding boxes around detected coins along with their corresponding class labels and confidence scores.

Inference with Roboflow Platform

Alternatively, you can perform inference using the Roboflow platform. The model outputs bounding boxes around detected coins along with their corresponding class labels and confidence scores. To use the trained model for inference through Roboflow's inference API, please follow this link.

Example Roboflow Inference

Yolov8 Inference (Tracking & Counting)

We employed YOLO for object detection and Botsort for tracking in our code. The implementation enables the counting and tracking of objects in videos. YOLO identifies objects, while Botsort assigns unique IDs for tracking across frames. This straightforward approach is particularly effective for counting and tracking objects, such as coins, in dynamic videos.

To run inference with tracking & counting the coins, please follow this notebook.

  • Image Inference Examples
Example Inference Image 1 Example Inference Image 2

Usage

  • Follow the instructions within the notebook cells.
  • Provide the path to the input video file (video_path) in the notebook.
  • Adjust confidence threshold (confidence_threshold) and other parameters if needed.

Presentation

For more details, please refer to our presentation here

Acknowledgments

This code is based on the YOLOv8l implementation by Ultralytics.See their GitHub Repository for more information.

jordan-coin-detector-yolov8-based-object-detection-and-counting's People

Contributors

albarashehadeh avatar tibraratib avatar

Stargazers

Hashem Aljarrah avatar

Watchers

Mohammad Abd-Almajeed avatar  avatar

Forkers

tibraratib

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.