Giter Club home page Giter Club logo

protect-your-face's Introduction

Protect your face !

Are you always unable to resist popping pimples? This is an algorithm that can use your computer camera to detect whether you are popping pimples. let's maintain a clean and tidy face together.

We provide a detailed implementation method here. By following the steps below, you can run this algorithm directly even on the CPU of your own computer and maintain real-time performance. It should be noted that we provide pre-trained models that can be run directly, but in order to ensure the accuracy of the algorithm, we still recommend that you capture your own videos and train.

Demo

You can directly use our trained model for testing, but limited by the blogger's special dataset (only contains my own photos, fixed camera background), the accuracy may be terrible. Download pretrained model from https://pan.baidu.com/s/19npZHlu-xRA4WnEVX64BJA (m57b) and put it in './save_model'. Run the following code to test the pretrained model:

python main.py

Train your own model

First, record videos to make your own dataset. We have encapsulated all the steps, you only need to capture two kinds of ".mp4" videos: pop-pimple video (put it in './data/on_face_video') and normal video (put it in './data/no_on_face_video'). It's better to be more than one minute in total duration for each type of video, and the duration of the two videos is similar. Then, run:

sh video.sh

Your own dataset is finished. Next, train your own model:

python train.py

Then, replace the "./save_model/best_model/best_model.pth", and you can test it on your computer, run:

python main.py

Good Luck!

protect-your-face's People

Contributors

vefalun avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.