function nonMaxSuppressionPadded_(boxes, scores, maxOutputSize, iouThreshold = 0.5, scoreThreshold = Number.NEGATIVE_INFINITY, padToMaxOutputSize = false) {
    const $boxes = (0, _tensorUtilEnv.convertToTensor)(boxes, "boxes", "nonMaxSuppression");
    const $scores = (0, _tensorUtilEnv.convertToTensor)(scores, "scores", "nonMaxSuppression");
    const params = (0, _nonmaxUtil.nonMaxSuppSanityCheck)($boxes, $scores, maxOutputSize, iouThreshold, scoreThreshold, null);
    const $maxOutputSize = params.maxOutputSize;
    const $iouThreshold = params.iouThreshold;
    const $scoreThreshold = params.scoreThreshold;
    const inputs = {
        boxes: $boxes,
        scores: $scores
    };
    const attrs = {
        maxOutputSize: $maxOutputSize,
        iouThreshold: $iouThreshold,
        scoreThreshold: $scoreThreshold,
        padToMaxOutputSize
    };
    // tslint:disable-next-line: no-unnecessary-type-assertion
    const result = (0, _engine.ENGINE).runKernel((0, _kernelNames.NonMaxSuppressionV4), inputs, attrs);
    return {
        selectedIndices: result[0],
        validOutputs: result[1]
    };
}
Asynchronously performs non maximum suppression of bounding boxes based on
iou (intersection over union), with an option to pad results.

@param boxes a 2d tensor of shape `[numBoxes, 4]`. Each entry is
    `[y1, x1, y2, x2]`, where `(y1, x1)` and `(y2, x2)` are the corners of
    the bounding box.
@param scores a 1d tensor providing the box scores of shape `[numBoxes]`.
@param maxOutputSize The maximum number of boxes to be selected.
@param iouThreshold A float representing the threshold for deciding whether
    boxes overlap too much with respect to IOU. Must be between [0, 1].
    Defaults to 0.5 (50% box overlap).
@param scoreThreshold A threshold for deciding when to remove boxes based
    on score. Defaults to -inf, which means any score is accepted.
@param padToMaxOutputSize Defaults to false. If true, size of output
    `selectedIndices` is padded to maxOutputSize.
@return A map with the following properties:
    - selectedIndices: A 1D tensor with the selected box indices.
    - validOutputs: A scalar denoting how many elements in `selectedIndices`
      are valid. Valid elements occur first, then padding.

@doc {heading: 'Operations', subheading: 'Images', namespace: 'image'}