Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python wrapper for FeatureExtraction #767

Open
wants to merge 27 commits into
base: master
Choose a base branch
from

Conversation

frankiezafe
Copy link

This branch (python) contains all required modification in bash files, dependencies and code to compile a python shared library containing the FeatureExtraction example with minimal controls.

The main issues i had with the code are the linkage with python3:

  • upgrade of CMake (3.15.0) - see prepare.sh & compile_deps.sh
  • upgrade of Boost (1.71.0) + a custom compilation configuration - see prepare.sh & compile_deps.sh
  • adjustments on dlib cmake configuration - see compile_deps.sh

The main modification to OpenFace code has been done in Utilities::RecorderOpenFace to retrieve landmarks, head pose and gaze easily. That is certainly not the best way to do it but it was the fastest.

All CMakes of OpenFace have also been altered to compile libraries in SHARED and not in STATIC. For the dependencies, this has been done via cmakes, so nothing to change manually.

CMake and compilation has been tested on Linux Mint 18.4 only.

Even if not complete or well documented, i think this could be a good basis for a complete OpenFace python lib.

All the best, great work by the way.

@TadasBaltrusaitis
Copy link
Owner

This will take some time for me to take a proper look at, but looks very promising, and as you mentioned would serve as a great foundation for a proper python interface to OpenFace (which would be awesome).

@a-hurst
Copy link

a-hurst commented Oct 24, 2019

Just chiming in to say that a proper Python interface would be extremely handy, especially for those of us trying to use OpenFace for reproducible analysis pipelines (matching eye tracking data to live recordings of faces, in my case).

Also, thanks to packages like cibuildwheel, if the Python interface is properly structured as a Python package (i.e. it has a setup.py file and whatnot) you can easily create pre-compiled wheels for macOS and Linux that contain all the required libraries to use OpenFace via Python. This would make installation and usage of the package on non-Windows systems a lot easier.

@SanBingYouYong
Copy link

Years later another one came to here from ER-NeRF, which also uses FeatureExtraction as part of its preprocessing. I approached this with a custom docker image based on the official one, extended with necessary libraries and environment to host a Flask api that receives the video and returns the ouput csv file needed to finetune ER-NeRF. This can also be extended to support other requests if needed.

Anyways, the issue where I mentioned the docker image is here, and I'm happy to keep working on it (e.g. get a proper Dockerfile based off openface docker image, or simply put the api code here) if needed.

@kendrew06
Copy link

kendrew06 commented Sep 10, 2024 via email

@ezyfzy
Copy link

ezyfzy commented Sep 27, 2024

Here is the docker file which can be used with minimal effort if you want to write the wrapper over openface, using python. It extends the orginal docker image after pulling it and uses it in ubuntu 22.04.
Dockerfile.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants