ofxTensorFlow2
TensorFlow 2 wrapper addon for openFrameworks — run ML models in creative coding applications.
What it does
An openFrameworks addon that wraps the TensorFlow 2 C API, making it straightforward to load and run trained ML models in creative coding projects. Developed at ZKM | Center for Art and Media Karlsruhe for use in interactive art installations.
Key features
- Simple API — load SavedModel or frozen graph formats with a few lines of code
- GPU support — optional CUDA acceleration for real-time inference
- Multi-platform — works on Linux, macOS, and Windows
- Example gallery — includes examples for style transfer, image classification, pose estimation, and pix2pix
- Tensor helpers — utilities for converting between openFrameworks types (ofImage, ofPixels) and TensorFlow tensors
Tech stack
C++ addon linking against the TensorFlow 2 C API. Build system integrates with openFrameworks’ project generator. Supports TF 2.x SavedModel format and TFLite.
Impact
Used in multiple art installations at ZKM and other institutions worldwide. The most-starred repository in the ZKM GitHub organization.