Skip to content

Commit

Permalink
Update train_util.py
Browse files Browse the repository at this point in the history
  • Loading branch information
gesen2egee committed Feb 26, 2024
1 parent a649689 commit 09d0696
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions library/train_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1363,10 +1363,11 @@ def __getitem__(self, index):
image = self.image_transforms(img) # -1.0~1.0のtorch.Tensorになる

images.append(image)
latents_list.append(latents)
masks.append(torch.tensor(mask))

latents_list.append(latents)
target_size = (image.shape[2], image.shape[1]) if image is not None else (latents.shape[2] * 8, latents.shape[1] * 8)
if mask == None:
mask = np.full(target_shape, 255, np.uint8)
masks.append(torch.tensor(mask))

if not flipped:
crop_left_top = (crop_ltrb[0], crop_ltrb[1])
Expand Down

0 comments on commit 09d0696

Please sign in to comment.