Git Product home page Git Product logo

stgan's Introduction

STGAN: Spectral-temporal sound effects generation with RNN-GAN

This repository provides implementations for a lecture presentation and a conference proceedings at the Acoustics 2023 Sydney conference.

We use RNN for the sound generator. The sound generation is guided and conditioned by a loudness envelope and a class label. We use a vanilla WGAN-GP discriminator to compute the adversarial loss on the generated Mel Spectrograms. For the generator loss, we further include a MSE reconstruction loss on the loudness difference between the generated and original Mel Spectrogram. The generated Mel spectrogram can be converted back to audio using a pretrained HIFIGAN vocoder from AudioLDM.

Model architecture

Training:

image

Inference:

image

Requirements:

pip install -r requirements.txt

Preprocess:

Configure appropriate parameters for the preprocessing and training using config.json. You should ensure that your dataset folder contains subcategories, because our model integrates class labels as conditioning vectors. Run 'python preprocess.py' and it will save the preprocessed features and data into a folder called 'preprocessed'

Train:

Run

python train.py

to train your model. Adjust the save_freq to save your model how many iterations you would like to save. This will save the state-dict so you could later load them with torch.

Generate:

Run

python generate.py

command to generate a number of audio samples by extracting loudness from an audio folder. This will use the extracted loudness from an audio folder as conditioning input for audio generation. Notice the latent vector is sampled randomly. You could adjust this to generate different outputs.

stgan's People

Contributors

reinliu avatar

Stargazers

 avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.