Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Ai-Powered Personal Stylish and Outfit Recommendation

1. User Profile and Preferences

β€’ Profile Creation: Allow users to create a profile with their: β—¦ Gender, age, body type, height, and weight. β—¦ Preferred colors, fabrics, and styles. β—¦ Occasion types (casual, formal, party, business). β€’ Style Quiz: Short quiz to identify fashion preferences. β€’ Wardrobe Input: Users can upload their wardrobe items (images or descriptions).

2. Outfit Recommendations

β€’ AI-Powered Recommendations: β—¦ Use machine learning to suggest outfits based on user preferences and the occasion. β—¦ Recommend outfits for specific weather conditions, location, or season. β—¦ Suggest complementary accessories (shoes, bags, jewelry). β€’ Mix & Match Suggestions: Combine existing wardrobe items with new recommendations.

3. Outfit Preview

β€’ Virtual Try-On: β—¦ Implemented using OOTDiffusion for realistic virtual try-ons. β—¦ Users upload a photo and visualize outfits on themselves. β€’ Outfit Visuals: Display styled outfits with options to swap or change elements.

4. Advanced Features

β€’ Weather-Based Suggestions: Recommend outfits based on local weather forecasts. β€’ Event-Specific Outfits: Tailor recommendations for events like weddings, parties, or work meetings. β€’ Trend Analysis: Highlight trending outfits, colors, and styles.

5. AI and ML Implementation

β€’ Clothing Style Recognition: β—¦ Train a model to identify clothing items and styles from uploaded images. β—¦ Use pre-trained models like OpenCV or TensorFlow for image classification. β€’ Personalized Suggestions: β—¦ Use collaborative filtering (like Netflix) to recommend outfits based on user preferences and trends. β—¦ Train models with datasets like Fashion-MNIST or DeepFashion.

6. Recommendations for Existing Wardrobe

β€’ Allow users to upload photos of their clothing. β€’ Suggest outfits by analyzing uploaded wardrobe items and filling in missing pieces.

7. Community and Social Features

β€’ Style Boards: Let users save their favorite looks. β€’ Style Sharing: Share outfits with friends or a community for feedback. β€’ Follow Stylists: Provide curated suggestions from professional stylists.

8. Notifications and Alerts

β€’ Daily style recommendations. β€’ Notifications for weather or events requiring specific outfits. β€’ Alerts for new trends or personalized deals.

9. Technology Stack

β€’ Backend: Python (Flask) β€’ Frontend: HTML, CSS, JavaScript β€’ AI Tools: DeepFace, TensorFlow, Keras, scikit-learn, PyTorch, torchvision, OpenCV, OOTDiffusion. β€’ Database: MySQL for storing user data and wardrobe items

AI-Powered Features:

  1. Gender, Age, and Skin Tone Detection
  2. Skin Tone-Based Outfit Recommendations
  3. Weather-Based Outfit Recommendations
  4. Occasion-Based Outfit Recommendations
  5. Image-Based Outfit Recommendations
  6. Virtual Try-On using OOTDiffusion

Non-AI Features:

  1. Interactive Dashboard
  2. Dynamic Login and Sign-Up Pages
  3. Style Quiz Page to Capture User Preferences
  4. Profile Page Displaying User Information and Recommended Outfits

ScreenShots

Screenshot (106)

SignIn

Screenshot (107)

SignUp

Screenshot (99)

Dashboard 1.

Screenshot (100)

Dashboard 2.

Screenshot (101)

Dashboard 3.

Screenshot (102)

Dashboard 4.

Screenshot (103)

Dashboard 5.

Screenshot (104)

Dashboard 6.

Screenshot (105)

Dashboard 7.

Screenshot (119)

Quiz 1.

Screenshot (120)

Quiz 2.

Screenshot (108)

User about page

Screenshot (110)

Personalized Outfit Based on Skin Tone

Screenshot (113)

Wardrobe Image-Based Recommendation

Screenshot (112)

Weather-Based Outfit Recommendation

Screenshot (114)

Occasion-Based Outfit Suggestions

Screenshot (115)

Trove – Category Selection Page

Screenshot (116)

Trove – Category-Based Product Listing

Screenshot (117) Screenshot (118)

Contact Page – User Query Form

Screenshot (121)

Voice and Text-Based Recommendation Interface

πŸš€ How to Run This Project

  1. Navigate to the project directory:

    cd ai-powered-personal-stylish-and-outfit-recommendation/

  2. Prepare the datasets and models: You have two options: Download the pre-trained models and datasets. Train the models yourself. The following directories contain the necessary components:

    • age_gender-dataset/
    • fashion_recommend/
    • fashion-dataset/
    • image_based/
    • occasion/
    • weather_based/ πŸ“„ Each folder includes a text file with detailed instructions on what files are needed, where to place them, and how to set them up. Please refer to those files for proper configuration.
  3. Install dependencies: Make sure all required packages are installed: pip install -r requirements.txt

  4. Update database configuration: Modify the database credentials in the following files: app/main.py β†’ Line 60 Locate the connection string: mysql://username:password@host:port/fashion

         Replace username, password, host, and port with your actual MySQL credentials.
         
         Do not change the database name (fashion) β€” it will be created automatically by the program.
    
     app/database.py β†’ Line 4
         Update the constructor parameters in the __init__ method:
             def __init__(self, host='localhost', user='your_username', password='your_password', database='fashion'):
    
         Replace 'your_username' and 'your_password' with your actual MySQL username and password.
    
  5. Set up Gemini API (Custom Search) This project uses the Gemini Custom Search API. You'll need two credentials: G_API_KEY: Your Gemini API key G_CX: Your Custom Search Engine ID (CX)

    πŸ“ Where to use them: In app/main.py β†’ Line 40, the API key is accessed like this: API_KEY = os.getenv('G_API_KEY') # Recommended for security

    While you can hardcode the key (e.g., API_KEY = "your_api_key"), using environment variables is strongly recommended for better security.

    βœ… How to set environment variables from the command line:

    On Windows (Command Prompt): set G_API_KEY = "your_actual_api_key" set G_CX = "your_actual_cx_value"

    On macOS/Linux (Bash/Zsh): export G_API_KEY=your_actual_api_key export G_CX=your_actual_cx_value

    These variables will be available during the session and accessed in your code via os.getenv().

  6. Set Up Hugging Face API for Virtual Try-On

    This project uses Hugging Face’s Inference API to generate virtual try-on clothing images.

    πŸ”— https://huggingface.co/settings/tokens

    To avoid failures due to rate limits, you can use multiple API keys (e.g., from different accounts).

    In ai_engine/virtual_try_on.py β†’ Line 10, update the api_tokens list:

     Option 1 (Direct):
         api_tokens = ["your_api_key_1", "your_api_key_2"]
    
     Option 2 (Using environment variables – recommended):
         Set in terminal:
             set HF_ONE_API = "Your API KEY"
             set HF_TWO_API = "Your API KEY"
    
         Update code:
             api_tokens = [os.getenv("HF_ONE_API"), os.getenv("HF_TWO_API")]
         
     One key is enough to start, but multiple keys improve reliability.
    
  7. Set Up Weather API (OpenWeatherMap)

    This project uses the OpenWeatherMap API to detect the current weather based on your location.

    πŸ”— https://home.openweathermap.org/api_keys

    In the file app/main.py, update the following lines: Line 104 Line 127 Replace: OPENWEATHERMAP_API_KEY = "" # Replace with your API key With: OPENWEATHERMAP_API_KEY = "your_api_key"

    This API is used to detect the user's current weather conditions, which helps personalize outfit recommendations.

    βœ… Only one API key is needed.

  8. Run the Project Once all setup steps are complete, start the application by running: python run.py

    The application will start locally and provide two links: A local URL (accessible only from your machine) An external URL (via NGROK, accessible from any device connected to the internet)

    🌐 Make Your App Public with NGROK To allow others to access your app online, you can use NGROK β€” a tunneling service that exposes your local server to the internet.

    πŸ”— Download NGROK https://dashboard.ngrok.com/get-started/setup/windows

    πŸ› οΈ Setup Instructions: 1. Move the downloaded NGROK executable to a convenient location (e.g., C:\ngrok or inside your project directory).

     2. Open NGROK in a terminal (double-click or use command line).
    
     3. Run the following command (replace 5000 with your actual port if different):
         ngrok http 5000 
     4. NGROK will generate a public URL (e.g., https://your-app.ngrok.io).
         Share this link β€” anyone can visit your application from anywhere.
    

    πŸ”’ Optional: Set a Static Domain To keep your NGROK URL unchanged in the future: Visit the "Deploy Your App" section on NGROK's dashboard. Set up a static domain for consistent access.

  9. Stop the Project To terminate the running application, press: Ctrl + C This will stop the server and end the process.

About

A smart fashion web app built with Python (Flask) that recommends personalized outfits based on user profiling and AI analysis. It includes features like real-time virtual try-on with OOTDiffusion, skin tone & demographic detection using DeepFace, and outfit recommendations powered by TensorFlow, Gemini API, and PyTorch.

Topics

Resources

Stars

26 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages