This project implements a chess piece detection system using YOLOv8 object detection model. It processes video input of chess games, identifies the pieces on the board, and outputs a video with bounding boxes and labels for each detected piece.
- Real-time chess piece detection in video streams
- Utilizes YOLOv8 for accurate object detection
- Draws bounding boxes and labels on detected chess pieces
- Outputs processed video with visual annotations
- Python 3.7+
- OpenCV
- Ultralytics YOLOv8
- Stockfish (for potential future integration with chess engines)
- Clone this repository:
git clone https://github.com/diaz3z/ChessSense-AI.git
cd ChessSense-AI- Install the required packages:
pip install opencv-python ultralytics stockfish- Download the trained YOLOv8 model weights and place them in the
runs/detect/train6/weights/directory.
-
Place your input chess game video in the
Video/directory. -
Run the script:
python save.py-
The processed video will be saved as
output_video.mp4in the project directory. -
Or to run locally Run this script:
python chessboard+chesspieces localize.pySample.Video.mp4
- The script loads a pre-trained YOLOv8 model for chess piece detection.
- It processes the input video frame by frame.
- For each frame, it detects chess pieces and their positions.
- Bounding boxes and labels are drawn on the detected pieces.
- The processed frames are compiled into an output video.
- Integration with a chess engine for move analysis
- Real-time board state tracking
- Support for live video input from cameras
- Web interface for easy usage
Contributions to improve the project are welcome. Please feel free to fork the repository and submit pull requests.




