face-recognition.js icon indicating copy to clipboard operation
face-recognition.js copied to clipboard

saveImage gives syntax Error

Open japita-se opened this issue 6 years ago • 1 comments

I am trying to import my "faces".

 > image = fr.loadImage('./mydata/2018-06-15-162209.png')
ImageRGB { cols: 1280, rows: 720 }
 > faceImages = detector.detectFaces(image,150)
[ ImageRGB { cols: 150, rows: 150 } ]
> faceImages.forEach((img, i) => fr.saveImage(img, `face_${i}.png`))
Error: Save_Image - Error: expected argument 0 to be of type string
    at faceImages.forEach (repl:1:35)
    at Array.forEach (<anonymous>)
> 

japita-se avatar Jun 15 '18 14:06 japita-se

You mixed up the arguments in saveImage, the file path is first, then the image.

justadudewhohacks avatar Jun 15 '18 15:06 justadudewhohacks