You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using MTCNN module as one of the final layers to detect faces. In my API, I'm pre-loading the MTCNN instance by executing the following code before spanning workers using gunicorn. **mtcnn_detector = MTCNN()**
But when I'm trying to use it on the image coming to MTCNN layer, the detect_faces method gets stuck and the worker times out all the time. **detector_object = mtcnn_detector.detect_faces(image_rgb)**
But surprisingly. when I initialize it just before calling detect_faces method, it works. I also noticed that the object created while preloading is the one getting used inside too when the image comes, but just that it gets stuck.
And, even when I try to use it as a singleton inside, it gets created for all the workers since it is not preloaded. Each object takes to around 200 MB approximately and I'm not in the position to afford 5 instances of it across the workers.
Any help would be of great help.
Thanks in advance.
The text was updated successfully, but these errors were encountered:
I'm using MTCNN module as one of the final layers to detect faces. In my API, I'm pre-loading the MTCNN instance by executing the following code before spanning workers using gunicorn.
**mtcnn_detector = MTCNN()**
But when I'm trying to use it on the image coming to MTCNN layer, the detect_faces method gets stuck and the worker times out all the time.
**detector_object = mtcnn_detector.detect_faces(image_rgb)**
But surprisingly. when I initialize it just before calling detect_faces method, it works. I also noticed that the object created while preloading is the one getting used inside too when the image comes, but just that it gets stuck.
And, even when I try to use it as a singleton inside, it gets created for all the workers since it is not preloaded. Each object takes to around 200 MB approximately and I'm not in the position to afford 5 instances of it across the workers.
Any help would be of great help.
Thanks in advance.
The text was updated successfully, but these errors were encountered: