This is an example of a custom processing block, which you can load in the Edge Impulse studio. See the docs: Building custom processing blocks. The features in this block are implemented in C++, then exposed to Python using pybind11. The Python code spins up a web server, which Edge Impulse then talks to.
The library folder contains a C++ library (cpp/test.hpp) with Python bindings (py/eicpp.cpp). To test it out quickly (verified on macOS):
-
Install pybind11 and a recent version of CMake.
-
Build the library:
sh library/build-library.sh
-
Run the example:
python3 library/py/test.py
-
Build and run the container:
docker build -t custom-block-cpp . && \ docker run --rm -it -v $PWD/server:/app/server -p 4446:4446 custom-block-cpp
-
To add the block to Edge Impulse, see Exposing the processing block to the outside world.