Open mirzamukkarambaig opened 6 months ago
HI, @mirzamukkarambaig
I apologize for the delayed response and thank you for bringing this issue to our attention, if possible could you please help us with your Github repo along with converted TensorFlow.js models and complete steps to replicate the same behavior from our end to investigate this issue further from our end ?
Thank you from your cooperation and patience.
No worries. Kindly find the code one this repo
the code you will be looking inside the src/utils/detect_faces and src/components/access_webcam files.
Hi @gaikwadrahul8 ,
Any news on this issue?
I'm seeing the same problem on a Vue 3 app and I'm interested in a solution or workaround.
Thank you.
Hi, @mirzamukkarambaig
Thank you for your patience with the delay in my response. I'm able to replicate the reported behavior using the npm run preview
command (output below). Running npm run build
produces a different output (also below). We'll need to investigate this issue further and will provide an update soon. thank you for bringing this issue to our attention.
1. Output log of npm run preview
command :
2. Output of npm run build
command :
gaikwadrahul-macbookpro2:Face-Detection-TF-JS gaikwadrahul$ npm run build
> react-js-ai-procotring-tool@0.0.0 build
> vite build
vite v5.2.12 building for production...
✓ 816 modules transformed.
dist/index.html 0.46 kB │ gzip: 0.29 kB
dist/assets/index-CGXWcEaS.css 6.14 kB │ gzip: 1.84 kB
dist/assets/index-fXzlpHlG.js 1,441.00 kB │ gzip: 271.41 kB
(!) Some chunks are larger than 500 kB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
✓ built in 2.75s
gaikwadrahul-macbookpro2:Face-Detection-TF-JS gaikwadrahul$
Thank you for your cooperation and patience.
@gaikwadrahul8 is there a fix for this issue, cause it's showing on my app too (only when running build dev)?
I've run into the same issue - any updates on the investigation here?
As a workaround, I've switched to using Mediapipe directly, see https://github.com/klimeryk/dealwithit/commit/7d470f6cb065cfa9e539ab4347b986a93abfc738. Since this library uses mediapipe behind the scenes, the data is in very similar format. You just need to multiple the keypoint coordinates by the dimensions of the source image. See full example from Google here: https://codepen.io/mediapipe-preview/pen/OJByWQr. And docs here: https://ai.google.dev/edge/mediapipe/solutions/vision/face_detector/web_js.
The model itself is not as accurate as the "full" model here. Looks like it's somewhere between short and full. But looks like "full" version is on the horizon: https://ai.google.dev/edge/mediapipe/solutions/vision/face_detector/index#blazeface_full-range.
Anyway, figured I'd share in case someone else finds it helpful 🙇
From my digging, looks like the root issue is https://github.com/vitejs/vite/issues/15851. Seems vite does not like when the library uses imports like import * as faceMesh from '@mediapipe/face_mesh';
? And instead would prefer import faceMesh from '@mediapipe/face_mesh';
. Or even better import { justStuffYouNeed } from '@mediapipe/face_mesh';
.
I am creating a React JS-based front end that employs the Tensorflow JS Simple Face Detection model. The application runs fine when being run on the dev environment using
npm run dev
. However when I runnpm run build
andnpm run preview
the model throws the following error:I ran the following command for installation
Got the following warnings:
This is the picture of the preview
This is the picture of the dev