Skip to content

Conversation

datumbox
Copy link
Contributor

@datumbox datumbox commented May 13, 2022

@datumbox datumbox marked this pull request as draft May 13, 2022 13:14
@datumbox datumbox marked this pull request as ready for review May 13, 2022 13:46
@datumbox datumbox changed the title [WIP] Add examples of Multi-weight support + model usage Add examples of Multi-weight support + model usage May 13, 2022
@datumbox datumbox requested a review from NicolasHug May 13, 2022 13:46
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")
Copy link
Contributor Author

@datumbox datumbox May 13, 2022

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?

Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See #6056

Copy link
Member

@NicolasHug NicolasHug left a 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:
Copy link
Member

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.

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'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()
Copy link
Member

@NicolasHug NicolasHug May 13, 2022

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

Copy link
Contributor Author

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?

@datumbox datumbox merged commit 8edd920 into pytorch:main May 13, 2022
@datumbox datumbox deleted the doc/model_usage branch May 13, 2022 15:45
@datumbox datumbox linked an issue May 13, 2022 that may be closed by this pull request
6 tasks
facebook-github-bot pushed a commit that referenced this pull request May 24, 2022
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve documentation for Multi-weight support

4 participants