项目处于实验阶段,可能有 bug;DeDoDe、LoFTR、SE2-LoFTR 仅支持 GPU;pycolmap 安装出问题需按官方说明手动安装;处理目录下必须包含名为 images 的子文件夹。
deep-image-matching
3DOM-FBK更新放缓用深度学习和传统手工特征做多视图图像匹配,为 COLMAP 等 SfM 软件提供高质量匹配结果,支持高分辨率图像和带旋转的图像,提供命令行和图形界面。
Multiview matching with deep-learning and hand-crafted local features for COLMAP and other SfM software. Supports high-resolution formats and images with rotations. Both CLI and GUI are supported.
uv venv --python 3.9
uv pip install -e .README 未说明具体显存要求;部分匹配器(DeDoDe、LoFTR、SE2-LoFTR)标注仅支持 GPU,其余特征与匹配器未注明是否可纯 CPU 运行。
多视图局部特征匹配工具,为 COLMAP 等 SfM 软件生成关键点与匹配
用深度学习和传统手工特征做多视图图像匹配,为 COLMAP 等 SfM 软件提供高质量匹配结果,支持高分辨率图像和带旋转的图像,提供命令行和图形界面。
核心能力
- 集成 SIFT、SuperPoint、DISK 等深度学习与传统特征提取器
- 支持 LightGlue、SuperGlue、RoMa 等多种匹配器
- 匹配结果直接导出到 COLMAP 数据库或 Bundler 格式
- 支持大尺寸图像与带旋转的图像
- 可在 DIM 内直接调用 pycolmap 等运行 SfM
容易踩的坑
- 2.0.0最新正式版2025-08-20 · 2025-08-20 14:45 UTC
Release Notes—Major Changes (1.3.0 -> 2.0.0)
After quite a long time, we have finally merged the
devbranch into the master to update it with the (several) new updates. Be careful when updating DIM, as there are many major (and possibly breaking) changes:-
Environment & Dependency Management
- Switched default environment management from pip/conda to uv. Refer to the documentation for instructions.
- Use
uv sync(oruv sync --dev) for setup. - Legacy install (
conda+pip install -e .) still supported.
- Use
- Switched default environment management from pip/conda to uv. Refer to the documentation for instructions.
-
Entrypoint & Scripts
- Removed
main.pyfrom project root.- Main entrypoint is now
src/deep_image_matching/__main__.py. Once you have installed DIM, you can run the full pipeline from anywhere (you don't need to be in the DIM repository directory anymore):
python -m deep_image_matching --dir <images> --pipeline <pipeline>
- Main entrypoint is now
- Added
demo.pyanddemo.ipynbto show DIM main functionalities; users should create their own scripts for custom workflows. - You can use the sfm_pipeline.ipynb notebook for a detailed explanation of the DIM workflow.
- Removed
-
Dependencies
- Updated
pycolmapto version 3.12 (major API changes, check your scripts). - Removed
pandasandxformersfrom dependencies. - Added
rufffor linting (replaces flake8/black). - Updated and cleaned up dependencies in
pyproject.toml.
- Updated
-
Functionality & Features
- Added new triangulation module and dense triangulation notebook.
- Improved geometric verification and added related tests.
- Added support for keypoints export in correct position for rotated images.
- Improved handling of EXIF data for image orientation.
- Added support for rasterio and thermal images.
- Added keyframe selection with global descriptors and k-means.
- Added option to select LightGlue or ROMA for preselection.
- Improved viewing and visualization options (graph, MST, communities).
- Added scripts for image normalization and keypoint distribution evaluation.
-
Codebase Refactoring
- Restructured imports: all imports are now internal to the package.
- Refactored config management in matcher and extractor classes.
- Updated default parameters and config exposure for ROMA and LightGlue.
- Cleaned and modularized
reconstruction.pyand triangulation modules. - Moved graph template directory to
utils. - Moved HLOC to
thirdparty.
-
Other Notable Changes
- Deprecated Bundler export in pycolmap reconstruction.
- Improved output folder handling (user confirmation before overwrite).
- Added main entrypoint for
python -m deep_image_matching. - Updated documentation for new installation and usage patterns.
- Various bugfixes and minor improvements throughout the codebase.
Note:
Some of these changes may break existing workflows or scripts. Please review the updated documentation and adapt your usage accordingly.Recent PRs
- Egu by @franioli in https://github.com/3DOM-FBK/deep-image-matching/pull/58
- Updated graph.py and template.html by @gperda in https://github.com/3DOM-FBK/deep-image-matching/pull/62
- Dev upright by @lcmrl in https://github.com/3DOM-FBK/deep-image-matching/pull/74
- LoftrRomaToMultiview mask by @SamueleBumbaca in https://github.com/3DOM-FBK/deep-image-matching/pull/79
- Merging dev branch (after SRIF merge) into dev_uv_pycolmap by @franioli in https://github.com/3DOM-FBK/deep-image-matching/pull/96
- Merge dev_uv_pycolmap into dev by @franioli in https://github.com/3DOM-FBK/deep-image-matching/pull/97
- More flexible cameras.yaml by @Blattvorhang in https://github.com/3DOM-FBK/deep-image-matching/pull/88
- Dev by @franioli in https://github.com/3DOM-FBK/deep-image-matching/pull/100
New Contributors
- @SamueleBumbaca made their first contribution in https://github.com/3DOM-FBK/deep-image-matching/pull/79
- @Blatt
-
- 1.3.02025-07-04 · 2025-07-04 18:14 UTC
查看更新说明
This is pre-major release. We will soon release version 2.0 which integrates all the updates of the current
devbranch, - 0.0.12024-05-02 · 2024-05-02 16:50 UTC
查看更新说明
Deep-Image-Matching v0. This is an old and simple, but working, version of DIM for internal use. Unless you have a very good reason to use this release, use a more recent version of DIM.
- 1.2.4pre-release2024-04-13 · 2024-04-13 16:38 UTC
查看更新说明
- First release on PyPi
- Updated imports of all modules inside DIM
- Update Config management to run DIM from notebooks
- Updated function export_to_db and export_to_openmvg to read the cameras config file within the function (note that the function's arguments are changed as the file path now is passed instead of the configuration dictionary)
- Added demo notebook
- Added notebook to perform dense matching and triangulation from known cameras poses
- Added notebook to perform georeferencing of the dense reconstruction based on GCP (experimental)
- Improved dense matching with RoMa
- Added tile preselection with RoMa
- Updated tests: now the main.py script is not required anymore to run the tests
- Updated COLMAPdatabase class with new methods for reading data inside the database and using context manager.
- Various small improvements
- 1.0.02024-03-19 · 2024-03-19 11:30 UTC
查看更新说明
New features:
- Release version 1.0.0
- Export the solution to OpenMVG
- Export the solution to MICMAC
- Possibility to define different camera models in a yaml file for all or subsets of images
- Graph visualization (thanks @gperda)
- Docker installation (thanks @kauevestena)
- Exapanded documentation with "usage DIM with" section, examples and modules API.
- Re-implemented Se2-LOFTR for full image processing (not for matching by tiles).
- Update CLI parser
- Added export of images with keypoints and matches in debug mode (-V option in CLI)
- Weights of the models are automatically downloaded from original repos.
- Added scripts for advanced processing
- Updated unit tests and Github actions
- Several bugfixes and small improvements
First contributions:
- @gperda
- @kauevestena
- @nneilsutherland
- @elliestath
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
DEEP-IMAGE-MATCHING
| SIFT | DISK | IMAGES ORIENTATION | DENSE WITH ROMA |
|---|---|---|---|
| SIFT | SUPERGLUE |
|---|---|
Multivew matcher for SfM software. Support both deep-learning based and hand-crafted local features and matchers and export keypoints and matches directly in a COLMAP database or to Agisoft Metashape by importing the reconstruction in Bundler format. Now, it supports both OpenMVG and MicMac. Feel free to collaborate!
For how to use DIM, check the Documentation (updated for the master branch).
Please, note that deep-image-matching is under active development and it is still in an experimental stage. If you find any bug, please open an issue. For the licence of individual local features and matchers please refer to the authors' original projects.
Key features:
- Multiview
- Large format images
- SOTA deep-learning and hand-crafted features
- Support for image rotations
- Compatibility with several SfM software
- Support image retrieval with deep-learning local features
- Graph-based clustering
- Run SfM directly in DIM (pycolmap, openmvg, etc)
Supported Extractors
| Algorithm | Year | Paper link | Github link | Notes |
|---|---|---|---|---|
| RIPE | 2025 | link | link | supported |
| RDD sparse | 2025 | link | link | supported |
| LiftFeat | 2025 | link | link | supported |
| XFeat | 2024 | link | link | supported |
| DeDoDe | 2024 | link | link | only GPU |
| ALIKED | 2023 | link | link | supported |
| SRIF | 2023 | link | link | supported |
| DISK | 2020 | link | link | supported |
| KeyNet | 2019 | link | link | supported |
| SuperPoint | 2018 | link | link | supported |
| Superpoint open | 2018 | link | link | supported |
| HardNet | 2017 | link | link | supported |
| ORB | 2011 | link | link | from OpenCV |
| SIFT | 2004 | link | link | from OpenCV |
Supported Matchers
| Algorithm | Year | Paper link | Github link | Notes |
|---|---|---|---|---|
| LightGlue | 2023 | link | link | with SuperPoint, DISK, and ALIKED |
| LighterGlue | 2023 | link | link | with XFeat |
| RoMa | 2023 | link | link | supported |
| SE2-LoFTR | 2022 | link | link | no tiling and only GPU |
| LoFTR | 2021 | link | link | only GPU |
| SuperGlue | 2020 | link | link | with SuperPoint |
| Nearest Neighbor | - | - | - | from KORNIA |
Supported SfM software
| ✓ COLMAP | | ✓ OpenMVG | | ✓ MICMAC | | ✓ Agisoft Metashape | | ✓ Software that supports bundler format |
Colab demo and notebooks
Want to run on a sample dataset? ➡️
Want to run on your images? ➡️
DIM can also be utilized as a library instead of being executed through the Command Line Interface (refer to the Usage Instructions).
For quick examples, see:
demo.py- Simple script demonstrating the basic workflowdemo.ipynb- Interactive notebook version of the demonotebooks/sfm_pipeline.ipynb- Complete SfM pipeline with detailed explanations
Local Installation
For installing deep-image-matching, we recommend using uv for fast and reliable package management:
# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create and activate a virtual environment
uv venv --python 3.9
source .venv/bin/activate # On Windows: .venv\Scripts\activate
Then, you can install deep-image-matching using uv:
uv pip install -e .
This command will install the package in editable mode, allowing you to modify the source code and see changes immediately without needing to reinstall. If you want to use deep-image-matching as a non-editable library, you can also install it without the -e flag.
This will also install pycolmap as a dependency, which is required for running the 3D reconstruction.
If you have any issues with pycolmap, you can manually install it following the official instructions here.
To verify that deep-image-matching is correctly installed, you can try to import the package in a Python shell:
import deep_image_matching as dim
To test most of the functionality, run the tests to check if deep-image-matching is correctly installed, run:
uv run pytests
For more information, check the documentation.
Why uv?
This project has migrated from conda/pip to uv for dependency management. Benefits include:
- Faster installation: uv is significantly faster than pip for dependency resolution and installation
- Better dependency resolution: More reliable resolution of complex dependency trees
- Lockfile support:
uv.lockensures reproducible installations across different environments - Integrated tooling: Built-in support for virtual environments, Python version management, and project building
- Cross-platform consistency: Better support for different operating systems and architectures
Conda/pip installation
If you have any issue with uv, you prefer to have a global installation of DIM, or you have any other problem with the installation, you can use conda/manba to create an environment and install DIM from source using pip:
git clone https://github.com/3DOM-FBK/deep-image-matching.git
cd deep-image-matching
conda create -n deep-image-matching python=3.9
conda activate deep-image-matching
pip install -e .
Docker Installation
For Docker installation, see the Docker Installation section in the documentation.
Usage instructions
Quick start with the demo
For a quick start, check out the demo.py script or demo.ipynb notebook that demonstrate basic usage with the example dataset:
python demo.py --dir assets/example_cyprus --pipeline superpoint+lightglue
The demo runs the complete pipeline from feature extraction to 3D reconstruction using the provided example dataset.
A similar demo example is also available as a notebook in demo.ipynb.
Command Line Interface
Use the following command to see all the available options from the CLI:
python -m deep_image_matching --help
For example, to run the matching with SuperPoint and LightGlue on the example_cyprus dataset:
python -m deep_image_matching --dir assets/example_cyprus --pipeline superpoint+lightglue
The --dir parameter defines the processing directory, where all the results will be saved. This directory must contain a subfolder named images with all the images to be processed.
Library usage
Deep-image-matching can also be used as a Python library. For a comprehensive example showing the complete SfM pipeline, see notebooks/sfm_pipeline.ipynb.
For detailed usage instructions and configurations, refer to the documentation.
Advanced usage
For advanced usage, please refer to the documentation and/or check the scripts directory.
Merging databases with different local features
To run the matching with different local features and/or matchers and marging together the results, you can use scripts in the ./scripts directory for merging the COLMAP databases.
python ./join_databases.py --help
python ./join_databases.py --input path/to/dir/with/databases --output path/to/output/dir
Exporting the solution to Metashape
Suggested solution:
- It is now possible to run SfM directly in Metashape using 2D observations extracted in DIM. You can use the script
export_to_bundler.pyfrom the scripts folder. It will create a fake bundler file. Then in Metashape import all the images you need, import camera poses using the bundler file, select all images and reset the alignment. Finally right click, align selected cameras (see issue).
Other solutions:
-
To export the solution to Metashape, you can export the COLMAP database to Bundler format and then import it into Metashape. This can be done from Metashape GUI, by first importing the images and then use the function
Import Cameras(File -> Import -> Import Cameras) to select Bundler file (e.g., bundler.out) and the image list file (e.g., bundler_list.txt). -
Alternatevely, you can use the
export_to_metashape.pyscript to automatically create a Metashape project from a reconstruction saved in Bundler format. The scriptexport_to_metashape.pytakes as input the solution in Bundler format and the images and it exports the solution to Metashape. It requires to install Metashape as a Python module in your environment and to have a valid license. Please, refer to the instructions at https://github.com/franioli/metashape.
How to contribute
Any contribution to this repo is really welcome! If you want to contribute to the project, please, check the contributing guidelines.
To Do List
See the TODO list for the list of features and improvements that are planned for the future.
References
If you find the repository useful for your work consider citing the papers:
@article{morelli2024_deep_image_matching,
AUTHOR = {Morelli, L. and Ioli, F. and Maiwald, F. and Mazzacca, G. and Menna, F. and Remondino, F.},
TITLE = {DEEP-IMAGE-MATCHING: A TOOLBOX FOR MULTIVIEW IMAGE MATCHING OF COMPLEX SCENARIOS},
JOURNAL = {The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences},
VOLUME = {XLVIII-2/W4-2024},
YEAR = {2024},
PAGES = {309--316},
DOI = {10.5194/isprs-archives-XLVIII-2-W4-2024-309-2024}
}
@article{morelli2022photogrammetry,
title={PHOTOGRAMMETRY NOW AND THEN--FROM HAND-CRAFTED TO DEEP-LEARNING TIE POINTS--},
author={Morelli, Luca and Bellavia, Fabio and Menna, Fabio and Remondino, Fabio},
journal={The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences},
volume={48},
pages={163--170},
year={2022},
publisher={Copernicus GmbH}
}
@article{ioli2024,
title={Deep Learning Low-cost Photogrammetry for 4D Short-term Glacier
Dynamics Monitoring},
author={Ioli, Francesco and Dematteis, Nicolò and Giordan, Daniele and Nex, Francesco and Pinto Livio},
journal={PFG – Journal of Photogrammetry, Remote Sensing and Geoinformation Science},
year={2024},
DOI = {10.1007/s41064-023-00272-w}
}
Depending on the options used, consider citing the corresponding work of: