Skip to content

Commit d6d0e71

Browse files
committed
triangulation and reconstruction module imported only if pycolmap is available
1 parent e6a98f4 commit d6d0e71

3 files changed

Lines changed: 32 additions & 21 deletions

File tree

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

8592
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

docs/installation.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ conda activate deep-image-matching
1717
pip install --upgrade pip
1818
```
1919

20+
Then, you can install deep-image-matching using pip with the following command:
21+
22+
```bash
23+
pip install deep-image-matching
24+
```
25+
26+
If there is any issue with the installation, you can also install the package from the source code.
2027
Clone the repository and install deep-image-matching in editable mode:
2128

2229
```bash
@@ -32,6 +39,12 @@ pip install pycolmap==0.6.1
3239
```
3340
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.
3441

42+
Try to run the tests to check if deep-image-matching is correctly installed, try to import the package in a Python shell:
43+
44+
```python
45+
import deep_image_matching as dim
46+
```
47+
3548

3649
### Notes and troubleshooting
3750

src/deep_image_matching/__init__.py

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,16 @@
2020

2121
# Import submodules
2222
from . import extractors
23-
24-
time_dict["extractors"] = time() - time_dict["start"]
2523
from . import matchers
26-
27-
time_dict["matchers"] = time() - time_dict["extractors"]
28-
29-
from . import reconstruction
30-
31-
time_dict["reconstruction"] = time() - time_dict["matchers"]
32-
3324
from . import io
3425
from . import utils
3526
from . import visualization
3627
from . import thirdparty
3728

38-
time_dict["aux"] = time() - time_dict["reconstruction"]
39-
4029
if not NO_PYCOLMAP:
41-
from . import triangulation # the triangulation module strictly requires pycolmap
42-
43-
time_dict["triangulation"] = time() - time_dict["aux"]
44-
30+
# Import submodules that require pycolmap
31+
from . import reconstruction
32+
from . import triangulation
4533
try:
4634
from . import graph
4735
except ImportError:
@@ -57,6 +45,3 @@
5745
from .config import Config
5846

5947
print("Deep Image Matching loaded in {:.3f} seconds.".format(time() - time_dict["start"]))
60-
# print("Time breakdown:")
61-
# for key in time_dict:
62-
# print(f"{key}: {time_dict[key]:.3f}")

0 commit comments

Comments
 (0)