MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / download

Function download

Test/astc_test_image_dl.py:33–52  ·  view source on GitHub ↗

Download a single image. Args: test_set: The test set name. index: The download image index. src_url: The download URL. dst_path: The destination file path.

(test_set: str, index: int, src_url: str, dst_path: Path)

Source from the content-addressed store, hash-verified

31
32
33def download(test_set: str, index: int, src_url: str, dst_path: Path) -> None:
34 '''
35 Download a single image.
36
37 Args:
38 test_set: The test set name.
39 index: The download image index.
40 src_url: The download URL.
41 dst_path: The destination file path.
42 '''
43 # Skip downloads if the file already exists
44 if dst_path.exists():
45 print(f'{test_set} image {index}: Skipping')
46 return
47
48 dir_name = dst_path.parent
49 dir_name.mkdir(parents=True, exist_ok=True)
50
51 print(f'{test_set} image {index}: Downloading')
52 urllib.request.urlretrieve(src_url, dst_path)
53
54
55def make_landscape(file_path: Path) -> None:

Callers 1

retrieve_kodak_setFunction · 0.85

Calls 1

printFunction · 0.50

Tested by

no test coverage detected