Tracking-Anything-with-DEVA
Tracking-Anything-with-DEVA copied to clipboard
How to use deva in python code
I expect to use DEVA in my Python tasks, but I am a novice and have tried to modify it from the demo, but it seems that the demo has expired. How to introduce usage in the code now. Help, thank you
I want to achieve recognition of objects in videos after frame extraction, and I have already completed frame extraction and video object list.
Which part of the demo does not work for you?
演示的哪一部分对您不起作用?
run demo_gradio or demo_with_text print
Traceback (most recent call last):
File "/home/phoenix/python_project/videoQuestionAnswer/Tracking-Anything-with-DEVA/demo/demo_with_text.py", line 15, in <module>
from deva.ext.grounding_dino import get_grounding_dino_model
File "/home/phoenix/anaconda3/envs/VQA/lib/python3.10/site-packages/deva/ext/grounding_dino.py", line 16, in <module>
from segment_anything import sam_model_registry, SamPredictor, sam_hq_model_registry
ImportError: cannot import name 'sam_hq_model_registry' from 'segment_anything'
or
Traceback (most recent call last):
File "/home/phoenix/python_project/videoQuestionAnswer/Tracking-Anything-with-DEVA/demo/demo_gradio.py", line 16, in <module>
from deva.ext.grounding_dino import get_grounding_dino_model
File "/home/phoenix/anaconda3/envs/VQA/lib/python3.10/site-packages/deva/ext/grounding_dino.py", line 18, in <module>
from deva.ext.LightHQSAM.setup_light_hqsam import setup_model as setup_light_hqsam
File "/home/phoenix/anaconda3/envs/VQA/lib/python3.10/site-packages/deva/ext/LightHQSAM/setup_light_hqsam.py", line 2, in <module>
from segment_anything.modeling import MaskDecoderHQ, PromptEncoder, Sam, TwoWayTransformer
ImportError: cannot import name 'MaskDecoderHQ' from 'segment_anything.modeling' (/home/phoenix/anaconda3/envs/VQA/lib/python3.10/site-packages/segment_anything/modeling/__init__.py)
I don't know if there are any other things behind
Thanks, and sorry for the late reply. I believe this is a dependency error coming from HQSAM -- I have added some import guards. Please let me know if it works now.