MCPcopy Create free account
hub / github.com/colmap/colmap / download_file

Function download_file

python/ci/test_regression_eth3d.py:18–30  ·  view source on GitHub ↗
(url: str, file_path: str, max_retries: int = 3)

Source from the content-addressed store, hash-verified

16
17
18def download_file(url: str, file_path: str, max_retries: int = 3) -> None:
19 if os.path.exists(file_path):
20 return
21 logging.info(f"Downloading {url} to {file_path}")
22 for retry in range(max_retries):
23 try:
24 urllib.request.urlretrieve(url, file_path)
25 return
26 except Exception as exc:
27 logging.error(
28 f"Failed to download {url} (trial={retry + 1}) "
29 f"to {file_path} due to {exc}"
30 )
31
32
33def check_small_errors_or_exit(

Callers 1

process_datasetFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected