ageitgey / face_recognition

The world's simplest facial recognition api for Python and the command line
MIT License
53.54k stars 13.5k forks source link

Batch Inference of Facial Landmarks #773

Open mibrahimy opened 5 years ago

mibrahimy commented 5 years ago

I am trying to use 5 pt shape predictor for batch inference. I have a batch of face crops let says 50, and I want to get their landmarks returned in a single go.

What I Did

I tried passing the dlib.shape_predictor() function the list of images as first argument and list of respective detections as second. But it returned the following error:

TypeError: __call__(): incompatible function arguments. The following argument types are supported:
    1. (self: dlib.shape_predictor, image: array, box: dlib.rectangle) -> dlib.full_object_detection
maheshwarkuchana commented 5 years ago

@ibrahimsherdil

The function dlib.shape_predictor() accepts

as its arguments.

But we cannot pass a list of images to predict the landmarks.

For more explanation in documentation I prefer you to read this link