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 334 forks source link

FileNotFoundError: [Errno 2] No such file or directory: './debug/seg_result/49.png' #99

Closed The-Martyr closed 11 months ago

The-Martyr commented 12 months ago

When running demo_instseg,there's an error:

...... processed frame 194, obj_num 11 processed frame 195, obj_num 12 processed frame 196, obj_num 12 processed frame 197, obj_num 11 processed frame 198, obj_num 11 processed frame 199, obj_num 11 processed frame 200, obj_num 12 processed frame 201, obj_num 12 processed frame 202, obj_num 14 processed frame 203, obj_num 14 processed frame 204, obj_num 14 final text_encoder_type: bert-base-uncased Model loaded from ./ckpt/groundingdino_swint_ogc.pth => _IncompatibleKeys(missing_keys=[], unexpected_keys=['label_enc.weight', 'bert.embeddings.position_ids']) SegTracker has been initialized Traceback (most recent call last): File "/root/Segment-and-Track-Anything-main/demo_instseg.py", line 198, in save_prediction(seg_mask, './debug/seg_result', str(frame_idx)+'.png') File "/root/Segment-and-Track-Anything-main/demo_instseg.py", line 17, in save_prediction save_mask.save(os.path.join(output_dir,file_name)) File "/root/miniconda3/envs/sam_track/lib/python3.9/site-packages/PIL/Image.py", line 2428, in save fp = builtins.open(filename, "w+b") FileNotFoundError: [Errno 2] No such file or directory: './debug/seg_result/49.png'

I don't know if something went wrong in the previous code. Maybe I should add a 'mkdir' command? I noticed that the number 49 was equal to the value of sam_gap, so what's the problem?

The-Martyr commented 11 months ago

The problem has been solved. It is really simple. I just need to make two new directory "./debug/seg_result" and "./debug/aot_result" , then there's no more problem.