Skip to content

uvm-plaid/dpvc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Differentially Private Anonymization via Voice Control

This repository provides a library for defining differentially private speaker anonymization systems using existing voice control models. The approach works for any voice control system that separates utterance information into constant-length speaker information (e.g. a speaker embedding) and time-varying content information (e.g. semantic features).

Click here for full documentation

Installation

Install the library by cloning this repository and then running:

pip install .

Example: OpenVoice

The library provides a wrapper around the OpenVoice voice control system. A minimal example of using it is as follows:

import dpvc
vc_wrapper = dpvc.OpenVoiceWrapper()
anonymizer = dpvc.Anonymizer(vc_wrapper)
anonymizer.anonymize(src_path, output_path, noise_level=1.0)

Here, src_path should be an input .wav file name, and output_path should be the output .wav file name. The noise_level parameter controls how much noise is added in the differential privacy step. The OpenVoiceWrapper object encapsulates the OpenVoice models, and the anonymize method performs the anonymization via differential privacy.

See the following files for examples of use:

  • examples/openvoice_inference.py contains a more complete example of anonymization using the OpenVoice wrapper
  • examples/openvoice_train_vae.py contains an example of how to train a custom DP-VAE for use in the anonymizer

Example: NaturalSpeech 3

Install NaturalSpeech 3's FACodec with:

pip install git+https://github.com/lifeiteng/naturalspeech3_facodec.git

Then use the wrapper as follows:

import dpvc
vc_wrapper = dpvc.NaturalSpeech3Wrapper()
anonymizer = dpvc.Anonymizer(vc_wrapper)
anonymizer.anonymize(src_path, output_path, noise_level=1.0)

Building Documentation

The documentation is built with MkDocs. To build the documentation:

pip install mkdocs "mkdocstrings[python]" mkdocs-material
mkdocs build

About

Differential privacy for voice control

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors