Create TensorFlow layers and models for audio preprocessing and audio data augmentation:
✔️ No dependency other than TensorFlow
✔️ Can utilize GPU
✔️ Online preprocessing and data augmentation
✔️ Deploy preprocessing logic in production with the saved model
Teal is in very early stage and a lot of work is to be done. Please feel free to reach out if you'd like to help out!! 😄
Install would be using pip
:
pip install --user git+https://github.com/am1tyadav/teal.git
import tensorflow as tf
import teal
NUM_SAMPLES = 44100
SAMPLE_RATE = 22050
N_FFT = 2048
HOP_LEN = 512
N_MELS = 64
log_mel_model = tf.keras.models.Sequential([
tf.keras.layers.Input(shape=(NUM_SAMPLES,)),
teal.AudioToMelSpectrogram(SAMPLE_RATE, N_FFT, HOP_LEN, N_MELS),
teal.PowerToDb()
])
# Save it as a Keras model or TF saved model
log_mel_model.save("log_mel.h5")
import tensorflow as tf
import teal
NUM_SAMPLES = 44100
audio_augmentation_model = tf.keras.models.Sequential([
tf.keras.layers.Input(shape=(NUM_SAMPLES,)),
teal.InversePolarity(0.5),
teal.RandomNoise(0.2),
teal.RandomGain(0.5)
])
Audio Classification with TensorFlow and Teal
- AudioToSTFT
- AudioToSpectrogram
- AudioToMelSpectrogram
- STFTToSpecAndPhase
- STFTToSpectrogram
- STFTToPhase
- SpectrogramToMelSpec
- PowerToDb
- DbToPower
- NormalizeAudio
- NormalizeSpectrum
- InversePolarity
- NoiseBank
- RandomGain
- RandomNoise
- PitchShift