Skip to content

Commit f8f3b6c

Browse files
author
Wiktor Muron
committed
updated README and simple example
1 parent c4ff380 commit f8f3b6c

File tree

3 files changed

+29
-7
lines changed

3 files changed

+29
-7
lines changed

README.md

+21-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
Project is meant to provide a simple yet powerful baseline for multiple object tracking without the hassle of writing the obvious algorithm stack yourself.
44

5+
![2D tracking preview](assets/mot16_challange.gif)
6+
*video source: https://motchallenge.net/data/MOT16/ - sequence 11*
7+
58
## Features:
69

710
- tracking by detection paradigm
@@ -24,39 +27,53 @@ cd motpy
2427
make install-develop # to install editable version of library
2528
make test # to run all tests
2629
```
27-
## Basic usage
30+
31+
## Demo
32+
33+
### 2D tracking
2834

2935
Run demo example of tracking N objects in 2D space. In the ideal world it will show a bunch of colorful objects moving on a grey canvas in various directions, sometimes overlapping, sometimes not. Each object is detected from time to time (green box) and once it's being tracked by motpy, its track box is drawn in red with an ID above.
36+
3037
```
3138
make demo
3239
```
3340

3441
![2D tracking preview](assets/2d_multi_object_tracking.gif)
3542

36-
Minimal tracking example below:
43+
## Basic usage
44+
45+
A minimal tracking example can be found below:
3746

3847
```python
3948
import numpy as np
4049

41-
from motpy import MultiObjectTracker, Detection
50+
from motpy import Detection, MultiObjectTracker
4251

4352
# format [xmin, ymin, xmax, ymax]
4453
object_box = np.array([1, 1, 10, 10])
4554

55+
# create a tracker object, keeping the state of the
4656
tracker = MultiObjectTracker(dt=0.1)
4757

4858
for step in range(10):
49-
# let's simulate object movement
59+
# let's simulate object movement by 1 pixel
5060
object_box += 1
5161

62+
# update the state of the multi-object-tracker tracker
63+
# with the list of bounding boxes
5264
tracker.step(detections=[Detection(box=object_box)])
65+
66+
# retrieve the active tracks from the tracker (you can customize
67+
# the hyperparameters of tracks filtering by passing extra arguments)
5368
tracks = tracker.active_tracks()
5469

5570
print('MOT tracker tracks %d objects' % len(tracks))
5671
print('first track box: %s' % str(tracks[0].box))
5772

5873
```
5974

75+
### MOT16
76+
6077
## Tested platforms
6178
- Linux (Ubuntu)
6279
- Raspberry Pi (4)

assets/mot16_challange.gif

9.3 MB
Loading

examples/simple_example.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
import numpy as np
22

3-
import motpy
4-
from motpy import MultiObjectTracker, Detection
3+
from motpy import Detection, MultiObjectTracker
54

65
# format [xmin, ymin, xmax, ymax]
76
object_box = np.array([1, 1, 10, 10])
87

8+
# create a tracker object, keeping the state of the
99
tracker = MultiObjectTracker(dt=0.1)
1010

1111
for step in range(10):
12-
# let's simulate object movement
12+
# let's simulate object movement by 1 pixel
1313
object_box += 1
1414

15+
# update the state of the multi-object-tracker tracker
16+
# with the list of bounding boxes
1517
tracker.step(detections=[Detection(box=object_box)])
18+
19+
# retrieve the active tracks from the tracker (you can customize
20+
# the hyperparameters of tracks filtering by passing extra arguments)
1621
tracks = tracker.active_tracks()
1722

1823
print('MOT tracker tracks %d objects' % len(tracks))

0 commit comments

Comments
 (0)