Open-Sora: Democratizing Efficient Video Production for All
Python
format (#103)
Shen Chenhui5d264f6cda92
diff --git a/tools/datasets/datautil.py b/tools/datasets/datautil.pyindex dd7607d..d4d52a9 100644--- a/tools/datasets/datautil.py+++ b/tools/datasets/datautil.py@@ -416,8 +416,8 @@ def main(args):print(f"Intersection csv contains {len(data_new)} samples.")cols_to_use = data_new.columns.difference(data.columns)- col_on = 'path'- # if 'id' in data.columns and 'id' in data_new.columns:+ col_on = "path"+ # if 'id' in data.columns and 'id' in data_new.columns:# col_on = 'id'cols_to_use = cols_to_use.insert(0, col_on)data = pd.merge(data, data_new[cols_to_use], on=col_on, how="inner")@@ -527,7 +527,7 @@ def main(args):data = data[data["num_frames"] <= args.fmax]if args.fpsmax is not None:assert "fps" in data.columns- data = data[data["fps"] <= args.fpsmax]+ data = data[(data["fps"] <= args.fpsmax) | np.isnan(data["fps"])]if args.hwmax is not None:if "resolution" not in data.columns:height = data["height"]@@ -590,7 +590,7 @@ def parse_args():# path processingparser.add_argument("--relpath", type=str, default=None, help="modify the path to relative path by root given")parser.add_argument("--abspath", type=str, default=None, help="modify the path to absolute path by root given")- parser.add_argument("--path-to-id", action='store_true', help="add id based on path")+ parser.add_argument("--path-to-id", action="store_true", help="add id based on path")# caption filteringparser.add_argument(