MCPcopy
hub / github.com/thygate/stable-diffusion-webui-depthmap-script / get

Method get

pix2pix/util/get_data.py:79–110  ·  view source on GitHub ↗

Download a dataset. Parameters: save_path (str) -- A directory to save the data to. dataset (str) -- (optional). A specific dataset to download. Note: this must include the file extension. If None, o

(self, save_path, dataset=None)

Source from the content-addressed store, hash-verified

77 os.remove(temp_save_path)
78
79 def get(self, save_path, dataset=None):
80 """
81
82 Download a dataset.
83
84 Parameters:
85 save_path (str) -- A directory to save the data to.
86 dataset (str) -- (optional). A specific dataset to download.
87 Note: this must include the file extension.
88 If None, options will be presented for you
89 to choose from.
90
91 Returns:
92 save_path_full (str) -- the absolute path to the downloaded data.
93
94 """
95 if dataset is None:
96 selected_dataset = self._present_options()
97 else:
98 selected_dataset = dataset
99
100 save_path_full = join(save_path, selected_dataset.split('.')[0])
101
102 if isdir(save_path_full):
103 warn("\n'{0}' already exists. Voiding Download.".format(
104 save_path_full))
105 else:
106 self._print('Downloading Data...')
107 url = "{0}/{1}".format(self.url, selected_dataset)
108 self._download_data(url, save_path=save_path)
109
110 return abspath(save_path_full)

Callers 15

get_configFunction · 0.80
get_image_from_urlFunction · 0.80
__init__Method · 0.80
__init__Method · 0.80
openMethod · 0.80
should_early_stopMethod · 0.80
train_on_batchMethod · 0.80
crop_aware_inferMethod · 0.80
load_state_dictFunction · 0.80
__init__Method · 0.80
point_to_voxelFunction · 0.80
voxel_to_pointFunction · 0.80

Calls 3

_present_optionsMethod · 0.95
_printMethod · 0.95
_download_dataMethod · 0.95

Tested by

no test coverage detected