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
.
Install
To install and run the project, follow these steps.
- Clone the project from the repository:
git clone https://github.com/vo-vuong/playing_cards_detection-faster_rcnn.git
- Navigate to the project directory:
cd playing_cards_detection-faster_rcnn
- Create a virtual environment:
python -m venv .venv
source .venv/bin/activate # For Linux/Mac
.venv\Scripts\activate # For Windows
- 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
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