This is an AI-powered Rock Paper Scissors game created with Python and Django. The AI predicts your next move based on previous moves and adjusts its and adjusts its strategy. The project includes machine learning to improve predictions over time.
- Turn on the camera and the play button will appear.
- When you click the play button, a countdown will appear.
- When the countdown reaches 0, a picture will be taken and the AI will recognize the gesture you are making with your hand.
- At the same time the picture is taken (it is not stored) the AI will make its move.
- The first to reach 5 points wins the game.
- Rock beats Scissors
- Scissors beats Paper
- Paper beats Rock
- If both make the same move, a tie occurs.
- If a misreading is reported, the point will be subtracted from whoever beat that move.
- Python: Main language.
- Django: Web framework.
- TensorFlow/Keras: For the AI gesture recognition model.
- Pandas: To manage the game data.
- NumPy: For image preprocessing.
- OpenCV and PIL: For image processing.
- HTML/CSS/JS: Front-end development for the user interface.
A TensorFlow model was trained to recognize hand gestures (Rock, Paper, Scissors). The AI that recognizes the gestures has an accuracy of 78.23%. The AI analyzes previous moves using predictive algorithms to anticipate your next move. Data from each game is recorded in a .csv file and used for continuous training. The front-end dynamically updates the scores and displays the winner with a pop-up.
It is recommended not to have too much visual noise in the background as it may affect the accuracy of the AI.
-
Clone this repository:
git clone -
Navigate to the project directory:
cd game -
Create and activate a virtual environment:
Windows: python -m venv venv Mac/Linux: python3 -m venv venv Windows: venv\Scripts\activate Max/Linux: source venv/bin/activate -
Install dependencies:
Windows: pip install -r requirements.txt Linux/Mac: pip install -r requirements.txt -
Run the Django server:
python manage.py runserver
Now open http://127.0.0.1:8000 in your browser to play the game. Good luck 🍀🤖
Feel free to contribute to this project! Create a pull request with your proposed changes or improvements.😊💕
Este es un juego de Piedra, Papel o Tijera potenciado por inteligencia artificial, creado con Python y Django. La IA predice tu próximo movimiento basándose en jugadas anteriores y ajusta su estrategia. El proyecto incluye aprendizaje automático para mejorar las predicciones con el tiempo.
- Conecta la camara y aparecera el boton de jugar.
- Cuando hagas click en el boton de jugar, aparecera una cuenta atrás.
- Cuando la cuenta llegue a 0, se hara una foto y la IA reconocera el gesto que estas haciendo con la mano
- Al mismo tiempo que se hace la foto (no se almacena) la IA hará su jugada.
- El primero en llegar a 5 puntos gana la partida.
- Piedra vence a Tijera
- Tijera vence a Papel
- Papel vence a Piedra
- Si ambos hacen el mismo movimiento, ocurre un empate.
- En caso de reportar una mala lectura, se le restará el punto a quien haya vencido esa jugada.
- Python: Lenguaje principal.
- Django: Framework web.
- TensorFlow/Keras: Para el modelo de reconocimiento de gestos de la IA.
- Pandas: Para manejar los datos del juego.
- NumPy: Para preprocesar imágenes.
- OpenCV y PIL: Para procesar imágenes.
- HTML/CSS/JS: Desarrollo del front-end para la interfaz de usuario.
Se entrenó un modelo de TensorFlow para reconocer gestos de mano (Piedra, Papel, Tijera). La IA que reconoce los gestos tiene una precisión del 78.23%. La IA analiza jugadas anteriores utilizando algoritmos de predicción para anticipar tu próxima jugada. Los datos de cada partida se registran en un archivo .csv y se usan para entrenamiento continuo. El front-end actualiza dinámicamente los puntajes y muestra al ganador con un pop-up.
Se recomienda no tener mucho ruido visual de fondo ya que puede afectar a la precisión de la IA.
-
Clona este repositorio:
git clone -
Navega al directorio del proyecto:
cd juego -
Crea y activa un entorno virtual:
Windows: python -m venv venv Mac/Linux: python3 -m venv venv Windows: venv\Scripts\activate Max/Linux: source venv/bin/activate -
Instale las dependencias:
Windows: pip install -r requirements.txt Linux/Mac: pip install -r requirements.txt -
Ejecuta el servidor Django:
python manage.py runserver
Ahora abre http://127.0.0.1:8000 en tu navegador para jugar al juego. Buena suerte 🍀🤖
¡Siéntase libre de contribuir a este proyecto! Cree un pull request con los cambios o mejoras que propone.😊💕
