If you’ve ever wanted to copy a celebrity hairstyle, there’s a new algorithm that will help you. Bringing your barber a photo of someone with your desired hairstyle is easy, but what if your side profile or the back of your head looks completely different from the photo?
AutoHair is a new algorithm developed by PhD student Menglei Chai from Zhejiang University’s State Key Lab of CAD&CG that can create a 3D model of a hairstyle from a portrait photo of someone. The algorithm can also be used to apply different hairstyles to different head shapes and to make hair look more realistic in animated games and movies.
The four-year project involved researchers looking through 100,000 portrait photos on Flickr and manually training the computer to depict natural hair by marking individual hair segments. However, this method caused hair to look “too smooth and flat, especially at the back.” To make the hair look more realistic, researchers also looked at hair models from The Sims and corrected the markings.
Though the algorithm is complete, Chai hopes to continue working on generating 3D models from pictures. “Perhaps it’s about the time to merge hair, face, and body together, to recover the whole human from images, and make it animatable!” says Chai. “That would be awesome.”
So your dream hairstyle might be achievable—just don’t go to Great Clips.
Watch the video below to see a few of the more than 50,000 models tested.