Open robmarkcole opened 5 years ago
The only difference with face recognition is that user_id is also returned. Handlign this in HA integration with:
def parse_faces(predictions):
"""Get recognised faces for the image_processing.detect_face event."""
faces = []
for entry in predictions:
if not "userid" in entry.keys():
break # we are in detect_only mode
if entry["userid"] == "unknown":
continue
face = {}
face["name"] = entry["userid"]
face[ATTR_CONFIDENCE] = round(100.0 * entry["confidence"], 2)
faces.append(face)
return faces
Have 2 endpoints, but should I have one detect method with an optional arg ,or two seperate methods?
e.g.
process_file(image_path, recognise=True) # default recognise=False uses detection