-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Face Detection not defined #8290
Comments
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. 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. |
Thank you for your patience with the delay in my response. I'm able to replicate the reported behavior using the 1. Output log of 2. Output of
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? |
Had some issues with tensorflow.js in production, see tensorflow/tfjs#8290 This feels more maintained, though the model does not seem as accurate as TFJS'. But I'll take it over fighting some old JS code, possibly needing to fork it, fix some simple import issues just to make Vitejs happy...
As a workaround, I've switched to using Mediapipe directly, see klimeryk/dealwithit@7d470f6. 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 🙇 |
It works after tensorflow/tfjs#7905 got fixed :tada: But, it's still not possible to use it in production due to tensorflow/tfjs#8290
From my digging, looks like the root issue is vitejs/vite#15851. Seems vite does not like when the library uses imports like |
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

The text was updated successfully, but these errors were encountered: