Blackjack Copilot recommends a next action(e.g. hit, stand) which has the highest winning rate, that is, optimal for a player.
first do
git clone https://github.com/HOchacha/Blackjack-copilot
then install the dependency
pip install ultralytics opency-python numpy torch PyQt5
Run
python3 ./app/util/main.app.py
It gets the card game board image as input, and gives an optimal action as output. Getting a video as input is of course possible since a video is composed of a plenty of continous image frames.
- Train a YOLOv8 object detection model
- Cluster cards for a dealer and players
- Implement a lookup table of optimal actions
- Recommend action in the case that player has more than two cards
- Make Blackjack Copilot work for video, webcam or stream
Object detection is based on YOLOv8s model.
It is trained for 13 epochs(10 epochs are pretrained by PD-Mera).
The training dataset has 10100 original images (except augmented).