-
Notifications
You must be signed in to change notification settings - Fork 2
/
tracker.py
48 lines (37 loc) · 1.5 KB
/
tracker.py
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
# Copyright (c) 2021 Alphons Gwatimba
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
from abc import ABC, abstractmethod
from typing import Any
import numpy.typing as npt
from epic.tracking.tracklet import Tracklet
class Tracker(ABC):
"""The interface for object trackers that can be used by EPIC.
Object detectors must be passable to Python worker processes executing
concurrently on separate CPUs.
"""
@abstractmethod
def __init__(self, **kwargs: Any) -> None:
"""Inits the the object tracker with the required parameters.
Raises:
NotImplementedError: The method was not implemented.
"""
raise NotImplementedError
@abstractmethod
def track(self, imgs: list[npt.NDArray[Any]], dets: list[list[
Tracklet]], ldg_es: tuple[int, int] | None = None) -> list[
Tracklet]:
"""Tracks objects across image sequences.
Args:
imgs: A list of images.
dets: A list, which is the same length as the number of
images, of Tracklets representing the detections in each image.
ldg_es: The top and bottom leading edges on the first frame of the
image sequence, applicable for wound repair image sequences.
Returns:
A list of Tracklets representing objects tracks.
Raises:
NotImplementedError: The method was not implemented.
"""
raise NotImplementedError