Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

The cards-object-detection repository on GitHub is a project that utilizes OpenCV with Python to create a visual detection system for card games. It's designed to capture and process data in real time during a card game, leveraging OpenCV's powerful image-processing capabilities to identify cards.

License

Notifications You must be signed in to change notification settings

MacMat01/cards-object-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cards Object Detection

CodeQL

This project aims to detect strategic fruits cards using YOLOv8. It is implemented in Python and uses several libraries for data processing and model training.

Project Structure

The project has the following structure:

  • src/main/python/model_training/cards-object-detection-dataset/: Contains the dataset used for training the model.
  • environment.yml: Contains the conda environment configuration.

Getting Started

Prerequisites

Ensure you have the following installed on your system:

Installation

  1. Clone the repository:
git clone https://github.com/MacMat01/cards-object-detection.git
  1. Navigate to the project directory:
cd strategic-fruits-card-detection
  1. Create a new conda environment from the environment.yml file:
conda env create --name cards-object-detection -f environment.yml
  1. Activate the conda environment:
conda activate cards-object-detection
  1. Install the build and pip tools:
pip install --upgrade build pip
  1. Build a source distribution (sdist) and a binary distribution (wheel) of your package:
python -m build
  1. Install the package from the wheel file:
pip install --user dist/*.whl # If it doesn't work, change </*.whl> to the name of the wheel file generated in step 6
  1. (OPTIONAL) If gpu isn't working for model training, install pytorch-cuda manually (remember to restart pc, it often works):
conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia

Running the Application

For Using the Main Application

To run the main application, navigate to the src/main/python/app directory and run the app.py script:

cd src/main/python/app

For the Real Time application, run the following command:

python real_time_app.py

For the On Demand application, run the following command:

python on_demand_app.py

For Using the Data Extraction Application

If you want to use the data extraction application with the cards object detection, please switch to the data-extraction/main branch:

git checkout data-extraction/main

Then, follow the instructions in the README.md file in the data-extraction/main branch.

For Creating Your Own Card Detection

Follow the instruction in the following Jupyter notebooks:

  1. Cards Extraction.ipynb
  2. Dataset Creation.ipynb
  3. Cards Object Detection - YOLOv8.ipynb

Ensure you have Jupyter installed in your environment, and start it with:

jupyter notebook

Navigate to the notebooks directory and open the respective notebook.

License

This project is licensed under the MIT License—see the LICENSE file for details.

About

The cards-object-detection repository on GitHub is a project that utilizes OpenCV with Python to create a visual detection system for card games. It's designed to capture and process data in real time during a card game, leveraging OpenCV's powerful image-processing capabilities to identify cards.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •