Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Ultralytics Assistant 2024-09-26 00:41:38 +02:00 committed by GitHub
parent 4bcc80c646
commit 38e95f33a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 30 additions and 31 deletions

View file

@ -645,9 +645,7 @@ class SAM2Model(torch.nn.Module):
# The case of `self.num_maskmem == 0` below is primarily used for reproducing SAM on images.
# In this case, we skip the fusion with any memory.
if self.num_maskmem == 0: # Disable memory and skip fusion
pix_feat = current_vision_feats[-1].permute(1, 2, 0).view(B, C, H, W)
return pix_feat
return current_vision_feats[-1].permute(1, 2, 0).view(B, C, H, W)
num_obj_ptr_tokens = 0
# Step 1: condition the visual features of the current frame on previous memories
if not is_init_cond_frame: