All Projects → DmitryUlyanov → Neural Style Audio Torch

DmitryUlyanov / Neural Style Audio Torch

Torch implementation for audio neural style.

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to Neural Style Audio Torch

Torch Models
Stars: ✭ 65 (-50%)
Mutual labels:  torch, style-transfer, neural-style
Texture nets
Code for "Texture Networks: Feed-forward Synthesis of Textures and Stylized Images" paper.
Stars: ✭ 1,147 (+782.31%)
Mutual labels:  torch, style-transfer, neural-style
neural-style-pytorch
Neural Style implementation in PyTorch! 🎨
Stars: ✭ 50 (-61.54%)
Mutual labels:  style-transfer, neural-style
Neural-Zoom-Legacy
Infinite Zoom For Style Transfer
Stars: ✭ 14 (-89.23%)
Mutual labels:  style-transfer, neural-style
Torch2coreml
Torch7 -> CoreML
Stars: ✭ 363 (+179.23%)
Mutual labels:  torch, neural-style
MeuralPaint
TensorFlow implementation of CNN fast neural style transfer ⚡️ 🎨 🌌
Stars: ✭ 19 (-85.38%)
Mutual labels:  style-transfer, neural-style
Keras-Style-Transfer
An implementation of "A Neural Algorithm of Artistic Style" in Keras
Stars: ✭ 36 (-72.31%)
Mutual labels:  style-transfer, neural-style
Fast Neural Doodle
Faster neural doodle
Stars: ✭ 339 (+160.77%)
Mutual labels:  torch, neural-style
Tensorflow Fast Style Transfer
A simple, concise tensorflow implementation of fast style transfer
Stars: ✭ 224 (+72.31%)
Mutual labels:  style-transfer, neural-style
Neural Style Pt
PyTorch implementation of neural style transfer algorithm
Stars: ✭ 456 (+250.77%)
Mutual labels:  style-transfer, neural-style
Adain Style
Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization
Stars: ✭ 1,049 (+706.92%)
Mutual labels:  style-transfer, neural-style
Neural-Tile
A better tiling script for Neural-Style
Stars: ✭ 35 (-73.08%)
Mutual labels:  style-transfer, neural-style
Online Neural Doodle
Feedforward neural doodle
Stars: ✭ 183 (+40.77%)
Mutual labels:  torch, neural-style
Neural-Zoom
Infinite Zoom For Style Transfer
Stars: ✭ 34 (-73.85%)
Mutual labels:  torch, neural-style
Samplernn torch
Torch implementation of SampleRNN: An Unconditional End-to-End Neural Audio Generation Model
Stars: ✭ 146 (+12.31%)
Mutual labels:  torch, audio
Tensorflow Style Transfer
A simple, concise tensorflow implementation of style transfer (neural style)
Stars: ✭ 278 (+113.85%)
Mutual labels:  style-transfer, neural-style
Neural Tools
Tools made for usage alongside artistic style transfer projects
Stars: ✭ 150 (+15.38%)
Mutual labels:  style-transfer, neural-style
Faststyle
Tensorflow implementation of fast neural style transfer.
Stars: ✭ 170 (+30.77%)
Mutual labels:  style-transfer, neural-style
Neural Style Audio Tf
TensorFlow implementation for audio neural style.
Stars: ✭ 413 (+217.69%)
Mutual labels:  style-transfer, neural-style
Fast Style Transfer
TensorFlow CNN for fast style transfer ⚡🖥🎨🖼
Stars: ✭ 10,240 (+7776.92%)
Mutual labels:  style-transfer, neural-style

Audio texture synthesis (and a bit of stylization)

This is an extension of texture synthesis and style transfer method of Leon Gatys et al. based on Justin Johnson's code for neural style transfer.

To listen to examples go to the blog post. Almost identical Lasagne implementation by Vadim Lebedev can be found here. Also check out TensorFlow implementation.

Examples

As there is no way to embed an audio player with github markdown please follow this link for the examples of texture synthesis and style transfer.

Prerequisites

wget https://www.dropbox.com/s/xpyoehayuhxvibq/net.t7?dl=1 -O data/net.t7
wget https://www.dropbox.com/s/dwsq33r5bsgy9cd/mean.t7?dl=1 -O data/mean.t7

Usage

1. First convert raw audio to spectrogram
python get_spectrogram.py --in_audio <path to audio file> --out_npy <where to save spectrogram>

Additional arguments:

  • -offset and -duration control boundaries of a segment which will be converted to spectrogram. [By default first 10 seconds are used].
  • -sr: sample rate (samples), [default = 44100].
  • -n_fft: FFT window size (samples) [default = 1024].
2. Run texture synthesis or style transfer

This is the cmd used for all the texture synthesis examples:

th neural_style_audio.lua -content <path to content.npy> -style <path to style.npy> -content_layers <indices of content layers> -style_layers <indices of style layers> -style_weight <number> -content_weight <number>

Parameters:

  • -content, -style are paths to .npy spectrogram files generated previously.
  • -content_layers, -style_layers: comma separated layer indices (the provided net has about 50 layers and of encoder-decoder type).
  • -style_weight, -content_weight: set content_weight to zero for texture synthesis.
  • -lowres: the higher receptive field the larger textures network captures. The easiest way to increase a receptive field is to drop every other column from an input spectrogram (kind of downscaling). Use this flag to process spectrogram both in original and low resolution at the same time.
  • -how_div, -normalize_gradients, -loss change some details of loss calculation.
  • -save indicates folder to save intermediate results.
3. Convert spectrogram back to audio file
python invert_spectrogram.py --spectrogram_t7 <path to synthesized spectrogram> --out_audio keyboard2_texture.wav

Parameters:

Command-line used for texture examples

python get_spectrogram.py --out_npy data/inputs/keyboard2.npy --in_audio data/inputs/keyboard2.mp3
th neural_style_audio.lua -style data/inputs/keyboard2.npy -content_layers '' -style_layers 1,5,10,15,20,25 -style_weight 10000000 -optimizer lbfgs -learning_rate 1e-1 -num_iterations 5000 -lowres
python invert_spectrogram.py --spectrogram_t7 data/out/out.png.t7 --out_audio data/outputs/keyboard2_texture.wav

Command-line used for style transfer

We have also implemented minimalistic script identical to TensorFlow and Lasagne scripts. Here is example how to use it:

python get_spectrogram.py --out_npy data/inputs/usa.npy --in_audio data/inputs/usa.mp3 --n_fft 2048 --sr 22050
python get_spectrogram.py --out_npy data/inputs/imperial.npy --in_audio data/inputs/imperial.mp3 --n_fft 2048 --sr 22050
th neural_style_audio_random.lua -alpha 1e-2
python invert_spectrogram.py --spectrogram_t7 data/out/out.t7 --out_audio out.wav --n_iter 500 --n_fft 2048 --sr 22050
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].