Git Product home page Git Product logo

donatefaces's Introduction


    by Joseph Turian

Extract faces from video clips; generate training data for pose-invariant face features.

USAGE:
    youtube-dl 'http://www.youtube.com/watch?v=2QlGj_GPPi4'
    ./detect_faces.py 2QlGj_GPPi4.flv > 2QlGj_GPPi4.flv.faces
    ./draw_faces.py 2QlGj_GPPi4.flv 2QlGj_GPPi4.flv.faces 2QlGj_GPPi4.faces.mp4

    ./smooth_faces.py 2QlGj_GPPi4.flv.faces > 2QlGj_GPPi4.flv.facechains
    ./draw_facechains.py 2QlGj_GPPi4.flv 2QlGj_GPPi4.flv.facechains 2QlGj_GPPi4.facechains.mp4

    youtube-dl 'http://www.youtube.com/watch?v=Hde4s-xBhqE'
    ./detect_faces.py Hde4s-xBhqE.flv > Hde4s-xBhqE.flv.faces
    ./draw_faces.py Hde4s-xBhqE.flv Hde4s-xBhqE.flv.faces Hde4s-xBhqE.faces.mp4
    ./smooth_faces.py Hde4s-xBhqE.flv.faces > Hde4s-xBhqE.flv.facechains
    ./draw_facechains.py Hde4s-xBhqE.flv Hde4s-xBhqE.flv.facechains Hde4s-xBhqE.facechains.mp4

If you want to crawl youtube video URLs, check out crawl/


REQUIREMENTS:
    * OpenCV (>=2?) with *old* style (Swig) Python bindings
        * If you are under Ubuntu, this is easy to install:
            sudo apt-get install python-opencv libcv-dev

            Note:
            /usr/share/opencv/haarcascades/haarcascade_frontalface_default.xml
            is contained in libcv-dev so you actually need to install
            that too for the code to run
        * If you are compiling the code from scratch, make sure you use option:
                -D BUILD_SWIG_PYTHON_SUPPORT=ON
            when running 'cmake' to get the old style bindings.
        * Note: The new style Python bindings are incomplete, unfortunately:
            http://stackoverflow.com/questions/2195441/opencv-2-0-and-python
            (See comment by ezod)
    * My Python common library:
        http://github.com/turian/commono
    * youtube-dl:
        http://bitbucket.org/rg3/youtube-dl/

        Always use the latest version of youtube-dl (the HG current version).

    * numpy

TODO:
    * Compute sha1sum after downloading a video

IMPLICIT REQUIREMENTS (things required by REQUIREMENTS):
    * ffmpeg
    * simplejson
        

CREDITS:
    * Python OpenCV face detection code originally based upon code from
    Robert Martin “Marty” McGuire:
        http://creatingwithcode.com/howto/face-detection-in-static-images-with-python/

---------------------

DEPRECATED

    * pyffmpeg
        http://code.google.com/p/pyffmpeg/issues/detail?id=9#c5

        sudo pip install -e git://github.com/tranx/pyffmpeg.git#egg=pyffmpeg

    * PyMedia
        For converting a video into images. I use version 1.3.7.3.
            <http://securfox.wordpress.com/2009/05/15/pymedia-on-debian-lenny/>
            Edit the audio/acodec/acodec.c file and on line 31 insert the following :

            #define HAVE_LRINTF

            So you should have:

            #include <libavcodec/avcodec.h>
            #define HAVE_LRINTF
            #include “libavcodec/dsputil.h”
            #include “version.h”
        TODO: Just use OpenCV cvCaptureFromFile method? PyMedia is old
        and unsupported.

    * Video to image dumping is from PyMedia example code:
        http://pymedia.org/tut/src/dump_video.py.html

donatefaces's People

Contributors

turian avatar reysajju 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.