update bug in control training (#26)

This commit is contained in:
Bubbliiiing
2024-09-30 16:45:48 +08:00
committed by GitHub
parent 0a9b013f39
commit 67ef062b64
+5 -1
View File
@@ -393,7 +393,7 @@ class ImageVideoControlDataset(Dataset):
def get_batch(self, idx):
data_info = self.dataset[idx % len(self.dataset)]
video_id, control_video_id, text = data_info['file_path'], data_info['control_file_path'], data_info['text']
video_id, text = data_info['file_path'], data_info['text']
if data_info.get('type', 'image')=='video':
if self.data_root is None:
@@ -444,6 +444,8 @@ class ImageVideoControlDataset(Dataset):
if random.random() < self.text_drop_ratio:
text = ''
control_video_id = data_info['control_file_path']
if self.data_root is None:
control_video_id = control_video_id
else:
@@ -489,6 +491,8 @@ class ImageVideoControlDataset(Dataset):
if random.random() < self.text_drop_ratio:
text = ''
control_image_id = data_info['control_file_path']
if self.data_root is None:
control_image_id = control_image_id
else: