# Tracker\_id mixedover similar objects

**URL:** <https://discuss.roboflow.com/t/tracker-id-mixedover-similar-objects/5675>\
**Category:** 🤝  Community Help\
**Created:** [May 8, 2024, 11:20am UTC](https://discuss.roboflow.com/t/tracker-id-mixedover-similar-objects/5675 "2024-05-08T11:20:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin\_Riveros](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/martin_riveros/32/4516_2.png) [@Martin\_Riveros](https://discuss.roboflow.com/u/Martin_Riveros)\
**Post date:** [May 8, 2024, 11:20am UTC](https://discuss.roboflow.com/t/tracker-id-mixedover-similar-objects/5675/1 "2024-05-08T11:20:26Z")

</div>

Hi! first time working with Supervision.  
I have the following problem: I am tracking cans over a conveyor. Cans are exactly the same, one behind the other. When i perform tracking, i get printed the id’s and i get:

[1,2] in one frame  
[2,1] in the next one  
[1,2] in the following one.

This leads to identifying later wrongly.

Has anyone happened this or got any clues how to solve this ? (i am thinking in the usual way, re-match the array when same values come in different order frame by frame).

Thank you!

---

<div class="post-metadata">

**Author:** ![linas](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/linas/32/4519_2.png) [@linas](https://discuss.roboflow.com/u/linas)\
**Post date:** [May 8, 2024, 12:49pm UTC](https://discuss.roboflow.com/t/tracker-id-mixedover-similar-objects/5675/2 "2024-05-08T12:49:39Z")

</div>

Hi @Martin_Riveros 👋

Great to have you here!

Generally tracking for similar objects can be tricky. However, if they’re moving at a constant speed, in the same direction and the frame rate is good enough, the tracker should work. Are you able to share a few pictures of correct and incorrect cases?

Alternatively, a quick video that’s either annotated or together with the code you’re running would be even better.

---

<div class="post-metadata">

**Author:** ![Martin\_Riveros](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/martin_riveros/32/4516_2.png) [@Martin\_Riveros](https://discuss.roboflow.com/u/Martin_Riveros)\
**Post date:** [May 9, 2024, 7:06pm UTC](https://discuss.roboflow.com/t/tracker-id-mixedover-similar-objects/5675/3 "2024-05-09T19:06:57Z")

</div>

Hello Linas! i will try to state my problem (i just show relevant sentences):

TRACK\_ACTIVATION\_TRESHOLD = 0.4  
slected\_classes = [‘41’]  
tracker = ByteTrack(track\_activation\_threshold=TRACK\_ACTIVATION\_TRESHOLD,  
minimum\_matching\_threshold=0.6,  
lost\_track\_buffer = 20  
)  
results = model(frame, agnostic\_nms = True, verbose=False)[0]  
detections = Detections.from\_ultralytics(results)

if any(class\_id in selected\_classes for class\_id in detections.class\_id):

```
 detections = detections[np.isin(detections.class_id, selected_classes)]
 
 if all(conf>TRACK_ACTIVATION_TRESHOLD for conf in detections.confidence):
                
                detections = tracker.update_with_detections(detections)
            
                print('DETECTIONS', detections)
                print("DETECTIONS.CLASS_ID ", detections.class_id)
                print("DETECTIONS.TRACKER_ID", detections.tracker_id)

```

-------------Here is the output-----------------

DETECTIONS Detections(xyxy=array([[0, 4.9233, 154.46, 678.54]], dtype=float32), mask=None, confidence=array([0.4089], dtype=float32), class\_id=array([41]), tracker\_id=array(, dtype=int32), data={‘class\_name’: array([‘cup’], dtype=‘\<U12’)})  
DETECTIONS.CLASS\_ID [41]  
DETECTIONS.TRACKER\_ID

Problem: tracker does not assign a track\_id

Hope this helps…

---

<div class="post-metadata">

**Author:** ![Raif\_Olson](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/raif_olson/32/2065_2.png) [@Raif\_Olson](https://discuss.roboflow.com/u/Raif_Olson)\
**Post date:** [May 13, 2024, 2:37pm UTC](https://discuss.roboflow.com/t/tracker-id-mixedover-similar-objects/5675/4 "2024-05-13T14:37:39Z")

</div>

Hi @Martin_Riveros

There are a few issues with ByteTrack in supervision release 0.20.0 If you switch to using the pre-released version `supervision=0.21.0rc3`, it should solve the issue.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/1X/bb6edbfa56d0cf2ee603f061e9e09103502cc8cc.png) [@system](https://discuss.roboflow.com/u/system)\
**Post date:** [June 3, 2024, 2:38pm UTC](https://discuss.roboflow.com/t/tracker-id-mixedover-similar-objects/5675/5 "2024-06-03T14:38:32Z")

</div>

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
