-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Remove warnings #111
Remove warnings #111
Changes from all commits
7a9a6ae
56522ae
448e854
2dfb538
4605477
d12d6e8
f66536e
f3aede9
e1550eb
7aecd29
0418a8a
2fdd211
135ba53
07264ce
afa14ea
67e5431
48dc35c
cc8d689
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import warnings | ||
|
||
import imageio | ||
|
||
|
||
def write_video(video_path, stacked_frames, fps): | ||
# Filter out DeprecationWarnings raised from pkg_resources | ||
with warnings.catch_warnings(): | ||
warnings.filterwarnings( | ||
"ignore", "pkg_resources is deprecated as an API", category=DeprecationWarning | ||
) | ||
imageio.mimsave(video_path, stacked_frames, fps=fps) | ||
Comment on lines
+6
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Out of curiosity, why cant we use imageio as an API without warning? What are the alternatives to generate an mp4 from a numpy array? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure to understand. To be clear, the problem here with |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Should we rename
io_utils.py
toio.py
?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 did this in a previous python project and it's okay until you need to
import io
from the standard library. It's confusing so I wouldn't recommend it.