Skip to content

Face Detection not defined #8290

Open
Open
@mirzamukkarambaig

Description

@mirzamukkarambaig

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 run npm run build and npm run preview the model throws the following error:

index-BEYgabte.js:15635 Uncaught (in promise) TypeError: Zse.FaceDetection is not a constructor
    at new t (index-BEYgabte.js:15635:1827)
    at index-BEYgabte.js:15635:3968
    at index-BEYgabte.js:15635:1457
    at Object.next (index-BEYgabte.js:15635:1562)
    at index-BEYgabte.js:15635:499
    at new Promise (<anonymous>)
    at l0 (index-BEYgabte.js:15635:250)
    at SEe (index-BEYgabte.js:15635:3683)
    at index-BEYgabte.js:15635:15604
    at index-BEYgabte.js:15635:1457

I ran the following command for installation

   yarn add @mediapipe/face_detection
yarn add @tensorflow/tfjs-core, @tensorflow/tfjs-backend-webgl
yarn add @tensorflow-models/face-detection

Got the following warnings:

upgrade
yarn upgrade v1.22.22
[1/4] Resolving packages...
warning @tensorflow-models/face-detection > rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
warning @tensorflow-models/face-detection > rimraf > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning @tensorflow-models/face-detection > rimraf > glob > inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning plotly.js > color-rgba > color-space > mumath@3.3.4: Redundant dependency in your project.
warning webgazer > @tensorflow-models/face-landmarks-detection > rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
warning eslint > file-entry-cache > flat-cache > rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "plotly.js > @plotly/mapbox-gl > @mapbox/mapbox-gl-supported@1.5.0" has unmet peer dependency "mapbox-gl@>=0.32.1 <2.0.0".
warning "webgazer > @tensorflow-models/face-landmarks-detection@0.0.3" has incorrect peer dependency "@tensorflow/tfjs-converter@^3.1.0".
warning "webgazer > @tensorflow-models/face-landmarks-detection@0.0.3" has incorrect peer dependency "@tensorflow/tfjs-core@^3.1.0".
warning "webgazer > @tensorflow-models/face-landmarks-detection > @tensorflow-models/blazeface@0.0.7" has incorrect peer dependency "@tensorflow/tfjs-converter@^3.1.0".
warning "webgazer > @tensorflow-models/face-landmarks-detection > @tensorflow-models/blazeface@0.0.7" has incorrect peer dependency "@tensorflow/tfjs-core@^3.1.0".

This is the picture of the preview
image

This is the picture of the dev
Screenshot from 2024-05-28 18-24-46

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions