Skip to content

Commit

Permalink
[bug fix] [PersonPath22] (JonathonLuiten#96)
Browse files Browse the repository at this point in the history
* added support for PersonPath22 dataset

* added files

* PersonPath22: changed website

* reverted changes in mot_challenge_2d_box.py

* fixed bug where crowd region was ignored for frames without GT boxes

* removed spaces

Co-authored-by: Alessandro Bergamo <[email protected]>
  • Loading branch information
alebergamo and Alessandro Bergamo authored Oct 25, 2022
1 parent 167d02c commit bdccd78
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions trackeval/datasets/person_path_22.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from .. import _timing
from ..utils import TrackEvalException


class PersonPath22(_BaseDataset):
"""Dataset class for MOT Challenge 2D bounding box tracking"""

Expand Down Expand Up @@ -357,6 +356,7 @@ def get_preprocessed_seq_data(self, raw_data, cls):
tracker_classes = raw_data['tracker_classes'][t]
tracker_confidences = raw_data['tracker_confidences'][t]
similarity_scores = raw_data['similarity_scores'][t]
crowd_ignore_regions = raw_data['gt_crowd_ignore_regions'][t]

# Evaluation is ONLY valid for pedestrian class
if len(tracker_classes) > 0 and np.max(tracker_classes) > 1:
Expand All @@ -367,7 +367,7 @@ def get_preprocessed_seq_data(self, raw_data, cls):
# Match tracker and gt dets (with hungarian algorithm) and remove tracker dets which match with gt dets
# which are labeled as belonging to a distractor class.
to_remove_tracker = np.array([], np.int)
if self.do_preproc and self.benchmark != 'MOT15' and gt_ids.shape[0] > 0 and tracker_ids.shape[0] > 0:
if self.do_preproc and self.benchmark != 'MOT15' and (gt_ids.shape[0] > 0 or len(crowd_ignore_regions) > 0) and tracker_ids.shape[0] > 0:

# Check all classes are valid:
invalid_classes = np.setdiff1d(np.unique(gt_classes), self.valid_class_numbers)
Expand All @@ -391,7 +391,6 @@ def get_preprocessed_seq_data(self, raw_data, cls):
to_remove_tracker = match_cols[is_distractor_class]

# remove bounding boxes that overlap with crowd ignore region.
crowd_ignore_regions = raw_data['gt_crowd_ignore_regions'][t]
intersection_with_ignore_region = self._calculate_box_ious(tracker_dets, crowd_ignore_regions, box_format='xywh', do_ioa=True)
is_within_crowd_ignore_region = np.any(intersection_with_ignore_region > 0.95 + np.finfo('float').eps, axis=1)
to_remove_tracker = np.unique(np.concatenate([to_remove_tracker, np.where(is_within_crowd_ignore_region)[0]]))
Expand Down

0 comments on commit bdccd78

Please sign in to comment.