CVHub520 / X-AnyLabeling

Effortless data labeling with AI support from Segment Anything and other awesome models.
GNU General Public License v3.0
4.22k stars 484 forks source link

SAM2 reverse propagation #688

Open quantaji opened 1 month ago

quantaji commented 1 month ago

Search before asking

Description

It would be very convenient if I can annotate a frame in the middle of a period where the object is appearing. Therefore, it would be nice if the tool can also reversely propagate key frame's annotation!

Use case

No response

Additional

No response

Are you willing to submit a PR?

CVHub520 commented 1 month ago

Hey there! @quantaji Thank you for bringing this to our attention. I'd like to clarify that the current software actually does support annotating any object on any frame directly. Here's how you can achieve what you're looking for:

Let's say your task has n total frames. You can annotate objects on any arbitrary frame k as follows:

  1. Navigate to frame k
  2. Press Ctrl+Del to delete any existing annotations on that frame (if present)
  3. Click "Reset Tracker"
  4. You can now treat frame k as your initial frame and annotate objects of interest
  5. Assign appropriate label names and IDs based on your specific task requirements

This process can be applied to any frame in your sequence. It allows you to flexibly annotate objects appearing in the middle of a period without needing reverse propagation.

Does this approach meet your needs? If you have any questions about implementing this workflow or if there are any other specific functionalities you're looking for, please let me know and I'd be happy to provide further assistance.

quantaji commented 1 month ago

If I annotate an object in frame k, can the current software propagate the annotation to frame k-1, k-2, k-3, ... etc?

Thanks!

CVHub520 commented 1 month ago

@quantaji The current software doesn't support propagating annotations backwards to frames k-1, k-2, k-3, etc. However, it can propagate annotations forward to subsequent frames k+1, k+2, k+3, and so on. This forward propagation allows you to extend annotations to future frames after annotating an object in frame k. If you need to annotate previous frames, you would need to navigate to those frames and annotate them individually using the process described earlier.

quantaji commented 1 month ago

Thank you for your reply! This can some times hard because there are cases when masks appear from a very small area of pixel and tracking from a small mask might be hard for the model and the result might be unreliable.

I would like to ask if it is possible to put backward (or "reverse" as this is the word used in sam2) propagation as a future feature? This would be really helpful and make this annotation tool outstanding among other tools!

Thanks!