IDEA-Research / Grounded-SAM-2

Grounded SAM 2: Ground and Track Anything in Videos with Grounding DINO, Florence-2 and SAM 2
https://arxiv.org/abs/2401.14159
Apache License 2.0
714 stars 51 forks source link

fix:fixed interruptions when there is no mask result for the current … #42

Closed Greywan closed 2 weeks ago

Greywan commented 2 weeks ago

Pre-Checklist

Please complete ALL items in the following checklist.

Description

When performing video inference, if a frame does not have a mask result, it cannot be merged to complete the final result:

File "./Projects/Grounded-SAM-2_wjh/utils/common_utils.py", line 52, in draw_masks_and_box_with_supervision all_object_masks = np.concatenate(all_object_masks, axis=0) ValueError: need at least one array to concatenate

Test

image

rentainhe commented 2 weeks ago

Thanks a lot for fixing this issue