This project aims to provide a simple yet effective solution for rookie Texas Hold'em players to improve their understanding of pre-flop win rates. The system includes an ESP32-based device with computer vision capabilities for card detection, a Monte Carlo algorithm for win rate calculation, and a 2-player live broadcasting real-time win rate webpage. The computer vision component is built upon the Poker Cards Computer Vision Project by Roboflow, utilizing the YOLOv5 object detection model.
-
Card Detection using YOLOv5: Leverage the pre-trained YOLOv5 model to detect and recognize poker cards from images or live video feed.
-
Monte Carlo Win Rate Calculation: Utilize a multiprocess-enabled Monte Carlo algorithm to quickly and accurately calculate pre-flop win rates based on the detected cards.
-
ESP32-based Device: The solution is implemented on an ESP32 microcontroller, providing a compact and easily deployable device for poker training.
-
2-Player Live Broadcasting Webpage: Create a real-time web interface to display the pre-flop win rates of two players, enhancing the training experience.
-
ESP32 Board: Use an ESP32 development board as the core hardware for the AIoT solution.
-
Camera Module: Connect a compatible camera module to the ESP32 for capturing live video feed or images.
git clone https://github.com/jotpalch/AIoT-Texas-hold-em-Smart-Table.git
cd AIoT-Texas-hold-em-Smart-Table
cd yolov5
pip install -r requirements.txt
Follow the YOLOv5 instructions to set up the environment and download the pre-trained model.
cd ../Flask
pip install -r requirements.txt
Replace Line notify token with your own token in the main.py
python main.py
Visit http://localhost:38999 in your browser to access the web interface.
To get started, pull the latest Docker image for the AIoT Texas Hold'em Smart Table application:
docker pull ghcr.io/jotpalch/aiot-texas-hold-em-smart-table:latest
docker run --rm -d -p 38999:38999/tcp aiot-texas-hold-em-smart-table:latest
-
Flash the ESP32 with the provided firmware in the folder /ESP32S3 and replace the API with your domain and change the wifi infomation in the file main.ino.
-
Connect the ESP32 to the camera module.
-
Access the live broadcasting webpage to monitor the real-time pre-flop win rates.
- Poker Cards Computer Vision Project by Roboflow - Link
- YOLOv5 by Ultralytics - Link
- Vector-playing-cards - Link
We have implemented a multi-process approach to accelerate the Monte Carlo algorithm for calculating hand win rates. In the case of 200,000 simulations, we achieved a 72% reduction in computation time, decreasing from the original single-process time of 6.87 seconds to 1.90 seconds.
- Single Process: 6.87 seconds
- Multi-Process: 1.90 seconds (72% reduction)
This project is licensed under the MIT License - see the LICENSE file for details.