Skip to content
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

Speaker identification WIP #46

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

etown
Copy link
Contributor

@etown etown commented Mar 1, 2024

Adds person and voice sample models. Also adds an abstract identification service which we can implement for different embedding models/strategies.

Persons can be enrolled from the CLI, but we will be able to tag them from the UI as well. actual identification not implemented yet.

class VoiceSample(CreatedAtMixin, table=True):
id: Optional[int] = Field(default=None, primary_key=True)
filepath: str = Field(...)
speaker_embeddings: dict = Field(default={}, sa_column=Column(JSON))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the key is embedding model can we name this explicitly speaker_embeddings_by_model?

# Use batch operations to support SQLite ALTER TABLE for adding constraints
with op.batch_alter_table('utterance', schema=None) as batch_op:
batch_op.add_column(sa.Column('person_id', sa.Integer(), nullable=True))
batch_op.create_foreign_key('fk_utterance_person', 'person', ['person_id'], ['id'])
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to store the vector embedding of the voice here? This way, we would be able to

  • Show distinct speakers in the UI even without having the Persons in the DB
  • On creating a new person, easily find all the instances in the past when that person spoke by fetching all the utterances with similar enough voice embeddings

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

Successfully merging this pull request may close these issues.

None yet

3 participants