Skip to content

Commit d416130

Browse files
authored
Merge pull request #136 from cvg/bindings
hloc v1.3
2 parents 9bad6b4 + 845f1ac commit d416130

Some content is hidden

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

49 files changed

+9550
-629
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ __pycache__
33
*.egg-info
44
.ipynb_checkpoints
55
outputs/
6+
third_party/netvlad
7+
datasets/*
8+
!datasets/sacre_coeur/

README.md

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,24 @@ With `hloc`, you can:
1616

1717
##
1818

19+
## Quick start ➡️ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1MrVs9b8aQYODtOGkoaGNF9Nji3sbCNMQ)
20+
21+
Build 3D maps with Structure-from-Motion and localize any Internet image right from your browser! **You can now run `hloc` and COLMAP in Google Colab with GPU for free.** The notebook [`demo.ipynb`](https://colab.research.google.com/drive/1MrVs9b8aQYODtOGkoaGNF9Nji3sbCNMQ) shows how to run SfM and localization in just a few steps. Try it with your own data and let us know!
22+
1923
## Installation
2024

21-
`hloc` requires Python >=3.6, PyTorch >=1.1, and [COLMAP](https://colmap.github.io/index.html). Installing the package locally pulls the other dependencies:
22-
```
25+
`hloc` requires Python >=3.7 and PyTorch >=1.1. Installing the package locally pulls the other dependencies:
26+
27+
```bash
2328
git clone --recursive https://github.com/cvg/Hierarchical-Localization/
2429
cd Hierarchical-Localization/
2530
python -m pip install -e .
2631
```
2732

28-
All dependencies are listed in `requirements.txt`.
29-
This codebase includes external local features as git submodules – don't forget to pull submodules with `git submodule update --init --recursive`. Your local features are based on TensorFlow? No problem! See [below](#using-your-own-local-features-or-matcher) for the steps.
33+
All dependencies are listed in `requirements.txt`. **Starting with `hloc-v1.3`, installing COLMAP is not required anymore.** This repository includes external local features as git submodules – don't forget to pull submodules with `git submodule update --init --recursive`.
3034

31-
We also provide a Docker image that includes COLMAP and other dependencies:
32-
```
35+
We also provide a Docker image:
36+
```bash
3337
docker build -t hloc:latest .
3438
docker run -it --rm -p 8888:8888 hloc:latest # for GPU support, add `--runtime=nvidia`
3539
jupyter notebook --ip 0.0.0.0 --port 8888 --no-browser --allow-root
@@ -58,7 +62,10 @@ Strcture of the toolbox:
5862
- `hloc/matchers/` : interfaces for feature matchers
5963
- `hloc/pipelines/` : entire pipelines for multiple datasets
6064

61-
`hloc` can be imported as an external package with `import hloc` or from the command line with `python -m hloc.script`.
65+
`hloc` can be imported as an external package with `import hloc` or called from the command line with:
66+
```bash
67+
python -m hloc.name_of_script --arg1 --arg2
68+
```
6269

6370
## Tasks
6471

@@ -87,7 +94,7 @@ We show in [`pipeline_SfM.ipynb`](https://nbviewer.jupyter.org/github/cvg/Hierar
8794
## Results
8895

8996
- Supported local feature extractors: [SuperPoint](https://arxiv.org/abs/1712.07629), [D2-Net](https://arxiv.org/abs/1905.03561), [SIFT](https://www.cs.ubc.ca/~lowe/papers/ijcv04.pdf), and [R2D2](https://arxiv.org/abs/1906.06195).
90-
- Supported feature matchers: [SuperGlue](https://arxiv.org/abs/1911.11763) and nearest neighbor search with ratio test, distance test, mutual check.
97+
- Supported feature matchers: [SuperGlue](https://arxiv.org/abs/1911.11763) and nearest neighbor search with ratio test, distance test, and/or mutual check.
9198
- Supported image retrieval: [NetVLAD](https://arxiv.org/abs/1511.07247) and [AP-GeM/DIR](https://github.com/naver/deep-image-retrieval).
9299

93100
Using NetVLAD for retrieval, we obtain the following best results:
@@ -109,7 +116,10 @@ Check out [visuallocalization.net/benchmark](https://www.visuallocalization.net/
109116

110117
## Supported datasets
111118

112-
We provide in [`hloc/pipelines/`](./hloc/pipelines) scripts to run the reconstruction and the localization on the following datasets: Aachen Day-Night (v1.0 and v1.1), InLoc, Extended CMU Seasons, RobotCar Seasons, 4Seasons, Cambridge Landmarks, and 7-Scenes.
119+
We provide in [`hloc/pipelines/`](./hloc/pipelines) scripts to run the reconstruction and the localization on the following datasets: Aachen Day-Night (v1.0 and v1.1), InLoc, Extended CMU Seasons, RobotCar Seasons, 4Seasons, Cambridge Landmarks, and 7-Scenes. For example, after downloading the dataset [with the instructions given here](./hloc/pipelines/Aachen#installation), we can run the Aachen Day-Night pipeline with SuperPoint+SuperGlue using the command:
120+
```bash
121+
python -m hloc.pipelines.Aachen.pipeline [--outputs ./outputs/aachen]
122+
```
113123

114124
## BibTex Citation
115125

@@ -178,9 +188,21 @@ In a match file, each key corresponds to the string `path0.replace('/', '-')+'_'
178188
## Versions
179189

180190
<details>
181-
<summary>master (development)</summary>
182-
183-
Multiple bug fixes and minor improvements.
191+
<summary>v1.3 (January 2022)</summary>
192+
193+
- Demo notebook in Google Colab
194+
- Use the new pycolmap Reconstruction objects and pipeline API
195+
- Do not require an installation of COLMAP anymore - pycolmap is enough
196+
- Faster model reading and writing
197+
- Fine-grained control over camera sharing via the `camera_mode` parameter
198+
- Localization with unknown or inaccurate focal length
199+
- Modular localization API with control over all estimator parameters
200+
- 3D visualizations or camera frustums and points with plotly
201+
- Package-specific logging in the hloc namespace
202+
- Store the extracted features by default as fp16 instead of fp32
203+
- Optionally fix a long-standing bug in SuperPoint descriptor sampling
204+
- Add script to compute exhaustive pairs for reconstruction or localization
205+
- Require pycolmap>=0.1.0 and Python>=3.7
184206
</details>
185207

186208
<details>
@@ -211,7 +233,6 @@ Initial public version.
211233

212234
External contributions are very much welcome. Please follow the [PEP8 style guidelines](https://www.python.org/dev/peps/pep-0008/) using a linter like flake8. This is a non-exhaustive list of features that might be valuable additions:
213235

214-
- [ ] handle unknown query intrinsics (extraction from EXIF + refinement in PnP)
215236
- [ ] support for GPS (extraction from EXIF + guided retrieval)
216237
- [ ] covisibility clustering for InLoc
217238
- [ ] visualization of the raw predictions (features and matches)

datasets/.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
# Ignore everything in this directory
2-
*
3-
# Except this file
4-
!.gitignore

datasets/sacre_coeur/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Sacre Coeur demo
2+
3+
We provide here a subset of images depicting the Sacre Coeur. These images were obtained from the [Image Matching Challenge 2021](https://www.cs.ubc.ca/research/image-matching-challenge/2021/data/) and were originally collected by the [Yahoo Flickr Creative Commons 100M (YFCC) dataset](https://multimediacommons.wordpress.com/yfcc100m-core-dataset/).
506 KB
Loading
341 KB
Loading
444 KB
Loading
523 KB
Loading
447 KB
Loading
349 KB
Loading

0 commit comments

Comments
 (0)