Skip to content

Commit f55415d

Browse files
authored
Merge pull request #58 from 3DOM-FBK/egu
Egu
2 parents 5907fc2 + d6d0e71 commit f55415d

193 files changed

Lines changed: 12433 additions & 10875 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.flake8

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ select = E9,F63,F7,F82
33
ignore = E501, E121, E123
44
exclude = .git,__pycache__,.ipynb_checkpoints
55
per-file-ignores =
6+
*/__init__.py: F401
67
src/deep_image_matching/thirdparty/RoMa/roma/losses/robust_loss.py:E9,F63,F7,F82
7-
src/deep_image_matching/thirdparty/DeDoDe/DeDoDe/utils.py:E9,F63,F7,F82
8+
src/deep_image_matching/thirdparty/DeDoDe/DeDoDe/utils.py:E9,F63,F7,F82
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
name: Build distribution 📦
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Set up Python
13+
uses: actions/setup-python@v4
14+
with:
15+
python-version: "3.x"
16+
- name: Install pypa/build
17+
run: >-
18+
python3 -m
19+
pip install
20+
build
21+
--user
22+
- name: Build a binary wheel and a source tarball
23+
run: python3 -m build
24+
- name: Store the distribution packages
25+
uses: actions/upload-artifact@v3
26+
with:
27+
name: python-package-distributions
28+
path: dist/
29+
30+
publish-to-pypi:
31+
name: >-
32+
Publish Python 🐍 distribution 📦 to PyPI
33+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
34+
needs:
35+
- build
36+
runs-on: ubuntu-latest
37+
environment:
38+
name: pypi
39+
url: https://pypi.org/p/deep-image-matching
40+
permissions:
41+
id-token: write # IMPORTANT: mandatory for trusted publishing
42+
steps:
43+
- name: Download all the dists
44+
uses: actions/download-artifact@v3
45+
with:
46+
name: python-package-distributions
47+
path: dist/
48+
- name: Publish distribution 📦 to PyPI
49+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/run_test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
python -m pip install --upgrade pip
3030
pip install -e .
3131
pip install pycolmap
32+
pip install pytest
3233
- name: Test with pytest
3334
run: |
3435
pytest

.github/workflows/run_test_win.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
run: |
2929
python -m pip install --upgrade pip
3030
pip install -e .
31+
pip install pytest
3132
- name: Test with pytest
3233
run: |
3334
pytest

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ sb_*
1111
config.yaml
1212
run_casalbagliano.sh
1313
config/cameras_test.yaml
14+
sandbox*
15+
requirements.txt
16+
belv_*
17+
egu/
1418

1519
# VScode
1620
.vscode/
@@ -43,6 +47,7 @@ share/python-wheels/
4347
.installed.cfg
4448
*.egg
4549
MANIFEST
50+
.pypirc
4651

4752
# PyInstaller
4853
# Usually these files are written by a python script from a template

LICENSE.txt renamed to LICENSE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# LICENSE
2+
13
BSD 3-Clause License
24

35
Copyright (c) 2018, the respective contributors, as shown by the AUTHORS file.

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Static Badge](https://img.shields.io/badge/Matches_for-COLMAP-red)](https://github.com/colmap/colmap) [![Static Badge](https://img.shields.io/badge/Matches_for-OpenMVG-red)](https://github.com/openMVG/openMVG) [![Static Badge](https://img.shields.io/badge/Matches_for-MICMAC-red)](https://github.com/micmacIGN/micmac) ![Static Badge](https://img.shields.io/badge/Matches_for-Metashape-red)
44

5-
[![Static Badge](https://img.shields.io/badge/Powered_by-Kornia-green)](https://github.com/kornia/kornia) [![Static Badge](https://img.shields.io/badge/Powered_by-hloc-green)](https://github.com/kornia/kornia) [![GitHub Release](https://img.shields.io/github/v/release/3DOM-FBK/deep-image-matching)](https://github.com/3DOM-FBK/deep-image-matching/releases) [![Static Badge](https://img.shields.io/badge/docs-DeepImageMatching-blue
5+
[![Static Badge](https://img.shields.io/badge/Powered_by-Kornia-green)](https://github.com/kornia/kornia) [![Static Badge](https://img.shields.io/badge/Powered_by-hloc-green)](https://github.com/kornia/kornia) [![GitHub Release](https://img.shields.io/github/v/release/3DOM-FBK/deep-image-matching)](https://github.com/3DOM-FBK/deep-image-matching/releases) [![Static Badge](https://img.shields.io/badge/docs-DeepImageMatcher-blue
66
)](https://3dom-fbk.github.io/deep-image-matching/)
77

88
</div>
@@ -68,27 +68,40 @@ DIM can also be utilized as a library instead of being executed through the Comm
6868

6969
For installing deep-image-matching, first create a conda environment:
7070

71-
```
71+
```bash
7272
conda create -n deep-image-matching python=3.9
7373
conda activate deep-image-matching
7474
pip install --upgrade pip
7575
```
7676

77-
Clone the repository and install deep-image-matching in editable mode:
77+
Then, you can install deep-image-matching using pip with the following command:
7878

79+
```bash
80+
pip install deep-image-matching
7981
```
82+
83+
If there is any issue with the installation, you can also install the package from the source code.
84+
Clone the repository and install deep-image-matching in editable mode:
85+
86+
```bash
8087
git clone https://github.com/3DOM-FBK/deep-image-matching.git
8188
cd deep-image-matching
8289
pip install -e .
8390
```
8491

85-
Install pycolmap (optional):
92+
Install pycolmap (optional, but recommended):
8693

87-
```
94+
```bash
8895
pip install pycolmap==0.6.1
8996
```
9097
Pycolmap is optional to run reconstruction directly in DIM. If pycolmap is not available, matches will be written both in a h5 and colmap database for later processing with COLMAP GUI or API, or other processing.
9198

99+
Try to run the tests to check if deep-image-matching is correctly installed, try to import the package in a Python shell:
100+
101+
```python
102+
import deep_image_matching as dim
103+
```
104+
92105
For more information, check the [documentation](https://3dom-fbk.github.io/deep-image-matching/installation/).
93106

94107
## Docker Installation

assets/example_cyprus/cameras.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
general:
2+
camera_model: "pinhole" # ["simple-pinhole", "pinhole", "simple-radial", "opencv"]
3+
openmvg_camera_model: "pinhole_radial_k3" # ["pinhole", "pinhole_radial_k3", "pinhole_brown_t2"]
4+
single_camera: True
5+
6+
cam0:
7+
camera_model: "pinhole"
8+
images : ""
9+
10+
cam1:
11+
camera_model: "pinhole"
12+
images : "DSC_6468.jpg,DSC_6468.jpg"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# User configuration file
2+
3+
general:
4+
# tile_size: (3000, 2000) # This setting is overwriten by the the upsample_res setting
5+
tile_overlap: 50
6+
geom_verification: none
7+
gv_threshold: 3
8+
gv_confidence: 0.9999
9+
min_matches_per_tile: 3
10+
min_inliers_per_pair: 5
11+
min_inlier_ratio_per_pair: 0.2
12+
refine_intrinsics: False
13+
preselection_pipeline: roma
14+
15+
extractor:
16+
name: no_extractor
17+
18+
matcher:
19+
name: roma
20+
coarse_res: 560
21+
upsample_res: 860
22+
num_sampled_points: 10000
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# User configuration file
2+
3+
general:
4+
tile_size: (2400, 2000)
5+
geom_verification: PYDEGENSAC # NONE, PYDEGENSAC, MAGSAC, RANSAC, LMEDS, RHO, USAC_DEFAULT, USAC_PARALLEL, USAC_FM_8PTS, USAC_FAST, USAC_ACCURATE, USAC_PROSAC, USAC_MAGSAC
6+
gv_threshold: 4
7+
min_inliers_per_pair: 10
8+
min_inlier_ratio_per_pair: 0.25
9+
10+
extractor:
11+
name: "superpoint"
12+
max_keypoints: 8000 # -1 no limits
13+
nms_radius: 4
14+
keypoint_threshold: 0.005
15+
remove_borders: 4
16+
fix_sampling: False
17+
18+
matcher:
19+
name: "lightglue"
20+
flash: True # enable FlashAttention if available
21+
mp: False # enable mixed precision
22+
depth_confidence: 0.95 # early stopping, disable with -1
23+
width_confidence: 0.99 # point pruning, disable with -1
24+
filter_threshold: 0.10 # match threshold

0 commit comments

Comments
 (0)