本文整理匯總了TypeScript中@tensorflow/tfjs-core.image.nonMaxSuppressionAsync方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript image.nonMaxSuppressionAsync方法的具體用法?TypeScript image.nonMaxSuppressionAsync怎麽用?TypeScript image.nonMaxSuppressionAsync使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@tensorflow/tfjs-core.image
的用法示例。
在下文中一共展示了image.nonMaxSuppressionAsync方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: async
export let executeOp: OpExecutor = async(
node: Node, tensorMap: NamedTensorsMap,
context: ExecutionContext): Promise<tfc.Tensor[]> => {
switch (node.op) {
case 'nonMaxSuppression': {
const boxes =
getParamValue('boxes', node, tensorMap, context) as tfc.Tensor;
const scores =
getParamValue('scores', node, tensorMap, context) as tfc.Tensor;
const maxOutputSize =
getParamValue('maxOutputSize', node, tensorMap, context) as number;
const iouThreshold =
getParamValue('iouThreshold', node, tensorMap, context) as number;
const scoreThreshold =
getParamValue('scoreThreshold', node, tensorMap, context) as number;
return [await tfc.image.nonMaxSuppressionAsync(
boxes as tfc.Tensor2D, scores as tfc.Tensor1D, maxOutputSize,
iouThreshold, scoreThreshold)];
}
case 'whereAsync': {
return [await tfc.whereAsync(
getParamValue('condition', node, tensorMap, context) as tfc.Tensor)];
}
default:
throw TypeError(`Node type ${node.op} is not implemented`);
}
};