z-x-yang / Segment-and-Track-Anything

An open-source project dedicated to tracking and segmenting any objects in videos, either automatically or interactively. The primary algorithms utilized include the Segment Anything Model (SAM) for key-frame segmentation and Associating Objects with Transformers (AOT) for efficient tracking and propagation purposes.
GNU Affero General Public License v3.0
2.77k stars 335 forks source link

NameError: name 'annotated_frame' is not defined #36

Closed kulkarnikeerti closed 1 year ago

kulkarnikeerti commented 1 year ago

Hi,

Thanks for such a wonderful work. I am trying to run demo_instseg.ipynb I get the below error. However, I can run demo.ipynb without any issues. NameError: name 'annotated_frame' is not defined

Can someone help me with this?

yamy-cheng commented 1 year ago

Hi, could you please provide a detailed description of the issue you encountered, such as which cell you encountered the issue in, and what the text prompt was?

kulkarnikeerti commented 1 year ago

@yamy-cheng So, the error comes in the third cell (Tuning Grounding-DINO and SAM on the First Frame for Good Initialization). And below is the complete error message

final text_encoder_type: bert-base-uncased

Model loaded from ./ckpt/groundingdino_swint_ogc.pth 
 => _IncompatibleKeys(missing_keys=[], unexpected_keys=['label_enc.weight'])
SegTracker has been initialized

NameError                                 Traceback (most recent call last)
Cell In[3], line 40
     38     break
     39 cap.release()
---> 40 init_res = draw_mask(annotated_frame, pred_mask,id_countour=False)
     41 plt.figure(figsize=(10,10))
     42 plt.axis('off')
NameError: name 'annotated_frame' is not defined
yamy-cheng commented 1 year ago

Could you please check if the video path you provided is correct.

kulkarnikeerti commented 1 year ago

You are right. I had the wrong video name (missed one letter). That resolved the issue. Thanks:)