This project demonstrates how to create an AI agent to play the Chrome Dino game using OpenAI's Gym environment and Stable-Baselines3. The AI model is trained using Deep Q-Learning (DQN) with the goal of maximizing the score by jumping over obstacles.
To get started, clone the repository and install the required dependencies. Ensure you have the correct versions of Python and pip installed.
The project requires various dependencies including PyTorch, Stable-Baselines3, MSS, PyDirectInput, and PyTesseract. Make sure to install all necessary packages before proceeding.
Set up a custom Gym environment for the Chrome Dino game. This environment will handle the game's screen capture, action space, and observation space.
Once the environment is created, test it by running a few episodes to ensure it functions correctly.
Implement a callback function to monitor and save the model during training. This ensures that the best-performing models are stored for later use.
Initialize and train the DQN model using the environment. The model will be trained to maximize the score by learning the best actions to take in different situations.
After training, test the model by running it in the environment for several episodes. Observe its performance and track the total rewards.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License.
