Realfix for dlib (#8517)

* Update dlib_face_detect.py

* fix lint

* Update dlib_face_detect.py
pull/8625/head
Pascal Vizeli 2017-07-17 12:09:42 +02:00 committed by Paulus Schoutsen
parent 7d99d6aad9
commit 4961ece931
1 changed files with 6 additions and 1 deletions

View File

@ -19,6 +19,8 @@ REQUIREMENTS = ['face_recognition==0.2.0']
_LOGGER = logging.getLogger(__name__)
ATTR_LOCATION = 'location'
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up the Dlib Face detection platform."""
@ -68,4 +70,7 @@ class DlibFaceDetectEntity(ImageProcessingFaceEntity):
image = face_recognition.load_image_file(fak_file)
face_locations = face_recognition.face_locations(image)
self.process_faces(list(face_locations), len(face_locations))
face_locations = [{ATTR_LOCATION: location}
for location in face_locations]
self.process_faces(face_locations, len(face_locations))