本文整理汇总了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`);
}
};