Giter VIP home page Giter VIP logo

stringless's Introduction

Stringless

Build Status

Stringless demo

Stringless is a real-time, markerless, single-camera facial motion capture system. By using dlib facial landmark detection, Stringless captures facial motion data as a collection of data points and sends it to an Autodesk Maya plug-in, where a user can map the motion capture data to a rigged face model. It was originally built as a pseudo-thesis project for my CS undergraduate degree at SJSU, but is now a continual work in progress with updates and added features.

For an overview of the system's design, operation flow, and current issues, please see this presentation, which was given live at the NASA Ames Research Center in June 2017.

I accept pull requests, and issues for bugs + feature requests are welcome.

Build instructions

Stringless server requires OpenCV and dlib, and the Maya plug-in requires Autodesk Maya.

  1. Clone a copy of Stringless:

    $ git clone https://github.com/justint/stringless.git

  2. Make a build directory and compile:

    $ cd stringless
    
    $ mkdir build
    
    $ cd build
    
    $ cmake .. -DUSE_AVX_INSTRUCTIONS=ON -DMAYA_VERSION=2017
    
    $ make
    

    Change the DMAYA_VERSION arg to whichever version of Maya you're compiling for. To compile the server alone (no Maya plug-in, run cmake .. -DUSE_AVX_INSTRUCTIONS=ON -DBUILD_MAYA=OFF

Running Stringless

To initiate the server process using the default camera (camera 0):

$ src/Stringless -p ../ext/dlib/shape_predictor_68_face_landmarks.dat

Use the -cn=<arg> flag to specify a different camera.

To start up the Maya plug-in:

  1. Load up the stringless-maya plug-in, copy the StringlessMaya.mel script into your Maya scripts directory
  2. Enter source StringlessMaya into the Maya MEL command line
  3. Enter createStringlessCap "<name>" into the Maya MEL command line, where <name> is your preferred capture node name

Once the capture device node is constructed, the node requires a neutral face pose to be defined before reading capture data. While the Stringless server is running, hold the actor's face still and enter calibrateNeutralFace("<name>_Device") into the MEL command line. The <name>_Device node's Live button will now be enabled. You can now read live capture data by enabling the Live checkmark.

To use the capture data on a rig, you can use the Constrain > Parent tool to parent the Stringless rig joints (found within the <name>_Face node in the Outliner) to your own rig.

Optimizing performance

Use the -d/--dsr flag to specify a downsample ratio. This scales down the captured image frames, speeding up face detection greatly.

Example: ./Stringless ... -d 2 will scale down the image by a half (1/2).

Use the -s/--sr flag to specify a sampling rate for face detection. By default Stringless attempts to detect faces in every frame, but if the actor is keeping their head fairly still during captures, the interval between sampled frames can be raised without any noticeable drop in capture quality.

Example: ./Stringless ... -s 3 will look for faces every three frames, and will use the face location data from the previously sampled frame to define the facial landmark detection region.

When compiling Stringless, it is important to use the -DUSE_AVX_INSTRUCTIONS=ON flag with cmake - this instructs your compiler to use especially optimized Advanced Vector Extension instructions, which came about in early 2011. If you're using a pre-2011 CPU, use the -DUSE_SSE4_INSTRUCTIONS=ON flag instead (the next best optimal instructions).

Contents

/ext                3rd-party libraries and dependencies

/src                Stringless server source

/stringless-maya    Stringless Maya plug-in

Licensing

Stringless is released under the Boost Software License; its dependency licenses can be viewed in the LICENSE file.

Author

Justin Tennant, 2017

stringless's People

Contributors

justint avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stringless's Issues

Make Stringless Windows OS compatible

It'd be nice to have Stringless be runnable on the Windows operating system.

Currently Stringless is performing IPC using POSIX shared memory, which works fine for Unix-based systems but not so much for Windows. I see two options on how to resolve this:

  • Implement named shared memory and do OS checks in Stringless
  • Convert Stringless to a socket-based system

calibrateNeutralFace("<name>_Device") does nothing in Maya 2022.3

I replaced <name> with the name that I had used in the previous command (createStringlessCap) but nothing happens after entering calibrateNeutralFace("<name>_Device") in the MEL command-line. I can see the <name>_Face Outlier but nothing else.

OS: Ubuntu 20.04
AutoDesk Maya: 2022.3

Interpret pitch, yaw, roll of face from capture data in plugin

Currently the plugin's implementation is very primitive in how it interprets the two dimensional capture data: it performs minimal corrections to translation changes by calculating delta distances from the neutral pose face, but doesn't factor in pitch, yaw, or roll of the face (moving & rotating in three dimensions).

Please help trying to compile it on OSX 10.13.6

Hi for the life of me i am unable to compile it

followed instructions to from the main page.
Tried to turn of maya plugin as suggested still wont compile.

Keep on getting cland error.

NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/Stringless] Error 1
make[1]: *** [src/CMakeFiles/Stringless.dir/all] Error 2
make: *** [all] Error 2

FaceDetection server crashing after approx. one minute of running on OSX

2017-08-11 22:32:05.372 Stringless[32898:454311] -[CaptureDelegate doFireTimer:]: unrecognized selector sent to instance 0x7fcc214122f0
2017-08-11 22:32:05.387 Stringless[32898:454311] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CaptureDelegate doFireTimer:]: unrecognized selector sent to instance 0x7fcc214122f0'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff883a22cb __exceptionPreprocess + 171
	1   libobjc.A.dylib                     0x00007fff9d1b248d objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff88423f04 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
	3   CoreFoundation                      0x00007fff88314755 ___forwarding___ + 1061
	4   CoreFoundation                      0x00007fff883142a8 _CF_forwarding_prep_0 + 120
	5   Foundation                          0x00007fff89dabe0f __NSFireTimer + 83
	6   CoreFoundation                      0x00007fff88321c54 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
	7   CoreFoundation                      0x00007fff883218df __CFRunLoopDoTimer + 1071
	8   CoreFoundation                      0x00007fff8832143a __CFRunLoopDoTimers + 298
	9   CoreFoundation                      0x00007fff88318b81 __CFRunLoopRun + 2065
	10  CoreFoundation                      0x00007fff88318114 CFRunLoopRunSpecific + 420
	11  Foundation                          0x00007fff89d2b252 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 277
	12  Foundation                          0x00007fff89dbb9b5 -[NSRunLoop(NSRunLoop) runUntilDate:] + 111
	13  libopencv_videoio.3.1.dylib         0x00000001104c9cf1 _ZN12CvCaptureCAM9grabFrameEd + 241
	14  libopencv_videoio.3.1.dylib         0x00000001104bda6f _ZN2cv12VideoCapture4grabEv + 31
	15  libopencv_videoio.3.1.dylib         0x00000001104bddf3 _ZN2cv12VideoCapture4readERKNS_12_OutputArrayE + 19
	16  libopencv_videoio.3.1.dylib         0x00000001104bde54 _ZN2cv12VideoCapturersERNS_3MatE + 52
	17  Stringless                          0x000000010f6e09b1 _ZN10Stringless12FaceDetector5startERNS_6WriterE + 3281
	18  Stringless                          0x000000010f6d5fda main + 6682
	19  libdyld.dylib                       0x00007fff9da98235 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
[1]    32898 abort      ./Stringless -d 4 -s 200 -p

I believe this and this issue is directly correlated, I have both OpenCV 2.4.13.2 and OpenCV 3.2.0 installed.

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.