-
Notifications
You must be signed in to change notification settings - Fork 271
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
Support for multiple object video tracking capabilities with SAM2.1 #668
base: master
Are you sure you want to change the base?
Support for multiple object video tracking capabilities with SAM2.1 #668
Conversation
Significant improvements have been made to the video segmentation and tracking features, including support for multi-object tracking. Users can now choose between 'box' or 'point' prompts for object identification. Docker support has also been enhanced, with the configuration updated to reserve GPU resources and ensure the correct Docker runtime is used. Additionally, the model configuration and checkpoint paths have been updated for SAM2.1. The segment-anything-2 repository can now be installed in any location by setting the appropriate environment variable. Lastly, the predict function has undergone major refactoring for improved clarity and efficiency.
Im trying to replicate your work! Since you are familiar with this what is the root directory for installing sam2? and also do we need to install it as Also I seem to be getting an error with not finding |
Added a new environment variable, SEGMENT_ANYTHING_2_REPO_PATH, to the README file in the segment_anything_2_video example. This variable specifies the path to the segment-anything-2 repo and defaults to `segment-anything-2`.
I've updated the default values of the environment variables to use SAM2.1. If you'd like to use a different model, you can adjust them as needed. Additionally, I've added documentation to the README about the SEGMENT_ANYTHING_2_REPO_PATH environment variable, which specifies the path to the "segment-anything" repository. You can set it to any location you prefer; personally, I like to install it outside the main repository to avoid having to ignore the folder in the .gitignore file. Please pull the latest changes to ensure you're up-to-date. Thanks for your input! |
Enhanced the error handling mechanism by changing the fallback from 'context' to 'annotations' when drafts are not found. Also, added model version and score to the prediction value for better tracking and evaluation of predictions.
I need to checkout your branch... anyway now I am running into an error where my tasks variable does not have a key called draft. I am trying to take a look at how the code works but its taking me a while so I thought I would ask! At the end of the day it comes down to this error: File "./mydir/sam-2-test-pr/label-studio-ml-backend/label_studio_ml/examples/segment_anything_2_video/model.py", line 263, in predict
drafts = tasks[0]['drafts'][0]
~~~~~~~~^^^^^^^^^^
KeyError: 'drafts' To be clear I am also using this annotation interface: <View>
<Labels name="videoLabels" toName="video" allowEmpty="true">
<Label value="bag" background="#11A39E"/>
<Label value="board" background="#D4380D"/>
<Label value="hole" background="#F4320D"/>
</Labels>
<!-- Please specify FPS carefully, it will be used for all project videos -->
<Video name="video" value="$video" framerate="25.0"/>
<VideoRectangle name="box" toName="video" smart="true"/>
</View> to make my life easier let me ask this: How do you debug model.py? I am having trouble setting up the logger to display the debug messages. Do you simply run model.py or do you use Im trying to add onto this and help with it out! |
Thanks for that info! I kept digging last night and found that my context is None. Im still looking into this and it does not seem to track my object regardless of coming back and relabeling. I am not sure what the problem is but I am trying to find out! Hopefully I can pinpoint my error more. Edit from label_studio_sdk._extensions.label_studio_tools.core.utils.io import get_local_path Edit 2 |
Support for multiple object video tracking capabilities with SAM2
Significant improvements have been made to the video segmentation and tracking features, including support for multi-object tracking.
Known Limitation