Giter Site home page Giter Site logo

strivec's Introduction

Strivec: Sparse Tri-Vector Radiance Fields

Video | Paper

Teaser image

Overal Instruction

  1. We build the initial geometry with the 1st stage of DVGO in our implementation by default, which is use_geo = -1 in config files.
  2. The geometry can be either initialized online (by default) or from other sources in .txt form, which can be enabled with use_geo = 1 and pointfile = /your/file.txt in config files.
  3. You may ignore preprosessing folder, which is initially for our ealy trying and not used here.
  4. You may refer to the comments in ./configs/synthetic-nerf/default/chair.txt for the usage of hyperparameters.

For Synthetic-NeRF dataset, we provide the initial geometry from DVGO (which is the default one in our implementation) and from MVS. Feel free to try both (e.g., use_geo = 1 and pointfile = /your/mvs_file.txt) to see the comparison.

For Scannet dataset, we use the initial geometry provided by the dataset itself. We convert the original .ply file into .txt and you may download from here.

Installation

Requirements

All the codes are tested in the following environment:

  • Linux 18.04+
  • Python 3.6+
  • PyTorch 1.10+
  • CUDA 10.2+

Data Preparation

And the layout should look like this:

Strivec
├── data
│   ├── nerf_synthetic
    │   │   |──default
    │   │   │   |──chair
    │   │   │   │──drums
    │   │   │   |──...
    │   │   |──local_vm
    │   │   │   |──chair
    │   │   │   │──drums
    │   │   │   |──...
    ├── scene0101_04 (scannet)
    │   │   │──exported
    │   │   │──scene0101_04_2d-instance-filt.zip
    │   │   │──...
    ├── scene0241_01 (scannet)
    │   │   │──exported
    │   │   │──scene0241_01_2d-instance-filt.zip
    │   │   │──...
    ├── TanksAndTemple
    │   │   │──Barn
    │   │   │──Caterpillar
    │   │   │──...
    ├── 360 (Mip-NeRF360)
    │   │   │──garden
    │   │   │──room
    │   │   │──...

Training & Evaluation

We not only provide the training and evaluation code to reproduce the results in the paper, but also the code of ablation that uses local VM tensors instead of local CP tensors (results are here).

# hierachical Strivec, without rotation (grid aligned)
python train_hier.py --config ./configs/synthetic-nerf/default/chair.txt

# local VM tensors instead of local CP tensors
train_dbasis.py --config ./configs/synthetic-nerf/local_vm/chair.txt

Visualization

We visualize the local tensors of different scales into ./log/your_scene/rot_tensoRF/0_lvl_k.ply, where k is the kth scale.

visual image

Why our local design is superior than original TensoRF against rotation

Here is a toy example to illustrate the TensoRF-CP (TensoRF-VM is similar) with global decomposition in (left) axis-aligned and (right) non-axis-aligned situations. The bottom shows the grid values. In axis-aligned case, only 1 component is needed to represent the scene (vector bases recover grid values by outer product). In non-axis-aligned case, however, 3 components are needed because the rank of matrix changes from 1 to 3 after scene rotation. While our design with local low-rank tensors can alleviate this issue, i.e., local tensors (2*2) are always rank-1 before and after rotation.

Citation

If you find our code or paper helps, please consider citing:

@INPROCEEDINGS{gao2023iCCV,
  author = {Quankai Gao and Qiangeng Xu and Hao Su and Ulrich Neumann and Zexiang Xu},
  title = {Strivec: Sparse Tri-Vector Radiance Fields},
  booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
  year = {2023}
}

strivec's People

Contributors

xharlie avatar zerg-overmind avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

strivec's Issues

My own dataset geometry error

I tried to generate sparse geometric prior points3D .txt with colmap on my own dataset, but the content form of the specified dataset for this project, such as the geometric prior chair_points.txt of the chair, was not consistent with the prior information generated by colmap, which made it impossible to run experiments on my own dataset.

Here are some of the chair_points.txt:
-6.647680401802062988e-01;-5.306981801986694336e-01;-9.567691683769226074e-01 -6.647680401802062988e-01;-5.306981801986694336e-01;-8.567692041397094727e-01 -6.647680401802062988e-01;-5.306981801986694336e-01;-7.567691802978515625e-01 -6.647680401802062988e-01;-5.306981801986694336e-01;-6.567691564559936523e-01 -6.647680401802062988e-01;-5.306981801986694336e-01;-5.567691326141357422e-01 -6.647680401802062988e-01;-5.306981801986694336e-01;-4.567691683769226074e-01 -6.647680401802062988e-01;-5.306981801986694336e-01;-3.567691445350646973e-01 -6.647680401802062988e-01;-5.306981801986694336e-01;-2.567691802978515625e-01 -6.647680401802062988e-01;-4.306981563568115234e-01;-9.567691683769226074e-01 -6.647680401802062988e-01;-4.306981563568115234e-01;-8.567692041397094727e-01 -6.647680401802062988e-01;-4.306981563568115234e-01;-7.567691802978515625e-01 -6.647680401802062988e-01;-4.306981563568115234e-01;-6.567691564559936523e-01 -6.647680401802062988e-01;-4.306981563568115234e-01;-5.567691326141357422e-01 -6.647680401802062988e-01;-4.306981563568115234e-01;-4.567691683769226074e-01

Here is a section from the geometric prior points3D .txt of my own dataset:
`# 3D point list with one line of data per point:

POINT3D_ID, X, Y, Z, R, G, B, ERROR, TRACK[] as (IMAGE_ID, POINT2D_IDX)

Number of points: 61514, mean track length: 5.30798

32121;1.89701;-2.06392;-1.22377;88;115;79;0.418525;83;1235;90;1316;76;1647;46;2144
32106;-2.75496;-0.305692;0.907331;220;191;177;1.06633;90;1385;76;1481;72;1987;124;1320;128;1969;12;1641
31179;-3.15775;-0.0896899;-0.29309;16;21;17;0.44702;71;5772;90;6490;80;6030
30999;-2.8119;-1.40516;0.390799;147;149;147;0.29395;52;3907;90;4510;83;4171;76;4931
30785;-2.75658;-0.181224;0.870917;174;147;140;1.53711;71;1710;80;1692;90;1842;83;1565;76;6019;46;2518;72;2803;124;1962;128;6646;12;6286;124;7693;31;4216;58;4684
30727;-2.72799;-0.239139;1.25309;172;158;145;1.1437;71;1320;90;1218;83;945;52;1113
30726;-2.79355;-0.637111;0.0574495;172;151;134;0.228956;80;1065;90;1141;46;1718
30725;-2.78021;-0.517449;0.386973;153;128;101;0.35321;52;1002;90;1119;76;1315;46;1859;72;2053;124;1356
30724;-2.78098;-0.536537;0.391568;99;70;79;0.282897;52;1000;90;1116;83;851;76;1164;46;1685;128;2014
30723;-2.77951;-0.517274;0.42304;114;73;71;0.200345;52;999;90;1111;83;983;76;1154;46;1682;72;2044;124;1354
30722;-2.77921;-0.514197;0.434202;106;85;87;0.233056;52;994;90;1110;83;982;76;1153;46;1670;72;2043;124;1353;128;2012
30721;-2.77922;-0.543786;0.470652;178;151;132;0.333867;80;1037;90;1106;76;1144;46;1665;72;6836;124;1340;128;1783
30720;-2.77957;-0.531162;0.486144;180;151;141;0.420966;71;1044;80;1035;90;1105;83;837;76;1140;46;1664;72;1763;128;1782
30719;-2.77203;-0.454851;0.596439;104;82;91;0.283401;80;1167;90;1100;83;968;76;1297;46;1843;72;2009;128;1993
30718;-2.77201;-0.454846;0.59644;104;82;91;0.255148;80;1166;90;1099;83;967;76;1296;46;1842;72;2008;124;1334;128;1992
30717;-2.77298;-0.483323;0.576481;175;140;133;0.448663;71;1043;90;1098;46;1650
30716;-2.77558;-0.496391;0.558868;176;150;136;0.27692;52;986;90;1097;83;829
30715;-2.77558;-0.496391;0.558868;176;150;136;0.27692;52;987;90;1096;83;828
30714;-2.77496;-0.509506;0.607156;185;161;148;0.451083;88;1093;90;1092;128;1756
30713;-2.77047;-0.457525;0.628846;178;152;144;0.318087;71;1041;90;1091;76;1122;46;1643;72;2004;124;1331
30712;-2.76073;-0.423008;0.878355;174;156;142;0.464141;52;976;90;1078;72;6823;124;5351;128;6383
30711;-2.73395;-0.28901;1.40828;179;156;142;0.362601;80;1137;90;1067;83;803;76;5637;72;6731;124;5292;128;6319;12;5756
30710;-2.73411;-0.288799;1.40835;179;156;142;0.364977;80;1138;90;1066;83;802;46;1603;124;5293;128;6318;12;5755;94;6016;31;611;58;4236`

Another question is how do I set the parameters in config based on my dataset?

What is local_gindx_s/l , local_gweight_s/l

Hi.

I was trying to understand the code and I don't know what the local_gindx_s/l and local_gweight_s/l mean, can you please explain or give a hint, like corresponding to which part of the paper? Thanks a lot!!!

Segmentation fault (core dumped)

Hi, I had a problem when I trained the program.

It was "Segmentation fault (core dumped)", and I couldn't find feasible solution.

Could you give some instructions?

Questions about installation

Hi, thanks for sharing the wonderful work and the code!

Here I have a small question regarding the installation. After installing python=3.9 and pytorch=1.10.1, I get an error when running python train_hier.py --config ./configs/TanksAndTemple/Family.txt which raises:
OSError: /home/miniconda3/envs/strivec/lib/python3.9/site-packages/torch/lib/../../../../libcurand.so.10: invalid ELF header

What should I do to solve this?
Thanks in advance!

Configuration for rotation experiments

Hi.

I was trying to reproduce the rotation experiment mentioned in the paper, but found that the corresponding parameters are not provided in the configuration.txt file. Could you please provide a file containing the rotation settings? Thanks a lot!

Checkpoint issue and bad render quality after loading the checkpoints....

HI, I found that there is a weird problem in the checkpoint module:

RuntimeError: Error(s) in loading state_dict for StrivecCP_hier:
size mismatch for density_line.0: copying a param with shape torch.Size([9, 32, 121]) from checkpoint, the shape in current model is torch.Size([9, 32, 122]).
size mismatch for density_line.1: copying a param with shape torch.Size([9, 32, 121]) from checkpoint, the shape in current model is torch.Size([9, 32, 122]).
size mismatch for density_line.2: copying a param with shape torch.Size([9, 32, 121]) from checkpoint, the shape in current model is torch.Size([9, 32, 122]).
size mismatch for density_line.3: copying a param with shape torch.Size([44, 24, 61]) from checkpoint, the shape in current model is torch.Size([44, 24, 62]).
size mismatch for density_line.4: copying a param with shape torch.Size([44, 24, 61]) from checkpoint, the shape in current model is torch.Size([44, 24, 62]).
size mismatch for density_line.5: copying a param with shape torch.Size([44, 24, 61]) from checkpoint, the shape in current model is torch.Size([44, 24, 62]).
size mismatch for app_line.0: copying a param with shape torch.Size([9, 48, 121]) from checkpoint, the shape in current model is torch.Size([9, 48, 122]).
size mismatch for app_line.1: copying a param with shape torch.Size([9, 48, 121]) from checkpoint, the shape in current model is torch.Size([9, 48, 122]).
size mismatch for app_line.2: copying a param with shape torch.Size([9, 48, 121]) from checkpoint, the shape in current model is torch.Size([9, 48, 122]).
size mismatch for app_line.3: copying a param with shape torch.Size([44, 48, 61]) from checkpoint, the shape in current model is torch.Size([44, 48, 62]).
size mismatch for app_line.4: copying a param with shape torch.Size([44, 48, 61]) from checkpoint, the shape in current model is torch.Size([44, 48, 62]).
size mismatch for app_line.5: copying a param with shape torch.Size([44, 48, 61]) from checkpoint, the shape in current model is torch.Size([44, 48, 62]).

Size mismatch when loading a saved checkpoint, the config file is not modified when loading the checkpoint. However, it can work if I
modify the local_dims_file from [121, 121, 121, 61, 61, 61, 31, 31, 31] to [120, 120, 120, 60, 60, 60, 31, 31, 31]. But it just help avoid the problem not solve it ...... Also, the rendered image quality is not as good as the image rendered during the training process(novel views.) I think the problem may be these dimension mismatch things........

This is the image output(render only) using the checkpoint after 30000 iterations....
020

This is the image output during the test time inside the training process(even just 4k iterations):
003999_020

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.