Open timlac opened 1 month ago
Thank you for reporting this issue and providing a detailed example. The problem you're encountering is due to how UniversalReader
handles NumPy arrays in version 0.5.0. Specifically, the old implementation assumes a certain format when converting the NumPy array to a PIL image, which can lead to incorrect processing and no face detections.
In version 0.5.1, we've updated the UniversalReader
to handle NumPy arrays more robustly:
This change should resolve the issue you're experiencing when passing a NumPy array to analyzer.run
.
Please update to facetorch version 0.5.1 and try running your code again. It should now correctly detect faces from the NumPy array input.
Let me know if you have any further questions or run into other issues!
I have tried the demo and everything works fine as long as I use the
path_image
parameter and pass an image path to theanalyzer.run
function. However, if I feed theanalyzer.run
with an image converted to numpy array instead no faces are detected at all.Adapting code in the demo to make a minimal reproducible example of the issue:
The code above will not result in any detections, while if I run the exact same code but with the path_image parameter (as in the demo), 4 faces are detected.
As instructed here I have replaced ImageReader with UniversalReader in my
gpu.config.yml
file.Using
facetorch
version0.5.0