百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

doppelgangers-plusplus

> 编程语言
开源

Doppelgangers++: 利用几何 3D 特征改进视觉歧义解决

99 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

Doppelgangers++: 利用几何 3D 特征改进视觉歧义解决

Doppelgangers++: Improved Visual Disambiguation with Geometric 3D Features

Yuanbo Xiangli, Ruojin Cai, Hanyu Chen, Jeffrey Byrne, Noah Snavely

[Project Page]

Overview

Implementation of Doppelganger++, an enhanced pairwise image classifier that excels in visual disambiguation across diverse and challenging scenes. Doppelgangers++ seamlessly integrates with SfM pipelines such as COLMAP and MASt3R-SfM, producing correct and complete reconstructions.

Installation

  1. Clone this repo:
bash
git clone --recursive https://github.com/doppelgangers25/doppelgangers-plusplus.git 
cd doppelgangers-plusplus
  1. Create the environment and install dependencies.
bash
conda create -n doppelgangers_pp python=3.11 cmake=3.14.0
conda activate doppelgangers_pp 
conda install pytorch torchvision pytorch-cuda=12.1 -c pytorch -c nvidia  # use the correct version of cuda for your system
pip install -r requirements.txt
pip install -r dust3r/requirements.txt
pip install -r dust3r/requirements_optional.txt
  1. Optional, compile the cuda kernels for RoPE (as in CroCo v2):
bash
# DUST3R relies on RoPE positional embeddings for which you can compile some cuda kernels for faster runtime.
cd dust3r/croco/models/curope/
python setup.py build_ext --inplace
cd ../../../../
  1. (Integration with MASt3R-SfM) Compile and install ASMK:
bash
pip install cython

git clone https://github.com/jenicek/asmk
cd asmk/cython/
cythonize *.pyx
cd ..
pip install .  # or python3 setup.py build_ext --inplace
cd ..
  1. (Integration with COLMAP) Download COLMAP from their installation page, we used vesion 3.10.

Data

Create a fata folder inside the project path:

bash
mkdir data
mkdir data/pairs_metadata

Next, download the Doppelgangers dataset (Cai et al.) and VisymScenes data, and place them under a desired direcory, e.g. data/.

The final folder layout should look like:

…

Doppelgangers Dataset

Follow the data download and preparation of Doppelgangers: Learning to Disambiguate Images of Similar Structures. Or following the instructions:

  • Training images without flip augmentation: train_set_noflip.tar.gz
  • Training images with flip augmentation:
    • First download base images: train_set_flip.tar.gz and MegaDepth subset: train_megadepth.tar.gz.
    • They provide a Python script flip_augmentation.py to perform the image flip augmentation on the provided base images. To use this script, please modify the configuration options at the beginning of the script and run with python flip_augmentation.py.
  • Test set: test_set.tar.gz
  • Image pair metadata for all training and test sets: pairs_metadata.tar.gz

Organize the data directory with:

bash
mv data/doppelgangers/pairs_metadata/* data/pairs_metadata/
rm -rf data/doppelgangers/pairs_metadata

VisymScenes Dataset

  • Download chunked zip files from huggingface. Recover original files with script:
…
  • Also download test_pairs_visym.npy and train_pairs_visym.npy, put them under data/pairs_metadata.

Pretrained Model

Download the checkpoints from huggingface and put them under a desired path, e.g. checkpoints/.

Model Usage in Structure-from-Motion

The general idea is to first perform feature extraction and matching, which generates a list of image pairs. Then use our visual disambiguation model on these image pairs to remove the ones with lower probability (i.e. more likely to be a doppelganger). Finally, run mapper on the filter image pairs for reconstruction.

We provide example scripts of integrating our visual disambiguation model into SfM pipelins:

Integration with COLMAP

bash
python colmap_usage.py --colmap_exe_command colmap \
    --input_image_path /path/to/your/images \
    --output_path /path/to/output/directory \
    --threshold 0.8 \
    --pretrained checkpoints/checkpoint-dg+visym.pth \

Integration with MASt3R-SfM

Download both the trainingfree.pth and codebook.pkl files following MASt3R-SfM's instruction, and put them in the same directory.

bash
mkdir -p checkpoints/
wget https://download.europe.naverlabs.com/ComputerVision/MASt3R/MASt3R_ViTLarge_BaseDecoder_512_catmlpdpt_metric_retrieval_trainingfree.pth -P checkpoints/
wget https://download.europe.naverlabs.com/ComputerVision/MASt3R/MASt3R_ViTLarge_BaseDecoder_512_catmlpdpt_metric_retrieval_codebook.pkl -P checkpoints/

Then run:

bash
python mast3r_sfm_usage.py \
    --input_image_path /path/to/your/images \
    --output_path /path/to/output/directory \
    --pretrained checkpoints/checkpoint-dg+visym.pth \
    --retrieval_model checkpoints/MASt3R_ViTLarge_BaseDecoder_512_catmlpdpt_metric_retrieval_trainingfree.pth \
    --threshold 0.8

Training

Given an image pair, we first create a symmetrized version of the pair and feed it into the frozen MASt3R model. Multi-layer features are extracted from each decoder branch, concatenated, and fed into two learnable doppelganger classification heads. Each head generates predictions supervised by cross-entropy loss.

To train the model, first download a pretrained MASt3R model, for example MASt3R_ViTLarge_BaseDecoder_512_catmlpdpt_metric.pth:

bash
mkdir -p checkpoints/
wget https://download.europe.naverlabs.com/ComputerVision/MASt3R/MASt3R_ViTLarge_BaseDecoder_512_catmlpdpt_metric.pth -P checkpoints/

An example training script:

…

Evaluation

To evaluate a model, use test.py, and specify the pretrained model path, e.g. checkpoints/checkpoint-dg+visym.pth. Change teston value in test_dataset to switch test sets.

…

Citation

If you find our work helpful, please consider citing:

bibtex
@misc{xiangli2024doppelgangersimprovedvisualdisambiguation,
      title={Doppelgangers++: Improved Visual Disambiguation with Geometric 3D Features}, 
      author={Yuanbo Xiangli and Ruojin Cai and Hanyu Chen and Jeffrey Byrne and Noah Snavely},
      year={2024},
      eprint={2412.05826},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2412.05826}, 
}

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Python

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言