Skip to content

Commit cdab2cf

Browse files
author
--unset
committed
Resizing bug
1 parent 10bf85f commit cdab2cf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

examples/cogvideo/train_cogvideox_lora.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,7 @@ def _preprocess_data(self):
594594
videos = []
595595

596596
for filename in self.instance_video_paths:
597-
progress_dataset_bar.update(1)
598-
video_reader = decord.VideoReader(uri=filename.as_posix(), width=self.width, height=self.height)
597+
video_reader = decord.VideoReader(uri=filename.as_posix())
599598
video_num_frames = len(video_reader)
600599

601600
start_frame = min(self.skip_frames_start, video_num_frames)
@@ -623,8 +622,12 @@ def _preprocess_data(self):
623622
# Training transforms
624623
frames = (frames - 127.5) / 127.5
625624
frames = frames.permute(0, 3, 1, 2) # [F, C, H, W]
625+
progress_dataset_bar.set_description(
626+
f"Loading progress Resizing video from {frames.shape[2]}x{frames.shape[3]} to {self.height}x{self.width}"
627+
)
626628
frames = self._resize_for_rectangle_crop(frames)
627629
videos.append(frames.contiguous()) # [F, C, H, W]
630+
progress_dataset_bar.update(1)
628631

629632
progress_dataset_bar.close()
630633
return videos

0 commit comments

Comments
 (0)