Closed Saoyu99 closed 1 year ago
Is your problem solved? I also encountered the same problem. The picture I used was the default parameter, and the test picture was also provided by the official data. command: python3 grounded_sam_demo.py --config GroundingDINO/groundingdino/config/GroundingDINO_SwinT_OGC.py --grounded_checkpoint groundingdino_swint_ogc.pth --sam_checkpoint sam_vit_h_4b8939.pth --input_image ./assets/demo1.jpg --output_dir "outputs/bear" --box_threshold 0.3 --text_threshold 0.25 --text_prompt "bear" --device "cuda"
Hi, this is a checkpoint loading problem.
For hq-sam, we need to use this argument --sam_hq_checkpoint
instead of --sam_checkpoint
. In the demo file, they use vit_h backbone, so the example argument for loading the hq-sam checkpoint is
--sam_hq_checkpoint ./sam_hq_vit_h.pth
.
The corresponding checkpoint can be downloaded here.
@ymq2017 thanks for the help! it works now.
thanks a lot!
when i try to use sam_hq, the segment make some mistake. i use the domo chair pic, and the sam_output is : the mask is :
my .sh file is : export CUDA_VISIBLE_DEVICES=0 python grounded_sam_demo.py \ --config GroundingDINO/groundingdino/config/GroundingDINO_SwinT_OGC.py \ --grounded_checkpoint groundingdino_swint_ogc.pth \ --sam_checkpoint sam_hq_vit_b.pth \ --use_sam_hq \ --input_image assets/sam_hq_demo_image.png \ --output_dir "outputs" \ --box_threshold 0.3 \ --text_threshold 0.25 \ --text_prompt "chair." \ --device "cuda"
and when i use the ori SAM, all things going to be right, is there any mistake?