feat: add custom metadata when a face is recognized#123
Merged
Conversation
494be1f to
96907d3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR introduces a new capability that allows the system to load custom metadata for known faces and attach it to face recognition results. This feature has been requested by a community user.
Over the face folder, for example,
FACE_DIR/Ilias/metadata.json,you can set the custom properties there that will be loaded and indexed when the face of "Ilias" has been recognized.FACE_DIR/Ilias/metadata.jsonexample file:{ "name": "Ilias Haddad", "alternate_names": ["Ilias Hadd"], "nationalities": ["Netherlands", "Morocco"], "date_of_birth": "1989-03-01", "place_of_birth": "Dordrecht, Netherlands", "height_m": 1.87, "positions": ["Centre-back"], "current_club": "Union Touarga", "club_jersey_number": 20, "dual_nationality": true }After the video is indexed, each video scene where "Ilias" has been recognized, this is how the video scene text document will be indexed and saved over the vector DB:
This is medium-shot shot featuring Ilias, Ilias (name: Ilias Haddad, alternate_names: Ilias Hadd, nationalities: Netherlands,Morocco, date_of_birth: 1989-03-01, place_of_birth: Dordrecht, Netherlands, height_m: 1.87, positions: Centre-back, current_club: Union Touarga, club_jersey_number: 20, dual_nationality: trueOver the search page, you can search for that video scene using any attributes like
current_club: Union Touargaand it'll give back the video scene that we indexed.