Update for windows compability (#32)

* replaced lambda statements with local functions to work with pickle in dataset.py and moved collate function outside of main and added its own class in cogvideox_image_to_video_lora.py

* Update cogvideox_image_to_video_lora.py

Remove the bug-fix related to image encoding since it's already present in #31

* Update cogvideox_image_to_video_lora.py

Revert to last commit (60c46827404cd4780ee0e7d3c9c56a953e2a04ca)
This commit is contained in:
Johan Mellin
2024-10-15 15:40:50 +02:00
committed by GitHub
parent 3754d20eac
commit 4f2744ee59
2 changed files with 35 additions and 20 deletions
+10 -2
View File
@@ -86,12 +86,20 @@ class VideoDataset(Dataset):
self.video_transforms = transforms.Compose(
[
transforms.RandomHorizontalFlip(random_flip) if random_flip else transforms.Lambda(lambda x: x),
transforms.Lambda(lambda x: x / 255.0),
transforms.RandomHorizontalFlip(random_flip) if random_flip else transforms.Lambda(self.identity_transform),
transforms.Lambda(self.scale_transform),
transforms.Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5], inplace=True),
]
)
@staticmethod
def identity_transform(x):
return x
@staticmethod
def scale_transform(x):
return x / 255.0
def __len__(self) -> int:
return self.num_videos