Replies: 10 comments 9 replies
-
|
👋 Hello @Tixtor710, thank you for sharing your detailed observations and YAML configuration! 🚀 We appreciate your interest in Ultralytics and the BoT-SORT and ByteTrack trackers. To address your questions and assist further:
If this is a 🐛 Bug Report, please share a minimum reproducible example to help us replicate and analyze the issue. This includes code, logs, and a detailed description of your webcam setup and environment. UpgradeTo ensure you are working with the latest features and fixes, upgrade the pip install -U ultralyticsEnvironmentsYOLO can run in any of the following environments with dependencies pre-installed:
CommunityYou can also join the Ultralytics community to discuss tracking algorithms or share your findings: An Ultralytics engineer will review your discussion soon to provide further assistance. Let us know if there are any additional details you'd like to share! 😊 |
Beta Was this translation helpful? Give feedback.
-
|
@Tixtor710 this is expected behavior in both trackers. ID reassignment occurs when objects leave the frame due to how track buffers and matching thresholds work. The key parameters to adjust are |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for the detailed explanation and suggestions! I've implemented the adjustments you recommended, including increasing track_buffer to 300 and lowering match_thresh to 0.6. However, I'm still experiencing ID reassignments when objects temporarily leave the frame. I'd like to delve deeper into the mechanics of re-identification in BoT-SORT and ByteTrack: ReID Integration: You mentioned ReID integration isn't currently supported. Are there plans to incorporate ReID models into Ultralytics for enhanced re-identification capabilities? Motion and Velocity Models: How do these trackers handle abrupt motion or occlusions? Are there specific parameters or techniques to improve tracking under such conditions? Practical Limits of track_buffer: You mentioned potential performance degradation with very high track_buffer values. What are the practical limits for this parameter in terms of frames or seconds, considering typical video frame rates (e.g., 30 FPS)? Custom Logic for Edge Cases: Are there any examples or guidelines for implementing custom logic to handle specific edge cases, such as brief exits from the frame or sudden changes in object appearance? Advanced Tuning Strategies: What advanced tuning strategies or parameter combinations have been successful in similar scenarios? Are there any community resources or examples that demonstrate effective use of these trackers in real-world applications? |
Beta Was this translation helpful? Give feedback.
-
|
It's normal. The ID is based on where the object is every consecutive frame compared to the last frame. It's very loosely based on how the object looks, if at all. Leaving the frame would result in a new ID. For a consistent ID, you would need at least reidentification if not advanced techniques like facial recognition, both of which makes inference slower. |
Beta Was this translation helpful? Give feedback.
-
Title: Model Assigning New IDs Without Proper ReID Similarity CheckDescription: Observed Issue:From the attached video and CSV data:
CSV Sample:Question:
I would appreciate any insights into resolving this premature ID reassignment issue. Script Used: Screen.Recording.2025-03-25.163231.mp4Code Snippet for ReID Logic:def match_embedding(dense_vector, threshold=0.8):
"""Matches a dense vector against stored embeddings for ReID."""
best_match = None
best_score = float("-inf")
for obj_id, stored_vector in embedding_store.items():
similarity = np.dot(dense_vector, stored_vector) / (
np.linalg.norm(dense_vector) * np.linalg.norm(stored_vector) + 1e-8
)
if similarity > best_score and similarity >= threshold:
best_match = obj_id
best_score = similarity
return best_match |
Beta Was this translation helpful? Give feedback.
-
|
"Thank you for the clarification. I understand the BoT-SORT ReID implementation is experimental, and I appreciate the parameter suggestions. My script uses an embedding_store and cosine similarity for ReID. However, I'm encountering an issue where objects, upon re-entry into the frame, are initially assigned a new ID before being corrected to their original ID after a brief period. This creates a temporary ID "swap" that I'd like to eliminate. Given my existing ReID setup, how can I ensure BoT-SORT prioritizes a faster and more consistent re-identification process upon an object's reappearance? Specifically: Parameter Influence on Re-entry: Could you elaborate on how parameters like track_buffer, appearance_thresh, proximity_thresh, and match_thresh specifically influence ID assignment when a previously tracked object re-enters the scene? What values would encourage immediate ReID and prevent the brief assignment of a new, incorrect ID? Early ReID Integration: Is there a specific point in the BoT-SORT code I could modify to force an immediate check against my embedding_store upon a new detection to minimize the delay in re-assigning the correct, pre-existing ID? Embedding Handling: Is there anything about how BoT-SORT handles embeddings of temporarily disappeared objects that might interfere with my match_embedding function? In other words, am I potentially fighting against some internal logic that is causing the temporary ID swap?" |
Beta Was this translation helpful? Give feedback.
-
Follow-Up ClarificationThank you for the detailed suggestions. I've implemented your recommended parameters and modified the Observed BehaviorCSV Log Example: The object disappears/re-enters and receives 3 temporary IDs before reverting to ID 1. Current ImplementationParameters: track_buffer = 90 # ~3s buffer at 30 FPS
appearance_thresh = 0.2
proximity_thresh = 0.7
match_thresh = 0.7 ReID Logic Flow:
def extract_dense_vector(frame, bbox, model):
# Crops object region, resizes to 640x640
# Uses YOLO to extract 4-element dense vector (xyxy coordinates)
return np.array([x1, y1, x2, y2]) # Simplified representation
Specific QuestionsParameter Conflict:
Confidence Thresholds:
|
Beta Was this translation helpful? Give feedback.
-
|
Hi @glenn-jocher and the Ultralytics team, thanks for the feedback on coordinate-based ReID. I understand that appearance-based features are crucial for reliable re-identification. Following up on my earlier question about accessing intermediate layers in YOLO12n for Centroid ReID: Is there a recommended or supported way to extract appearance features directly from YOLO12n's intermediate layers to improve ReID performance? If intermediate layer access isn't feasible, are there alternative methods within the Ultralytics framework for generating robust appearance embeddings from YOLO12n detections that can then be integrated with a Centroid ReID pipeline, as you mentioned in your reply? |
Beta Was this translation helpful? Give feedback.
-
|
I'm working on a YOLO-based model to detect surgical instruments during surgery, where the tools are often overlapping, clustered, and partially occluded. My goal is to not only detect all present instruments but also retain consistent detection throughout the procedure. I'm currently training on annotated surgical videos/images, but I'm noticing the model sometimes misses tools when they overlap or when motion blur/occlusion occurs. My main questions are: Any advice or insights from people who have worked on similar medical/industrial use cases would be greatly appreciated! Thanks in advance. |
Beta Was this translation helpful? Give feedback.
-
|
hello thank you! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been experimenting with the BoT-SORT and ByteTrack trackers in Ultralytics YOLO, using my webcam as the video source. I've observed the following behavior:
When I remain within the webcam's field of view, moving around or staying still, the tracker maintains the same ID for me.
However, if I exit the field of view completely and then re-enter, I'm assigned a new ID number.
I've tried this with both the default BoT-SORT and ByteTrack configurations, as well as a modified BoT-SORT configuration. The behavior remains consistent across all setups.
My questions are:
Is this the expected behavior for these trackers?
What factors determine ID assignment and reassignment in these tracking algorithms?
Are there any configuration parameters I can adjust to maintain ID consistency even when an object temporarily leaves the frame?
I'd appreciate any insights into the underlying mechanics of ID assignment in these trackers and potential ways to optimize for consistent ID tracking across brief disappearances from the frame. Thank you!
This is my modified yaml file.
Beta Was this translation helpful? Give feedback.
All reactions