forked from TrackingLaboratory/tracklab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcallback.py
76 lines (62 loc) · 1.8 KB
/
callback.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
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
# from pytorch_lightning import Callback as PLCallback
from typing import Any, TYPE_CHECKING
import pandas as pd
from torch.utils.data import DataLoader
if TYPE_CHECKING:
from tracklab.engine import TrackingEngine
class Callback:
after_saved_state = False
def on_dataset_track_start(self, engine: "TrackingEngine"):
pass
def on_dataset_track_end(self, engine: "TrackingEngine"):
pass
def on_video_loop_start(
self,
engine: "TrackingEngine",
video_metadata: pd.Series, # FIXME keep ?
# image_metadatas: pd.DataFrame, # FIXME add ?
video_idx: int,
index: int, # FIXME change name ?
):
pass
def on_video_loop_end(
self,
engine: "TrackingEngine",
video_metadata: pd.Series, # FIXME keep ?
# image_metadatas: pd.DataFrame, # FIXME add ?
video_idx: int,
detections: pd.DataFrame,
image_pred: pd.DataFrame,
):
pass
def on_image_loop_start(
self,
engine: "TrackingEngine",
image_metadata: pd.Series,
image_idx: int,
index: int,
):
pass
def on_image_loop_end(
self,
engine: "TrackingEngine",
image_metadata: pd.Series,
image,
image_idx: int,
detections: pd.DataFrame,
):
pass
def on_module_start(
self, engine: "TrackingEngine", task: str, dataloader: DataLoader
):
pass
def on_module_end(
self, engine: "TrackingEngine", task: str, detections: pd.DataFrame
):
pass
def on_module_step_start(self, engine: "TrackingEngine", task: str, batch: Any):
pass
def on_module_step_end(
self, engine: "TrackingEngine", task: str, batch: Any, detections: pd.DataFrame
):
pass