Jake-Jay / styleNeRF

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

styleNeRF

Style transfer for neural radiance fields, based on a PyTorch Lightning implementation and official PyTorch implementation of fast neural style transfer.

Download the blender dataset

Download nerf_synthetic.zip from here and extract the content under ./datasets

Train the model

From the command line:

python train.py --dataset_name blender --root_dir $BLENDER_DIR --N_importance 64 --img_wh 400 400 --noise_std 0 --num_epochs 20 --batch_size 1024 --optimizer adam --lr 5e-4 --lr_scheduler cosine --exp_name exp

Add --encode_a for appearance embedding, --encode_t for transient embedding.

You can monitor the training process by tensorboard --logdir runs and go to localhost:6006 in your browser.

Pretrained models and logs

You can download the pretrained models and training logs in release.

Testing

Use eval.py to create the whole sequence of moving views. E.g.

python eval.py \
   --root_dir $BLENDER \
   --dataset_name blender --scene_name lego \
   --img_wh 400 400 --N_importance 64 --ckpt_path $CKPT_PATH

It will create folder results/{dataset_name}/{scene_name} and run inference on all test data, finally create a gif out of them.

nerf-u

Notes on differences with the paper

  • Current base MLP uses 8 layers of 256 units as the original NeRF, while NeRF-W uses 512 units each.
  • Current static head uses 1 layer as the original NeRF, while NeRF-W uses 4 layers.
  • Softplus activation for sigma (reason explained here) while NeRF-W uses relu.

About

License:GNU General Public License v3.0


Languages

Language:Python 100.0%