-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Add examples of Multi-weight support + model usage #6013
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
from torchvision.io.video import read_video | ||
from torchvision.models.video import r3d_18, R3D_18_Weights | ||
vid, _, _ = read_video("test/assets/videos/v_SoccerJuggling_g23_c01.avi") |
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.
@bjuncek Apparently this emits a vague deprecation warning (without a fixed removal date). Does it make sense to remove the warning given that we are still uncertain on what we will do with the specific API? Or perhaps I should modify my example to avoid the warnings?
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, feel free to remove it.
I'm in the process of re-writing the video-module to have a more sensical stucture
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 #6056
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 @datumbox I made some minor suggestions, LGTM regardless.
I think the snippets describing the different usages are useful, but I wonder if it would make more sense to move them into a gallery example (maybe exampleS)?
Definitely fine as-is though, we can improve on that later (potentially after the release) if we have more bandwidth.
|
||
| | ||
Here is an example of how to use the pre-trained quantized image classification models: |
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 wonder if we should just refer to the snippet above instead, and mention to pass quantize=True
? This seems to be the only difference, apart from the imports.
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'm OK giving a second example given we have a different namespace. Hopefully on the future this will be deprecated and move all quantization of models on main model builders (with FX quant)
colors="red", | ||
width=4, font_size=30) | ||
im = to_pil_image(box.detach()) | ||
im.show() |
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'm getting
RuntimeError: "qnms_kernel" not implemented for 'Float'
But I haven't compiled or updated the nightlies recently, maybe that's why
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.
That's strange. It works for me. Can you put the recent in case this is a bug?
Co-authored-by: Nicolas Hug <contact@nicolas-hug.com>
Summary: * Adding code examples for image classification + quant * Adding code example detection * Adding code example segmentation * Adding code example for video classification * Adding information on how to use the new API. * Putting back the comma. * Apply suggestions from code review * Remove output to avoid staleness from flakiness. * Minor fixes. Reviewed By: datumbox Differential Revision: D36413367 fbshipit-source-id: 661fe7364bc55f7fb1ed1d15c9c72618f03b9177 Co-authored-by: Nicolas Hug <contact@nicolas-hug.com> Co-authored-by: Nicolas Hug <contact@nicolas-hug.com>
Fixes partially #6014
Demo link: https://output.circle-artifacts.com/output/job/eb77e259-c40e-488d-b5f5-b3adc3121885/artifacts/0/docs/models_new.html
Multi-weight API example:
Model usage example: