Home

Awesome

FvOR: Robust Joint Shape and Pose Optimization for Few-view Object Reconstruction

<img src="data/03001627_ea87765cf9dbe2fe55f46d55537192b6-000003-000002-000000-000021-000012.gif" width="115" height="115" /><img src="data/03001627_e401be99c5a51d8bef8e9284f76f3024-000007-000017-000009-000011-000023.gif" width="115" height="115" /><img src="data/03001627_e93d141a3dd25b46219e03e23fb59d78-000007-000005-000016-000011-000013.gif" width="115" height="115" /><img src="data/03001627_f4e24cf8c5d0c5c31dbb0393636b3531-000014-000007-000006-000019-000015.gif" width="115" height="115" /><img src="data/04379243_f1252c297d7ad9a47c51ec7d2716b33d-000020-000014-000018-000023-000021.gif" width="115" height="115" /><img src="data/03001627_fa7f42b395c3cfce520ab6214a789faf-000001-000015-000003-000012-000002.gif" width="115" height="115" /><img src="data/03001627_d7da1c65f996cef2febad4f49b26ec52-000007-000010-000020-000006-000021.gif" width="115" height="115" />

Paper

<br/>

⚙️ Installation

Our system uses CUDA10.1. Setup the environment with following commands:

conda create --name fvor python=3.8.0
conda activate fvor
conda install pytorch==1.7.1 torchvision==0.8.2 cudatoolkit=10.1 -c pytorch
pip install -r requirements.txt

python setup.py build_ext --inplace

cd ./src/lib/sdf_extension
python setup.py install
cd ../../../

:file_folder: Download

Our ShapeNet dataset are based on Occupancy Network. Please go to Occupancy Network and download their processed data. And also download and uncompress our processed data and index file. You should make a folder structure as follows:

.
└── data
    └── shapenet
        ├── FvOR_ShapeNet
        │   └── 03001627
        │       └── ae02a5d77184ae2638449598167b268b
        ├── index
        │   ├── data
        │   │   └── 03001627_ae02a5d77184ae2638449598167b268b.npz
        │   ├── test.txt
        │   ├── train.txt
        │   └── val.txt
        └── ShapeNet   <- Occupancy Network's processed data
            └── 03001627
                └── ae02a5d77184ae2638449598167b268b

We also test our approach on HM3D-ABO dataset. Please follow the instructions in HM3D-ABO to setup the dataset.

⏳ ShapeNet

<details> <summary>Click to expand </summary>

Training

First download and extract ShapeNet training data and split. Then run following command to train our model.

Train Pose Init Module

bash scripts/shapenet/pose_init.sh  ./configs/shapenet/config_pose_init_fvor.yaml

Train Shape Init Module

bash scripts/shapenet/shape_init.sh  ./configs/shapenet/config_shape_init_fvor.yaml 

Joint Shape-and-Pose Optimization Module

You need to first train the shape init module. Then provided that checkpoint as the initial weight for training joint shape-and-pose optimization module.

bash scripts/shapenet/joint.sh  ./configs/shapenet/config_joint.yaml --noise_std 0.005

     

Testing

First download and extract data, split and pretrained models.

Shape Module

Testing FvOR recon model trained with Ground Truth camera poses.

bash scripts/shapenet/test_shape_init.sh  ./configs/shapenet/config_shape_init_fvor.yaml

You should get following results where for each metric we show mean/median:

classesIoUChamfer-L1Normal
car0.78966/0.861600.00902/0.007800.88122/0.88809
bench0.72131/0.742750.00459/0.004200.91949/0.93939
cabinet0.84035/0.912160.00670/0.006050.93675/0.94482
rifle0.82634/0.839850.00267/0.002400.94196/0.95006
loudspeaker0.80380/0.858840.00970/0.008410.91553/0.93439
sofa0.83387/0.885550.00638/0.005470.94379/0.95480
watercraft0.74418/0.778340.00717/0.006300.89389/0.89511
table0.68933/0.710800.00631/0.005360.93191/0.94281
airplane0.80502/0.824660.00328/0.002560.92771/0.94142
telephone0.87473/0.893830.00396/0.003360.97978/0.98560
lamp0.68345/0.712130.00616/0.005080.90505/0.91853
display0.79516/0.811130.00613/0.005460.95023/0.95460
chair0.74117/0.759400.00615/0.005200.93033/0.94113
Overall0.78064/0.814700.00602/0.005200.92751/0.93775

Pose Module

Testing FvOR pose estimation model.

bash scripts/shapenet/test_pose_init.sh ./configs/shapenet/config_pose_init_fvor.yaml

You should get following results:

classesError_PixError_RotError_Trans
display3.287/0.6278.448/0.9280.012/0.010
airplane0.750/0.4881.670/1.1350.017/0.012
sofa0.832/0.4661.279/0.6570.011/0.008
chair0.727/0.5321.215/0.8280.012/0.009
lamp2.524/1.5287.641/4.0540.024/0.015
car0.530/0.4440.830/0.6990.010/0.009
cabinet0.707/0.3011.486/0.4300.006/0.004
watercraft0.969/0.7712.290/1.6690.020/0.017
rifle1.528/0.5504.452/1.6090.023/0.018
loudspeaker3.279/0.8336.461/1.4260.019/0.011
bench0.724/0.4061.371/0.6950.010/0.008
table1.172/0.3482.067/0.4470.009/0.005
telephone1.220/0.4333.700/0.8850.010/0.008
Overall1.404/0.5943.301/1.1890.014/0.010

Joint Shape-and-Pose Optimization Module

Testing FvOR full model with noisy input pose with different noise magnitude.

bash scripts/shapenet/test_joint.sh ./configs/shapenet/test_config_joint.yaml --noise_std 0.005

We use noise_std = {0.0025, 0.005, 0.0075} in our paper experiments. Such evaluation takes around 4 hours with 4 NVIDIA V100 GPUs. When finish, you should see several tables. The first table list the final metrics after 3 alternation steps. Then there will be tables listing per-step metrics.

You should get something like these if you run with --noise_std 0.005

classesIoUChamferL1Normal
sofa0.82785/0.880030.00710/0.006030.93701/0.94966
watercraft0.72476/0.791810.00854/0.007190.87260/0.88030
table0.69154/0.713080.00738/0.005590.91906/0.93406
cabinet0.85904/0.915080.00805/0.006680.92446/0.92311
bench0.67623/0.683920.00547/0.005050.89604/0.91215
car0.79223/0.874560.00951/0.008360.87503/0.88206
chair0.72057/0.745910.00737/0.006150.91392/0.92637
lamp0.63754/0.691630.00974/0.007690.86965/0.88945
airplane0.75356/0.776040.00474/0.003500.90310/0.92717
display0.79926/0.801170.00704/0.006010.93633/0.93791
rifle0.78764/0.803780.00386/0.003120.92098/0.93473
loudspeaker0.80257/0.849340.01219/0.009320.90700/0.91931
telephone0.89708/0.910870.00382/0.003420.97793/0.98349
Overall0.76691/0.802860.00729/0.006010.91178/0.92306

IoU

classesstep0step1step2step3
sofa0.75881/0.801330.81876/0.873260.82566/0.877200.82785/0.88003
watercraft0.64152/0.690560.71531/0.784230.72171/0.789170.72476/0.79181
table0.56633/0.589330.67476/0.688430.69061/0.709330.69154/0.71308
cabinet0.81327/0.857200.85581/0.915720.85816/0.915130.85904/0.91508
bench0.49186/0.520490.64679/0.661140.67004/0.689660.67623/0.68392
car0.74156/0.806330.78504/0.861130.79069/0.872620.79223/0.87456
chair0.57205/0.608510.68814/0.714680.71386/0.741740.72057/0.74591
lamp0.48011/0.493970.60173/0.645730.63038/0.685110.63754/0.69163
airplane0.53660/0.541940.69903/0.734530.73847/0.767380.75356/0.77604
display0.70697/0.774470.78866/0.796590.79729/0.800470.79926/0.80117
rifle0.53468/0.560820.72926/0.758730.78132/0.797210.78764/0.80378
loudspeaker0.76775/0.821620.80123/0.846190.80194/0.842750.80257/0.84934
telephone0.75342/0.791070.88990/0.902370.89519/0.905880.89708/0.91087
Overall0.64346/0.681360.74572/0.783290.76272/0.799510.76691/0.80286

There will be also several other per-step tables like the IoU table above. And you can check the visualizations in test_results folder.

Test FvOR full model with predicted pose

bash scripts/shapenet/test_joint.sh ./configs/shapenet/test_config_joint.yaml --use_predicted_pose

Note that you need to first generate the predicted pose by running test command of FvOR pose module.

Test FvOR full model with G.T. pose

bash scripts/shapenet/test_joint.sh ./configs/shapenet/test_config_joint.yaml --use_gt_pose
</details>

⏳ HM3D-ABO

<details> <summary>Click to expand </summary>

Training

First setup the HM3D-ABO dataset. Then run following command to train our model.

Train Pose Init Module

bash scripts/HM3D_ABO/pose_init.sh  ./configs/HM3D_ABO/config_pose_init_fvor.yaml

Train Shape Init Module

bash scripts/HM3D_ABO/shape_init.sh  ./configs/HM3D_ABO/config_shape_init_fvor.yaml 

Joint Shape-and-Pose Optimization Module

You need to first train the shape init module. Then provided that checkpoint as the initial weight for training joint shape-and-pose optimization module.

bash scripts/HM3D_ABO/joint.sh  ./configs/HM3D_ABO/config_joint.yaml --noise_std 0.005

     

Testing

Please download the checkpoints for HM3D-ABO datasets and put them under this directory.

Shape Module

Testing FvOR recon model trained with Ground Truth camera poses.

bash scripts/hm3d_abo/test_shape_init.sh  ./configs/hm3d_abo/config_shape_init_fvor.yaml

You should get following results where for each metric we show mean/median:

classesIoUChamferL1Normal
HM3D_ABO0.85517/0.883800.00848/0.007470.94955/0.95803
Overall0.85517/0.883800.00848/0.007470.94955/0.95803

Pose Module

Testing FvOR pose estimation model.

bash scripts/HM3D_ABO/test_pose_init.sh ./configs/HM3D_ABO/config_pose_init_fvor.yaml

You should get following results:

classesError_PixError_RotError_Trans
HM3D_ABO17.968/5.01514.344/1.3310.076/0.050
Overall17.968/5.01514.344/1.3310.076/0.050

Joint Shape-and-Pose Optimization Module

Testing FvOR full model with noisy input pose with different noise magnitude.

bash scripts/HM3D_ABO/test_joint.sh ./configs/HM3D_ABO/test_config_joint.yaml --noise_std 0.005

You should get something like these if you run with --noise_std 0.005

classesIoUChamferL1Normal
HM3D_ABO0.84931/0.880100.00980/0.008430.93698/0.94923
Overall0.84931/0.880100.00980/0.008430.93698/0.94923

IoU

classesstep0step1step2step3
HM3D_ABO0.81886/0.863840.84796/0.879970.84956/0.880230.84931/0.88010
Overall0.81886/0.863840.84796/0.879970.84956/0.880230.84931/0.88010

There will be also several other per-step tables like the IoU table above. And you can check the visualizations in test_results folder.

Test FvOR full model with predicted pose

bash scripts/HM3D_ABO/test_joint.sh ./configs/HM3D_ABO/test_config_joint.yaml --use_predicted_pose

Note that you need to first generate the predicted pose by running test command of FvOR pose module.

Test FvOR full model with G.T. pose

bash scripts/HM3D_ABO/test_joint.sh ./configs/HM3D_ABO/test_config_joint.yaml --use_gt_pose
</details>

If you find our work useful for your research, please consider citing our paper:

@misc{yang2022fvor,
      title={FvOR: Robust Joint Shape and Pose Optimization for Few-view Object Reconstruction}, 
      author={Zhenpei Yang and Zhile Ren and Miguel Angel Bautista and Zaiwei Zhang and Qi Shan and Qixing Huang},
      year={2022},
      eprint={2205.07763},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

Acknowledgement

We thank the awesome codes from LoFTR, Occupancy Networks, BARF, and IDR.