Skip to content

How to determine if face detect or face recognise? #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
robmarkcole opened this issue Sep 14, 2019 · 1 comment
Open

How to determine if face detect or face recognise? #14

robmarkcole opened this issue Sep 14, 2019 · 1 comment

Comments

@robmarkcole
Copy link
Owner

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

@robmarkcole
Copy link
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant