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

Refining masks after propagation? #546

Open
Zarxrax opened this issue Jan 19, 2025 · 2 comments
Open

Refining masks after propagation? #546

Zarxrax opened this issue Jan 19, 2025 · 2 comments

Comments

@Zarxrax
Copy link

Zarxrax commented Jan 19, 2025

I was wondering if anyone has had success with refining masks by adding additional points after running propagation?
In my attempts, it is not working well, if at all.

While the video_predictor_example notebook provides an example of how it should work, its difficult to see what its actually doing since the additional refining point is on such a small area and it gets almost fully covered by the star. But when I change the model used in the example to the tiny model, it's easier to see that nothing is really happening.

Putting a negative point on frame 150:

Image

After running propagation again, there is no effect on frame 150 from the negative prompt:

Image

@sabry9999
Copy link

I have the same issue. I'm using the video predictor notebook on Colab, and after applying a refinement on a specific frame, it doesn't show the refinement when I run the mask propagation.

@heyoeyo
Copy link

heyoeyo commented Jan 23, 2025

While the refinement capability is a neat idea, it seems it's always going to be unpredictable, since you're sort of asking the model to give you the 'average' of multiple prompts, and it's not always clear what that should be.

So for predictable results, it might better to 'restart' the tracking on the frame that needs refinement, using a prompt that captures the object in full (as opposed to partial prompts like the example, that don't fully specify what should be segmented).

Restarting might be a bit annoying to implement, but you can mimic the behavior by setting the max_cond_frames_in_attn to 1 (this can be added to the yaml config if you don't want to modify the code), which tells the model to only use the most recent prompt (instead of trying to combine them all).
For some reason the code includes an assertion to force this setting to be at least 2 prompts. You can comment that line out (without any obvious consequence) or otherwise set it to 2 and then double-add the 'refinement' prompt to get the same effect.

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

3 participants