The AI Emotion-Based Poem Generator is a creative project that combines computer vision and natural language processing (NLP) to capture emotions in real-time webcam images and generate poems based on the detected emotions. It leverages machine learning models and streamlines the process of transforming visual cues into artistic expressions.
-
Real-time Emotion Detection: The application uses a deep learning model to analyze facial expressions in real-time webcam frames, accurately detecting emotions such as happiness, sadness, anger, surprise, and more.
-
Emotion-to-Poem Generation: Based on the detected emotion, the application generates creative poems that capture the emotional essence of the moment. Each poem is unique and crafted to resonate with the user's emotional state.
-
Streamlit User Interface: The user-friendly Streamlit interface makes it easy for users to interact with the application, providing a seamless experience for capturing images, analyzing emotions, and reading generated poems.
-
Docker and Kubernetes Deployment: The project includes Docker and Kubernetes configurations for containerization and easy deployment, enabling users to run the application locally or on a Kubernetes cluster.
Before running the AI Emotion-Based Poem Generator, ensure you have the following prerequisites installed:
- Docker for containerization.
- Kubernetes cluster if deploying on Kubernetes.
-
Docker Setup (Local Deployment):
-
Clone this repository to your local machine:
git clone https://github.com/your-username/your-repo.git cd your-repo
-
Build the Docker image:
docker build -t streamlit_app .
-
Run the Docker container:
docker run -p 80:80 streamlit_app
-
Open your web browser and access the Streamlit app at http://localhost:80.
-
-
Kubernetes Deployment (Cluster Deployment):
-
Apply the Kubernetes Deployment configuration:
kubectl apply -f streamlit-deployment.yaml
-
Apply the Kubernetes Service configuration to expose the app:
kubectl apply -f streamlit-service.yaml
-
If using a cloud provider like GKE, wait for the external IP to be assigned to your service:
kubectl get svc streamlit-service
-
Access the Streamlit app through a web browser by navigating to the external IP or the cluster's NodePort (if using NodePort type).
-
The project is organized as follows:
your_streamlit_app.py
: The Streamlit application script that captures webcam images, detects emotions, and generates poems.streamlit-deployment.yaml
: Kubernetes Deployment configuration for deploying the application.streamlit-service.yaml
: Kubernetes Service configuration for exposing the application.Dockerfile
: Configuration for building the Docker image.
To clean up resources:
-
For Kubernetes, use the following commands:
kubectl delete deployment streamlit-app kubectl delete service streamlit-service
-
For Docker, stop and remove the Docker container:
docker stop <container-id-or-name>
This project is licensed under the MIT License - see the LICENSE.md file for details.
- Special thanks to [contributors or libraries you've used].
Feel free to customize this project description and README to match your specific project details, including authorship, acknowledgments, and any additional instructions or information you want to provide to users and developers.