sportslabkit.detection_model.dummy#
Overview#
Base class for detection models. This class implements basic functionality for handling input and output data, and requires subclasses to implement model loading and forward pass functionality. |
Classes#
- class sportslabkit.detection_model.dummy.DummyDetectionModel(detections)[source]#
Bases:
sportslabkit.detection_model.base.BaseDetectionModelBase class for detection models. This class implements basic functionality for handling input and output data, and requires subclasses to implement model loading and forward pass functionality.
Subclasses should override the ‘load’ and ‘forward’ methods. The ‘load’ method should handle loading the model from the specified repository and checkpoint, and ‘forward’ should define the forward pass of the model. Then add ConfigTemplates for your model to define the available configuration options.
The input to the model should be flexible. It accepts numpy.ndarray, torch.Tensor, pathlib Path, string file, PIL Image, or a list of any of these. All inputs will be converted to a list of numpy arrays representing the images.
The output of the model is expected to be a list of Detection objects, where each Detection object represents a detected object in an image. If the model’s output does not meet this expectation, _check_and_fix_outputs method should convert the output into a compatible format.
Example
- class CustomDetectionModel(BaseDetectionModel):
- def load(self):
# Load your model here pass
- def forward(self, x):
# Define the forward pass here pass
- input_is_batched#
Whether the input is batched or not. This is set by the _check_and_fix_inputs method.
- Type:
Overview
Members