Skip to content

Commit

Permalink
[fix] rename fps in DecordInit to avoid overwriting fps in SampleAVAF…
Browse files Browse the repository at this point in the history
…rame
  • Loading branch information
cir7 committed Feb 24, 2023
1 parent c99ad65 commit eae4896
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mmaction/datasets/transforms/loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def transform(self, results: dict) -> dict:
total_frames = results['total_frames']
# if can't get fps, same value of `fps` and `target_fps`
# will perform nothing
fps = results.get('fps')
fps = results.get('avg_fps')
if self.target_fps is None or not fps:
fps_scale_ratio = 1.0
else:
Expand Down Expand Up @@ -1111,7 +1111,7 @@ def transform(self, results):

file_obj = io.BytesIO(self.file_client.get(results['filename']))
container = decord.VideoReader(file_obj, num_threads=self.num_threads)
results['fps'] = container.get_avg_fps()
results['avg_fps'] = container.get_avg_fps()
results['video_reader'] = container
results['total_frames'] = len(container)
return results
Expand Down

0 comments on commit eae4896

Please sign in to comment.