MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / maybe_download

Function maybe_download

tensorpack/dataflow/dataset/caltech101.py:14–21  ·  view source on GitHub ↗

Download the data from Marlin's website, unless it's already here.

(url, work_directory)

Source from the content-addressed store, hash-verified

12
13
14def maybe_download(url, work_directory):
15 """Download the data from Marlin's website, unless it's already here."""
16 filename = url.split("/")[-1]
17 filepath = os.path.join(work_directory, filename)
18 if not os.path.exists(filepath):
19 logger.info("Downloading to {}...".format(filepath))
20 download(url, work_directory)
21 return filepath
22
23
24class Caltech101Silhouettes(RNGDataFlow):

Callers 1

get_images_and_labelsMethod · 0.70

Calls 3

downloadFunction · 0.85
joinMethod · 0.80
formatMethod · 0.80

Tested by

no test coverage detected