Skip to content

Mask identity jumping between similar objects #739

Description

@tywei08

Hi all,

I’m encountering an issue when using SAM2 for multi-object video segmentation/tracking, and I’m wondering whether others have seen similar behavior or have suggestions to mitigate it.

Setup

Task: Generate masklets for fruit flies in a video

Method:

  1. Provide an initial mask prompt on the first frame
  2. Use SAM2 to propagate masks across the video

Objects: Multiple fruit flies with very similar appearance

Observed issue

The predicted mask for a given object occasionally jumps to a different fly, even when:

  • The two flies are not spatially close
  • There is no obvious occlusion or interaction
  • Once the jump happens, the identity is effectively lost and continues tracking the wrong fly

I’ve attached a short video demonstrating the issue. In the video, the initial mask is correct, but at certain frames the mask abruptly switches to another fly elsewhere in the scene.

github_idtracker_drosophila_6.mp4

Since the flies have very similar appearance, I suspect this may be an identity ambiguity issue in the model, but I’m wondering whether others have observed similar behavior and if there are any known workarounds or best practices to reduce it. Otherwise, I’m curious if this is a known limitation of the current model design.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions