File size: 3,969 Bytes
864ebc9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Visual Localization with DUSt3R

## Dataset preparation

### CambridgeLandmarks

Each subscene should look like this:

```

Cambridge_Landmarks

β”œβ”€ mapping

β”‚   β”œβ”€ GreatCourt

β”‚   β”‚  └─ colmap/reconstruction

β”‚   β”‚     β”œβ”€ cameras.txt

β”‚   β”‚     β”œβ”€ images.txt

β”‚   β”‚     └─ points3D.txt

β”œβ”€ kapture

β”‚   β”œβ”€ GreatCourt

β”‚   β”‚  └─ query  # https://github.com/naver/kapture/blob/main/doc/datasets.adoc#cambridge-landmarks

β”‚   ... 

β”œβ”€ GreatCourt 

β”‚   β”œβ”€ pairsfile/query

β”‚   β”‚     └─ AP-GeM-LM18_top50.txt  # https://github.com/naver/deep-image-retrieval/blob/master/dirtorch/extract_kapture.py followed by https://github.com/naver/kapture-localization/blob/main/tools/kapture_compute_image_pairs.py

β”‚   β”œβ”€ seq1

β”‚   ...

...

```

### 7Scenes
Each subscene should look like this:

```

7-scenes

β”œβ”€ chess

β”‚   β”œβ”€ mapping/  # https://github.com/naver/kapture/blob/main/doc/datasets.adoc#1-7-scenes

β”‚   β”œβ”€ query/  # https://github.com/naver/kapture/blob/main/doc/datasets.adoc#1-7-scenes

β”‚   └─ pairsfile/query/

β”‚         └─ APGeM-LM18_top20.txt  # https://github.com/naver/deep-image-retrieval/blob/master/dirtorch/extract_kapture.py followed by https://github.com/naver/kapture-localization/blob/main/tools/kapture_compute_image_pairs.py

...

```

### Aachen-Day-Night

```

Aachen-Day-Night-v1.1

β”œβ”€ mapping

β”‚   β”œβ”€ colmap/reconstruction

β”‚   β”‚  β”œβ”€ cameras.txt

β”‚   β”‚  β”œβ”€ images.txt

β”‚   β”‚  └─ points3D.txt

β”œβ”€ kapture

β”‚   └─ query  # https://github.com/naver/kapture/blob/main/doc/datasets.adoc#2-aachen-day-night-v11

β”œβ”€ images

β”‚   β”œβ”€ db

β”‚   β”œβ”€ query

β”‚   └─ sequences

└─ pairsfile/query

    └─ fire_top50.txt  # https://github.com/naver/fire/blob/main/kapture_compute_pairs.py

```

### InLoc

```

InLoc

β”œβ”€ mapping  # https://github.com/naver/kapture/blob/main/doc/datasets.adoc#6-inloc

β”œβ”€ query    # https://github.com/naver/kapture/blob/main/doc/datasets.adoc#6-inloc

└─ pairsfile/query

    └─ pairs-query-netvlad40-temporal.txt  # https://github.com/cvg/Hierarchical-Localization/blob/master/pairs/inloc/pairs-query-netvlad40-temporal.txt

```

## Example Commands

With `visloc.py` you can run our visual localization experiments on Aachen-Day-Night, InLoc, Cambridge Landmarks and 7 Scenes.

```bash

# Aachen-Day-Night-v1.1:

# scene in 'day' 'night'

# scene can also be 'all'

python3 visloc.py --model_name DUSt3R_ViTLarge_BaseDecoder_512_dpt --dataset "VislocAachenDayNight('/path/to/prepared/Aachen-Day-Night-v1.1/', subscene='${scene}', pairsfile='fire_top50', topk=20)" --pnp_mode poselib --reprojection_error_diag_ratio 0.008 --output_dir /path/to/output/Aachen-Day-Night-v1.1/${scene}/loc



# InLoc

python3 visloc.py --model_name DUSt3R_ViTLarge_BaseDecoder_512_dpt --dataset "VislocInLoc('/path/to/prepared/InLoc/', pairsfile='pairs-query-netvlad40-temporal', topk=20)" --pnp_mode poselib --reprojection_error_diag_ratio 0.008 --output_dir /path/to/output/InLoc/loc





# 7-scenes:

# scene in 'chess' 'fire' 'heads' 'office' 'pumpkin' 'redkitchen' 'stairs'

python3 visloc.py --model_name DUSt3R_ViTLarge_BaseDecoder_512_dpt --dataset "VislocSevenScenes('/path/to/prepared/7-scenes/', subscene='${scene}', pairsfile='APGeM-LM18_top20', topk=1)" --pnp_mode poselib --reprojection_error_diag_ratio 0.008 --output_dir /path/to/output/7-scenes/${scene}/loc



# Cambridge Landmarks:

# scene in 'ShopFacade' 'GreatCourt' 'KingsCollege' 'OldHospital' 'StMarysChurch'

python3 visloc.py --model_name DUSt3R_ViTLarge_BaseDecoder_512_dpt --dataset "VislocCambridgeLandmarks('/path/to/prepared/Cambridge_Landmarks/', subscene='${scene}', pairsfile='APGeM-LM18_top50', topk=20)" --pnp_mode poselib --reprojection_error_diag_ratio 0.008 --output_dir /path/to/output/Cambridge_Landmarks/${scene}/loc



```