Paper Reference: https://arxiv.org/pdf/1508.06576.pdf
Configuration used:
- Optimizer Used: L-BFGS
- Content Layer = 'Conv_5'
- Style Layer = 'Conv_1', 'Conv_2', 'Conv_3', 'Conv_4', 'Conv_5'
- CNN = VGG-19 (Pre-trained)
- GPU = Nvidia 1080Ti
Style Image | Content Image | CW | SW | NST Image |
---|---|---|---|---|
1 | 1000000 | |||
1 | 1000000 | |||
10 | 100000 | |||
1 | 1000000 | |||
1 | 1000000 |
The below snapshot is the various stages of NST specifically at a gap of 100 iterations of the LBFGS optimizer from 0 to number of steps.
Note above samples are on Nvidia 1080Ti GPU and use L-BFGS optimizer. To use L-BFGS need a GPU machine with CUDA installed. For torch.cuda.is_available() is false use Adam optimizer instead
If starting from noise_img otherwise give the starting image as input.
-
Create a virtual Environment
conda create -n env
-
Activate the environment
conda activate env
-
Install Pytorch
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
-
Run
python main.py --style 'edtaonisl.jpg' --content 'green_bridge.jpeg' --input "noise" --style_weight 1000000 --content_weight 1 --num_steps 500
-
To Run using Gradio
python gradio_nst.py