-
-
Notifications
You must be signed in to change notification settings - Fork 329
Issues
When using Human
library version with TFJS
bundled and you try to load another copy of TFJS
explicitly, you will see warnings in the console/inspector output
Additionally, if those two versions of TFJS
as incompatible, it will result in runtime issues
Typically error message is:
Platform browser has already been set. Overwriting the platform with [object Object].
cpu backend was already registered. Reusing existing backend factory.
The kernel '_FusedMatMul' for backend 'cpu' is already registered
The kernel 'Abs' for backend 'cpu' is already registered
...
Solution:
- Since
Human
already pre-packagesTFJS
, you do not need to importTFJS
explicitly - If you want to explicitly import
TFJS
into your project,
you should use-nobundle
version ofHuman
library that does not pre-packageTFJS
If you're using Human
library with a custom bundler, bundler may not be able
to recognize target platform and automatically exclude unnecessary dependencies
This happens when using server-side-bundling to create a client-side package, for example inside NextJS
.
Typically error message is:
Error: Module not found: Can't resolve 'fs'
Solution: Configure custom bundler to mark specific dependencies as external
Example:
- ESBuild configuration:
{ external: ['fs', 'buffer', 'util', 'os'] }
- WebPack configuration:
externals: {
'fs': 'commonjs2 fs',
'buffer': 'commonjs2 buffer',
'util': 'commonjs2 util',
'os': 'os fs'
}
Human Library Wiki Pages
3D Face Detection, Body Pose, Hand & Finger Tracking, Iris Tracking, Age & Gender Prediction, Emotion Prediction & Gesture Recognition