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

Batch/Video Processing #97

Closed
Echolink50 opened this issue Mar 5, 2022 · 2 comments
Closed

Batch/Video Processing #97

Echolink50 opened this issue Mar 5, 2022 · 2 comments

Comments

@Echolink50
Copy link

I was looking to install this. I was wondering if it supports some way to do a batch of images from a sequence or even do a video? Or do I have to manual highlight the object i want removed in each image? Thanks everyone.

@windj007
Copy link
Collaborator

windj007 commented Mar 6, 2022

LaMa was designed for image inpainting. Technologies for video inpainting significantly differ from those for separate images, because in videos on the one hand you need temporal consistency and on the other you have more information - regions of different frames can be reused.

LaMa can be used for videos, but the quality will probably be inferior compared to designated video inpainting methods. The most straightforward way to use existing LaMa codebase to process video is:

  1. Split video to separate frames and store frames to a folder, with something like ffmpeg -i video.mp4 video_frames/%05d.jpg. Somehow add masks for each frame to the same folders.
  2. Run prediction with LaMa - its current codebase can process all images in a folder in a single run.
  3. Merge inpainted images into a video using e.g. ffmpeg.

Note that you need to specify a mask for each separate frame. There is no functionality for object segmentation and tracking in videos in LaMa.

There is a third-party colab with CLIP-based segmentation and LaMa for video inpainting, which is based on the similar idea (twitter post and video, colab)

There are designated video completion methods, e.g. Flow-edge guided video completion.

@Echolink50
Copy link
Author

Thank you so much for a very clear and informative answer.

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