dzh19990407 / LBDT

CVPR2022 - Language-Bridged Spatial-Temporal Interaction for Referring Video Object Segmentation
MIT License
23 stars 3 forks source link

Download this dataset from here. Extract frames and masks from clips320H/ and Annotations/col? #4

Closed EricWui closed 2 years ago

EricWui commented 2 years ago

Can you give some shell scripts to extract frames from clips320H? Thanks!

dzh19990407 commented 2 years ago

You can try this script:

import os

video_root = 'clips320H'
frame_root = 'frames'

video_list = os.listdir(video_root)
total_videos = len(video_list)
for idx, video_name in enumerate(video_list):
    video_path = os.path.join(frame_root, video_name[:-4])
    if not os.path.exists(video_path):
        os.mkdir(video_path)
    is_success = os.system('ffmpeg -i {} -f image2 {}/%05d.jpg'.format(os.path.join(video_root, video_name),
                                                                      video_path))
    print(idx, '/', total_videos, video_name, is_success)
EricWui commented 2 years ago

Thank you very much!

---- Replied Message ---- | From | Zihan @.> | | Date | 09/21/2022 22:49 | | To | @.> | | Cc | @.**@.> | | Subject | Re: [dzh19990407/LBDT] Download this dataset from here. Extract frames and masks from clips320H/ and Annotations/col? (Issue #4) |

You can try this script:

importosvideo_root='clips320H'frame_root='frames'video_list=os.listdir(video_root) total_videos=len(video_list) foridx, video_nameinenumerate(video_list): video_path=os.path.join(frame_root, video_name[:-4]) ifnotos.path.exists(video_path): os.mkdir(video_path) is_success=os.system('ffmpeg -i {} -f image2 {}/%05d.jpg'.format(os.path.join(video_root, video_name), video_path)) print(idx, '/', total_videos, video_name, is_success)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>