Giter VIP home page Giter VIP logo

hair's Introduction

Hair

"Hair" is a GUI application where you can experiment with different hair styles real time. It is made using open-cv and tkinter.

Usage

hair

To use this GUI, start by running gui.py. You will see a starting screen that looks like this: image Next, click "start" and it will take you to a page where you can click on multiple buttons, each representing a certain hair style. image

Fade

fade

Mushroom cut

mushroom

Bangs

bangs

Anime

anime

Afro

afro

Once you click on a button, the camera will start and you'll get another window where you should see the hair style you selected in real time. If another person is next to you, you should see them with the hair style as well. Press esc to close this window.

(If you don't see the hair style, make sure your at least 2 feet from the device and be sure your lighting is decent)

How it works

The GUI itself is pretty straightforward. In gui.py there is simply an image placed in the background and another image that i've made into a button. When you click this button, it goes to the next file functionality.py through an import import functionality. In functionality.py there are just a couple more buttons which are binded to the function cam(hair) which essentially imports video.py and calls the specific hair style selected.

Most of the magic happens in video.py. Basically, you open the camera, set the frame width and height, and then use the haarcascades model to identify where the face is in the live camera. Next, I used a pre-set x and y which I added to the default x and y values of where the face lies. In short, it detects the face, then goes up about 50 pixels (the top of the head) and places an overlay of the hair style selected.

You can experiment with this by adding your own hair overlays and create your own icons.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.