Textual Inversion: Added custom training image size and number of repeats per input image in a single epoch

This commit is contained in:
alg-wiki
2022-10-10 17:07:46 +09:00
parent 8acc901ba3
commit 3110f895b2
4 changed files with 24 additions and 9 deletions

View File

@@ -15,13 +15,13 @@ re_tag = re.compile(r"[a-zA-Z][_\w\d()]+")
class PersonalizedBase(Dataset):
def __init__(self, data_root, size=None, repeats=100, flip_p=0.5, placeholder_token="*", width=512, height=512, model=None, device=None, template_file=None):
def __init__(self, data_root, size, repeats, flip_p=0.5, placeholder_token="*", model=None, device=None, template_file=None):
self.placeholder_token = placeholder_token
self.size = size
self.width = width
self.height = height
self.width = size
self.height = size
self.flip = transforms.RandomHorizontalFlip(p=flip_p)
self.dataset = []