MCPcopy Index your code
hub / github.com/huggingface/diffusers / InstanceDataImageDataset

Class InstanceDataImageDataset

examples/amused/train_amused.py:325–341  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

323
324
325class InstanceDataImageDataset(Dataset):
326 def __init__(
327 self,
328 instance_data_image,
329 train_batch_size,
330 size=512,
331 ):
332 self.value = process_image(Image.open(instance_data_image), size)
333 self.train_batch_size = train_batch_size
334
335 def __len__(self):
336 # Needed so a full batch of the data can be returned. Otherwise will return
337 # batches of size 1
338 return self.train_batch_size
339
340 def __getitem__(self, index):
341 return self.value
342
343
344class HuggingFaceDataset(Dataset):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…