Inspiration

One of our team members often struggles to manage her hair, especially in hot, humid weather that makes it curl. She also spends a lot of time looking for haircuts suited to her hair type and local climate, as well as products that meet her needs. Her experience inspired us to build a tool that helps people make more informed hair-care choices.

Haircuts are also the least reversible beauty decision. Makeup washes off and clothes can be returned, but hair grows only about 1.25 cm a month. A salon photo shows the cut on its best day, not on a humid Tuesday or three months later, and showing a stylist a photo of someone else's hair rarely works.

What it does

HairCam answers "will I actually like living with this cut?" before you sit in the chair.

HairCam is a virtual hairstylist you chat with on Telegram (@HairCamBot). Like a good stylist, it asks what you're after, asks for a photo, where you live and how you live (work, sports, how many minutes you'll spend on your hair each morning), then shows you options and iterates with you: "shorter", "what about bangs?", "how will it look on a humid day?". The same features are also available as a web app.

  1. Reads your hair. Send or take a selfie (and optionally two 45° side shots). YouCam's AI detects your face shape, hair length, density, hair type (straight to coily) and frizziness. The stylist coaches you on framing (the web app shows an oval guide), and relays plain-language tips if a photo can't be read.
  2. Checks your climate. Share your location (or name a city) and HairCam pulls the coming week's humidity and dew point to estimate your frizz risk.
  3. Recommends styles with reasons. It ranks hairstyles by face shape, how well they work with your natural texture, humidity, density, how much daily styling you'll accept, and whether you do sports. Every style lists its pros and cons, including how many months it would take to grow back what gets cut off, and whether it needs extensions or a wig.
  4. Lets you live with it before you commit:
    • Try it on your own photo, or send a photo of a look you like and see that hairstyle on you.
    • Fine-tune it: add bangs or try a new hair color on top of the cut.
    • A typical day in your city: adds the volume and curl your local humidity would cause to the try-on.
    • Grow-out: shows the cut at successively longer stages.
    • See it move: a short video of you wearing the cut, in a Calm head turn (to see the sides), Lively, Windy day or Workout motion. It takes a few minutes, so the bot keeps chatting and sends the video when it's ready.
  5. Connects you to the purchase. Finds local stylists who are good with your hair type and the chosen style, and suggests shampoo, conditioner and styling products for your hair, climate and new look.

How we built it

  • YouCam API (13 endpoints). Detection: AI Face Analyzer, Hair Type, Hair Length, Hair Frizziness and Hair Density Detection. Generation: AI Hairstyle Generator (templates, and v2.1 transfer from a reference photo), Hair Color, Hair Bang Generator, Hair Volume, Wavy Hair, Hair Extension, and AI Image to Video Generator V2.
  • Agentic stylist. An LLM (OpenAI gpt-5.4-mini) with tool calling runs the consultation. Its 14 tools wrap the YouCam pipeline (analyze, recommend, try on, recolor, bangs, humid day, grow-out, video), the climate lookup, stylist and product search, and quick-reply buttons. It decides what to ask next and which tool to call, and explains results in plain words.
  • Telegram bot. Long polling (no public webhook needed), one saved session per chat, quick-reply and share-location buttons, photo albums, and background video delivery.
  • Chained effects. Every result is stored like an uploaded photo, so the humid-day, grow-out and video steps run on the try-on result rather than the original selfie.
  • Recommender. A rule-based engine that encodes stylist knowledge about each YouCam hairstyle template (length, texture, upkeep, humidity tolerance, which face shapes it flatters), scored against the detected profile.
  • Local context. Open-Meteo for the 7-day humidity and dew point forecast (from a city name or a shared location); Tavily web search for local stylists and products.
  • Stack. Node.js and Express server (keeps API keys off the client) hosting both the bot and a plain HTML/CSS/JavaScript web app with in-browser camera capture; deployed on Render.
  • Unit budgeting and reliability. Every YouCam call is cached on disk by photo and parameters, so each result is paid for once and demos replay for free. Network calls retry brief failures, but a call that starts a paid task is never sent twice.
  • Demo video. A small Python + ffmpeg script renders the demo from a JSON edit list (segments, captions, speed-ups).
  • Built with Claude Code as a pair programmer.

Challenges we ran into

  • Male and female hairstyles. Our team includes a husband and wife, so we tested with both. YouCam's hairstyle templates are split into male and female sets, and we first chose the set from the detected gender. When face analysis couldn't read a photo, the female set (twice as large) crowded out every suggestion. We now let users choose Masculine, Feminine or All. That works reliably, and it's their choice to make.
  • Photo capture, not just upload. Customers often don't have a suitable photo ready, and the AI needs a specific framing (face filling 50–80% of the width, near-frontal, hairline visible). We added in-browser camera capture with a face-sized oval guide and per-angle instructions.
  • Multi-angle detection. Hair type and frizziness are designed for three photos (left 45°, front, right 45°). Our shortcut of sending one selfie three times failed the angle check, so the side shots became optional extras that unlock those two detectors.
  • Video realism. Our first image-to-video prompt mentioned a breeze, and the hair whipped around until the hairstyle no longer matched the try-on. We tuned the prompts per motion style so the cut stays recognizable.
  • Slow video generation. A 5-second video took about 7.5 minutes. The web app runs it as a background job with a visible timer; in the chat it's natural: the bot says the video is coming and sends it when ready.
  • From forms to conversation. Our first version was a website with fixed steps. Hair decisions are iterative and personal, so we rebuilt the experience as a chat with an AI stylist that asks follow-up questions, while keeping the website as a second front end on the same pipeline.
  • Flaky networks during the demo. One connection timeout to the LLM broke a conversation. We added retries everywhere, carefully: retrying a call that starts a paid YouCam task could double-charge, so those are retried only when the connection never opened.

Accomplishments that we're proud of

  • A complete flow from photo to analysis, recommendations, try-on, real-life previews, stylists and products, as a working Telegram stylist and a web app.
  • A stylist that holds a real consultation: it asks one question at a time, adapts to answers, and chains 13 YouCam endpoints on the customer's behalf.
  • Recommendations that explain themselves, including a "months to grow back" cost for every cut.
  • Previews of the cut after the salon: in local humidity, as it grows out, and in motion.
  • A careful unit budget: caching, deduplicated in-flight calls, and remembering photo-quality errors so a bad photo isn't paid for twice.

What we learned

  • Detectors have strict photo requirements, so capture guidance matters as much as the model. A good oval guide prevents most errors.
  • Dew point predicts frizz better than relative humidity alone.
  • Image-to-video models follow motion words very literally; a single word like "breeze" can change the whole result.
  • Chaining generative effects (try-on, then humidity, then motion) creates previews no single API call provides.
  • A website isn't really the best medium for a virtual hair assistant, so we later switched to a chatbot, which works much more naturally for iterative conversations.

What's next for HairCam

  • A shareable stylist handoff card: your face wearing the chosen cut, your hair profile and notes for the stylist.
  • Real booking and checkout integrations with salons and product retailers (wigs, extensions and care products).
  • WhatsApp and LINE versions of the stylist, which plug into the same agent.
  • Voice messages, and remembering a customer between visits to track how their hair and preferences change.
  • Tracking hair density over time for people experiencing hair loss.

Built With

Share this project:

Updates

Submission history