Skip to main content

An unofficial minimal package for using BigVGAN at inference time

Project description

BigVGAN Inference

An unofficial minimal package for using BigVGAN at inference time

PyPI version License Python versions

Installation

pip install bigvganinference

or install from source:

git clone https://github.com/thunn/BigVGANInference.git
cd BigVGANInference
poetry install

Usage

Loading model is as simple as:

from bigvganinference import BigVGANInference

# -- model loading ---

# model is loaded, set to eval and weight norm is removed
model = BigVGANInference.from_pretrained(
    'nvidia/BigVGAN-V2-44KHZ-128BAND-512X', use_cuda_kernel=False
)

# also supports loading from local directory
model = BigVGANInference.from_pretrained(
    "path/to/local/model", use_cuda_kernel=False
)

# --- usage example ---

path_to_audio = "path/to/audio.wav"
wav, sr = librosa.load(path_to_audio, sr=model.h.sampling_rate, mono=True)

# get mel spectrogram using bigvgan's implementation
mel = model.get_mel_spectrogram(wav)

# generate waveform from mel
# note: torch.inference_mode() is used internally
output_audio = model(input_mel)

See the example for full usage example.

Acknowledgements

This is an unofficial implementation based on original BigVGAN repository.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bigvganinference-0.0.3.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bigvganinference-0.0.3-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file bigvganinference-0.0.3.tar.gz.

File metadata

  • Download URL: bigvganinference-0.0.3.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for bigvganinference-0.0.3.tar.gz
Algorithm Hash digest
SHA256 d2eb998ac17e5fa275b3a46f6253881f0752a37648c3fc50c34128c41dbae0e6
MD5 94b5fb893bfe578dae5af85c6cc9de6b
BLAKE2b-256 23440c1c7b74f87bef7446d590b1237e5547f356fef163e82271825833b13ce2

See more details on using hashes here.

Provenance

The following attestation bundles were made for bigvganinference-0.0.3.tar.gz:

Publisher: build-package.yaml on thunn/BigVGANInference

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bigvganinference-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for bigvganinference-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 290cbe4077e08230ce7ee67998f7ec527543efee15b7c3ae016bb0eb3dd81b2e
MD5 b7fecc56a70de8234014c863d2deccdc
BLAKE2b-256 54754ccf5db5f1763318e91bfd1461f952d4c554f45a81182d2c1eb7bc52bb73

See more details on using hashes here.

Provenance

The following attestation bundles were made for bigvganinference-0.0.3-py3-none-any.whl:

Publisher: build-package.yaml on thunn/BigVGANInference

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page