GithubHelp home page GithubHelp logo

novasky0709 / dfnet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from activevisionlab/dfnet

0.0 0.0 0.0 1009 KB

DFNet: Enhance Absolute Pose Regression with Direct Feature Matching (ECCV 2022)

Home Page: https://dfnet.active.vision

License: MIT License

Python 100.00%

dfnet's Introduction

DFNet: Enhance Absolute Pose Regression with Direct Feature Matching

Shuai Chen, Xinghui Li, Zirui Wang, and Victor Adrian Prisacariu (ECCV 2022)

Project Page | Paper

DFNet

Setup

Installing Requirements

We tested our code based on CUDA11.3+, PyTorch 1.11.0+, and Python 3.7+ using docker.

Rest of dependencies are in requirement.txt

Data Preparation

  • 7-Scenes

We use a similar data preparation as in MapNet. You can download the 7-Scenes datasets to the data/deepslam_data directory.

Or you can use simlink

cd data/deepslam_data && ln -s 7SCENES_DIR 7Scenes

Notice that we additionally computed a pose averaging stats (pose_avg_stats.txt) and manually tuned world_setup.json in data/7Scenes to align the 7Scenes' coordinate system with NeRF's coordinate system. You could generate your own re-alignment to a new pose_avg_stats.txt using the --save_pose_avg_stats configuration.

  • Cambridge Landmarks

You can download the Cambridge Landmarks dataset using this script here. Please also put the pose_avg_stats.txt and world_setup.json to the data/Cambridge/CAMBRIDGE_SCENES like we provided in the source code.

Training

Our method relies on a pretrained Histogram-assisted NeRF model and a DFNet model as we stated in the paper. We have provide example config files in our repo. The followings are examples to train the models.

  • NeRF model
python run_nerf.py --config config_nerfh.txt
  • DFNet model
python run_feature.py --config config_dfnet.txt
  • Direct Feature Matching (DFNetdm)
python train.py --config config_dfnetdm.txt

Evaluation

We provide methods to evaluate our models.

  • To evaluate the NeRF model in PSNR, simply add --render_test argument.
python run_nerf.py --config config_nerfh.txt --render_test
  • To evaluate APR performance of the DFNet model, you can just add --eval --testskip=1 --pretrain_model_path=../logs/PATH_TO_CHECKPOINT. For example:
python run_feature.py --config config_dfnet.txt --eval --testskip=1 --pretrain_model_path=../logs/heads/dfnet/checkpoint.pt
  • Same to evaluate APR performance for the DFNetdm model
python train.py --config config_dfnetdm.txt --eval --testskip=1 --pretrain_model_path=../logs/heads/dfnetdm/checkpoint.pt

Pre-trained model

We provide the 7-Scenes and Cambridge pre-trained models here. Some models have slight better results than our paper reported. We suggest the models to be put in a new directory (./logs/) of the project.

Notice we additionally provided Cambridge's Great Court scene models, although we didn't include the results in our main paper for fair comparisons with other works.

Due to my limited resource, my pre-trained models are trained using 3080ti or 1080ti. I noticed earlier that the model's performance might vary slightly (could be better or worse) when inferencing with different types of GPUs, even using the exact same model. Therefore, all experiments on the paper are reported based on the same GPUs as they were trained.

Acknowledgement

We thank Michael Hobley, Theo Costain, Lixiong Chen, and Kejie Li for their generous discussion on this work.

Most of our code is built upon Direct-PoseNet. Part of our Histogram-assisted NeRF implementation is referenced from the reproduced NeRFW code here. We thank @kwea123 for this excellent work!

Citation

Please cite our paper and star this repo if you find our work helpful. Thanks!

@inproceedings{chen2022dfnet,
  title={DFNet: Enhance Absolute Pose Regression with Direct Feature Matching},
  author={Chen, Shuai and Li, Xinghui and Wang, Zirui and Prisacariu, Victor},
  booktitle={Proceedings of the European Conference on Computer Vision (ECCV)},
  year={2022}
}

dfnet's People

Contributors

chenusc11 avatar yuzewang1998 avatar

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.