Skip to content

20username11/Fashion_Recommender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Fashion Recommender System

This project is a Fashion Recommender System that recommends visually similar fashion styles based on a user-uploaded image. It leverages a pre-trained ResNet50 model to extract image features and find the most relevant matches from a dataset.

Table of Contents

Features

  • Pre-trained Model: Uses ResNet50 for feature extraction.
  • Efficient Search: Finds the top 5 most similar images using the Nearest Neighbors algorithm.
  • Interactive UI: Provides an easy-to-use Streamlit interface for uploading images and viewing recommendations.

Core Components

app.py

  • Extracts features from dataset images.
  • Saves the precomputed embeddings (embeddings.pkl) and filenames (filenames.pkl).

main.py

  • Implements the Streamlit interface.
  • Loads precomputed embeddings and filenames for efficient recommendations.
  • Provides a recommendation system based on user-uploaded images.

How It Works

  1. Feature Extraction:

    • Images are resized to 224x224 and preprocessed using ResNet50.
    • Extracted features are normalized using L2 norm.
  2. Recommendation:

    • The Nearest Neighbors algorithm (Euclidean distance) identifies the closest matches.
  3. Display:

    • Displays the uploaded image and top 5 similar images in a grid layout.

Setup and Installation

Prerequisites

  • Python 3.8.10
  • A TensorFlow-compatible environment

Steps

  1. Clone the Repository:

    git clone <repository-url>
    cd <repository-folder>
  2. Create a Virtual Environment:

    python -m venv env

    Activate the environment:

    • Windows:
      .\env\Scripts\activate
    • Mac/Linux:
      source env/bin/activate
  3. Install Dependencies:

    pip install -r requirements.txt
  4. Precompute Embeddings (Optional):

    • If embeddings need to be regenerated:
      python app.py
  5. Run the Application:

    streamlit run main.py

Usage

  1. Upload a fashion image using the file uploader in the Streamlit app.
  2. View the uploaded image alongside the top 5 most similar styles from the dataset.

Dependencies

The project dependencies are listed in requirements.txt:

numpy
tensorflow
streamlit
Pillow
scikit-learn
tqdm

Install them with:

pip install -r requirements.txt

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages