justadudewhohacks / face-api.js

JavaScript API for face detection and face recognition in the browser and nodejs with tensorflow.js
MIT License
16.74k stars 3.72k forks source link

Module Not Found #855

Open kyahAndoy opened 2 years ago

kyahAndoy commented 2 years ago

Everytimre I import (import * as faceapi from "face-api.js") in my react project it gives throws me error like this.

ailed to parse source map from 'D:\Thesis\facial-recognition-v1\facial-recognition\node_modules\face-api.js\src\xception\extractParamsFromWeigthMap.ts' file: Error: ENOENT: no such file or directory, open 'D:\Thesis\facial-recognition-v1\facial-recognition\node_modules\face-api.js\src\xception\extractParamsFromWeigthMap.ts' @ ./node_modules/face-api.js/build/es6/xception/TinyXception.js 9:0-74 99:11-37 @ ./node_modules/face-api.js/build/es6/ageGenderNet/AgeGenderNet.js 5:0-56 19:33-45 @ ./node_modules/face-api.js/build/es6/ageGenderNet/index.js 1:0-31 1:0-31 @ ./node_modules/face-api.js/build/es6/index.js 5:0-37 5:0-37 @ ./src/App.js 8:0-39 @ ./src/index.js 7:0-24 11:33-36

I dont know what to do please help me

miladganjali commented 2 years ago

You are using this for browser, this is node API not e6 javascript

keogh commented 2 years ago

@miladganjali not sure I follow, does it mean we should not use this library in the browser or should we ignore those warnings?

kyahAndoy commented 2 years ago

@keogh What I did is downgrade my web pack to 4. something and it works fine. Now I am attempting to use it to my server instead of puting it into client side (react js). I'm also confused on how to use it because it has an browser option and node option but I guess I will be using the API in the server side.

keogh commented 2 years ago

@kyahAndoy I see what you mean, and yes, after I finished my prototype I thought it was better to have all this in the server side rather than on the browser

Thank you

Ardziv commented 2 years ago

seems the "node-modules/face-api.js/src" folder is missing all together from the NPM package "face-api.js" would be nice to include it in this package? oterwise needs to copy manually the src folder