-
-
Notifications
You must be signed in to change notification settings - Fork 323
Backends
Human library includes pre-bundled CPU
, WASM
and WebGL
backends, there is no need to load them externally.
WebGL backend usage is fastest on systems with modern GPU
although startup speed is a bit slower
CPU backend usage is not recommended for performance reasons
as TensorFlow implementation in JavaScript is by far the slowest
- WASM backend has good resuts under specific conditions:
- Enable WASM SIMD support in your browser
(CPU parallel processing instructions) - Reduce size of input image (e.g. webcam)
as WASM does not have optimized image extraction methods
- Enable WASM SIMD support in your browser
WASM backend requires access to wasm
files which are part of @tensorflow/tfjs-backend-wasm
package and included in
node_modules/@tensorflow/tfjs-backend-wasm/dist/*.wasm
(different WASM file is loaded depending on detected capabilities)
Also, to be able to load WASM files your web server, web server has to set appropriate HTTP headers:
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp
Or load WASM files from a CDN such as https://www.jsdelivr.com/package/npm/@tensorflow/tfjs-backend-wasm?path=dist
Chrome:
- Navigate to chrome://flags
-
WebAssembly SIMD support
set to Enabled
Edge:
- Navigate to chrome://flags
-
WebAssembly SIMD support
set to Enabled
Firefox:
- Navigate to about:config
-
javascript.options.wasm_simd
set to True
See <TODO.md>
Human Library Wiki Pages
3D Face Detection, Body Pose, Hand & Finger Tracking, Iris Tracking, Age & Gender Prediction, Emotion Prediction & Gesture Recognition