-
Notifications
You must be signed in to change notification settings - Fork 37
Generalize README benchmark #327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
video_count += 1 | ||
|
||
wait(futures) | ||
for f in futures: | ||
assert f.result() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ensures that if we encounter an error while generating a video, we stop.
shutil.rmtree(videos_path) | ||
ffmpeg_path = "ffmpeg" | ||
videos_path = "/tmp/torchcodec_benchmarking_videos" | ||
shutil.rmtree(videos_path, ignore_errors=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to fail if the tmp directory does not exist already.
@@ -56,7 +56,7 @@ def main() -> None: | |||
ffmpeg_path, | |||
videos_path, | |||
) | |||
video_paths = glob.glob(f"{videos_path}/*.mp4") | |||
video_files = glob.glob(f"{videos_path}/*.mp4") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was confused by how close the old variable names were to each other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment above about rename
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment about renames
videos_path = "/tmp/videos" | ||
shutil.rmtree(videos_path) | ||
ffmpeg_path = "ffmpeg" | ||
videos_path = "/tmp/torchcodec_benchmarking_videos" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should be renamed to videos_dir_path
I like path over files because it tells the user it's a full path and not the filename only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, good point, I'll make one use dir
and the other file
.
@@ -56,7 +56,7 @@ def main() -> None: | |||
ffmpeg_path, | |||
videos_path, | |||
) | |||
video_paths = glob.glob(f"{videos_path}/*.mp4") | |||
video_files = glob.glob(f"{videos_path}/*.mp4") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment above about rename
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment about renames
I could not run the benchmarks at first; these are the changes I had to make to get them to run fresh.