Implement all missing docstrings (#5298)

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Glenn Jocher 2023-10-10 20:07:13 +02:00 committed by GitHub
parent e7f0658744
commit 7fd5dcbd86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 649 additions and 79 deletions

View file

@ -17,6 +17,24 @@ from .build import build_sam
class Predictor(BasePredictor):
"""
A prediction class for segmentation tasks, extending the BasePredictor.
This class serves as an interface for model inference for segmentation tasks.
It can preprocess input images, perform inference, and postprocess the output.
It also supports handling various types of input prompts including bounding boxes,
points, and low-resolution masks for better prediction results.
Attributes:
cfg (dict): Configuration dictionary.
overrides (dict): Dictionary of overriding values.
_callbacks (dict): Dictionary of callback functions.
args (namespace): Argument namespace.
im (torch.Tensor): Preprocessed image for current prediction.
features (torch.Tensor): Image features.
prompts (dict): Dictionary of prompts like bboxes, points, masks.
segment_all (bool): Whether to perform segmentation on all objects or not.
"""
def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None):
"""Initializes the Predictor class with default or provided configuration, overrides, and callbacks."""