We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dad654e commit e40de1bCopy full SHA for e40de1b
src/transformers/video_utils.py
@@ -108,8 +108,10 @@ def timestamps(self) -> list[float]:
108
109
@property
110
def sampled_fps(self) -> float:
111
- "fps of the sampled video."
112
- return len(self.frames_indices) / self.total_num_frames * self.fps if self.fps else 24
+ "FPS of the sampled video."
+ if self.frames_indices is None or self.total_num_frames is None or self.fps is None:
113
+ return self.fps or 24
114
+ return len(self.frames_indices) / self.total_num_frames * self.fps
115
116
def update(self, dictionary):
117
for key, value in dictionary.items():
0 commit comments