Skip to content
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

fix(media): Update video.py: Fix fps bug #6887

Merged
merged 2 commits into from
Jan 23, 2024
Merged

Conversation

stellargo
Copy link
Contributor

Change imageio to the updated parameter fps from duration. I am a first time contributor, please let me know if I need to change the format of the PR. I like using wandb, and believe people can benefit from this fix :)

Description

When I log gifs from numpy arrays to wandb, even when the frame rate is passed, it does not seem to obey it. This fix ensures that the correct frame rate gif is created and logged to the wandb console.

Testing

In the examples below, I log a video with the same number of frames (44) using the following piece of code. The output duration of the gif should be 44/24 = 1.76 seconds. However, as visible below, the before gif has a longer duration.

wandb.log({'video': wandb.Video(final, fps=25)})

Before:

before

After:

after

Change imageio to the updated parameter `fps` from `duration`.
Copy link

codecov bot commented Jan 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b4a6ec7) 79.56% compared to head (191e193) 64.98%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #6887       +/-   ##
===========================================
- Coverage   79.56%   64.98%   -14.58%     
===========================================
  Files         452      451        -1     
  Lines       50667    50243      -424     
===========================================
- Hits        40311    32652     -7659     
- Misses      10065    17350     +7285     
+ Partials      291      241       -50     
Flag Coverage Δ
func 50.19% <ø> (-1.15%) ⬇️
system ?
unit 58.93% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
wandb/sdk/data_types/video.py 85.96% <ø> (+7.89%) ⬆️

... and 176 files with indirect coverage changes

@dmitryduev dmitryduev added this to the sdk-2024-02.1 milestone Jan 23, 2024
@dmitryduev dmitryduev changed the title fix(sdk) Update video.py: Fix fps bug fix(media): Update video.py: Fix fps bug Jan 23, 2024
@dmitryduev dmitryduev requested a review from a team January 23, 2024 21:29
Copy link
Member

@dmitryduev dmitryduev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix, @stellargo!

@dmitryduev dmitryduev merged commit d27f5ab into wandb:main Jan 23, 2024
47 of 52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants