Skip to content

Latest commit

 

History

History
98 lines (59 loc) · 4.19 KB

README.md

File metadata and controls

98 lines (59 loc) · 4.19 KB

AIoT-Texas-hold-em-Smart-Table

Google Slide Link (zh-tw)

Overview

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.

Features

  1. Card Detection using YOLOv5: Leverage the pre-trained YOLOv5 model to detect and recognize poker cards from images or live video feed.

  2. 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.

  3. ESP32-based Device: The solution is implemented on an ESP32 microcontroller, providing a compact and easily deployable device for poker training.

  4. 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.

Hardware Setup

  1. ESP32 Board: Use an ESP32 development board as the core hardware for the AIoT solution.

  2. Camera Module: Connect a compatible camera module to the ESP32 for capturing live video feed or images.

Setup Instructions

1. Clone the Repository

git clone https://github.com/jotpalch/AIoT-Texas-hold-em-Smart-Table.git
cd AIoT-Texas-hold-em-Smart-Table

2. YOLOv5 Integration

cd yolov5
pip install -r requirements.txt

Follow the YOLOv5 instructions to set up the environment and download the pre-trained model.

3. Flask Server Setup

cd ../Flask
pip install -r requirements.txt

Replace Line notify token with your own token in the main.py

4. Run the Application

python main.py

Visit http://localhost:38999 in your browser to access the web interface.

Running the Application with Docker

Pull the Docker Image

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 

Usage

  1. 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.

  2. Connect the ESP32 to the camera module.

  3. Access the live broadcasting webpage to monitor the real-time pre-flop win rates.

Acknowledgments

  • Poker Cards Computer Vision Project by Roboflow - Link
  • YOLOv5 by Ultralytics - Link
  • Vector-playing-cards - Link

Performance Enhancement

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)

Performance Enhancement

License

This project is licensed under the MIT License - see the LICENSE file for details.