MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / __init__

Method __init__

k_diffusion/utils.py:395–399  ·  view source on GitHub ↗
(self, root, transform=None)

Source from the content-addressed store, hash-verified

393 IMG_EXTENSIONS = {'.jpg', '.jpeg', '.png', '.ppm', '.bmp', '.pgm', '.tif', '.tiff', '.webp'}
394
395 def __init__(self, root, transform=None):
396 super().__init__()
397 self.root = Path(root)
398 self.transform = nn.Identity() if transform is None else transform
399 self.paths = sorted(path for path in self.root.rglob('*') if path.suffix.lower() in self.IMG_EXTENSIONS)
400
401 def __repr__(self):
402 return f'FolderOfImages(root="{self.root}", len: {len(self)})'

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected