FaceRecognitionDotNet
FaceRecognitionDotNet copied to clipboard
FrontalFaceDetector cause MemoryCorruptionException in multithread usage
- implement a code that find face
- invoke the code with a big bunch of different threads
- Fatal MemoryCorruptionExecption, process die and there is no way to recover
@matteofabbri You can not share FRDN instance between threads. So you must
- Create some FaceRecognition instance
- Use multiprocess
@takuya-takeuchi if you take a look at my PR i fixed the issue. Making different issues dont fix the problem, due to DlibDotNet internal issues. ASAP i will fix other not thredsafe components
You may be able to avoid excpetion for FaceLocation but other function may face to same issue. Should we generate internal instance when function is invoked every time? I guess it is not good.
In the path of detecting faces, extracting encodings and recognize a subject in those encoding there are no other thread unsafe regions. Unless you select a different kind of faceselector that i will try to fix asap. On the test i runned, the whole path takes more that 24seconds for serving a thread using the lock to access the FRDN and 400ms with the fix that i applied