Skip to content

Open-Sora: Democratizing Efficient Video Production for All

Python

merge

Zangwei Zhengf5e347e08e88
diff --cc tools/caption/utils.py
index 978b96c,d6a8d84..eb43566
--- a/tools/caption/utils.py
+++ b/tools/caption/utils.py
@@@ -101,7 -94,9 +103,10 @@@ class VideoTextDataset(torch.utils.data
images = [pil_loader(path)]
length = 1
else:
- 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.py
index 6b98ad4,e7931ce..dcbf9a1
--- a/tools/scoring/aesthetic/inference.py
+++ b/tools/scoring/aesthetic/inference.py
@@@ -4,7 -4,7 +4,6 @@@ import o
from datetime import timedelta
import clip
--import decord
import numpy as np
import pandas as pd
import torch
@@@ -57,7 -49,7 +48,7 @@@ class VideoTextDataset(torch.utils.data
if 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)