Skip to content

vo-vuong/Playing_Cards_Detection-Faster_RCNN

Repository files navigation

Playing Cards Detection using Faster-RCNN

Introduction

The project is an application to detect and classify a deck of 52 playing cards using the Faster R-CNN model.

For each suffix followed by a label: H: Hearts, D: Diamonds, C: Clubs, S: Spades.


demo

Install

To install and run the project, follow these steps.

  1. Clone the project from the repository:
git clone https://github.com/vo-vuong/playing_cards_detection-faster_rcnn.git
  1. Navigate to the project directory:
cd playing_cards_detection-faster_rcnn
  1. Create a virtual environment:
python -m venv .venv
source .venv/bin/activate  # For Linux/Mac
.venv\Scripts\activate  # For Windows
  1. Install the dependencies:
pip install -r requirements.txt
Inference

Run the inference by an image file and the result will be saved at outputs/images/.

python test.py --test_images img.jpg          # image

Project Structure

playing_cards_detection-faster_rcnn/
├── constants
│   ├── config_const.py
│   └── paths_const.py
├── data
├── outputs                             # default path of model prediction
│   └── images
├── test_data
├── trained_models                      # the folder containing pretrain model
├── utils
│   ├── download_model.py
│   └── file_helpers.py
├── dataset_analysis.ipynb              # dataset analysis file
├── dataset.py                          # setup dataset for training
├── README.md
├── requirements.txt
├── test.py                             # main file to run test
└── train.py                            # training file

Additional Resources