Class: ObjectDetection

SuperMap.ObjectDetection

目标检测类。

new SuperMap.ObjectDetection()

common/thirdparty/ai/ObjectDetection.js, line 5

Extends

Members

backendObject

模型分析方式( cpu 或 webgl)。

imagePixelData ImageData HTMLImageElement HTMLCanvasElement HTMLVideoElement ImageBitmap

图片对象

modelUrlstring

模型地址

Methods

inherited _loadModel(modelUrl){Promise.<tf.GraphModel>}

common/thirdparty/ai/MachineLearningBase.js, line 38

加载模型

Name Type Description
modelUrl string

模型地址。

Returns:
Type Description
Promise.<tf.GraphModel>

inherited dispose()

common/thirdparty/ai/MachineLearningBase.js, line 88

释放内存

getIntervalFromArray(array, interval, start){array}

common/thirdparty/ai/ObjectDetection.js, line 175
Name Type Description
array array

数组。

interval number

取值的间隔。

start number

取值的起始位置。

Returns:
Type Description
array 返回被间隔取值后的数组

handleInputParams(image, width, height, dtype){Object}

common/thirdparty/ai/ObjectDetection.js, line 191

处理输入张量

Name Type Description
image PixelData | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap

图片对象。

width number

图片宽度。

height number

图片高度。

dtype string

数据类型。

Returns:
Type Description
Object
  • 输入处理后的张量

handleResult(prediction){Object}

common/thirdparty/ai/LandcoverClassification.js, line 15

对模型进行预测

Name Type Description
prediction Object

模型预测后的张量。

Returns:
Type Description
Object 处理返回的数据

handleResult(result){Object}

common/thirdparty/ai/ObjectDetection.js, line 35

对预测数据进行处理

Name Type Description
result object

预测后的数据。

Returns:
Type Description
Object 处理返回的数据

nms(bbox, scores){array}

common/thirdparty/ai/ObjectDetection.js, line 163
Name Type Description
bbox array

包围框数据。

scores array

模型得分数据。

Returns:
Type Description
array 返回去重后的包围框数据

predict(){Object}

common/thirdparty/ai/ObjectDetection.js, line 16

对模型进行预测

Returns:
Type Description
Object 预测后的数据