Skip to content

Commit

Permalink
Bugfix in 7Scenes download and eval
Browse files Browse the repository at this point in the history
  • Loading branch information
sarlinpe committed Dec 9, 2021
1 parent a220857 commit 0072dc7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions pixloc/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ def extract_zip(zippath: Path, extract_path: Optional[Path] = None,
extract_path = zippath.parent
logger.info('Extracting %s.', zippath)
with zipfile.ZipFile(zippath, 'r') as z:
z.extractall(extract_path)
# For some reasons extracting Thumbs.db (a Windows file) can crash
names = [n for n in z.namelist() if Path(n).name != "Thumbs.db"]
z.extractall(extract_path, members=names)
if remove:
zippath.unlink()
return zippath.parent / zippath.name
Expand Down Expand Up @@ -100,16 +102,16 @@ def download_7Scenes(do_dataset=True, do_outputs=True):
extract_zip(out_path / f'{scene}.zip')
for seq in (out_path / scene).glob('*.zip'):
extract_zip(seq)
zipfile = '7scenes_sfm_triangulated.zip'
download_from_google_drive(
'1cu6KUR7WHO7G4EO49Qi3HEKU6n_yYDjb', out_path / zipfile)
extract_zip(out_path / zipfile)

if do_outputs:
url = URLs['logs'] + '7Scenes/'
out_path = settings.LOC_PATH / '7Scenes'
logger.info('Downloading logs for the 7Scenes dataset...')
download_from_url(url, out_path)
zipfile = '7scenes_sfm_triangulated.zip'
download_from_google_drive(
'1cu6KUR7WHO7G4EO49Qi3HEKU6n_yYDjb', out_path / zipfile)
extract_zip(out_path / zipfile)


def download_Cambridge(do_dataset=True, do_outputs=True):
Expand All @@ -126,16 +128,16 @@ def download_Cambridge(do_dataset=True, do_outputs=True):
for scene in scene2id:
download_from_url(url + f'{scene2id[scene]}/{scene}.zip', out_path)
extract_zip(out_path / f'{scene}.zip')
zipfile = 'CambridgeLandmarks_Colmap_Retriangulated_1024px.zip'
download_from_google_drive(
'1esqzZ1zEQlzZVic-H32V6kkZvc4NeS15', out_path / zipfile)
extract_zip(out_path / zipfile)

if do_outputs:
url = URLs['logs'] + 'Cambridge-Landmarks/'
out_path = settings.LOC_PATH / 'Cambridge'
logger.info('Downloading logs for the Cambridge Landmarks dataset...')
download_from_url(url, out_path)
zipfile = 'CambridgeLandmarks_Colmap_Retriangulated_1024px.zip'
download_from_google_drive(
'1esqzZ1zEQlzZVic-H32V6kkZvc4NeS15', out_path / zipfile)
extract_zip(out_path / zipfile)


def download_Aachen(do_dataset=True, do_outputs=True):
Expand Down
2 changes: 1 addition & 1 deletion pixloc/run_7Scenes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
default_paths = Paths(
query_images='{scene}/',
reference_images='{scene}/',
reference_sfm='{scene}/sfm_superpoint+superglue/',
reference_sfm='{scene}/sfm_superpoint+superglue+depth/',
query_list='{scene}/query_list_with_intrinsics.txt',
retrieval_pairs='7scenes_densevlad_retrieval/{scene}_top10.txt',
ground_truth='7scenes_sfm_triangulated/{scene}/triangulated/',
Expand Down

0 comments on commit 0072dc7

Please sign in to comment.