Tapir
- class grid.model.perception.tracking.tapir.Tapir(*args, **kwargs)
Tapir: Point Tracking Model
This class implements a wrapper for the Tapir model, which tracks points in video frames using the TAPIR framework.
- Credits:
- License:
This code is licensed under the Apache 2.0 License.
- __init__()
Initialize Tapir model
- run(frame, query_points)
Runs the tracker on a single frame.
- Parameters:
frame (np.ndarray) -- The input frame.
query_points -- The query points for tracking.
- Returns:
The prediction made by the tracker.
Example
>>> model = Tapir() >>> initial_frame = im0 >>> x = int(0.5*im0.shape[1]) >>> y = int(0.5*im0.shape[0]) >>> query_points = np.array([[0, y, x]]) >>> ret0 = model.run(initial_frame, query_points) >>> subsequent_frame = im1 >>> ret1 = model.run(subsequent_frame, query_points)