EmotiEffLib C++ examples
Here you can find examples of using EmotiEffLib in C++.
Here is a list of examples:
Building and running examples
To run the examples locally you need to do the following:
- Install python dependencies:
pip install -r requirements.txt
- Build EmotiEffCppLib with Libtorch and ONNXRuntime. It is important to build EmotiEffCppLib with flag: -DBUILD_TESTS=ON because we need to reuse one library which builds for tests. Also, it is required to build EmotiEffCppLib with flag: -DBUILD_SHARED_LIBS=ON because xeus-cling works only with shared libraries.
Install xeus-cling. Instruction how to build xeus-cling can be found here.
After installing xeus-cling, you should be able to check available kernels and see xcpp17 kernel:
$ jupyter kernelspec list
Available kernels:
python3 /opt/anaconda3/envs/emotiefflib/share/jupyter/kernels/python3
xcpp11 /opt/anaconda3/envs/emotiefflib/share/jupyter/kernels/xcpp11
xcpp14 /opt/anaconda3/envs/emotiefflib/share/jupyter/kernels/xcpp14
xcpp17 /opt/anaconda3/envs/emotiefflib/share/jupyter/kernels/xcpp17
- Prepare models for cpp runtime:
python3 <EmotiEffLib_root>/models/prepare_models_for_emotieffcpplib.py
- Download and unpack test data:
cd <EmotiEffLib_root>/tests
./download_test_data.sh
tar -xzf data.tar.gz
- Run jupyter notebook and select C++ kernel.