def add_nms(
        self,
        name,
        input_names,
        output_names,
        iou_threshold=0.5,
        score_threshold=0.0,
        max_boxes=1,
        per_class_suppression=False,
    ):
        """
        Add a non maximum suppression layer.
        Refer to the ``NonMaximumSuppressionLayerParams`` message in the specification (NeuralNetwork.proto) for more details.

        Parameters
        ----------
        name: str
            The name of this layer.
        input_names: list of str
            The input blob names of this layer. Must be at least 2, and maximum 5.
        output_names: list of str
            The output blob names of this layer. Must be of length 4 exactly.
        iou_threshold: float
            intersection over union threshold for suppression. Ignored if 3rd input is present.
        score_threshold: float
            threshold for selecting boxes to be used for NMS algorithm. Ignored if 4th input is present.
        max_boxes: int
            maximum number of boxes to output. Ignored if 5th input is present.
        per_class_suppression: bool
            If true, boxes are organized into classes and suppression is applied to each class group separately

        See Also
        --------
        add_constant_pad
        """

        spec_layer = self._add_generic_layer(name, input_names, output_names)
        spec_layer_params = spec_layer.NonMaximumSuppression
        spec_layer_params.iouThreshold = iou_threshold
        spec_layer_params.scoreThreshold = score_threshold
        spec_layer_params.maxBoxes = max_boxes
        spec_layer_params.perClassSuppression = per_class_suppression

        self.rank_dict[output_names[0]] = 3
        self.rank_dict[output_names[1]] = 3
        self.rank_dict[output_names[2]] = 2
        self.rank_dict[output_names[3]] = 1
        return spec_layer

        Add a non maximum suppression layer.
        Refer to the ``NonMaximumSuppressionLayerParams`` message in the specification (NeuralNetwork.proto) for more details.

        Parameters
        ----------
        name: str
            The name of this layer.
        input_names: list of str
            The input blob names of this layer. Must be at least 2, and maximum 5.
        output_names: list of str
            The output blob names of this layer. Must be of length 4 exactly.
        iou_threshold: float
            intersection over union threshold for suppression. Ignored if 3rd input is present.
        score_threshold: float
            threshold for selecting boxes to be used for NMS algorithm. Ignored if 4th input is present.
        max_boxes: int
            maximum number of boxes to output. Ignored if 5th input is present.
        per_class_suppression: bool
            If true, boxes are organized into classes and suppression is applied to each class group separately

        See Also
        --------
        add_constant_pad
        
coremltools/models/neural_network/builder.py