graphid.util.util_grabdata module¶
Ported from kwimage
.
- graphid.util.util_grabdata.grab_test_imgpath(key='astro.png', allow_external=True, verbose=True)[source]¶
Gets paths to standard / fun test images. Downloads them if they dont exits
- Parameters:
key (str) – one of the standard test images, e.g. astro.png, carl.jpg, …
allow_external (bool) – if True you can specify existing fpaths
- Returns:
testimg_fpath - filepath to the downloaded or cached test image.
- Return type:
Example
>>> testimg_fpath = grab_test_imgpath('carl.jpg') >>> assert exists(testimg_fpath)
- graphid.util.util_grabdata._update_hashes()[source]¶
for dev use to update hashes of the demo images
- graphid.util.util_grabdata.grab_test_image_fpath(key='astro', dsize=None, overviews=None)[source]¶
Ensures that the test image exists (this might use the network) and returns the cached filepath to the requested image.
- Parameters:
key (str) – which test image to grab. Valid choices are: astro - an astronaught carl - Carl Sagan paraview - ParaView logo stars - picture of stars in the sky
dsize (None | Tuple[int, int]) – if specified, we will return a variant of the data with the specific dsize
overviews (None | int) – if specified, will return a variant of the data with overviews
- Returns:
path to the requested image
- Return type: