✨ About the Project

💡 Inspiration

We were inspired by the idea that visual self-awareness can spark real, lasting transformation. In an age where fitness apps bombard users with numbers, we wanted to build something that felt personal, empowering, and smart. What if you could simply upload a photo and receive a personalized plan based on your current body type?

That’s how LeanLens was born — an AI-powered body fat analyzer and fitness coach that understands your starting point and helps you get to your goal, with no guesswork.


🧠 What It Does

LeanLens uses Azure AI to:

  1. 📸 Analyze a user’s full-body photo using Azure Computer Vision
  2. 🧠 Estimate body fat % using GPT based on detected image tags
  3. 🎯 Ask for a target fat % and goal physique
  4. ✍️ Generate a full fitness plan via GPT-4 — including:
    • Weekly fat loss goals
    • Workout plan (with rest days)
    • Diet and macro recommendations
    • Timeline and motivational advice

All in seconds, through a modern, intuitive interface.


🛠️ How We Built It

  • Frontend: HTML/CSS + JavaScript (Vanilla)
    • Styled with custom CSS
    • Built-in loading states and GPT-style typing animations
  • Backend: Python + Flask
    • Receives image and goal inputs
    • Calls Azure Computer Vision to extract tags from the uploaded image
    • Sends image tags to Azure OpenAI GPT-4, asking it to estimate body fat
    • Then asks GPT to create a fitness plan based on that estimate
  • Azure AI Services Used:
    • Azure Computer Vision
    • Azure OpenAI (GPT-4 deployment)

🧩 Challenges We Ran Into

  • Vision tags were too generic — “man”, “person”, “window” weren’t useful, so we had to get creative. We used GPT itself to interpret those tags and estimate body fat based on context.
  • CORS and frontend-backend integration took careful debugging to allow image upload and async responses from Flask.
  • GPT needed a very clear prompt to output clean HTML for the frontend.
  • Dealing with deployment naming issues in Azure OpenAI (404 errors!) required careful setup and endpoint matching.

🎓 What We Learned

  • How to combine Vision + GPT reasoning to interpret images in a more human way
  • The power of prompting GPT not just for answers, but for structured formatting and dynamic logic
  • That even a simple input like a photo can spark deep personalization when AI is used correctly
  • UX matters — and small touches like typing animations and spinners go a long way

🚀 What’s Next

  • Build a GPT Vision model to directly analyze photos more accurately
  • Add body progress tracking and calendar plans
  • Integrate wearable data (steps, heart rate, etc.)
  • Export plan to PDF, or sync to mobile devices
Share this project:

Updates