Segment-and-Track-Anything icon indicating copy to clipboard operation
Segment-and-Track-Anything copied to clipboard

increment before assignment

Open yrrah opened this issue 1 year ago • 0 comments

Please let me know if this is correct:

The background / unlabeled part of a mask is index 0.

If you have two objects being tracked, they would be index 1 & 2 and SegTracker.curr_idx = 2

Then when SegTracker.find_new_objs() finds one additional object, it should set the index in the resulting combined mask to SegTracker.curr_idx + 1 = 3

Currently the increment happens after assignment, so the third object incorrectly gets assigned SegTracker.curr_idx = 2

This might be the cause of https://github.com/z-x-yang/Segment-and-Track-Anything/issues/105

yrrah avatar Nov 11 '23 20:11 yrrah