Skip to content

Latest commit

 

History

History

README.md

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:

  1. Install python dependencies:
pip install -r requirements.txt
  1. 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.
  2. 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
  1. Prepare models for cpp runtime:
python3 <EmotiEffLib_root>/models/prepare_models_for_emotieffcpplib.py
  1. Download and unpack test data:
cd <EmotiEffLib_root>/tests
./download_test_data.sh
tar -xzf data.tar.gz
  1. Run jupyter notebook and select C++ kernel.