qimaqi / Continuous-Pose-in-NeRF

Implementation of Continuous Pose for Monocular Cameras in Neural Implicit Representation
Apache License 2.0
41 stars 1 forks source link

Continuous Pose for Monocular Cameras in Neural Implicit Representation

Introduction | Results Demo | Installation | Quick Start | News |

News

Introduction

This repository contains the example code, test results for the paper Continuous Pose for Monocular Cameras in Neural Implicit Representation. It showcase the effectiveness of optimizing monocular camera poses as a continuous function of time with neural network.

We have released the demo code, more details will be released soon, please check news for details.

Results-demo

We test our method on multiplte NeRF application, based on amazing code borrowed from BARF, EventNeRF and NICE-SLAM.

We also plan to try it on more application like NeRFstudio, also welcome to give it shot on your application.

Some of the results

BaRF results of initialize pose, BARF reuslts and our results

EventNeRF compare

NICE-SLAM compare

Installation

Regarding the environment you need nothing but numpy, torch to make it work

Quick start

You can check the code block in the bottom of PoseNet.py to get some idea of how it work. In short:

from PoseNet import PoseNet 

# create a config dict
## if no imu is used, you can set min_time = 0 and max_time to number of images
## remember set activ to softplus if you calculate the derivatives
## max iterations is used to set scheduler
config = {
        'device': "cuda:0", 
        'poseNet_freq': 5,
        'layers_feat': [None,256,256,256,256,256,256,256,256],
        'skip': [4],  
        'min_time': 0,
        'max_time': 100,
        'activ': 'relu',
        'cam_lr': 1e-3,
        'use_scheduler': False
        'max_iter': 20000,
        }

# create instance
posenet = PoseNet(config)

# get a Nx3x4 pose matrix 
time = 1
est_pose = posenet.forward(time)

# add the step function after loss backward
loss.backward() # according to your implementation

posenet.step()

Step by step implementation on how to use PoseNet in SLAM-Task

Since now the popularity in dense-slam is crazing and before I cleaned all messy code :(, I release a tutorial on how to using PoseNet in Splatam which is a famous Gaussian-splatting SLAM, simply using PoseNet can get results below:

Method Rel Pose Error Pose Error RMSE PSNR
Splatam 0.0011 0.0089 0.019 32.3667
Splatam+Ours 0.0002 0.0084 0.0031 37.0875

Detail tutorial


That's it, by simply doing so we test on Replica room 0 and results we show on step 500, more results will coming out.

TODOs