-
Notifications
You must be signed in to change notification settings - Fork 211
from_tensors
support for VideoClassification
#1389
from_tensors
support for VideoClassification
#1389
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Codecov Report
@@ Coverage Diff @@
## master #1389 +/- ##
==========================================
- Coverage 92.90% 92.83% -0.07%
==========================================
Files 286 287 +1
Lines 12874 12969 +95
==========================================
+ Hits 11960 12040 +80
- Misses 914 929 +15
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
…m:PyTorchLightning/lightning-flash into video/feature/classification/from_tensors
…m:Lightning-AI/lightning-flash into video/feature/classification/from_tensors
for more information, see https://pre-commit.ci
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.
Looking good, few comments 😃
Co-authored-by: Ethan Harris <[email protected]>
…m:Lightning-AI/lightning-flash into video/feature/classification/from_tensors
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.
LGTM, small suggestion
Co-authored-by: Ethan Harris <[email protected]>
for more information, see https://pre-commit.ci
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.
Looks great, just a comment on the API
flash/video/classification/data.py
Outdated
>>> datamodule = VideoClassificationData.from_tensors( | ||
... input_field="data", | ||
... target_field="targets", | ||
... train_data=train_data, | ||
... predict_data=predict_data, | ||
... batch_size=1, | ||
... ) |
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 think it would be better to make the API consistent with what we have for image classification. E.g. like this:
>>> datamodule = VideoClassificationData.from_tensors(
... train_data=[input_video, input_video, input_video],
... train_targets=[1, 2, 3],
... predict_data=predict_data,
... batch_size=1,
... )
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.
Just requesting changes so we don't accidentally merge it before agreeing on the API 😃
…h format as of imageclassifcation from_tensors
…m:Lightning-AI/lightning-flash into video/feature/classification/from_tensors
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.
LGTM 😃
What does this PR do?
Addresses #1356. A sample script to try it out:
Output:
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃