The Playing Cards Detection project using YOLOv5 is a system for identifying and classifying playing cards using the YOLOv5n model.
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-Yolo.git
- Navigate to the project directory:
cd Playing_Cards_Detection-Yolo
- Create a virtual environment:
python -m venv .venv
source .venv/bin/activate # For Linux/Mac
.venv\Scripts\activate # For Windows
- Install submodule Yolov5:
git submodule init
git submodule update
- Install the dependencies:
pip install -r yolov5/requirements.txt
- Download the weight file at best.pt and move it to the root folder.
Inference
Run inferences on various sources and the results will be saved at yolov5/runs/detect
.
python yolov5/detect.py --weights best.pt --hide-conf --source 0 # webcam
img.jpg # image
vid.mp4 # video
screen # screenshot
path/ # directory
list.txt # list of images
list.streams # list of streams
'path/*.jpg' # glob
'https://youtu.be/Zgi9g1ksQHc' # YouTube
'rtsp://example.com/media.mp4' # RTSP, RTMP, HTTP stream