-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Inference on video without extracting images#641
Draft
cjaverliat wants to merge 24 commits intofacebookresearch:main from
Draft
Inference on video without extracting images #641cjaverliat wants to merge 24 commits intofacebookresearch:main from
cjaverliat wants to merge 24 commits intofacebookresearch:main from
Conversation
...t methods in SAM2Result
Prompt
为什么我的gpu只占用了不到3G,推理的时候感觉没有用上gpu,使用率一直为0,速度很慢,四分钟视频七千多帧,要跑四十几分钟
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
Inference on video without extracting images
This PR proposes an alternative to the original SAM2Base, SAM2Generic, which provides new APIs. Additionally, I added a SAM2GenericVideoPredictor which is a re-implementation of the video predictor but with configurable strategies for memorization and removal of past memories (cf. here for an example), this solves the issue with keeping everything in the VRAM.
More importantly, this gives more flexibility as to how the images are provided (as tensors instead of giving a video url or individual images):
The full usage example is available in the
generic_video_predictor_example.ipynbnotebook.