Skip to content

Repository files navigation

🎬✨ Movie Recommendation System

A Modern Content-Based Recommender App Built with Streamlit + TMDB API



🚀 Overview

This Movie Recommendation System uses content-based filtering to recommend similar movies based on metadata and cosine similarity. It integrates with the TMDB API to fetch high-quality posters, providing a clean and modern UI built using Streamlit.

The project is lightweight, fast, and ready for deployment.


🌟 Key Features

Content-based filtering using cosine similarity 🎞️ Real-time posters fetched via TMDB API ⚡ Optimized response time using Session-based requests 🎨 Sleek Streamlit UI with responsive layout 📦 Pickle-based model loading (lightweight & quick) 🔍 Accurate recommendations from metadata vectors


🧰 Tech Stack

Component Technology
Frontend/UI Streamlit
Backend Logic Python
Data Handling Pandas, Pickle
API TMDB (The Movie Database)
Similarity Model Cosine Similarity

📂 Project Structure

Movie-Recommendation/
│── app.py
│── movie_list.pkl
│── similarity.pkl
│── requirements.txt
│── README.md

⚙️ Installation & Setup

1️⃣ Clone the repository

git clone https://github.com/Asphane/Movie-Recommendation.git
cd Movie-Recommendation

2️⃣ Create a virtual environment

python3 -m venv venv
source venv/bin/activate      # Mac/Linux
venv\Scripts\activate         # Windows

3️⃣ Install required dependencies

pip install -r requirements.txt

4️⃣ Add TMDB API Token

Inside app.py, replace:

"Authorization": "Bearer YOUR_TOKEN_HERE"

with your actual TMDB Read Access Token (v4).


▶️ Run the Application

streamlit run app.py

App runs at: 👉 http://localhost:8501


🧠 How It Works

🔹 Step 1 — Load Metadata

Reads movie_list.pkl which contains movie vectors & metadata.

🔹 Step 2 — Load Similarity Matrix

Loads pre-computed cosine similarity from similarity.pkl.

🔹 Step 3 — Recommend Movies

Finds top N most similar movies based on the selected movie.

🔹 Step 4 — Fetch Posters

Uses TMDB API to fetch high-resolution posters.

🔹 Step 5 — Display in Streamlit

Renders posters and titles in a clean grid layout.


🌄 Screenshots

(Add your screenshot images here) Example:

<p align="center">
  <img src="assets/app_preview.png" width="80%">
</p>

🔧 Troubleshooting

Poster not loading

  • Invalid or expired TMDB token
  • Missing "Bearer " prefix
  • API rate limit possibly hit

Git not detecting repo

git init
git remote add origin https://github.com/Asphane/Movie-Recommendation.git

🤝 Contributing

Contributions are welcome! You can help improve:

  • UI Design
  • Advanced recommendation algorithms
  • Model training
  • Deployments (Streamlit Cloud / Render / HuggingFace Spaces)

Feel free to submit a pull request.


📜 License

Licensed under the MIT License.


Support the Project

If this project helped you, please ⭐ the repo! It motivates me to build more cool ML apps.


About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages