fad_gen

Produce directories of real and fake audio

This program may not be needed if you already have directories of real & fake audio.

Sample calling sequence(s):

Single GPU, local data:

fad_gen test autoencoder.ts "real1/ real2/ real3/"

Multiple GPUs, data on S3:

accelerate launch fad_pytorch/fad_gen.py 5s_simple model_checkpoint.ts "s3://s-laion-audio/webdataset_tar/freesound_no_overlap/ s3://s-laion-audio/webdataset_tar/epidemic_sound_effects/" -p "{'s3://s-laion-audio':'default'}"

General calling sequence:

$ fad_gen -h
usage: fad_gen [-h] [-b BATCH_SIZE] [--n N] [--num_workers NUM_WORKERS] [-p PROFILES] [--sample_rate SAMPLE_RATE] [-s SAMPLE_SIZE]
               name model_ckpt data_sources

positional arguments:
  name                  Name prefix for output directories: <name>_reals/ & <name>_fakes/
  model_ckpt            TorchScript (.ts) (Generative) Model checkpoint file
  data_sources          Space-separated string listing either S3 resources or local directories (but not a mix of both!) for real data

optional arguments:
  -h, --help            show this help message and exit
  -b BATCH_SIZE, --batch_size BATCH_SIZE
                        batch size (default: 2)
  --n N                 Number of real/fake samples to grab/generate, respectively (default: 256)
  --num_workers NUM_WORKERS
                        Number of pytorch workers to use in DataLoader (default: 12)
  -p PROFILES, --profiles PROFILES
                        String representation of dict {resource:profile} (default: )
  --sample_rate SAMPLE_RATE
                        sample rate (will resample inputs at this rate) (default: 48000)
  -s SAMPLE_SIZE, --sample_size SAMPLE_SIZE
                        Number of samples per clip (default: 262144)

source

gen

 gen (args)

source

main

 main ()