sunniesuhyoung / Dst

Deformable Style Transfer (ECCV 2020)

Projects that are alternatives of or similar to Dst

Shapematchinggan
[ICCV 2019, Oral] Controllable Artistic Text Style Transfer via Shape-Matching GAN
Stars: ✭ 315 (+88.62%)
Mutual labels:  jupyter-notebook, style-transfer
Tensorflow 101
TensorFlow 101: Introduction to Deep Learning for Python Within TensorFlow
Stars: ✭ 642 (+284.43%)
Mutual labels:  jupyter-notebook, style-transfer
Neural Style Audio Tf
TensorFlow implementation for audio neural style.
Stars: ✭ 413 (+147.31%)
Mutual labels:  jupyter-notebook, style-transfer
Deep Learning V2 Pytorch
Projects and exercises for the latest Deep Learning ND program https://www.udacity.com/course/deep-learning-nanodegree--nd101
Stars: ✭ 4,457 (+2568.86%)
Mutual labels:  jupyter-notebook, style-transfer
Neural Painters X
Neural Paiters
Stars: ✭ 61 (-63.47%)
Mutual labels:  jupyter-notebook, style-transfer
Zhihu
This repo contains the source code in my personal column (https://zhuanlan.zhihu.com/zhaoyeyu), implemented using Python 3.6. Including Natural Language Processing and Computer Vision projects, such as text generation, machine translation, deep convolution GAN and other actual combat code.
Stars: ✭ 3,307 (+1880.24%)
Mutual labels:  jupyter-notebook, style-transfer
Hidt
Official repository for the paper "High-Resolution Daytime Translation Without Domain Labels" (CVPR2020, Oral)
Stars: ✭ 513 (+207.19%)
Mutual labels:  jupyter-notebook, style-transfer
Style transfer
CNN image style transfer 🎨.
Stars: ✭ 210 (+25.75%)
Mutual labels:  jupyter-notebook, style-transfer
Style Transfer
Style Transfer - Alia Bhatt (Google Colab)
Stars: ✭ 26 (-84.43%)
Mutual labels:  jupyter-notebook, style-transfer
Py Style Transfer
🎨 Artistic neural style transfer with tweaks (pytorch).
Stars: ✭ 23 (-86.23%)
Mutual labels:  jupyter-notebook, style-transfer
Pytorch Multi Style Transfer
Neural Style and MSG-Net
Stars: ✭ 687 (+311.38%)
Mutual labels:  jupyter-notebook, style-transfer
Deep Learning With Python
Example projects I completed to understand Deep Learning techniques with Tensorflow. Please note that I do no longer maintain this repository.
Stars: ✭ 134 (-19.76%)
Mutual labels:  jupyter-notebook, style-transfer
Neural Painters Pytorch
PyTorch library for "Neural Painters: A learned differentiable constraint for generating brushstroke paintings"
Stars: ✭ 118 (-29.34%)
Mutual labels:  jupyter-notebook, style-transfer
Cartoonify
Deploy and scale serverless machine learning app - in 4 steps.
Stars: ✭ 157 (-5.99%)
Mutual labels:  jupyter-notebook, style-transfer
Deformable Convnets Caffe
Deformable Convolutional Networks on caffe
Stars: ✭ 166 (-0.6%)
Mutual labels:  jupyter-notebook
Recommendersystems pydata 2016
Stars: ✭ 166 (-0.6%)
Mutual labels:  jupyter-notebook
Capsnet Traffic Sign Classifier
A Tensorflow implementation of CapsNet(Capsules Net) apply on german traffic sign dataset
Stars: ✭ 166 (-0.6%)
Mutual labels:  jupyter-notebook
Mixture model trading public
Stars: ✭ 166 (-0.6%)
Mutual labels:  jupyter-notebook
Signals And Systems Lecture
Continuous- and Discrete-Time Signals and Systems - Theory and Computational Examples
Stars: ✭ 166 (-0.6%)
Mutual labels:  jupyter-notebook
Azure Cosmosdb Spark
Apache Spark Connector for Azure Cosmos DB
Stars: ✭ 165 (-1.2%)
Mutual labels:  jupyter-notebook

Deformable Style Transfer (DST)

Project Page | Paper | Demo | 1 Minute Video | 10 Minute Talk

This repo provides the source code and demo of our paper: Deformable Style Transfer (ECCV 2020).

It also contains a pytorch implementation of a differentiable warping module that uses thin-plate spline interpolation. This is a reimplementation of WarpGAN's tensorflow code.

@InProceedings{Kim20DST,
  author = {Sunnie S. Y. Kim and Nicholas Kolkin and Jason Salavon and Gregory Shakhnarovich},
  title = {Deformable Style Transfer},
  year = {2020},  
  booktitle = {European Conference on Computer Vision (ECCV)}  
}

Dependencies

  • Python 3 (e.g. conda create -n DST python=3.7.3)
  • pytorch, torchvision, cudatoolkit, numpy, PIL, matplotlib, sklearn

Demo

See demo_DST.ipynb for a demo of our work. You can also run this demo on Google Colab.
See demo_warp.ipynb for a short demo of the warping module we use to deform images.

Usage

See job_example.sh for a single script that will produce a DST output, given a pair of content and style images, with default settings that we like.

1. Run NBB to get correspondences

Run NBB to find correspondences between images. This will take about a minute or two to run. If you already have matching points, you can skip this step.

python NBB/main.py --results_dir ${results_dir} --imageSize ${im_size} --fast \
  --datarootA ${content_path} --datarootB ${style_path}

2. Clean (NBB) points

If you're cleaning NBB points, set NBB to 1. This script will filter out points with low activations and select up to max_num_points with at least b space between them. Then it will remove crossing points.

If you're cleaning non-NBB points, set NBB to 0, and this script will only remove crossing points.

This will take a few seconds to run.

python cleanpoints.py ${content_path} ${style_path} ${content_pts_path} ${style_pts_path} \
  ${activation_path} ${output_path} ${im_size} ${NBB} ${max_num_points} ${b}

3. Run DST

Finally, run deformable style transfer. Stylization will take a few minutes on a GPU.

By default, DST will stylize the image at three scales (small to big) with max_iter iterations at each scale. Change content_weight (alpha) and warp_weight (beta) to control the relative importance of content preservation and deformation to stylization, and reg_weight (gamma) to control the amount of regularization on the deformation. We like using 8, 0.5, and 50, respectively.

Set verbose to 1 to get the individual loss term values during training.
Set save_intermediate to 1 to get intermediate stylized images every checkpoint_iter iterations.
Set save_extra to 1 to get additional plots (e.g. content/stylized images naively warped, content image with DST warp) with points and arrows marked.

python main.py ${content_path} ${style_path} ${content_pts_path} ${style_pts_path} \
  ${output_dir} ${output_prefix} ${im_size} ${max_iter} \
  ${checkpoint_iter} ${content_weight} ${warp_weight} ${reg_weight} ${optim} \
  ${lr} ${verbose} ${save_intermediate} ${save_extra} ${device}

Acknowledgment

Our code is based on code from the following papers:

  • Style Transfer by Relaxed Optimal Transport and Self-Similarity. Nicholas Kolkin, Jason Salavon and Gregory Shakhnarovich. CVPR 2019. [paper] [code] [David Futschik's implementation]
  • WarpGAN: Automatic Caricature Generation. Yichun Shi, Debayan Deb and Anil K. Jain. CVPR 2019. [paper] [code]
  • Neural Best-Buddies: Sparse Cross-Domain Correspondence. Kfir Aberman, Jing Liao, Mingyi Shi, Dani Lischinski, Baoquan Chen and Daniel Cohen-Or. SIGGRAPH 2018. [paper] [code]
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].