|
20 | 20 | ] # person_on_vehicle, static_person, distractor, reflection
|
21 | 21 | MOT_IGNORE_IDS = [2, 7, 8, 12, 13] # Includes crowd (13) for ignore, adjust as needed
|
22 | 22 | ZERO_MARKED_EPSILON = 1e-5
|
23 |
| -# --- End MOT Constants --- |
| 23 | + |
24 | 24 |
|
25 | 25 | logger = get_logger(__name__)
|
26 | 26 |
|
@@ -141,7 +141,7 @@ def _parse_mot_file(
|
141 | 141 | "frame_idx": frame_idx,
|
142 | 142 | "obj_id": obj_id,
|
143 | 143 | "xyxy": [x, y, x + width, y + height],
|
144 |
| - "confidence": confidence, # Correctly assigned |
| 144 | + "confidence": confidence, |
145 | 145 | "class_id": class_id,
|
146 | 146 | }
|
147 | 147 |
|
@@ -254,7 +254,6 @@ def get_sequence_info(self, sequence_name: str) -> Dict[str, Any]:
|
254 | 254 | info: Dict[str, Union[int, float, str]] = {}
|
255 | 255 | for key, value in config["Sequence"].items():
|
256 | 256 | try:
|
257 |
| - # Attempt to convert to int, then float, else keep as string |
258 | 257 | info[key] = int(value)
|
259 | 258 | except ValueError:
|
260 | 259 | try:
|
@@ -528,7 +527,6 @@ def preprocess(
|
528 | 527 | gt_out_list = []
|
529 | 528 | pred_out_list = []
|
530 | 529 |
|
531 |
| - # --- Input Validation --- |
532 | 530 | if (
|
533 | 531 | gt_dets.data is None
|
534 | 532 | or "frame_idx" not in gt_dets.data
|
@@ -563,8 +561,7 @@ def preprocess(
|
563 | 561 |
|
564 | 562 | pred_dets_t_filtered = pred_dets_t
|
565 | 563 |
|
566 |
| - # --- TrackEval Preprocessing Step 1 & 2: |
567 |
| - # Optionally remove tracker dets matching distractor GTs --- |
| 564 | + # Optionally remove tracker dets matching distractor GTs |
568 | 565 | if remove_distractor_matches:
|
569 | 566 | to_remove_tracker_indices = np.array([], dtype=int)
|
570 | 567 | if len(gt_dets_t) > 0 and len(pred_dets_t) > 0:
|
@@ -598,9 +595,8 @@ def preprocess(
|
598 | 595 | pred_keep_mask = np.ones(len(pred_dets_t), dtype=bool)
|
599 | 596 | pred_keep_mask[to_remove_tracker_indices] = False
|
600 | 597 | pred_dets_t_filtered = pred_dets_t[pred_keep_mask]
|
601 |
| - # else: pred_dets_t_filtered remains pred_dets_t |
602 | 598 |
|
603 |
| - # --- TrackEval Preprocessing Step 4: Remove unwanted GT dets --- |
| 599 | + # Remove unwanted GT dets |
604 | 600 | gt_is_pedestrian = gt_dets_t.class_id == MOT_PEDESTRIAN_ID
|
605 | 601 |
|
606 | 602 | # Refined check for zero_marked: Check if confidence is very close to 0
|
@@ -632,7 +628,7 @@ def preprocess(
|
632 | 628 | else sv.Detections.empty()
|
633 | 629 | )
|
634 | 630 |
|
635 |
| - # --- TrackEval Preprocessing Step 6: Relabel IDs using the utility function --- |
| 631 | + # Relabel IDs using the utility function |
636 | 632 | gt_processed = relabel_ids(gt_processed)
|
637 | 633 | pred_processed = relabel_ids(pred_processed)
|
638 | 634 |
|
|
0 commit comments