Coder Social home page Coder Social logo

ongaunjie1 / playing_card_classifier Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 24.08 MB

Playing Cards Classifier (53 classes including Joker)

Home Page: https://playingcardclassifier-efficientnet.streamlit.app/

Python 0.06% Jupyter Notebook 99.94%
image-classification pytorch streamlit

playing_card_classifier's Introduction

Playing Cards Classifier App (trained using PyTorch)

Important Note

  • Pre-trained model used was EfficientNet_B0 (model pre-trained on ImageNet dataset) : https://github.com/lukemelas/EfficientNet-PyTorch
  • Custom model was trained using the smallest EfficientNet, model imported using torch image model (timm) : https://huggingface.co/timm
  • Model Trained on 53 classes including Joker, refer to classes.txt for the list of classes
  • For the purpose of using Streamlit cloud, the smallest model is chosen for a faster inference speed, with less accuracy
  • Accuracy of the model is 97.36%

Link to app

How to use the app?

Step 1: Upload the image of a playing card

image

Step 2: Click on the classify button

image

General steps for fine-tuning a pre-trained CNN model:

  1. Label images:
  • For image classification tasks, the labeling process involves assigning a class label to each image and organizing them into folders based on their classes. Tools like RoboFlow or CVAT simplify this process.
  1. 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.
  1. Pre-process the images: (Resize images and batching dataset)
  • Resize images into appropriate sizes, each pre-trained model has a different image size. For EfficientNet, the image size used was 128x128 for the smallest model.
  • Batch size for image classification can vary, a good starting point is 32 for batch size.
  1. Augment Images (if needed):
  • Data augmentation techniques can be applied to artificially increase the diversity of your dataset. This helps the model generalize better.
  1. Train the model:
  • The models were trained using PyTorch, feel free to use tensorflow if you want. Monitor metrics such as train loss and val loss during training.
  1. Validate the Model:
  • Evaluate the trained model on the validation set to ensure it generalizes well to new, unseen data.
  1. Inference on Test Set:
  • After training, perform inference on a separate test set to assess the model's performance on completely unseen data.

playing_card_classifier's People

Contributors

ongaunjie1 avatar

Watchers

 avatar

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.