Skip to content

Commit

Permalink
Compatible for windows system (#29)
Browse files Browse the repository at this point in the history
Compatibility for Windows: handle paths and globs properly.

Co-authored-by: mason.suh <[email protected]>
  • Loading branch information
smwgf and mason.suh authored Dec 7, 2020
1 parent 82c3bc2 commit 39ced98
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion hloc/extract_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def __init__(self, root, conf):
self.paths += list(Path(root).glob('**/'+g))
if len(self.paths) == 0:
raise ValueError(f'Could not find any image in root: {root}.')
self.paths = sorted(list(set(self.paths)))
self.paths = [i.relative_to(root) for i in self.paths]
logging.info(f'Found {len(self.paths)} images in root {root}.')

Expand Down Expand Up @@ -107,7 +108,7 @@ def __getitem__(self, idx):
image = image / 255.

data = {
'name': str(path),
'name': path.as_posix(),
'image': image,
'original_size': np.array(size),
}
Expand Down
2 changes: 1 addition & 1 deletion hloc/triangulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def run_triangulation(colmap_path, model_path, database_path, image_dir,
exit(ret)

stats_raw = subprocess.check_output(
[str(colmap_path), 'model_analyzer', '--path', model_path])
[str(colmap_path), 'model_analyzer', '--path', str(model_path)])
stats_raw = stats_raw.decode().split("\n")
stats = dict()
for stat in stats_raw:
Expand Down

0 comments on commit 39ced98

Please sign in to comment.