Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using masks in video format for video completion #75

Open
Nd-sole opened this issue Mar 4, 2024 · 1 comment
Open

Using masks in video format for video completion #75

Nd-sole opened this issue Mar 4, 2024 · 1 comment

Comments

@Nd-sole
Copy link

Nd-sole commented Mar 4, 2024

Hi,

Can we use video mask corresponding to each frame instead of image mask for video completion?

@marslong88
Copy link

def read_mask(mpath, length, size, flow_mask_dilates=8, mask_dilates=5,resize_ratio=1):
masks_img = []
masks_dilated = []
flow_masks = []

if mpath.endswith(('jpg', 'jpeg', 'png', 'JPG', 'JPEG', 'PNG')): # input single img path
   masks_img = [Image.open(mpath)]
elif mpath.endswith(('mp4')):
    #把mp4抽帧
    frames, fps, size, video_name = read_frame_from_videos(mpath)
    frames ,size, out_size = resize_frames(frames,  (int(resize_ratio * size[0]), int(resize_ratio * size[1])))
    masks_img=frames

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants