MCPcopy
hub / github.com/cvg/Hierarchical-Localization / main

Function main

hloc/match_features.py:151–176  ·  view source on GitHub ↗
(conf: Dict,
         pairs: Path, features: Union[Path, str],
         export_dir: Optional[Path] = None,
         matches: Optional[Path] = None,
         features_ref: Optional[Path] = None,
         overwrite: bool = False)

Source from the content-addressed store, hash-verified

149
150
151def main(conf: Dict,
152 pairs: Path, features: Union[Path, str],
153 export_dir: Optional[Path] = None,
154 matches: Optional[Path] = None,
155 features_ref: Optional[Path] = None,
156 overwrite: bool = False) -> Path:
157
158 if isinstance(features, Path) or Path(features).exists():
159 features_q = features
160 if matches is None:
161 raise ValueError('Either provide both features and matches as Path'
162 ' or both as names.')
163 else:
164 if export_dir is None:
165 raise ValueError('Provide an export_dir if features is not'
166 f' a file path: {features}.')
167 features_q = Path(export_dir, features+'.h5')
168 if matches is None:
169 matches = Path(
170 export_dir, f'{features}_{conf["output"]}_{pairs.stem}.h5')
171
172 if features_ref is None:
173 features_ref = features_q
174 match_from_paths(conf, pairs, matches, features_q, features_ref, overwrite)
175
176 return matches
177
178
179def find_unique_new_pairs(pairs_all: List[Tuple[str]], match_path: Path = None):

Callers 1

match_features.pyFile · 0.70

Calls 1

match_from_pathsFunction · 0.85

Tested by

no test coverage detected