NumesSanguis / FACSvatar

An Open Source Modular Framework From Face to FACS Based Avatar Animation (Unity3D / Blender)
GNU Lesser General Public License v3.0
434 stars 99 forks source link

How should I get python output? #30

Closed Wolfsin closed 3 years ago

Wolfsin commented 4 years ago

Thank you for your work, which has helped me a lot. As you know, openface has not provided python binding library yet, but I need to use some data identified by it. I see that your work can already output openface data in python. If I want to use these data in Python, what should I do?

NumesSanguis commented 3 years ago

We modified OpenFace to include ZeroMQ (pyzmq): https://zeromq.org/ This allows for data to be send over sockets (e.g. TCP). So instead of working with Python bindings or something, we send the data from OpenFace over the network, and have a socket listening in Python. This documentation page is still a draft, but some more information can be found here: https://facsvatar.readthedocs.io/en/v0.4.0/trackers/openface.html

  1. My colleague at that time was good with C#, so the ZeroMQ component has only been added to the Windows version with interface. You can download the .exe here: https://github.com/NumesSanguis/FACSvatar/releases/download/v0.3.4-alpha-release/openface_2.1.0_zeromq.zip
  2. You can either use FACSvatar directly or write the code for a subscriber yourself: a. Start the process_bridge module as described here. Then check this line of code of output_facstofile. b. Create a subscriber socket. You can find a simple zeromq publisher-subscriber project here. You have to check in the openface_2.1.0_zeromq.zip (step 1) for config.xml to know the right IP and port.
Wolfsin commented 3 years ago

Thank you for your reply.This information can make me work smoothly in the next step.