Skip to content

Image Recognition - Find the largest face #6

Open
@wrussell1999

Description

To prevent dodgy crops, pick the largest face in the array and use that. Using the Google Cloud Vision API

Activity

wei

wei commented on Apr 19, 2022

@wei
Member

This snippet below is currently always picking the last face in the faces array:

for face in faces:
box = [(vertex.x, vertex.y) for vertex in face.bounding_poly.vertices]

We should add a conditional here to only set the box variable if the new face width/height is larger than the one stored in box. or just do a sort by width/height and take the largest one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

      Participants

      @wei@wrussell1999

      Issue actions

        Image Recognition - Find the largest face · Issue #6 · MLH-Fellowship/class-photo