Tensorflow.js tf.image.nonMaxSuppressionAsync() Function Last Updated : 30 Jul, 2021 Comments Improve Suggest changes Like Article Like Report Tensorflow.js is an open-source library developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .image.nonMaxSuppressionAsync() function is used to execute the non maximum suppression of the limiting boxes on the basis of iou i.e. intersection over union. Moreover, its the async interpretation of nonMaxSuppression() method. Syntax: tf.image.nonMaxSuppressionAsync(boxes, scores, maxOutputSize, iouThreshold?, scoreThreshold?) Parameters: boxes: The stated 2d tensor, which is of configuration [numBoxes, 4]. And every access is [y1, x1, y2, x2], allowing that (y1, x1) and (y2, x2) are the edges of the restricting box. It can be of type tf.Tensor2D, TypedArray, or Array.scores: The stated 1d tensor, provided that the box scores is of configuration [numBoxes]. It is of type tf.Tensor2D, TypedArray, or Array.maxOutputSize: It is the maximum count of the stated boxes that is to be picked. It is of type number.iouThreshold: It is the stated float signifying the threshold in order to decide if the stated boxes intersect too much with reference to the IOU. It should be in the midst of [0, 1]. The by default value is 0.5 i.e. 50 percent of the box intersects. It is optional and is of type number.scoreThreshold: It is the stated threshold in order to decide at which time boxes are to be removed on the basis of the stated score. The by default value is -inf, i.e. every single score is allowed. It is optional and is of type number. Return Value: It returns Promise of tf.Tensor1D. Example 1: In this example, we will be going to use a 2d tensor, scores, and maxOutputSize parameters. JavaScript // Importing the tensorflow.js library import * as tf from "@tensorflow/tfjs" // Calling image.nonMaxSuppressionAsync() method const output = await tf.image.nonMaxSuppressionAsync( tf.tensor2d([1, 2, 3, 4, 2, 4, 6, 7], [2, 4]), [1, 1], 4); // Printing output output.print(); Output: Tensor [0, 1] Example 2: In this example, we will be going to use an array of floats, iouThreshold, as well as scoreThreshold. JavaScript // Importing the tensorflow.js library import * as tf from "@tensorflow/tfjs" // Defining an array of floats const arr = [[11.1, 2.3, 7.3, 6.4], [3, 6]] // Calling image.nonMaxSuppressionAsync() method const res = await tf.image.nonMaxSuppressionAsync( arr, [2.1, 0], 100, 0.5, 1); // Printing output res.print(); Output: Tensor [0] Reference: https://js.tensorflow.org/api/latest/#image.nonMaxSuppressionAsync Comment More infoAdvertise with us Next Article Tensorflow.js tf.image.nonMaxSuppressionAsync() Function nidhi1352singh Follow Improve Article Tags : JavaScript Web Technologies Tensorflow.js Similar Reads Tensorflow.js tf.image.nonMaxSuppressionPaddedAsync() Function Tensorflow.js is an open-source library developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .image.nonMaxSuppressionPaddedAsync() function is used to asynchronously execute the non-maximum suppression of the limitin 3 min read Tensorflow.js tf.image.nonMaxSuppression() Function Tensorflow.js is an open-source library developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .image.nonMaxSuppression() function is used to execute the non maximum suppression of the limiting boxes on the basis of io 2 min read Tensorflow.js tf.image.nonMaxSuppressionWithScoreAsync() Function Tensorflow.js is an open-source library developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .image.nonMaxSuppressionWithScoreAsync() function is used to asynchronously execute the non-maximum suppression of the limi 3 min read Tensorflow.js tf.image.nonMaxSuppressionPadded() Function Tensorflow.js is an open-source library developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .image.nonMaxSuppressionPadded() function is used to asynchronously execute the non maximum suppression of the limiting box 3 min read Tensorflow.js tf.image.nonMaxSuppressionWithScore() Function Tensorflow.js is an open-source library developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .image.nonMaxSuppressionWithScore() function is used to execute the non maximum suppression of the limiting boxes on the ba 3 min read Tensorflow.js tf.image.resizeBilinear() Function Tensorflow.js is an open-source library developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .image.resizeBilinear() function is used to bilinearly rescale an individual 3D image or else a heap of 3D images to a diff 3 min read Tensorflow.js tf.image.resizeNearestNeighbor() Function Tensorflow.js is an open-source library developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .image.resizeNearestNeighbor() function is used to rescale a heap of 3D images to a different configuration. Syntax: tf.ima 2 min read Tensorflow.js tf.ready() Function Introduction: Tensorflow.js is an open-source library that is developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .ready() function is used to return a promise which determines at what time the recently picked backe 1 min read Tensorflow.js tf.print() Function Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment. It helps developers to develop ML models in JavaScript, and use ML directly in the browser or in Node.js. The tf.print() function is u 2 min read Tensorflow.js tf.sparseToDense() Function Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment. The tf.sparseToDense() function is used to convert a specified sparse representation into a dense Tensor. If the given indices get rep 2 min read Like