Tensorflow implementation of Transport-Based Neural Style Transfer for Smoke Simulations.
Byungsoo Kim, Vinicius C. Azevedo, Markus Gross, Barbara Solenthaler
Computer Graphics Laboratory, ETH Zurich
This code is tested on Windows 10 and Ubuntu 16.04 with GTX 1080 (8GB) and the following requirements:
Firstly, clone our code including mantaflow:
$ git clone --recurse-submodules https://gitlab.ethz.ch/cglsim/neural-flow-style.git
Then run setup.bat
or setup.sh
for setup. (might need to change)
Lastly, download the pre-trained inception network, and unzip it in data/model
.
Run a script for the dataset generation using mantaflow. For instance,
$ .\manta\build\Release\manta.exe ./scene/smoke_gun.py
This script will simulate a smoke gun
scene described in our paper and store density and velocity fields in data/smoke_gun/d
and data/smoke_gun/v
, respectively.
Note that the current version only supports npz
numpy array format.
To stylize a single frame with a net structure:
$ python styler.py --tag net --content_layer mixed3b_3x3_bottleneck_pre_relu --content_channel 44
For further details about parameters and examples, please take a closer look at run.bat
or run.sh
, and for semantic transfer, see this page for pattern selection.
We also provide a Houdini plugin, a user-friendly and an artist-centered tool for Smoke Stylization.
This tool lets you take smoke simulations you've created in Houdini and stylize them. This gives them the aesthetic and apperance of your choice, whilst remaining governed by the physical accuracy of the simulation.
-
Ensure you have Houdini installed. If not, download it.
- You do not need the commercial version.
-
Open a Houdini smoke simulation or create one from scratch. Regardless, you should have a "pyro_import" geometry node.
-
File > Import > Houdini Digital Asset..., navigate to the this repository and select a smoke_stylizer.hdanc file. Click Install.
-
Enter the "pyro_import" geometry node. In the /obj/pyro_import Network view, Add > Node > Digital Assets > Smoke stylizer.
-
Connect the "import pyrofields" node's output to the input of our "Smoke_Stylizer_Oz" node.
-
Click on the Smoke Stylizer digital asset. Set the "Python version" and "Python Path" to that of the Houdini-independent python you have installed (e.g.,
C:\Users\user_name\AppData\Local\Programs\Python\Python36
). Set the "Stylizer Path" to this repository (e.g.,C:\Users\user_name\dev\neural-flow-style
). -
Tweak other details as you wish. Otherwise, click "New Stylization". Stylization will begin on the next frame after.
- If confused, you may refer to our example scene, demo.hipnc
Penelope Tay / @ozeuth for Houdini Plugin