facial-landmarks-for-cubism icon indicating copy to clipboard operation
facial-landmarks-for-cubism copied to clipboard

[SUGGESTION] Facial animation interpolation and misc. improvements

Open ItsRogueRen opened this issue 3 years ago • 5 comments

This runs extremely well, way better than anything you can run in Wine/Proton to get this on Linux. However the actual animation is choppy as I believe its locked to the framerate of the webcam being used. Would it be possible to interpolate the animation so it appears smooth? Also the eyes in particular seem to be prone to only half-shutting when blinking so perhaps some sort of slider to increase certain parts sensitivity (ex. eyes, mouse, and head movement).

ItsRogueRen avatar May 29 '21 03:05 ItsRogueRen

Glad to hear it's running well. :)

There are a few parameters in the config file that you can try tweaking to see if it helps:

eyeClosedThreshold 0.18 This is the eye aspect ratio (height divided by width) below which the algorithm will consider the eye as closed. Problem is that everyone's face is different so you can only work out the best value by trial and error (or some calibration routine, not sure if I want to code that). Increasing this would mean that the eye would close more when blinking. Just make sure to keep this below eyeOpenThreshold, and you could also try to tweak eyeOpenThreshold.

The way I tune these is just run it, squint my eyes and see if it's shown as closed, and increase the value if not. Similarly for the open threshold, open my eyes (without putting too much effort to force them open), if the eyelids start to move I'll decrease the open threshold.

The various "Filtering parameters" at the end of the config file:

I am using some moving average filters to reduce noise in the detection. For example leftEyeOpenNumTaps 3 means that each sample is actually replaced by the average of the previous three samples. This has the effect of smoothening the motion, but will cause some lag, and will decrease the sensitivity to sudden movements such as blinks. A larger number means a smoother response but lower sensitivity. A smaller number means higher sensitivity, but also more noise and more choppiness.

I suggest trying to spend a few minutes tweaking them, see if that improves anything. Let me know if not, I'll see what I can do over the weekend.

Oh and make sure to pass the path to the config file as a command line argument using the -c flag.

adrianiainlam avatar May 29 '21 03:05 adrianiainlam

"Oh and make sure to pass the path to the config file as a command line argument using the -c flag."

Don't know how to do that last part but I'll see about messing with the config parameters

ItsRogueRen avatar May 29 '21 03:05 ItsRogueRen

instead of running ./Demo, run ./Demo -c /path/to/facial-landmarks-for-cubism/config.txt, change /path/to/ to your actual location where you cloned the repo.

adrianiainlam avatar May 29 '21 06:05 adrianiainlam

Have you had any chance to play with this yet? Encountering any problems that need help?

adrianiainlam avatar Jun 29 '21 19:06 adrianiainlam

Have you had any chance to play with this yet? Encountering any problems that need help?

No, I had to repair my OS and haven't had the chance to rebuild this yet

ItsRogueRen avatar Jun 29 '21 19:06 ItsRogueRen

Closing due to inactivity.

adrianiainlam avatar Mar 05 '23 23:03 adrianiainlam