Open-Sora: Democratizing Efficient Video Production for All
Python
merge
Zangwei Zhengf5e347e08e88
diff --cc tools/caption/utils.pyindex 978b96c,d6a8d84..eb43566--- a/tools/caption/utils.py+++ b/tools/caption/utils.py@@@ -101,7 -94,9 +103,10 @@@ class VideoTextDataset(torch.utils.dataimages = [pil_loader(path)]length = 1else:- images, length = extract_frames(sample["path"], points=self.points)+ # images, length = extract_frames(sample["path"], points=self.points)+ images, length = extract_frames_new(- sample["path"], points=self.points, backend='opencv', return_length=True)++ sample["path"], points=self.points, backend="opencv", return_length=True++ )if self.resize_size is not None:images_r = []for img in images:diff --cc tools/scoring/aesthetic/inference.pyindex 6b98ad4,e7931ce..dcbf9a1--- a/tools/scoring/aesthetic/inference.py+++ b/tools/scoring/aesthetic/inference.py@@@ -4,7 -4,7 +4,6 @@@ import ofrom datetime import timedeltaimport clip--import decordimport numpy as npimport pandas as pdimport torch@@@ -57,7 -49,7 +48,7 @@@ class VideoTextDataset(torch.utils.dataif not is_video(path):images = [pil_loader(path)]else:- images = extract_frames(sample["path"], points=self.points)- images = extract_frames_new(sample["path"], points=self.points, backend='opencv')++ images = extract_frames_new(sample["path"], points=self.points, backend="opencv")images = [self.transform(img) for img in images]images = torch.stack(images)return dict(index=index, images=images)