Back to Case Studies

Virtual Hairstyle Try-On in a Mobile App

New Cuts and Colours on Your Own Photo

ProductionFashion & BeautyAug 2024 – Feb 2026Computer Vision & Document Intelligence
100k+
Users at peak
15–20 s
Per try-on image
Live
In the App Store and Google Play
2 paths
GAN or diffusion, chosen per edit

My Role

Role
Consulting lead
At Dataforest
Team
Me + 2 ML engineers, in a team of 8
Stage reached
Live in stores, ended early 2026
Key decisions
  • Segment, edit, blend: generation touches only hair
  • GAN editing where enough, diffusion where clearly better
  • Colour as a separate path, no regeneration

Approach at a Glance

Details
  1. 1Segment → Edit → Blend
  2. 2Hair Boundaries
  3. 3GAN Editing vs Diffusion Inpainting
  4. 4Long to Short Hair
  5. 5Colour as a Separate, Cheaper Path
  6. 6Quality and Identity Checks
  7. 7Cost and Latency at Scale
  8. 8Recommendations

Executive Summary

A mobile app where people try a new hairstyle or hair colour on their own photo before going to the salon, and then get style, salon and product recommendations. At its peak, it served more than 100,000 users, with each try-on generated in about 15–20 seconds.

I was the consulting lead on the project at Dataforest. I advised the engineering team, two of my ML engineers among them, on the architecture and on the hardest computer vision problems from August 2024, when I joined, to February 2026. My main decisions:

  • Segment, edit, blend: separate the hair from everything else first, so that generation changes only the hair and never the face or background.
  • The right generator for the job: latent GAN editing where it is fast and good enough, diffusion inpainting where it delivers clearly better quality.
  • Colour as its own path: recolouring without regenerating the hair, which is cheaper and keeps the original texture and shine.
  • Checks before showing a result: quality and identity checks, so users never see a broken image or a face that isn't theirs.

The project ended in early 2026, when new general-purpose image models from OpenAI made much of a custom pipeline like this one unnecessary.


Client Profile

The client built a consumer beauty app for people who want to see a new look before committing to it. A haircut or a colour change is hard to undo, and photos of models with different faces don't show what it would look like on you.

Hair is one of the hardest subjects in image editing:

  • The boundary is never clean. Flyaways, curls and strands falling over the face or the background make a precise mask very difficult.
  • Removing hair is harder than adding it. Going from long to short hair means inventing what was hidden behind it: ears, neck, shoulders and background.
  • The person must stay the same. Any change to the face, skin or expression breaks the illusion immediately.
  • Colour has to look real. Hair has texture, highlights and shine, and flat recolouring looks like a filter.
  • It has to work at consumer scale. At 100,000+ users, every second of GPU time per image is a real cost.

Technical Approach

  1. Segment → Edit → Blend – I advised splitting the pipeline into three independent stages. Hair segmentation and matting produce a precise hair mask with soft edges for flyaways and curls. The edit stage changes only the masked region. The blend stage composites the result back into the original photo. Because generation never touches the rest of the image, the face, the background and the lighting stay exactly as they were.

  2. Hair Boundaries – Matting rather than a hard mask was key to the boundary problem: strands crossing the face or the background get partial transparency instead of a cut-out edge, so the new hairstyle blends in naturally.

  3. GAN Editing vs Diffusion Inpainting – The two families of models have opposite trade-offs. GAN-based latent editing (StyleGAN- and HairCLIP-type approaches) is fast and keeps the person's identity well, but is limited in how far it can change a style. Diffusion inpainting can produce much larger and more realistic changes, at a higher compute cost. I helped the team decide where each one fits, so the more expensive diffusion path is used only where it makes a visible difference.

  4. Long to Short Hair – Shortening hair means reconstructing the areas that the hair used to cover. Diffusion inpainting fills those regions, such as the ears, neck and background, so that a shorter cut looks plausible instead of leaving a halo of old hair.

  5. Colour as a Separate, Cheaper Path – Changing the colour doesn't require generating new hair. Recolouring the existing hair inside the matte keeps its real texture, highlights and shine, and is far cheaper than regeneration. Colour try-ons are both more realistic and faster.

  6. Quality and Identity Checks – Before a result is shown, it passes quality checks for artefacts and an identity check that compares the face with the original photo. A result that looks broken or changes who the person is never reaches the user.

  7. Cost and Latency at Scale – With more than 100,000 users at peak, GPU time per image was a direct cost. Routing each request to the cheapest path that gives a good result, such as colour without generation or GAN before diffusion, kept a try-on at about 15–20 seconds per image.

  8. Recommendations – Beyond try-on, the app recommends hairstyles, salons and products, turning a preview into the next step: booking the cut or buying the colour.


Business Outcome

The app went live in the App Store and Google Play and served more than 100,000 users at its peak, letting people see a new cut or colour on their own photo in about 15–20 seconds, then find a salon or a product to make it real.

The project also shows how quickly the field moved. A pipeline that needed custom segmentation, GAN editing, diffusion inpainting and identity checks in 2024 was overtaken in early 2026 by general-purpose image models from OpenAI, which is when the project ended.

Technologies

Computer VisionHair SegmentationImage MattingGANsLatent EditingDiffusion InpaintingIdentity VerificationGPU Inference

Planning something similar?

Tell me about it on a short call. New projects can start within 2 weeks