vladmandic / face-api

FaceAPI: AI-powered Face Detection & Rotation Tracking, Face Description & Recognition, Age & Gender & Emotion Prediction for Browser and NodeJS using TensorFlow/JS
https://vladmandic.github.io/face-api/demo/webcam.html
MIT License
824 stars 149 forks source link

Face api gives an error when there are too many photos #167

Closed Gokhan-Onal-DegoDe closed 1 year ago

Gokhan-Onal-DegoDe commented 1 year ago

Hello. When the face api has too many photos (eg 5000 photos), wait for a few minutes and then gives an error. I share the demo address. You can review js file

When the photo is not much (for example, 300 photos) works properly. It only gives an error when there is too many photos.

I am new in the use of this library. I would be glad if you explain in detail. Thanks

vladmandic commented 1 year ago

i took a look at your js code and of course it has problems with too many photos - you're submitting all photos in parallel and expect library to handle it. you should limit number of submitted photos and do part-by-part. this is not a library issue, this is really bad way to handle processing of large number of items in general - you can never submit all in parallel and create thousands of promises, no matter what you're doing - even if its simple 1+1=2.

Gokhan-Onal-DegoDe commented 1 year ago

@vladmandic I already know that this is the problem. Can you share a sample code about how to divide the photos?

Gokhan-Onal-DegoDe commented 1 year ago

Nevermind. I solved the problem.