Skip to content

Deep lab v3 plus segmentation

DeepLabV3PlusSemanticSegmentation

Bases: SemanticSegmentationBaseOnnxRoboflowInferenceModel

DeepLabV3Plus Semantic Segmentation ONNX Inference Model.

This class is responsible for performing semantic segmentation using the DeepLabV3Plus model with ONNX runtime.

Attributes:

Name Type Description
weights_file str

Path to the ONNX weights file.

Methods:

Name Description
predict

Performs inference on the given image using the ONNX session.

Source code in inference/models/deep_lab_v3_plus/deep_lab_v3_plus_segmentation.py
 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
class DeepLabV3PlusSemanticSegmentation(
    SemanticSegmentationBaseOnnxRoboflowInferenceModel
):
    """DeepLabV3Plus Semantic Segmentation ONNX Inference Model.

    This class is responsible for performing semantic segmentation using the DeepLabV3Plus model
    with ONNX runtime.

    Attributes:
        weights_file (str): Path to the ONNX weights file.

    Methods:
        predict: Performs inference on the given image using the ONNX session.
    """

    # match train params
    preprocess_means = [0.485, 0.456, 0.406]
    preprocess_stds = [0.229, 0.224, 0.225]

    @property
    def weights_file(self) -> str:
        """Gets the weights file for the DeepLabV3Plus model.

        Returns:
            str: Path to the ONNX weights file.
        """
        return "weights.onnx"

weights_file property

Gets the weights file for the DeepLabV3Plus model.

Returns:

Name Type Description
str str

Path to the ONNX weights file.