-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Add typehints for torchvision.io #2543
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
Co-authored-by: Francisco Massa <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #2543 +/- ##
==========================================
+ Coverage 70.68% 70.81% +0.13%
==========================================
Files 94 94
Lines 8017 8718 +701
Branches 1276 1483 +207
==========================================
+ Hits 5667 6174 +507
- Misses 1945 2122 +177
- Partials 405 422 +17
Continue to review full report at Codecov.
|
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.
@fmassa I did my best, but without having worked with PyAV before and no type hints from their side to check against, this will most likely contain errors. Please be thorough. I've identified two places (see below) that will not work in the current state.
Binary CI failures are related. I'll address them first and ping you if they are fixed. |
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.
Sorry for the delay in reviewing @pmeier
Given that we are lacking CI testing on GitHub for _video_opt
for now, can you please revert the changes to that file, disable mypy for it for now, and then maybe in the future once we have FFmpeg being compiled and tested in the CI we re-add it back?
Sure, I can do that. My motivation to go for |
Yeah, I would prefer if we leave |
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.
Last couple of comments and then I think we can merge this!
@fmassa Test failures seem unrelated. |
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.
Thanks!
* enable typing check for torchvision.io * fix existing errors * Update torchvision/io/_video_opt.py Co-authored-by: Francisco Massa <[email protected]> * add ignores for FileFinder * use python 3 type hints * lint * video_opt * video * try quote av type hints * revert from .dim() to .ndim * revert changes to _video_opt.py and ignore errors * fix type hints * fix type hints for read_video_timestamps * change offset int to float * remove unused import Co-authored-by: Francisco Massa <[email protected]>
* enable typing check for torchvision.io * fix existing errors * Update torchvision/io/_video_opt.py Co-authored-by: Francisco Massa <[email protected]> * add ignores for FileFinder * use python 3 type hints * lint * video_opt * video * try quote av type hints * revert from .dim() to .ndim * revert changes to _video_opt.py and ignore errors * fix type hints * fix type hints for read_video_timestamps * change offset int to float * remove unused import Co-authored-by: Francisco Massa <[email protected]>
I'll do this first before finishing
torchvision.datasets
since it is needed for the video datasets.