Figure out and fix marination and inpainting. #109
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was investigating inpainting but it didn't behave as I expected. This is in both how the marination parameter worked and how the inpainting mask worked. I made some assumptions that I will try to outline them as detailed as possible. But after these small changes it works as I would expect. I'll start with what I actually think needs a fix, the
get_bmask
function and then what I fixed to align to my assumptions,build_mask
. (If the later assumption is wrong I can remove the second commit).marination and bmask
Given this comment below and how the
inpainting_callback
is implemented I made some assumption on how this should work and tried to fix it.My assumption is that given 10 steps and a mask of only 0.5s, for the first 5 steps
new_x
on this line would benew_x = input_noise
then for the last 5 would benew_x = x
. Or in other words the bmask for all steps would look something like this:With this current implementation however it looks like this:
Where we keep the generated output at the start but then copy the initial noise on the later steps.
One more test to make sure!
Below is another test to ensure the new implementation is correct. Given a mask like this:
The current implementation give these
bmask
s for 10 steps:Where we copy more and more from the initial data.
The new implementation gives these
bmask
s for 10 steps:Where we copy more at the start then let the generation process take over more and more.
Inpainting mask
Given the parameters names
maskstart
andmaskend
my assumption is that I can mark out a section to regenerate. For example, for a 10s clip I can setmaskstart=10
andmaskend=90
to keep the first and last seconds and inpaint the other 8 in the middle. The current implementation does the opposite making it impossible to replace the middle part.Comments
I hope this could help us explore inpainting and marination some more but if my assumptions I based these changes on are wrong feel free to disregard or reject. Thank you!