Realfix for dlib ()

* Update dlib_face_detect.py

* fix lint

* Update dlib_face_detect.py
pull/8528/head
Pascal Vizeli 2017-07-17 12:09:42 +02:00 committed by GitHub
parent 40aafcdf5d
commit f0479855bd
1 changed files with 6 additions and 1 deletions
homeassistant/components/image_processing

View File

@ -19,6 +19,8 @@ REQUIREMENTS = ['face_recognition==0.2.0']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
ATTR_LOCATION = 'location'
def setup_platform(hass, config, add_devices, discovery_info=None): def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up the Dlib Face detection platform.""" """Set up the Dlib Face detection platform."""
@ -68,4 +70,7 @@ class DlibFaceDetectEntity(ImageProcessingFaceEntity):
image = face_recognition.load_image_file(fak_file) image = face_recognition.load_image_file(fak_file)
face_locations = face_recognition.face_locations(image) 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))