This repository contains the code for the paper "A Simple And Effective Filtering Scheme For Improving Neural Fields".
The code has been tested on Ubuntu 18.04, please follow the following instructions to install the requirements.
conda create --name finn python=3.7
conda activate finn
conda install pytorch==1.4.0 cudatoolkit=10.2 torchvision -c pytorch
pip install -r requirements.txt
- Run the following command:
python image_regress.py -g 0 --data './data' --model FINN
to regress all images located at folderdata
using the networkFINN
on gpu0
. - To fit a single image, use the following command:
python image_regress.py -g 0 --data './data/reference_1.png' --model FINN
instead. - For an alternative network, e.g.,
FFN
, use the command:python image_regress.py -g 0 --data './data/reference_1.png' --model FFN
. - Generate an image with arbitary resolution, e.g.,
1000
, runpython image_regress.py --ckpt pretrained_checkpoint_path --test_file save_to_file --model FINN -g 3 --res 1000
.
- Run the following command:
python statistics_images.py
for PSNR statistics. - For the ꟻLIP metric, please use the code from NVIDIA
-
Run the following command:
python surface_reconstruct.py --data './test.xyz' --pc_num 100000 --model FINN -g 0
to train the point cloud using the networkFINN
. At each iteration,100000
points are randomly sampled. -
Generate a mesh from the signed distance field with an arbitrary resolution, e.g.,
1600
, runpython surface_reconstruct.py --ckpt pretrained_checkpoint_path --test_file save_to_file --model FINN -g 3 --res 1600
. -
Run the following command:
python calc_error_abc.py --gt './shapename.obj' --pred './logs/shapename_FINN/mesh/10000.ply'
to compute reconstruction error indicated by the chamfer distance.
- We use a simplified version of NeRF for demonstration. We replace the 'Positional Encodering' with 'Gaussian Random Fourier Feature Mapping' and apply 'Filtering' to MLPs. The source code is at file folder
./tiny-nerf
. - Run the following command:
python run_nerf.py --config ./configs/fern.txt -g 0
to train on 'Fern' dataset. The testing PSNR will be saved.
- Download the datasets for image regression and 3D reconstruction from google drive.
- Download the datasets, following the instruction of nerf-pytorch.
Please cite our work if you find it useful:
@article{zhuang2023finn,
title={A Simple And Effective Filtering Scheme For Improving Neural Fields},
author={Zhuang, Yixin},
journal={Computational Visual Media},
year={2024}
}