-
Clone the repo from https://github.com/SRai22/tfjs-object-detection.git
-
cd tfjs-object-detection
-
npm install
npm start
- Opens the browser, allow the browser to access camera, click the button to start the detection.
-
Download and Install Chrome Canary from https://www.google.com/chrome/canary/
-
Open chrome, and goto: chrome://flags/ , enable the option #enable-unsafe-webgpu
-
Relaunch chrome
-
Goto tfjs-object-detection/src/components/ObjectDetection.js --> edit line
66 await detector.current.setModelBackend("wasm");
to
66 await detector.current.setModelBackend("webgpu");
npm start
- Open with Chrome Canary, allow the browser to access camera, click the button to start the detection.
- Parameterize the backend variable