MCPcopy Create free account
hub / github.com/thygate/stable-diffusion-webui-depthmap-script / make_dataset

Function make_dataset

pix2pix/data/image_folder.py:23–32  ·  view source on GitHub ↗
(dir, max_dataset_size=float("inf"))

Source from the content-addressed store, hash-verified

21
22
23def make_dataset(dir, max_dataset_size=float("inf")):
24 images = []
25 assert os.path.isdir(dir), '%s is not a valid directory' % dir
26
27 for root, _, fnames in sorted(os.walk(dir)):
28 for fname in fnames:
29 if is_image_file(fname):
30 path = os.path.join(root, fname)
31 images.append(path)
32 return images[:min(max_dataset_size, len(images))]
33
34
35def default_loader(path):

Callers 2

__init__Method · 0.90
__init__Method · 0.85

Calls 2

is_image_fileFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected