Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Improved Association Pipeline Tracker by Stadler and Beyerer (https://ieeexplore.ieee.org/document/10223159) #1527

Merged
merged 9 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
outputs:
status: ${{ job.status }}
env:
TRACKERS: "ocsort bytetrack botsort hybridsort deepocsort"
TRACKERS: "ocsort bytetrack botsort hybridsort deepocsort imprassoc"

# Timeout: https://stackoverflow.com/a/59076067/4521646
timeout-minutes: 50
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ __pycache__/
runs/
videos/

# experiment files
*.pkl

# Downloaded weights
weights/*.pt
weights/*.torchscript
Expand Down
2 changes: 2 additions & 0 deletions README.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ This repo contains a collections of pluggable state-of-the-art multi-object trac
| [HybridSORT](https://arxiv.org/pdf/2308.00783.pdf) | 77.3 | 77.9 | 88.8 |
| [ByteTrack](https://arxiv.org/pdf/2110.06864.pdf) | 75.6 | 74.6 | 86.0 |
| [StrongSORT](https://arxiv.org/pdf/2202.13514.pdf) | | | |
| [ImprAssoc](https://ieeexplore.ieee.org/document/10223159)| | |
| <img width=200/> | <img width=100/> | <img width=100/> | <img width=100/> |

<sub> NOTES: performed on the 10 first frames of each MOT17 sequence. The detector used is ByteTrack's YoloXm, trained on: CrowdHuman, MOT17, Cityperson and ETHZ. Each tracker is configured with its original parameters found in their respective official repository.</sub>
Expand Down Expand Up @@ -147,6 +148,7 @@ $ python tracking/track.py --tracking-method deepocsort
ocsort
bytetrack
botsort
imprassoc
```

</details>
Expand Down
6 changes: 4 additions & 2 deletions boxmot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
from boxmot.trackers.hybridsort.hybridsort import HybridSORT
from boxmot.trackers.ocsort.ocsort import OCSort as OCSORT
from boxmot.trackers.strongsort.strong_sort import StrongSORT
from boxmot.trackers.imprassoc.impr_assoc_tracker import ImprAssocTrack

TRACKERS = ['bytetrack', 'botsort', 'strongsort', 'ocsort', 'deepocsort', 'hybridsort']

TRACKERS = ['bytetrack', 'botsort', 'strongsort', 'ocsort', 'deepocsort', 'hybridsort', 'imprassoc']

__all__ = ("__version__",
"StrongSORT", "OCSORT", "BYTETracker", "BoTSORT", "DeepOCSORT", "HybridSORT",
"StrongSORT", "OCSORT", "BYTETracker", "BoTSORT", "DeepOCSORT", "HybridSORT", "ImprAssocTrack"
"create_tracker", "get_tracker_config", "gsi")
4 changes: 2 additions & 2 deletions boxmot/configs/botsort.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Trial number: 0
# HOTA, MOTA, IDF1: [20.236, 5.1887, 12.987]
# HOTA, MOTA, IDF1: [37.804, 19.34, 34.483]
appearance_thresh: 0.7636154550757781
cmc_method: sparseOptFlow
conf: 0.5024512355200363
conf: 0.4828271520496597
frame_rate: 30
lambda_: 0.9764964093204093
match_thresh: 0.22182609980772128
Expand Down
12 changes: 12 additions & 0 deletions boxmot/configs/imprassoc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
appearance_thresh: 0.25
cmc_method: sparseOptFlow
frame_rate: 30
lambda_: 0.2
match_thresh: 0.65
new_track_thresh: 0.7
overlap_thresh: 0.55
proximity_thresh: 0.1
second_match_thresh: 0.19
track_buffer: 35
track_high_thresh: 0.6
track_low_thresh: 0.1
21 changes: 21 additions & 0 deletions boxmot/tracker_zoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,27 @@ def create_tracker(tracker_type, tracker_config, reid_weights, device, half, per
use_byte=cfg.use_byte,
)
return hybridsort
elif tracker_type == 'imprassoc':
from boxmot.trackers.imprassoc.impr_assoc_tracker import ImprAssocTrack
imprassoc = ImprAssocTrack(
reid_weights,
device,
half,
per_class=per_class,
track_high_thresh=cfg.track_high_thresh,
track_low_thresh=cfg.track_low_thresh,
new_track_thresh=cfg.new_track_thresh,
track_buffer=cfg.track_buffer,
match_thresh=cfg.match_thresh,
second_match_thresh=cfg.second_match_thresh,
overlap_thresh=cfg.overlap_thresh,
lambda_=cfg.lambda_,
proximity_thresh=cfg.proximity_thresh,
appearance_thresh=cfg.appearance_thresh,
cmc_method=cfg.cmc_method,
frame_rate=cfg.frame_rate,
)
return imprassoc
else:
print('No such tracker')
exit()
60 changes: 60 additions & 0 deletions boxmot/trackers/imprassoc/basetrack.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import numpy as np
from collections import OrderedDict


class TrackState(object):
New = 0
Tracked = 1
Lost = 2
LongLost = 3
Removed = 4


class BaseTrack(object):
_count = 0

track_id = 0
is_activated = False
state = TrackState.New

history = OrderedDict()
features = []
curr_feature = None
score = 0
start_frame = 0
frame_id = 0
time_since_update = 0

# multi-camera
location = (np.inf, np.inf)

@property
def end_frame(self):
return self.frame_id

@staticmethod
def next_id():
BaseTrack._count += 1
return BaseTrack._count

def activate(self, *args):
raise NotImplementedError

def predict(self):
raise NotImplementedError

def update(self, *args, **kwargs):
raise NotImplementedError

def mark_lost(self):
self.state = TrackState.Lost

def mark_long_lost(self):
self.state = TrackState.LongLost

def mark_removed(self):
self.state = TrackState.Removed

@staticmethod
def clear_count():
BaseTrack._count = 0
Loading
Loading