Read Base64 Data And Feed It To Face_recognition

face_recognition use PIL library to read image data. PIL need a file or a file-like object to work with. In the case of base64 data, after decode it, we wrap it inside a BytesIO object and pass this object to face_recognition.

data = base64.b64decode(base64_data)
face_recognition.load_image_file(BytesIO(data))