I tried the following to load an image from disk using face-api.js:
faceapi.fetchImage(path.resolve(INPUT_DIR, 'input1.jpg');
It throws the following error: Error: fetch - missing fetch implementation for nodejs environment
Is there any other way of load image from disk and displaying using nodejs?
The reason it fails because you need to implements the fetch function for it to work.
FetchImage
should be used when you are trying to retrieve the image from online. If you are using the image from local disk, then do this:Load the modules from local disk.
// for me, I have put all the modules in src/models/
Load the canvas
Pass the canvas and modules option (if any)