face-api.js
face-api.js copied to clipboard
Unhandled Promise Rejection: TypeError: null is not an object (evaluating 'e.isContextLost')
$ cat package.json|grep tfjs
"@tensorflow/tfjs": "4.7.0",
"@tensorflow/tfjs-backend-wasm": "^4.9.0",
"@tensorflow/tfjs-core": "^4.9.0",
$ node -v v20.4.0 $ uname -a Darwin 51pwn-2.local 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul 5 23:51:32 PDT 2023; root:xnu-8796.141.3~8/RELEASE_X86_64 x86_64
safari:Version 16.6 (18615.3.12.11.2) or chrome:Version 114.0.5735.198 (Official Build) (x86_64) Steps to Reproduce
yarn build out v8.js
<script src=/js/v8.js></script><script src=/js/face-api.min.js></script>
code:
faceapi.env.monkeyPatch({
Canvas: window.ov8canvas,
Image: oImgOcr,
ImageData: szImageData,
})
await faceapi.tf.enableProdMode()
faceapi.tf.ENV['DEBUG'] = false;
await faceapi.tf.ready()
err: Unhandled Promise Rejection: TypeError: null is not an object (evaluating 'e.isContextLost')
Remove the code related to the face API, and other functions related to "@ tensorflow/tfjs" are running normally
how fix?thanks