Inspiration

We were watching the final part of Attack on Titan where the main character Eren Yeager gets a haircut. We all did not like the haircut he got and related to experiences where we got a bad haircut because we were not able to verbally explain what we wanted. We decided we could fix this using generative AI. Long gone are the days of panicking while the barber ties the sheet around your neck trying to think what sort of person you will portray yourself for the next month.

What it does

This app allows users to upload a picture of themselves and change the style of their hair. It then gives the user the choice of picking from prebuilt prompts or creating their own prompt describing what they want. The app will also output the measurements so the barber can know what to make of it.

How we built it

The tech stack starts with the user taking a picture using the webcam. The script does a bit of preprocessing and then uploads the picture to a Roboflow API for hair segmentation. Using the result from the segmentation, we can identify which parts are the user's hair. Then we mask it out and upload it to Dall-E to edit the image with some predefined or custom-entered prompts. The user can then see what the haircut looks like and if they want to change anything they can change the prompt.

Challenges we ran into

We ran into issues with hair segmentation, we were first doing it manually to see if it would work. After that, we tried using a bounding box method based on the location of facial features such as eyebrows and

Accomplishments that we're proud of

We were able to create focus on the hair in the original image and reduce the number of artifacts that popped up on the generated image.

What we learned

We learnt how to use DALLE to generate images and how to focus on specific aspects in an image, in our case the hair on someone, and create better and more specific prompts.

What's next for hAIrmony

We want to optimize the program, prompts, and technology we use to create more accurate and more detailed hair styles for users. We also want to introduce the feature where users can add in their own specific prompt/input for a hairstyle they want.

Built With

Share this project:

Updates