forked from adipandas/multi-object-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapidocuments.html
More file actions
1453 lines (1270 loc) · 117 KB
/
apidocuments.html
File metadata and controls
1453 lines (1270 loc) · 117 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tracker — Multi-object trackers in Python 1.0.0 documentation</title>
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<script type="text/javascript" src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="prev" title="Multi-object trackers in Python" href="readmefile.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home"> Multi-object trackers in Python
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="readmefile.html">Multi-object trackers in Python</a></li>
<li class="toctree-l1"><a class="reference internal" href="readmefile.html#example-tf-mobilenetssd-centroidtracker">Example: <cite>TF-MobileNetSSD + CentroidTracker</cite></a></li>
<li class="toctree-l1"><a class="reference internal" href="readmefile.html#example-yolov3-centroidtracker">Example: <cite>YOLOv3 + CentroidTracker</cite></a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Tracker</a></li>
<li class="toctree-l1"><a class="reference internal" href="#sort">SORT</a></li>
<li class="toctree-l1"><a class="reference internal" href="#iou-tracker">IOU Tracker</a></li>
<li class="toctree-l1"><a class="reference internal" href="#kalman-filter-based-centroid-tracker">Kalman Filter based Centroid Tracker</a></li>
<li class="toctree-l1"><a class="reference internal" href="#tracks">Tracks</a></li>
<li class="toctree-l1"><a class="reference internal" href="#kalman-filters">Kalman Filters</a></li>
<li class="toctree-l1"><a class="reference internal" href="#object-detection">Object Detection</a></li>
<li class="toctree-l1"><a class="reference internal" href="#utilities">Utilities</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#download-pretrained-neural-network-weights">Download pretrained neural-network weights.</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#yolov3">YOLOv3</a></li>
<li class="toctree-l3"><a class="reference internal" href="#tensorflow-mobilenetssdv2">TensorFlow - MobileNetSSDv2</a></li>
<li class="toctree-l3"><a class="reference internal" href="#caffemodel-mobilenetssd">Caffemodel - MobileNetSSD</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="#references-and-credits">References and Credits</a></li>
<li class="toctree-l1"><a class="reference internal" href="#contributor-covenant-code-of-conduct">Contributor Covenant Code of Conduct</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#our-pledge">Our Pledge</a></li>
<li class="toctree-l2"><a class="reference internal" href="#our-standards">Our Standards</a></li>
<li class="toctree-l2"><a class="reference internal" href="#our-responsibilities">Our Responsibilities</a></li>
<li class="toctree-l2"><a class="reference internal" href="#scope">Scope</a></li>
<li class="toctree-l2"><a class="reference internal" href="#enforcement">Enforcement</a></li>
<li class="toctree-l2"><a class="reference internal" href="#attribution">Attribution</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">Multi-object trackers in Python</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home"></a> »</li>
<li>Tracker</li>
<li class="wy-breadcrumbs-aside">
<a href="../_sources/includeme/apidocuments.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="tracker">
<h1>Tracker<a class="headerlink" href="#tracker" title="Permalink to this headline">¶</a></h1>
<dl class="py class">
<dt id="motrackers.tracker.Tracker">
<em class="property">class </em><code class="sig-prename descclassname">motrackers.tracker.</code><code class="sig-name descname">Tracker</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">max_lost</span><span class="o">=</span><span class="default_value">5</span></em>, <em class="sig-param"><span class="n">tracker_output_format</span><span class="o">=</span><span class="default_value">'mot_challenge'</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/tracker.html#Tracker"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.tracker.Tracker" title="Permalink to this definition">¶</a></dt>
<dd><p>Greedy Tracker with tracking based on <code class="docutils literal notranslate"><span class="pre">centroid</span></code> location of the bounding box of the object.
This tracker is also referred as <code class="docutils literal notranslate"><span class="pre">CentroidTracker</span></code> in this repository.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>max_lost</strong> (<em>int</em>) – Maximum number of consecutive frames object was not detected.</p></li>
<li><p><strong>tracker_output_format</strong> (<em>str</em>) – Output format of the tracker.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="motrackers.tracker.Tracker.preprocess_input">
<em class="property">static </em><code class="sig-name descname">preprocess_input</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">bboxes</span></em>, <em class="sig-param"><span class="n">class_ids</span></em>, <em class="sig-param"><span class="n">detection_scores</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/tracker.html#Tracker.preprocess_input"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.tracker.Tracker.preprocess_input" title="Permalink to this definition">¶</a></dt>
<dd><p>Preprocess the input data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>bboxes</strong> (<em>list</em><em> or </em><em>numpy.ndarray</em>) – Array of bounding boxes with each bbox as a tuple containing <cite>(xmin, ymin, width, height)</cite>.</p></li>
<li><p><strong>class_ids</strong> (<em>list</em><em> or </em><em>numpy.ndarray</em>) – Array of Class ID or label ID.</p></li>
<li><p><strong>detection_scores</strong> (<em>list</em><em> or </em><em>numpy.ndarray</em>) – Array of detection scores (a.k.a. detection probabilities).</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Data for detections as list of tuples containing <cite>(bbox, class_id, detection_score)</cite>.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>detections (list[Tuple])</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="motrackers.tracker.Tracker.update">
<code class="sig-name descname">update</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">bboxes</span></em>, <em class="sig-param"><span class="n">detection_scores</span></em>, <em class="sig-param"><span class="n">class_ids</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/tracker.html#Tracker.update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.tracker.Tracker.update" title="Permalink to this definition">¶</a></dt>
<dd><p>Update the tracker based on the new bounding boxes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>bboxes</strong> (<em>numpy.ndarray</em><em> or </em><em>list</em>) – List of bounding boxes detected in the current frame. Each element of the list represent
coordinates of bounding box as tuple <cite>(top-left-x, top-left-y, width, height)</cite>.</p></li>
<li><p><strong>detection_scores</strong> (<em>numpy.ndarray</em><em> or </em><em>list</em>) – List of detection scores (probability) of each detected object.</p></li>
<li><p><strong>class_ids</strong> (<em>numpy.ndarray</em><em> or </em><em>list</em>) – List of class_ids (int) corresponding to labels of the detected object. Default is <cite>None</cite>.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>List of tracks being currently tracked by the tracker. Each track is represented by the tuple with elements <cite>(frame_id, track_id, bb_left, bb_top, bb_width, bb_height, conf, x, y, z)</cite>.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>list</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="sort">
<h1>SORT<a class="headerlink" href="#sort" title="Permalink to this headline">¶</a></h1>
<dl class="py function">
<dt id="motrackers.sort_tracker.assign_tracks2detection_iou">
<code class="sig-prename descclassname">motrackers.sort_tracker.</code><code class="sig-name descname">assign_tracks2detection_iou</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">bbox_tracks</span></em>, <em class="sig-param"><span class="n">bbox_detections</span></em>, <em class="sig-param"><span class="n">iou_threshold</span><span class="o">=</span><span class="default_value">0.3</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/sort_tracker.html#assign_tracks2detection_iou"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.sort_tracker.assign_tracks2detection_iou" title="Permalink to this definition">¶</a></dt>
<dd><p>Assigns detected bounding boxes to tracked bounding boxes using IoU as a distance metric.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>bbox_tracks</strong> (<em>numpy.ndarray</em>) – Bounding boxes of shape <cite>(N, 4)</cite> where <cite>N</cite> is number of objects already being tracked.</p></li>
<li><p><strong>bbox_detections</strong> (<em>numpy.ndarray</em>) – Bounding boxes of shape <cite>(M, 4)</cite> where <cite>M</cite> is number of objects that are newly detected.</p></li>
<li><p><strong>iou_threshold</strong> (<em>float</em>) – IOU threashold.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><dl class="simple">
<dt>Tuple contains the following elements in the given order:</dt><dd><ul class="simple">
<li><p>matches (numpy.ndarray): Array of shape <cite>(n, 2)</cite> where <cite>n</cite> is number of pairs formed after matching tracks to detections. This is an array of tuples with each element as matched pair of indices`(track_index, detection_index)`.</p></li>
<li><p>unmatched_detections (numpy.ndarray): Array of shape <cite>(m,)</cite> where <cite>m</cite> is number of unmatched detections.</p></li>
<li><p>unmatched_tracks (numpy.ndarray): Array of shape <cite>(k,)</cite> where <cite>k</cite> is the number of unmatched tracks.</p></li>
</ul>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
</dd></dl>
<dl class="py class">
<dt id="motrackers.sort_tracker.SORT">
<em class="property">class </em><code class="sig-prename descclassname">motrackers.sort_tracker.</code><code class="sig-name descname">SORT</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">max_lost</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">tracker_output_format</span><span class="o">=</span><span class="default_value">'mot_challenge'</span></em>, <em class="sig-param"><span class="n">iou_threshold</span><span class="o">=</span><span class="default_value">0.3</span></em>, <em class="sig-param"><span class="n">process_noise_scale</span><span class="o">=</span><span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">measurement_noise_scale</span><span class="o">=</span><span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">time_step</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/sort_tracker.html#SORT"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.sort_tracker.SORT" title="Permalink to this definition">¶</a></dt>
<dd><p>SORT - Multi object tracker.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>max_lost</strong> (<em>int</em>) – Max. number of times a object is lost while tracking.</p></li>
<li><p><strong>tracker_output_format</strong> (<em>str</em>) – Output format of the tracker.</p></li>
<li><p><strong>iou_threshold</strong> (<em>float</em>) – Intersection over union minimum value.</p></li>
<li><p><strong>process_noise_scale</strong> (<em>float</em><em> or </em><em>numpy.ndarray</em>) – Process noise covariance matrix of shape (3, 3)
or covariance magnitude as scalar value.</p></li>
<li><p><strong>measurement_noise_scale</strong> (<em>float</em><em> or </em><em>numpy.ndarray</em>) – Measurement noise covariance matrix of shape (1,)
or covariance magnitude as scalar value.</p></li>
<li><p><strong>time_step</strong> (<em>int</em><em> or </em><em>float</em>) – Time step for Kalman Filter.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="motrackers.sort_tracker.SORT.update">
<code class="sig-name descname">update</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">bboxes</span></em>, <em class="sig-param"><span class="n">detection_scores</span></em>, <em class="sig-param"><span class="n">class_ids</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/sort_tracker.html#SORT.update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.sort_tracker.SORT.update" title="Permalink to this definition">¶</a></dt>
<dd><p>Update the tracker based on the new bounding boxes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>bboxes</strong> (<em>numpy.ndarray</em><em> or </em><em>list</em>) – List of bounding boxes detected in the current frame. Each element of the list represent
coordinates of bounding box as tuple <cite>(top-left-x, top-left-y, width, height)</cite>.</p></li>
<li><p><strong>detection_scores</strong> (<em>numpy.ndarray</em><em> or </em><em>list</em>) – List of detection scores (probability) of each detected object.</p></li>
<li><p><strong>class_ids</strong> (<em>numpy.ndarray</em><em> or </em><em>list</em>) – List of class_ids (int) corresponding to labels of the detected object. Default is <cite>None</cite>.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>List of tracks being currently tracked by the tracker. Each track is represented by the tuple with elements <cite>(frame_id, track_id, bb_left, bb_top, bb_width, bb_height, conf, x, y, z)</cite>.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>list</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="iou-tracker">
<h1>IOU Tracker<a class="headerlink" href="#iou-tracker" title="Permalink to this headline">¶</a></h1>
<dl class="py class">
<dt id="motrackers.iou_tracker.IOUTracker">
<em class="property">class </em><code class="sig-prename descclassname">motrackers.iou_tracker.</code><code class="sig-name descname">IOUTracker</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">max_lost</span><span class="o">=</span><span class="default_value">2</span></em>, <em class="sig-param"><span class="n">iou_threshold</span><span class="o">=</span><span class="default_value">0.5</span></em>, <em class="sig-param"><span class="n">min_detection_confidence</span><span class="o">=</span><span class="default_value">0.4</span></em>, <em class="sig-param"><span class="n">max_detection_confidence</span><span class="o">=</span><span class="default_value">0.7</span></em>, <em class="sig-param"><span class="n">tracker_output_format</span><span class="o">=</span><span class="default_value">'mot_challenge'</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/iou_tracker.html#IOUTracker"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.iou_tracker.IOUTracker" title="Permalink to this definition">¶</a></dt>
<dd><p>Intersection over Union Tracker.</p>
<p class="rubric">References</p>
<ul class="simple">
<li><p>Implementation of this algorithm is heavily based on <a class="reference external" href="https://github.com/bochinski/iou-tracker">https://github.com/bochinski/iou-tracker</a></p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>max_lost</strong> (<em>int</em>) – Maximum number of consecutive frames object was not detected.</p></li>
<li><p><strong>tracker_output_format</strong> (<em>str</em>) – Output format of the tracker.</p></li>
<li><p><strong>min_detection_confidence</strong> (<em>float</em>) – Threshold for minimum detection confidence.</p></li>
<li><p><strong>max_detection_confidence</strong> (<em>float</em>) – Threshold for max. detection confidence.</p></li>
<li><p><strong>iou_threshold</strong> (<em>float</em>) – Intersection over union minimum value.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="motrackers.iou_tracker.IOUTracker.update">
<code class="sig-name descname">update</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">bboxes</span></em>, <em class="sig-param"><span class="n">detection_scores</span></em>, <em class="sig-param"><span class="n">class_ids</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/iou_tracker.html#IOUTracker.update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.iou_tracker.IOUTracker.update" title="Permalink to this definition">¶</a></dt>
<dd><p>Update the tracker based on the new bounding boxes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>bboxes</strong> (<em>numpy.ndarray</em><em> or </em><em>list</em>) – List of bounding boxes detected in the current frame. Each element of the list represent
coordinates of bounding box as tuple <cite>(top-left-x, top-left-y, width, height)</cite>.</p></li>
<li><p><strong>detection_scores</strong> (<em>numpy.ndarray</em><em> or </em><em>list</em>) – List of detection scores (probability) of each detected object.</p></li>
<li><p><strong>class_ids</strong> (<em>numpy.ndarray</em><em> or </em><em>list</em>) – List of class_ids (int) corresponding to labels of the detected object. Default is <cite>None</cite>.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>List of tracks being currently tracked by the tracker. Each track is represented by the tuple with elements <cite>(frame_id, track_id, bb_left, bb_top, bb_width, bb_height, conf, x, y, z)</cite>.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>list</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="kalman-filter-based-centroid-tracker">
<h1>Kalman Filter based Centroid Tracker<a class="headerlink" href="#kalman-filter-based-centroid-tracker" title="Permalink to this headline">¶</a></h1>
<dl class="py function">
<dt id="motrackers.centroid_kf_tracker.assign_tracks2detection_centroid_distances">
<code class="sig-prename descclassname">motrackers.centroid_kf_tracker.</code><code class="sig-name descname">assign_tracks2detection_centroid_distances</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">bbox_tracks</span></em>, <em class="sig-param"><span class="n">bbox_detections</span></em>, <em class="sig-param"><span class="n">distance_threshold</span><span class="o">=</span><span class="default_value">10.0</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/centroid_kf_tracker.html#assign_tracks2detection_centroid_distances"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.centroid_kf_tracker.assign_tracks2detection_centroid_distances" title="Permalink to this definition">¶</a></dt>
<dd><p>Assigns detected bounding boxes to tracked bounding boxes using IoU as a distance metric.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>bbox_tracks</strong> (<em>numpy.ndarray</em>) – Tracked bounding boxes with shape <cite>(n, 4)</cite>
and each row as <cite>(xmin, ymin, width, height)</cite>.</p></li>
<li><p><strong>bbox_detections</strong> (<em>numpy.ndarray</em>) – detection bounding boxes with shape <cite>(m, 4)</cite> and
each row as <cite>(xmin, ymin, width, height)</cite>.</p></li>
<li><p><strong>distance_threshold</strong> (<em>float</em>) – Minimum distance between the tracked object
and new detection to consider for assignment.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><dl>
<dt>Tuple containing the following elements:</dt><dd><ul class="simple">
<li><p>matches (numpy.ndarray): Array of shape <cite>(n, 2)</cite> where <cite>n</cite> is number of pairs formed after</p></li>
</ul>
<p>matching tracks to detections. This is an array of tuples with each element as matched pair
of indices`(track_index, detection_index)`.
- unmatched_detections (numpy.ndarray): Array of shape <cite>(m,)</cite> where <cite>m</cite> is number of unmatched detections.
- unmatched_tracks (numpy.ndarray): Array of shape <cite>(k,)</cite> where <cite>k</cite> is the number of unmatched tracks.</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
</dd></dl>
<dl class="py class">
<dt id="motrackers.centroid_kf_tracker.CentroidKF_Tracker">
<em class="property">class </em><code class="sig-prename descclassname">motrackers.centroid_kf_tracker.</code><code class="sig-name descname">CentroidKF_Tracker</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">max_lost</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">centroid_distance_threshold</span><span class="o">=</span><span class="default_value">30.0</span></em>, <em class="sig-param"><span class="n">tracker_output_format</span><span class="o">=</span><span class="default_value">'mot_challenge'</span></em>, <em class="sig-param"><span class="n">process_noise_scale</span><span class="o">=</span><span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">measurement_noise_scale</span><span class="o">=</span><span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">time_step</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/centroid_kf_tracker.html#CentroidKF_Tracker"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.centroid_kf_tracker.CentroidKF_Tracker" title="Permalink to this definition">¶</a></dt>
<dd><p>Kalman filter based tracking of multiple detected objects.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>max_lost</strong> (<em>int</em>) – Maximum number of consecutive frames object was not detected.</p></li>
<li><p><strong>tracker_output_format</strong> (<em>str</em>) – Output format of the tracker.</p></li>
<li><p><strong>process_noise_scale</strong> (<em>float</em><em> or </em><em>numpy.ndarray</em>) – Process noise covariance matrix of shape (3, 3) or
covariance magnitude as scalar value.</p></li>
<li><p><strong>measurement_noise_scale</strong> (<em>float</em><em> or </em><em>numpy.ndarray</em>) – Measurement noise covariance matrix of shape (1,)
or covariance magnitude as scalar value.</p></li>
<li><p><strong>time_step</strong> (<em>int</em><em> or </em><em>float</em>) – Time step for Kalman Filter.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="motrackers.centroid_kf_tracker.CentroidKF_Tracker.update">
<code class="sig-name descname">update</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">bboxes</span></em>, <em class="sig-param"><span class="n">detection_scores</span></em>, <em class="sig-param"><span class="n">class_ids</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/centroid_kf_tracker.html#CentroidKF_Tracker.update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.centroid_kf_tracker.CentroidKF_Tracker.update" title="Permalink to this definition">¶</a></dt>
<dd><p>Update the tracker based on the new bounding boxes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>bboxes</strong> (<em>numpy.ndarray</em><em> or </em><em>list</em>) – List of bounding boxes detected in the current frame. Each element of the list represent
coordinates of bounding box as tuple <cite>(top-left-x, top-left-y, width, height)</cite>.</p></li>
<li><p><strong>detection_scores</strong> (<em>numpy.ndarray</em><em> or </em><em>list</em>) – List of detection scores (probability) of each detected object.</p></li>
<li><p><strong>class_ids</strong> (<em>numpy.ndarray</em><em> or </em><em>list</em>) – List of class_ids (int) corresponding to labels of the detected object. Default is <cite>None</cite>.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>List of tracks being currently tracked by the tracker. Each track is represented by the tuple with elements <cite>(frame_id, track_id, bb_left, bb_top, bb_width, bb_height, conf, x, y, z)</cite>.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>list</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="tracks">
<h1>Tracks<a class="headerlink" href="#tracks" title="Permalink to this headline">¶</a></h1>
<dl class="py class">
<dt id="motrackers.track.Track">
<em class="property">class </em><code class="sig-prename descclassname">motrackers.track.</code><code class="sig-name descname">Track</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">track_id</span></em>, <em class="sig-param"><span class="n">frame_id</span></em>, <em class="sig-param"><span class="n">bbox</span></em>, <em class="sig-param"><span class="n">detection_confidence</span></em>, <em class="sig-param"><span class="n">class_id</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">lost</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">iou_score</span><span class="o">=</span><span class="default_value">0.0</span></em>, <em class="sig-param"><span class="n">data_output_format</span><span class="o">=</span><span class="default_value">'mot_challenge'</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/track.html#Track"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.track.Track" title="Permalink to this definition">¶</a></dt>
<dd><p>Track containing attributes to track various objects.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>frame_id</strong> (<em>int</em>) – Camera frame id.</p></li>
<li><p><strong>track_id</strong> (<em>int</em>) – Track Id</p></li>
<li><p><strong>bbox</strong> (<em>numpy.ndarray</em>) – Bounding box pixel coordinates as (xmin, ymin, width, height) of the track.</p></li>
<li><p><strong>detection_confidence</strong> (<em>float</em>) – Detection confidence of the object (probability).</p></li>
<li><p><strong>class_id</strong> (<em>str</em><em> or </em><em>int</em>) – Class label id.</p></li>
<li><p><strong>lost</strong> (<em>int</em>) – Number of times the object or track was not tracked by tracker in consecutive frames.</p></li>
<li><p><strong>iou_score</strong> (<em>float</em>) – Intersection over union score.</p></li>
<li><p><strong>data_output_format</strong> (<em>str</em>) – Output format for data in tracker.
Options include <code class="docutils literal notranslate"><span class="pre">['mot_challenge',</span> <span class="pre">'visdrone_challenge']</span></code>. Default is <code class="docutils literal notranslate"><span class="pre">mot_challenge</span></code>.</p></li>
<li><p><strong>kwargs</strong> (<em>dict</em>) – Additional key word arguments.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="motrackers.track.Track.centroid">
<em class="property">property </em><code class="sig-name descname">centroid</code><a class="headerlink" href="#motrackers.track.Track.centroid" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the centroid of the bounding box.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Centroid (x, y) of bounding box.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="motrackers.track.Track.get_mot_challenge_format">
<code class="sig-name descname">get_mot_challenge_format</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/track.html#Track.get_mot_challenge_format"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.track.Track.get_mot_challenge_format" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the tracker data in MOT challenge format as a tuple of elements containing
<cite>(frame, id, bb_left, bb_top, bb_width, bb_height, conf, x, y, z)</cite></p>
<p class="rubric">References</p>
<ul class="simple">
<li><p>Website : <a class="reference external" href="https://motchallenge.net/">https://motchallenge.net/</a></p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Tuple of 10 elements representing <cite>(frame, id, bb_left, bb_top, bb_width, bb_height, conf, x, y, z)</cite>.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>tuple</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="motrackers.track.Track.get_vis_drone_format">
<code class="sig-name descname">get_vis_drone_format</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/track.html#Track.get_vis_drone_format"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.track.Track.get_vis_drone_format" title="Permalink to this definition">¶</a></dt>
<dd><p>Track data output in VISDRONE Challenge format with tuple as
<cite>(frame_index, target_id, bbox_left, bbox_top, bbox_width, bbox_height, score, object_category,
truncation, occlusion)</cite>.</p>
<p class="rubric">References</p>
<ul class="simple">
<li><p>Website : <a class="reference external" href="http://aiskyeye.com/">http://aiskyeye.com/</a></p></li>
<li><p>Paper : <a class="reference external" href="https://arxiv.org/abs/2001.06303">https://arxiv.org/abs/2001.06303</a></p></li>
<li><p>GitHub : <a class="reference external" href="https://github.com/VisDrone/VisDrone2018-MOT-toolkit">https://github.com/VisDrone/VisDrone2018-MOT-toolkit</a></p></li>
<li><p>GitHub : <a class="reference external" href="https://github.com/VisDrone/">https://github.com/VisDrone/</a></p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Tuple containing the elements as <cite>(frame_index, target_id, bbox_left, bbox_top, bbox_width, bbox_height,
score, object_category, truncation, occlusion)</cite>.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>tuple</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="motrackers.track.Track.predict">
<code class="sig-name descname">predict</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/track.html#Track.predict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.track.Track.predict" title="Permalink to this definition">¶</a></dt>
<dd><p>Implement to prediction the next estimate of track.</p>
</dd></dl>
<dl class="py method">
<dt id="motrackers.track.Track.update">
<code class="sig-name descname">update</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">frame_id</span></em>, <em class="sig-param"><span class="n">bbox</span></em>, <em class="sig-param"><span class="n">detection_confidence</span></em>, <em class="sig-param"><span class="n">class_id</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">lost</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">iou_score</span><span class="o">=</span><span class="default_value">0.0</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/track.html#Track.update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.track.Track.update" title="Permalink to this definition">¶</a></dt>
<dd><p>Update the track.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>frame_id</strong> (<em>int</em>) – Camera frame id.</p></li>
<li><p><strong>bbox</strong> (<em>numpy.ndarray</em>) – Bounding box pixel coordinates as (xmin, ymin, width, height) of the track.</p></li>
<li><p><strong>detection_confidence</strong> (<em>float</em>) – Detection confidence of the object (probability).</p></li>
<li><p><strong>class_id</strong> (<em>int</em><em> or </em><em>str</em>) – Class label id.</p></li>
<li><p><strong>lost</strong> (<em>int</em>) – Number of times the object or track was not tracked by tracker in consecutive frames.</p></li>
<li><p><strong>iou_score</strong> (<em>float</em>) – Intersection over union score.</p></li>
<li><p><strong>kwargs</strong> (<em>dict</em>) – Additional key word arguments.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="motrackers.track.KFTrackSORT">
<em class="property">class </em><code class="sig-prename descclassname">motrackers.track.</code><code class="sig-name descname">KFTrackSORT</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">track_id</span></em>, <em class="sig-param"><span class="n">frame_id</span></em>, <em class="sig-param"><span class="n">bbox</span></em>, <em class="sig-param"><span class="n">detection_confidence</span></em>, <em class="sig-param"><span class="n">class_id</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">lost</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">iou_score</span><span class="o">=</span><span class="default_value">0.0</span></em>, <em class="sig-param"><span class="n">data_output_format</span><span class="o">=</span><span class="default_value">'mot_challenge'</span></em>, <em class="sig-param"><span class="n">process_noise_scale</span><span class="o">=</span><span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">measurement_noise_scale</span><span class="o">=</span><span class="default_value">1.0</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/track.html#KFTrackSORT"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.track.KFTrackSORT" title="Permalink to this definition">¶</a></dt>
<dd><p>Track based on Kalman filter tracker used for SORT MOT-Algorithm.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>track_id</strong> (<em>int</em>) – Track Id</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – Camera frame id.</p></li>
<li><p><strong>bbox</strong> (<em>numpy.ndarray</em>) – Bounding box pixel coordinates as (xmin, ymin, width, height) of the track.</p></li>
<li><p><strong>detection_confidence</strong> (<em>float</em>) – Detection confidence of the object (probability).</p></li>
<li><p><strong>class_id</strong> (<em>str</em><em> or </em><em>int</em>) – Class label id.</p></li>
<li><p><strong>lost</strong> (<em>int</em>) – Number of times the object or track was not tracked by tracker in consecutive frames.</p></li>
<li><p><strong>iou_score</strong> (<em>float</em>) – Intersection over union score.</p></li>
<li><p><strong>data_output_format</strong> (<em>str</em>) – Output format for data in tracker.
Options <code class="docutils literal notranslate"><span class="pre">['mot_challenge',</span> <span class="pre">'visdrone_challenge']</span></code>. Default is <code class="docutils literal notranslate"><span class="pre">mot_challenge</span></code>.</p></li>
<li><p><strong>process_noise_scale</strong> (<em>float</em>) – Process noise covariance scale or covariance magnitude as scalar value.</p></li>
<li><p><strong>measurement_noise_scale</strong> (<em>float</em>) – Measurement noise covariance scale or covariance magnitude as scalar value.</p></li>
<li><p><strong>kwargs</strong> (<em>dict</em>) – Additional key word arguments.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="motrackers.track.KFTrackSORT.predict">
<code class="sig-name descname">predict</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/track.html#KFTrackSORT.predict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.track.KFTrackSORT.predict" title="Permalink to this definition">¶</a></dt>
<dd><p>Predicts the next estimate of the bounding box of the track.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Bounding box pixel coordinates as (xmin, ymin, width, height) of the track.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="motrackers.track.KFTrackSORT.update">
<code class="sig-name descname">update</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">frame_id</span></em>, <em class="sig-param"><span class="n">bbox</span></em>, <em class="sig-param"><span class="n">detection_confidence</span></em>, <em class="sig-param"><span class="n">class_id</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">lost</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">iou_score</span><span class="o">=</span><span class="default_value">0.0</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/track.html#KFTrackSORT.update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.track.KFTrackSORT.update" title="Permalink to this definition">¶</a></dt>
<dd><p>Update the track.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>frame_id</strong> (<em>int</em>) – Camera frame id.</p></li>
<li><p><strong>bbox</strong> (<em>numpy.ndarray</em>) – Bounding box pixel coordinates as (xmin, ymin, width, height) of the track.</p></li>
<li><p><strong>detection_confidence</strong> (<em>float</em>) – Detection confidence of the object (probability).</p></li>
<li><p><strong>class_id</strong> (<em>int</em><em> or </em><em>str</em>) – Class label id.</p></li>
<li><p><strong>lost</strong> (<em>int</em>) – Number of times the object or track was not tracked by tracker in consecutive frames.</p></li>
<li><p><strong>iou_score</strong> (<em>float</em>) – Intersection over union score.</p></li>
<li><p><strong>kwargs</strong> (<em>dict</em>) – Additional key word arguments.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="motrackers.track.KFTrack4DSORT">
<em class="property">class </em><code class="sig-prename descclassname">motrackers.track.</code><code class="sig-name descname">KFTrack4DSORT</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">track_id</span></em>, <em class="sig-param"><span class="n">frame_id</span></em>, <em class="sig-param"><span class="n">bbox</span></em>, <em class="sig-param"><span class="n">detection_confidence</span></em>, <em class="sig-param"><span class="n">class_id</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">lost</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">iou_score</span><span class="o">=</span><span class="default_value">0.0</span></em>, <em class="sig-param"><span class="n">data_output_format</span><span class="o">=</span><span class="default_value">'mot_challenge'</span></em>, <em class="sig-param"><span class="n">process_noise_scale</span><span class="o">=</span><span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">measurement_noise_scale</span><span class="o">=</span><span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">kf_time_step</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/track.html#KFTrack4DSORT"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.track.KFTrack4DSORT" title="Permalink to this definition">¶</a></dt>
<dd><p>Track based on Kalman filter tracker used for SORT MOT-Algorithm.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>track_id</strong> (<em>int</em>) – Track Id</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – Camera frame id.</p></li>
<li><p><strong>bbox</strong> (<em>numpy.ndarray</em>) – Bounding box pixel coordinates as (xmin, ymin, width, height) of the track.</p></li>
<li><p><strong>detection_confidence</strong> (<em>float</em>) – Detection confidence of the object (probability).</p></li>
<li><p><strong>class_id</strong> (<em>str</em><em> or </em><em>int</em>) – Class label id.</p></li>
<li><p><strong>lost</strong> (<em>int</em>) – Number of times the object or track was not tracked by tracker in consecutive frames.</p></li>
<li><p><strong>iou_score</strong> (<em>float</em>) – Intersection over union score.</p></li>
<li><p><strong>data_output_format</strong> (<em>str</em>) – Output format for data in tracker.
Options <code class="docutils literal notranslate"><span class="pre">['mot_challenge',</span> <span class="pre">'visdrone_challenge']</span></code>. Default is <code class="docutils literal notranslate"><span class="pre">mot_challenge</span></code>.</p></li>
<li><p><strong>process_noise_scale</strong> (<em>float</em>) – Process noise covariance scale or covariance magnitude as scalar value.</p></li>
<li><p><strong>measurement_noise_scale</strong> (<em>float</em>) – Measurement noise covariance scale or covariance magnitude as scalar value.</p></li>
<li><p><strong>kwargs</strong> (<em>dict</em>) – Additional key word arguments.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="motrackers.track.KFTrack4DSORT.predict">
<code class="sig-name descname">predict</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/track.html#KFTrack4DSORT.predict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.track.KFTrack4DSORT.predict" title="Permalink to this definition">¶</a></dt>
<dd><p>Implement to prediction the next estimate of track.</p>
</dd></dl>
<dl class="py method">
<dt id="motrackers.track.KFTrack4DSORT.update">
<code class="sig-name descname">update</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">frame_id</span></em>, <em class="sig-param"><span class="n">bbox</span></em>, <em class="sig-param"><span class="n">detection_confidence</span></em>, <em class="sig-param"><span class="n">class_id</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">lost</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">iou_score</span><span class="o">=</span><span class="default_value">0.0</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/track.html#KFTrack4DSORT.update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.track.KFTrack4DSORT.update" title="Permalink to this definition">¶</a></dt>
<dd><p>Update the track.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>frame_id</strong> (<em>int</em>) – Camera frame id.</p></li>
<li><p><strong>bbox</strong> (<em>numpy.ndarray</em>) – Bounding box pixel coordinates as (xmin, ymin, width, height) of the track.</p></li>
<li><p><strong>detection_confidence</strong> (<em>float</em>) – Detection confidence of the object (probability).</p></li>
<li><p><strong>class_id</strong> (<em>int</em><em> or </em><em>str</em>) – Class label id.</p></li>
<li><p><strong>lost</strong> (<em>int</em>) – Number of times the object or track was not tracked by tracker in consecutive frames.</p></li>
<li><p><strong>iou_score</strong> (<em>float</em>) – Intersection over union score.</p></li>
<li><p><strong>kwargs</strong> (<em>dict</em>) – Additional key word arguments.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="motrackers.track.KFTrackCentroid">
<em class="property">class </em><code class="sig-prename descclassname">motrackers.track.</code><code class="sig-name descname">KFTrackCentroid</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">track_id</span></em>, <em class="sig-param"><span class="n">frame_id</span></em>, <em class="sig-param"><span class="n">bbox</span></em>, <em class="sig-param"><span class="n">detection_confidence</span></em>, <em class="sig-param"><span class="n">class_id</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">lost</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">iou_score</span><span class="o">=</span><span class="default_value">0.0</span></em>, <em class="sig-param"><span class="n">data_output_format</span><span class="o">=</span><span class="default_value">'mot_challenge'</span></em>, <em class="sig-param"><span class="n">process_noise_scale</span><span class="o">=</span><span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">measurement_noise_scale</span><span class="o">=</span><span class="default_value">1.0</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/track.html#KFTrackCentroid"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.track.KFTrackCentroid" title="Permalink to this definition">¶</a></dt>
<dd><p>Track based on Kalman filter used for Centroid Tracking of bounding box in MOT.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>track_id</strong> (<em>int</em>) – Track Id</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – Camera frame id.</p></li>
<li><p><strong>bbox</strong> (<em>numpy.ndarray</em>) – Bounding box pixel coordinates as (xmin, ymin, width, height) of the track.</p></li>
<li><p><strong>detection_confidence</strong> (<em>float</em>) – Detection confidence of the object (probability).</p></li>
<li><p><strong>class_id</strong> (<em>str</em><em> or </em><em>int</em>) – Class label id.</p></li>
<li><p><strong>lost</strong> (<em>int</em>) – Number of times the object or track was not tracked by tracker in consecutive frames.</p></li>
<li><p><strong>iou_score</strong> (<em>float</em>) – Intersection over union score.</p></li>
<li><p><strong>data_output_format</strong> (<em>str</em>) – Output format for data in tracker.
Options <code class="docutils literal notranslate"><span class="pre">['mot_challenge',</span> <span class="pre">'visdrone_challenge']</span></code>. Default is <code class="docutils literal notranslate"><span class="pre">mot_challenge</span></code>.</p></li>
<li><p><strong>process_noise_scale</strong> (<em>float</em>) – Process noise covariance scale or covariance magnitude as scalar value.</p></li>
<li><p><strong>measurement_noise_scale</strong> (<em>float</em>) – Measurement noise covariance scale or covariance magnitude as scalar value.</p></li>
<li><p><strong>kwargs</strong> (<em>dict</em>) – Additional key word arguments.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="motrackers.track.KFTrackCentroid.predict">
<code class="sig-name descname">predict</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/track.html#KFTrackCentroid.predict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.track.KFTrackCentroid.predict" title="Permalink to this definition">¶</a></dt>
<dd><p>Predicts the next estimate of the bounding box of the track.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Bounding box pixel coordinates as (xmin, ymin, width, height) of the track.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="motrackers.track.KFTrackCentroid.update">
<code class="sig-name descname">update</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">frame_id</span></em>, <em class="sig-param"><span class="n">bbox</span></em>, <em class="sig-param"><span class="n">detection_confidence</span></em>, <em class="sig-param"><span class="n">class_id</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">lost</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">iou_score</span><span class="o">=</span><span class="default_value">0.0</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/track.html#KFTrackCentroid.update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.track.KFTrackCentroid.update" title="Permalink to this definition">¶</a></dt>
<dd><p>Update the track.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>frame_id</strong> (<em>int</em>) – Camera frame id.</p></li>
<li><p><strong>bbox</strong> (<em>numpy.ndarray</em>) – Bounding box pixel coordinates as (xmin, ymin, width, height) of the track.</p></li>
<li><p><strong>detection_confidence</strong> (<em>float</em>) – Detection confidence of the object (probability).</p></li>
<li><p><strong>class_id</strong> (<em>int</em><em> or </em><em>str</em>) – Class label id.</p></li>
<li><p><strong>lost</strong> (<em>int</em>) – Number of times the object or track was not tracked by tracker in consecutive frames.</p></li>
<li><p><strong>iou_score</strong> (<em>float</em>) – Intersection over union score.</p></li>
<li><p><strong>kwargs</strong> (<em>dict</em>) – Additional key word arguments.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="kalman-filters">
<h1>Kalman Filters<a class="headerlink" href="#kalman-filters" title="Permalink to this headline">¶</a></h1>
<dl class="py class">
<dt id="motrackers.kalman_tracker.KalmanFilter">
<em class="property">class </em><code class="sig-prename descclassname">motrackers.kalman_tracker.</code><code class="sig-name descname">KalmanFilter</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">transition_matrix</span></em>, <em class="sig-param"><span class="n">measurement_matrix</span></em>, <em class="sig-param"><span class="n">control_matrix</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">process_noise_covariance</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">measurement_noise_covariance</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">prediction_covariance</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">initial_state</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/kalman_tracker.html#KalmanFilter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.kalman_tracker.KalmanFilter" title="Permalink to this definition">¶</a></dt>
<dd><p>Kalman Filter Implementation.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>transition_matrix</strong> (<em>numpy.ndarray</em>) – Transition matrix of shape <code class="docutils literal notranslate"><span class="pre">(n,</span> <span class="pre">n)</span></code>.</p></li>
<li><p><strong>measurement_matrix</strong> (<em>numpy.ndarray</em>) – Measurement matrix of shape <code class="docutils literal notranslate"><span class="pre">(m,</span> <span class="pre">n)</span></code>.</p></li>
<li><p><strong>control_matrix</strong> (<em>numpy.ndarray</em>) – Control matrix of shape <code class="docutils literal notranslate"><span class="pre">(m,</span> <span class="pre">n)</span></code>.</p></li>
<li><p><strong>process_noise_covariance</strong> (<em>numpy.ndarray</em>) – Covariance matrix of shape <code class="docutils literal notranslate"><span class="pre">(n,</span> <span class="pre">n)</span></code>.</p></li>
<li><p><strong>measurement_noise_covariance</strong> (<em>numpy.ndarray</em>) – Covariance matrix of shape <code class="docutils literal notranslate"><span class="pre">(m,</span> <span class="pre">m)</span></code>.</p></li>
<li><p><strong>prediction_covariance</strong> (<em>numpy.ndarray</em>) – Predicted (a priori) estimate covariance of shape <code class="docutils literal notranslate"><span class="pre">(n,</span> <span class="pre">n)</span></code>.</p></li>
<li><p><strong>initial_state</strong> (<em>numpy.ndarray</em>) – Initial state of shape <code class="docutils literal notranslate"><span class="pre">(n,)</span></code>.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="motrackers.kalman_tracker.KalmanFilter.predict">
<code class="sig-name descname">predict</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">u</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/kalman_tracker.html#KalmanFilter.predict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.kalman_tracker.KalmanFilter.predict" title="Permalink to this definition">¶</a></dt>
<dd><p>Prediction step of Kalman Filter.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>u</strong> (<em>float</em><em> or </em><em>int</em><em> or </em><em>numpy.ndarray</em>) – Control input. Default is <cite>0</cite>.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>State vector of shape <cite>(n,)</cite>.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="motrackers.kalman_tracker.KalmanFilter.update">
<code class="sig-name descname">update</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">z</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/kalman_tracker.html#KalmanFilter.update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.kalman_tracker.KalmanFilter.update" title="Permalink to this definition">¶</a></dt>
<dd><p>Measurement update of Kalman Filter.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>z</strong> (<em>numpy.ndarray</em>) – Measurement vector of the system with shape <code class="docutils literal notranslate"><span class="pre">(m,)</span></code>.</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="motrackers.kalman_tracker.KFTrackerConstantAcceleration">
<em class="property">class </em><code class="sig-prename descclassname">motrackers.kalman_tracker.</code><code class="sig-name descname">KFTrackerConstantAcceleration</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">initial_measurement</span></em>, <em class="sig-param"><span class="n">time_step</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">process_noise_scale</span><span class="o">=</span><span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">measurement_noise_scale</span><span class="o">=</span><span class="default_value">1.0</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/kalman_tracker.html#KFTrackerConstantAcceleration"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.kalman_tracker.KFTrackerConstantAcceleration" title="Permalink to this definition">¶</a></dt>
<dd><p>Kalman Filter with constant acceleration kinematic model.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>initial_measurement</strong> (<em>numpy.ndarray</em>) – Initial state of the tracker.</p></li>
<li><p><strong>time_step</strong> (<em>float</em>) – Time step.</p></li>
<li><p><strong>process_noise_scale</strong> (<em>float</em>) – Process noise covariance scale.
or covariance magnitude as scalar value.</p></li>
<li><p><strong>measurement_noise_scale</strong> (<em>float</em>) – Measurement noise covariance scale.
or covariance magnitude as scalar value.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py class">
<dt id="motrackers.kalman_tracker.KFTracker1D">
<em class="property">class </em><code class="sig-prename descclassname">motrackers.kalman_tracker.</code><code class="sig-name descname">KFTracker1D</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">initial_measurement</span><span class="o">=</span><span class="default_value">array([0.0])</span></em>, <em class="sig-param"><span class="n">time_step</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">process_noise_scale</span><span class="o">=</span><span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">measurement_noise_scale</span><span class="o">=</span><span class="default_value">1.0</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/kalman_tracker.html#KFTracker1D"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.kalman_tracker.KFTracker1D" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="py class">
<dt id="motrackers.kalman_tracker.KFTracker2D">
<em class="property">class </em><code class="sig-prename descclassname">motrackers.kalman_tracker.</code><code class="sig-name descname">KFTracker2D</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">initial_measurement</span><span class="o">=</span><span class="default_value">array([0.0, 0.0])</span></em>, <em class="sig-param"><span class="n">time_step</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">process_noise_scale</span><span class="o">=</span><span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">measurement_noise_scale</span><span class="o">=</span><span class="default_value">1.0</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/kalman_tracker.html#KFTracker2D"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.kalman_tracker.KFTracker2D" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="py class">
<dt id="motrackers.kalman_tracker.KFTracker4D">
<em class="property">class </em><code class="sig-prename descclassname">motrackers.kalman_tracker.</code><code class="sig-name descname">KFTracker4D</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">initial_measurement</span><span class="o">=</span><span class="default_value">array([0.0, 0.0, 0.0, 0.0])</span></em>, <em class="sig-param"><span class="n">time_step</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">process_noise_scale</span><span class="o">=</span><span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">measurement_noise_scale</span><span class="o">=</span><span class="default_value">1.0</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/kalman_tracker.html#KFTracker4D"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.kalman_tracker.KFTracker4D" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="py class">
<dt id="motrackers.kalman_tracker.KFTrackerSORT">
<em class="property">class </em><code class="sig-prename descclassname">motrackers.kalman_tracker.</code><code class="sig-name descname">KFTrackerSORT</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">bbox</span></em>, <em class="sig-param"><span class="n">process_noise_scale</span><span class="o">=</span><span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">measurement_noise_scale</span><span class="o">=</span><span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">time_step</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/kalman_tracker.html#KFTrackerSORT"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.kalman_tracker.KFTrackerSORT" title="Permalink to this definition">¶</a></dt>
<dd><p>Kalman filter for <code class="docutils literal notranslate"><span class="pre">SORT</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>bbox</strong> (<em>numpy.ndarray</em>) – Bounding box coordinates as <code class="docutils literal notranslate"><span class="pre">(xmid,</span> <span class="pre">ymid,</span> <span class="pre">area,</span> <span class="pre">aspect_ratio)</span></code>.</p></li>
<li><p><strong>time_step</strong> (<em>float</em><em> or </em><em>int</em>) – Time step.</p></li>
<li><p><strong>process_noise_scale</strong> (<em>float</em>) – Scale (a.k.a covariance) of the process noise.</p></li>
<li><p><strong>measurement_noise_scale</strong> (<em>float</em>) – Scale (a.k.a. covariance) of the measurement noise.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
</div>
<div class="section" id="object-detection">
<h1>Object Detection<a class="headerlink" href="#object-detection" title="Permalink to this headline">¶</a></h1>
<dl class="py class">
<dt id="motrackers.detectors.detector.Detector">
<em class="property">class </em><code class="sig-prename descclassname">motrackers.detectors.detector.</code><code class="sig-name descname">Detector</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">object_names</span></em>, <em class="sig-param"><span class="n">confidence_threshold</span></em>, <em class="sig-param"><span class="n">nms_threshold</span></em>, <em class="sig-param"><span class="n">draw_bboxes</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/detectors/detector.html#Detector"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.detectors.detector.Detector" title="Permalink to this definition">¶</a></dt>
<dd><p>Abstract class for detector.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>object_names</strong> (<em>dict</em>) – Dictionary containing (key, value) as (class_id, class_name) for object detector.</p></li>
<li><p><strong>confidence_threshold</strong> (<em>float</em>) – Confidence threshold for object detection.</p></li>
<li><p><strong>nms_threshold</strong> (<em>float</em>) – Threshold for non-maximal suppression.</p></li>
<li><p><strong>draw_bboxes</strong> (<em>bool</em>) – If true, draw bounding boxes on the image is possible.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="motrackers.detectors.detector.Detector.detect">
<code class="sig-name descname">detect</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">image</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/detectors/detector.html#Detector.detect"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.detectors.detector.Detector.detect" title="Permalink to this definition">¶</a></dt>
<dd><p>Detect objects in the input image.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>image</strong> (<em>numpy.ndarray</em>) – Input image.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><dl class="simple">
<dt>Tuple containing the following elements:</dt><dd><ul class="simple">
<li><p>bboxes (numpy.ndarray): Bounding boxes with shape (n, 4) containing detected objects with each row as <cite>(xmin, ymin, width, height)</cite>.</p></li>
<li><p>confidences (numpy.ndarray): Confidence or detection probabilities if the detected objects with shape (n,).</p></li>
<li><p>class_ids (numpy.ndarray): Class_ids or label_ids of detected objects with shape (n, 4)</p></li>
</ul>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="motrackers.detectors.detector.Detector.draw_bboxes">
<code class="sig-name descname">draw_bboxes</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">image</span></em>, <em class="sig-param"><span class="n">bboxes</span></em>, <em class="sig-param"><span class="n">confidences</span></em>, <em class="sig-param"><span class="n">class_ids</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/detectors/detector.html#Detector.draw_bboxes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.detectors.detector.Detector.draw_bboxes" title="Permalink to this definition">¶</a></dt>
<dd><p>Draw the bounding boxes about detected objects in the image.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>image</strong> (<em>numpy.ndarray</em>) – Image or video frame.</p></li>
<li><p><strong>bboxes</strong> (<em>numpy.ndarray</em>) – Bounding boxes pixel coordinates as (xmin, ymin, width, height)</p></li>
<li><p><strong>confidences</strong> (<em>numpy.ndarray</em>) – Detection confidence or detection probability.</p></li>
<li><p><strong>class_ids</strong> (<em>numpy.ndarray</em>) – Array containing class ids (aka label ids) of each detected object.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>image with the bounding boxes drawn on it.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="motrackers.detectors.detector.Detector.forward">
<code class="sig-name descname">forward</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">image</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/detectors/detector.html#Detector.forward"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.detectors.detector.Detector.forward" title="Permalink to this definition">¶</a></dt>
<dd><p>Forward pass for the detector with input image.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>image</strong> (<em>numpy.ndarray</em>) – Input image.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>detections</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="motrackers.detectors.caffe.Caffe_SSDMobileNet">
<em class="property">class </em><code class="sig-prename descclassname">motrackers.detectors.caffe.</code><code class="sig-name descname">Caffe_SSDMobileNet</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">weights_path</span></em>, <em class="sig-param"><span class="n">configfile_path</span></em>, <em class="sig-param"><span class="n">labels_path</span></em>, <em class="sig-param"><span class="n">confidence_threshold</span><span class="o">=</span><span class="default_value">0.5</span></em>, <em class="sig-param"><span class="n">nms_threshold</span><span class="o">=</span><span class="default_value">0.2</span></em>, <em class="sig-param"><span class="n">draw_bboxes</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">use_gpu</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/detectors/caffe.html#Caffe_SSDMobileNet"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.detectors.caffe.Caffe_SSDMobileNet" title="Permalink to this definition">¶</a></dt>
<dd><p>Caffe SSD MobileNet model for Object Detection.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>weights_path</strong> (<em>str</em>) – path to network weights file.</p></li>
<li><p><strong>configfile_path</strong> (<em>str</em>) – path to network configuration file.</p></li>
<li><p><strong>labels_path</strong> (<em>str</em>) – path to data labels json file.</p></li>
<li><p><strong>confidence_threshold</strong> (<em>float</em>) – confidence threshold to select the detected object.</p></li>
<li><p><strong>nms_threshold</strong> (<em>float</em>) – Non-maximum suppression threshold.</p></li>
<li><p><strong>draw_bboxes</strong> (<em>bool</em>) – If True, assign colors for drawing bounding boxes on the image.</p></li>
<li><p><strong>use_gpu</strong> (<em>bool</em>) – If True, try to load the model on GPU.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="motrackers.detectors.caffe.Caffe_SSDMobileNet.forward">
<code class="sig-name descname">forward</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">image</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/detectors/caffe.html#Caffe_SSDMobileNet.forward"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.detectors.caffe.Caffe_SSDMobileNet.forward" title="Permalink to this definition">¶</a></dt>
<dd><p>Forward pass for the detector with input image.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>image</strong> (<em>numpy.ndarray</em>) – Input image.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>detections</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="motrackers.detectors.tf.TF_SSDMobileNetV2">
<em class="property">class </em><code class="sig-prename descclassname">motrackers.detectors.tf.</code><code class="sig-name descname">TF_SSDMobileNetV2</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">weights_path</span></em>, <em class="sig-param"><span class="n">configfile_path</span></em>, <em class="sig-param"><span class="n">labels_path</span></em>, <em class="sig-param"><span class="n">confidence_threshold</span><span class="o">=</span><span class="default_value">0.5</span></em>, <em class="sig-param"><span class="n">nms_threshold</span><span class="o">=</span><span class="default_value">0.4</span></em>, <em class="sig-param"><span class="n">draw_bboxes</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">use_gpu</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/detectors/tf.html#TF_SSDMobileNetV2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.detectors.tf.TF_SSDMobileNetV2" title="Permalink to this definition">¶</a></dt>
<dd><p>Tensorflow SSD MobileNetv2 model for Object Detection.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>weights_path</strong> (<em>str</em>) – path to network weights file.</p></li>
<li><p><strong>configfile_path</strong> (<em>str</em>) – path to network configuration file.</p></li>
<li><p><strong>labels_path</strong> (<em>str</em>) – path to data labels json file.</p></li>
<li><p><strong>confidence_threshold</strong> (<em>float</em>) – confidence threshold to select the detected object.</p></li>
<li><p><strong>nms_threshold</strong> (<em>float</em>) – Non-maximum suppression threshold.</p></li>
<li><p><strong>draw_bboxes</strong> (<em>bool</em>) – If True, assign colors for drawing bounding boxes on the image.</p></li>
<li><p><strong>use_gpu</strong> (<em>bool</em>) – If True, try to load the model on GPU.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="motrackers.detectors.tf.TF_SSDMobileNetV2.forward">
<code class="sig-name descname">forward</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">image</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/detectors/tf.html#TF_SSDMobileNetV2.forward"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.detectors.tf.TF_SSDMobileNetV2.forward" title="Permalink to this definition">¶</a></dt>
<dd><p>Forward pass for the detector with input image.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>image</strong> (<em>numpy.ndarray</em>) – Input image.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>detections</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="motrackers.detectors.yolo.YOLOv3">
<em class="property">class </em><code class="sig-prename descclassname">motrackers.detectors.yolo.</code><code class="sig-name descname">YOLOv3</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">weights_path</span></em>, <em class="sig-param"><span class="n">configfile_path</span></em>, <em class="sig-param"><span class="n">labels_path</span></em>, <em class="sig-param"><span class="n">confidence_threshold</span><span class="o">=</span><span class="default_value">0.5</span></em>, <em class="sig-param"><span class="n">nms_threshold</span><span class="o">=</span><span class="default_value">0.2</span></em>, <em class="sig-param"><span class="n">draw_bboxes</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">use_gpu</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/detectors/yolo.html#YOLOv3"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.detectors.yolo.YOLOv3" title="Permalink to this definition">¶</a></dt>
<dd><p>YOLOv3 Object Detector Module.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>weights_path</strong> (<em>str</em>) – path to network weights file.</p></li>
<li><p><strong>configfile_path</strong> (<em>str</em>) – path to network configuration file.</p></li>
<li><p><strong>labels_path</strong> (<em>str</em>) – path to data labels json file.</p></li>
<li><p><strong>confidence_threshold</strong> (<em>float</em>) – confidence threshold to select the detected object.</p></li>
<li><p><strong>nms_threshold</strong> (<em>float</em>) – Non-maximum suppression threshold.</p></li>
<li><p><strong>draw_bboxes</strong> (<em>bool</em>) – If True, assign colors for drawing bounding boxes on the image.</p></li>
<li><p><strong>use_gpu</strong> (<em>bool</em>) – If True, try to load the model on GPU.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="motrackers.detectors.yolo.YOLOv3.detect">
<code class="sig-name descname">detect</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">image</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/motrackers/detectors/yolo.html#YOLOv3.detect"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#motrackers.detectors.yolo.YOLOv3.detect" title="Permalink to this definition">¶</a></dt>
<dd><p>Detect objects in the input image.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>image</strong> (<em>numpy.ndarray</em>) – Input image.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><dl class="simple">
<dt>Tuple containing the following elements:</dt><dd><ul class="simple">
<li><p>bboxes (numpy.ndarray): Bounding boxes with shape (n, 4) containing detected objects with each row as <cite>(xmin, ymin, width, height)</cite>.</p></li>
<li><p>confidences (numpy.ndarray): Confidence or detection probabilities if the detected objects with shape (n,).</p></li>
<li><p>class_ids (numpy.ndarray): Class_ids or label_ids of detected objects with shape (n, 4)</p></li>
</ul>
</dd>
</dl>
</p>