-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
Add docstrings and fix VIVIT examples #25628
Add docstrings and fix VIVIT examples #25628
Conversation
>>> indices = sample_frame_indices(clip_len=32, frame_sample_rate=4, seg_len=container.streams.video[0].frames) | ||
>>> video = read_video_pyav(container=container, indices=indices) |
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.
-
videoreader
was an undeclared variable. It has been replaced with an equivalent code. -
When
seg_len
is set to the whole video lengthframe_sample_rate
needs to be set to4
otherwise the model will assign a wrong class to the video invalidating the whole example.
@@ -698,7 +717,7 @@ def forward( | |||
>>> # model predicts one of the 400 Kinetics-400 classes | |||
>>> predicted_label = logits.argmax(-1).item() | |||
>>> print(model.config.id2label[predicted_label]) | |||
eating spaghetti | |||
LABEL_116 |
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.
The model actually doesn't output eating spaghetti
it outputs LABEL_116
which corresponds to eating spaghetti
in kinetics 400.
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. |
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.
Doctests pass locally for me and the docstrings look good!
@Geometrein Thanks for the PR - ping me whenever you're happy for me to merge! |
Thanks for your review @Rocketknight1! |
* fix docstrings and examples * docstring update * add missing whitespace
* fix docstrings and examples * docstring update * add missing whitespace
* fix docstrings and examples * docstring update * add missing whitespace
What does this PR do?
sample_frame_indices
methodPytorch
&VivitForVideoClassification
importsvideoreader
variable.Before submitting
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.