CineMood AI — Emotion-Based Movie Recommendation System with DeepFace Facial Recognition
Back to ProjectBefore you begin, ensure you have the following installed on your system:
Open your terminal or command prompt and run the following commands:
Command:
git clone https://github.com/yourusername/cinemood.git
cd cinemood
This will download the complete project source code to your local machine and navigate into the project directory.
It's recommended to create a virtual environment to isolate project dependencies:
Command:
python -m venv venv
For Windows:
venv\Scripts\activate
For macOS / Linux:
source venv/bin/activate
You should see (venv) prefix in your terminal indicating the virtual environment is active.
Install all required Python packages using pip:
Command:
pip install django deepface opencv-python numpy tf-keras
⚠️ Important Note: DeepFace will automatically download model weights (approximately 600MB) on first run. Ensure you have a stable internet connection.
Alternative: If a requirements.txt file is provided, you can use:
pip install -r requirements.txt
Set up the SQLite database by running Django migrations:
Command:
python manage.py migrate
This creates all necessary database tables for the application.
Launch the Django development server:
Command:
python manage.py runserver
You should see output indicating the server is running, typically at:
Starting development server at http://127.0.0.1:8000/
Navigate to the following URL in your web browser:
http://127.0.0.1:8000/
You should now see the CineMood home page with the animated starfield background.
When you navigate to the Camera page for the first time:
💡 Tip: Ensure good lighting on your face for accurate emotion detection.
pip install -r requirements.txtpip install --upgrade pip~/.deepface/weights/pip cache purgedb.sqlite3 filepython manage.py migrate againUnderstanding the project folder structure:
cinemood/
├── manage.py # Django management script
├── db.sqlite3 # SQLite database file
├── requirements.txt # Python dependencies
├── README.md # Project documentation
│
├── emotion/ # Main Django application
│ ├── views.py # Core emotion analysis logic
│ ├── urls.py # URL routing for emotion app
│ ├── apps.py # App configuration
│ ├── models.py # Database models
│ └── haarcascade_frontalface_default.xml # Face detection model
│
├── emotion_is_everything/ # Django project settings
│ ├── settings.py # Project configuration
│ ├── urls.py # Main URL configuration
│ ├── wsgi.py # WSGI application
│ └── asgi.py # ASGI application
│
└── templates/ # HTML template files
├── home.html # Landing page
├── cam.html # Camera/emotion scanner page
├── moviesList.html # Movie recommendations page
├── about.html # About page
└── contact.html # Contact page
| Method | URL | Description |
|---|---|---|
| GET | / | Home page |
| GET | /cam/ | Emotion scanner page |
| POST | /analyze_frame/ | Accepts base64 image, returns emotion data |
| GET | /movieslist/<emotion> | Movie recommendations for given emotion |
| GET | /about/ | About page |
| GET | /contact/ | Contact page |
{
"image": "data:image/jpeg;base64,/9j/4AAQ..."
}
{
"emotion": "happy",
"all_emotions": {
"angry": 2.1,
"disgust": 0.3,
"fear": 1.2,
"happy": 87.4,
"neutral": 6.8,
"sad": 1.5,
"surprise": 0.7
}
}
Confirm successful installation by checking the following:
If you encounter any issues during installation:
Optional Add-ons Available:
Our team is here to assist you with installation and setup.