Skip to content

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

Merged
merged 1 commit into from
Oct 31, 2024
Merged

Generalize README benchmark #327

merged 1 commit into from
Oct 31, 2024

Conversation

scotts
Copy link
Contributor

@scotts scotts commented Oct 31, 2024

I could not run the benchmarks at first; these are the changes I had to make to get them to run fresh.

@scotts scotts marked this pull request as ready for review October 31, 2024 13:58
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 31, 2024
video_count += 1

wait(futures)
for f in futures:
assert f.result()
Copy link
Contributor Author

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)
Copy link
Contributor Author

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")
Copy link
Contributor Author

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.

Copy link
Contributor

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

@scotts scotts requested a review from ahmadsharif1 October 31, 2024 13:59
Copy link
Contributor

@ahmadsharif1 ahmadsharif1 left a 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"
Copy link
Contributor

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

Copy link
Contributor Author

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")
Copy link
Contributor

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

Copy link
Contributor

@ahmadsharif1 ahmadsharif1 left a 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

@scotts scotts merged commit b839529 into pytorch:main Oct 31, 2024
31 checks passed
@scotts scotts deleted the exp branch October 31, 2024 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants