OpenSeeFace/README.md

81 lines
4.4 KiB
Markdown
Raw Normal View History

This is kind of a personal project, but it spiraled out of control and I figured I'd share it in case anyone else can make use of it.
2024-02-05 16:56:57 -05:00
I make no promises to the quality of this code or the reliablity of it
2024-02-05 16:56:57 -05:00
I am not responsible if this somehow causes you issues
2024-02-05 16:56:57 -05:00
I have drastically restructured this, but I'm listing it as a fork because this is still based on emilianavt's work.
2024-02-05 16:56:57 -05:00
I am specifically targeting Vtube Studio on Linux, some stuff was changed to make it work with VTS, idk how well it works with VeeSeeFace at this point
2024-02-05 16:56:57 -05:00
This is also very much tuned to how I use it and what works best for me, so I make no promises there
2024-02-05 16:56:57 -05:00
If you do use it, be aware that I removed directshow support(can't make use of it) and MJPEG is kinda janky, so your best bet is 480p which defaults to raw rgb
2024-02-05 16:56:57 -05:00
This will do a rock steady 30fps on my system as long as my cpu isn't completely overloaded
2024-02-05 16:56:57 -05:00
I'll update this readme to explain more later, but first I need to actually upload all my changes. I didn't expect this to turn into something I wanted to upload.
2024-02-05 17:04:35 -05:00
Packages you'll need
Numpy
OpenCV-python
2024-02-05 17:04:35 -05:00
onnxruntime
2024-02-05 18:42:22 -05:00
<br>
<br>
2024-02-05 20:56:33 -05:00
### Changes (in no particular order):<br>
2024-02-05 18:46:44 -05:00
I tried to make this nice but indents don't exist here I guess<br>
2024-02-05 18:42:22 -05:00
-Major restructure<br>
2024-02-05 20:46:04 -05:00
-I've broken out major chunks of functionality into separate files to make them easier to deal with and read<br>
2024-02-05 20:48:44 -05:00
---I've tried to break functions down into multiple smaller parts when possible<br>
---I've taken a more object oriented approach in some places<br>
---I've removed features that didn't fit my needs<br>
---Removed functionlaity for tracking multiple faces<br>
---Removed options I didn't forsee myself using (this was intended to be just for me)<br>
2024-02-05 18:42:22 -05:00
-Added more threading and multi-processing<br>
2024-02-05 20:48:44 -05:00
---The webcam (and some new image processing) are now on a separate process<br>
---Previews are now a separate process because I didn't want to deal with the related performance weirdness<br>
---Console messages are now handled via a helper thread, idk if it does any good, but it can't hurt<br>
2024-02-05 20:49:10 -05:00
---VTS communication is also handled via a helper thread<br>
2024-02-05 18:42:22 -05:00
-Added image pre-processing<br>
2024-02-05 20:48:44 -05:00
---I'm now applying a gamma curve to the webcam output to make faces more visible<br>
---The gamma curve is calculated after face tracking is done, it uses a copy of the webcam frame and face location data so get the average brightness of the face<br>
---This has drasitcally improved low light performance<br>
---It also lets me run the webcam with no gain<br>
---Removed the separate library that handled the webcam, then broke that off into a separate library again<br>
---The stuff around the webcam is still simpler now, most of the existing cases didn't apply to my use case<br>
2024-02-05 18:42:22 -05:00
-Revamped the way features are calculated and normalized<br>
2024-02-05 20:48:44 -05:00
---This was kind of my original intent, my eyes kept registering as closed when they were not<br>
---Removed features that didn't seem to be used by Vtube Studio<br>
---Added functionality to apply response curves to features<br>
---Removed the calibration period in favor of a system where the limits of features slowly decay towards a center point<br>
---Removed the average from the way featured are normalized<br>
2024-02-05 18:42:22 -05:00
-Added a feature to prevent errant eye movements<br>
2024-02-05 20:48:44 -05:00
---Each eye has an average confidence and standard deviation calculated every frame<br>
---eye movements more than two standard deviations below average are severely restricted<br>
2024-02-05 20:53:55 -05:00
---The restriction is based on how far the confidence is from the cutoff point<br>
2024-02-05 18:42:22 -05:00
-Added early exits to situations where subsequent steps will fail<br>
-The main process skips frames when the webcam falls behind, once webcam latency is long enough to be late it will remain behind otherwise<br>
-Added warnings to various states such as late webcam frames, longer than ideal frames, and early exits<br>
-Changed which stats are shown on exit, added some stats that get tracked like webcam latency<br>
-Added conditions to skip steps when they are unnecessary, such as not rotating the eye images for small angles<br>
<br>
I'll list more as I remember them<br>
<br>
2024-02-05 20:56:33 -05:00
###Installation<br>
I haven't tested how this works on windows, but on Linux:<br>
-Download and extract the code<br>
-
2024-02-05 20:53:55 -05:00
For documentation on how openseeface works and the computer vision models, go see https://github.com/emilianavt/OpenSeeFace
I don't want to leave documentation here that makes it seem like this is all my work
2020-01-01 13:55:01 +01:00
2024-02-05 20:53:55 -05:00
Seriously, emilianavt did all the hard work