MCPcopy
hub / github.com/tensorflow/tfjs-models / predict

Method predict

deeplab/src/index.ts:127–132  ·  view source on GitHub ↗

* Segments an arbitrary image and generates a two-dimensional tensor with * class labels assigned to each cell of the grid overlayed on the image ( the * maximum number of cells on the side is fixed to 513). * * @param input :: * `ImageData|HTMLImageElement|HTMLCanvasElement|HTMLV

(input: DeepLabInput)

Source from the content-addressed store, hash-verified

125 * The segmentation map of the image
126 */
127 public predict(input: DeepLabInput): tf.Tensor2D {
128 return tf.tidy(() => {
129 const data = tf.cast(toInputTensor(input), 'int32');
130 return tf.squeeze(this.model.execute(data) as tf.Tensor);
131 });
132 }
133
134 /**
135 * Segments an arbitrary image and generates a two-dimensional tensor with

Callers 15

segmentMethod · 0.95
spectrogramCallbackMethod · 0.45
warmUpModelMethod · 0.45
recognizeMethod · 0.45
evaluateMethod · 0.45
predictFunction · 0.45
estimateMultiplePosesMethod · 0.45
estimateSinglePoseMethod · 0.45
estimateDepthMethod · 0.45

Calls 1

toInputTensorFunction · 0.90

Tested by

no test coverage detected