Skip to content

ladyHufflePuff/UNO-Card-Recognition-Software

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Uno Card Recognition Software


This project is a machine learning-based solution to detect and recognize Uno cards using a custom trained YOLOv8 model. The model is trained on a custom dataset created via Roboflow, enabling it to identify all 54 cards with high accuracy. The software includes evaluation scripts for testing the model and a simple UI for interacting with the system.

Potential Applications:
This project can be used to build autonomous Uno-playing robots, assist in card-based games, or demonstrate the power of computer vision in real-world applications.

Features


  • YOLOv8-based recognition: The project leverages the YOLOv8 model to detect Uno cards.
  • Custom Dataset: A Roboflow-based custom dataset is used for training the model.
  • Evaluation Scripts: Includes scripts to test the trained model on images and live video.
  • UI Interface: A simple UI for interacting with the detection software.

File Structure


UNO-Card-Recognition-Software/
│
├── evaluation/                              # Scripts and results for evaluating model performance
│   ├── detection_results.csv                # Example detection results
│   ├── file_interference_test.py            # Evaluate with image files
│   └── live_interference_test.py            # Evaluate with live video
│
├── model/                                   # Model training notebook and outputs
|   ├── runs/                                # YOLO model outputs
│   │   ├── detect/                          # Model predictions
│   └── uno_card_recognition_training.ipynb  # Notebook for model training
│
├── UI/                                      # User interface files
│   ├── logo.jpg                             # Project logo
|   ├── unocards.csv                         # Labels for Uno cards
│   └── unocardrecognition.py                # Main UI script
│              
├── README.md                                # Project documentation
└── .gitignore                               # Files and folders to exclude from Git

Getting Started


Prerequisites

  • Python 3.8 or higher
  • Required Python Libraries:
    • Ultralytics==8.0.0
    • OpenCV==4.7.0
    • Pillow==9.3.0
    • Tkinter (standard library)
    • Imutils==0.5.4

Installation

  1. Clone the repository:
git clone https://github.com/ladyHufflePuff/UNO-Card-Recognition-Software.git
cd UNO-Card-Recognition-Software
  1. Set up a virtual environment
python -m venv venv
source venv/bin/activate   # For Linux/Mac
venv\Scripts\activate      # For Windows
  1. Install required libraries
pip install opencv-python pillow ultralytics tkinter imutils

Usage


Running the UI

Run the script to recognize Uno cards in an image or live feed:

python UI/unocardrecognition.py

Training the Model

To train the YOLOv8 model using your own dataset from Roboflow:

  1. Create a Roboflow project, upload your images, and annotate them with bounding boxes.
  2. Export the dataset in YOLOv8 format and use the provided .env file to set your API key.
  3. Open uno_card_recognition_training.ipynb in Jupyter Notebook or JupyterLab and follow the step-by-step instructions to train your model.
  4. Save the trained model weights and use them with the evaluation scripts or UI.

Disclaimer


This project is intended solely for educational purposes as part of a school project and is not licensed for public or commercial use. The code, scripts, and materials provided are as-is and come without any warranties or guarantees.

The dataset is not included in this repository to respect privacy and intellectual property considerations. However, users can recreate the dataset by following the training instructions provided in the documentation, including leveraging Roboflow to generate a similar custom dataset.

Unauthorized use, modification, or distribution of this code or materials is strictly prohibited without explicit permission from the contributors. By accessing or using the project, you agree to these terms and acknowledge the contributors' intellectual property rights.

Contributors


About

A computer vision-based solution for detecting and recognizing Uno cards using a custom-trained YOLOv8 model, including a user-friendly interface and evaluation tools.

Topics

Resources

Stars

Watchers

Forks

Contributors