A reinforcement learning environment for automating and training agents to play Pong using screen capture and keyboard control.
- Uses OpenAI Gymnasium interface for RL compatibility.
- Captures game frames using
mssand processes them withcv2. - Controls the game via
pyautoguifor mouse and keyboard automation. - Detects game end state using OCR (
pytesseract) on winner/loser text. - Includes helper functions for mouse position and image display.
- Python 3.10.13 (use a virtual environment)
mssopencv-pythonpyautoguinumpypytesseractmatplotlibgymnasiumstable-baselines3
Install dependencies:
pip install mss opencv-python pyautogui numpy pytesseract matplotlib gymnasium stable-baselines3