Skip to content

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyang23333 committed Dec 4, 2024
1 parent b06e61a commit 420bd2f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
11 changes: 2 additions & 9 deletions examples/opensora_pku/opensora/dataset/t2v_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,18 +365,11 @@ def define_frame_index(self, cap_list):
cnt_too_short += 1
continue
# frame_indices = frame_indices[:end_frame_idx]
if len(frame_indices)<end_frame_idx:
frame_indices+=[frame_indices[-1]]*(end_frame_idx-len(frame_indices))
if len(frame_indices) < end_frame_idx:
frame_indices += [frame_indices[-1]] * (end_frame_idx - len(frame_indices))
else:
frame_indices = frame_indices[:end_frame_idx]








i["sample_frame_index"] = frame_indices.tolist()
new_cap_list.append(i)
i["sample_num_frames"] = len(i["sample_frame_index"]) # will use in dataloader(group sampler)
Expand Down
1 change: 0 additions & 1 deletion examples/opensora_pku/opensora/utils/dataset_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ def process(self, batch_tubes, input_ids, cond_mask, t_ds_stride, ds_stride, max
assert len(batch_input_size) == self.batch_size
# if self.group_frame or self.group_resolution or self.batch_size == 1: #
if self.group_frame or self.group_resolution or self.batch_size == 1000: #

len_each_batch = batch_input_size
idx_length_dict = dict([*zip(list(range(self.batch_size)), len_each_batch)])
count_dict = Counter(len_each_batch)
Expand Down

0 comments on commit 420bd2f

Please sign in to comment.