Skip to content

Open-Sora: Democratizing Efficient Video Production for All

Python

[fix] bucket

Zangwei Zheng50c0a3565823
diff --git a/configs/opensora-v1-1/train/video.py b/configs/opensora-v1-1/train/video.py
index 7be2630..3693cb8 100644
--- a/configs/opensora-v1-1/train/video.py
+++ b/configs/opensora-v1-1/train/video.py
@@ -3,7 +3,7 @@ dataset = dict(
type="VariableVideoTextDataset",
data_path=None,
num_frames=None,
- frame_interval=1,
+ frame_interval=3,
image_size=(None, None),
transform_name="resize_crop",
)
@@ -11,18 +11,18 @@ bucket_config = { # 6s/it
"240p": {16: (1.0, 16), 32: (1.0, 8), 64: (1.0, 4), 128: (1.0, 2)},
"256": {1: (1.0, 256)},
"512": {1: (1.0, 80)},
- "480p": {1: (0.5, 52), 16: (0.5, 4), 32: (0.0, None)},
- "720p": {16: (1.0, 2), 32: (0.0, None)}, # No examples now
- "1024": {1: (1.0, 20)},
- "1080p": {1: (1.0, 8)},
-}
-mask_ratios = {
- "mask_no": 0.9,
- "mask_random": 0.06,
- "mask_head": 0.01,
- "mask_tail": 0.01,
- "mask_head_tail": 0.02,
+ "480p": {1: (0.4, 52), 16: (0.4, 4), 32: (0.0, None)},
+ "720p": {16: (0.1, 2), 32: (0.0, None)}, # No examples now
+ "1024": {1: (0.3, 20)},
+ "1080p": {1: (0.3, 8)},
}
+# mask_ratios = {
+# "mask_no": 0.9,
+# "mask_random": 0.06,
+# "mask_head": 0.01,
+# "mask_tail": 0.01,
+# "mask_head_tail": 0.02,
+# }
# Define acceleration
num_workers = 4
diff --git a/opensora/datasets/bucket.py b/opensora/datasets/bucket.py
index 311f788..117f5ee 100644
--- a/opensora/datasets/bucket.py
+++ b/opensora/datasets/bucket.py
@@ -102,7 +102,7 @@ class Bucket:
break
hw_id = list(self.hw_criteria.keys())[hw_id_index]
- if T_id is None or hw_id_index >= len(self.hw_criteria) - 1:
+ if T_id is None or hw_id_index > len(self.hw_criteria) - 1:
return None
# ar