MCPcopy
hub / github.com/tensorflow/tfjs / decodePng

Function decodePng

tfjs-node/src/image.ts:86–95  ·  view source on GitHub ↗
(
    contents: Uint8Array, channels = 0, dtype = 'int32')

Source from the content-addressed store, hash-verified

84 * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'}
85 */
86export function decodePng(
87 contents: Uint8Array, channels = 0, dtype = 'int32'): Tensor3D {
88 util.assert(
89 dtype === 'int32',
90 () => 'decodeImage could only return Tensor of type `int32` for now.');
91 ensureTensorflowBackend();
92 return tidy(() => {
93 return nodeBackend().decodePng(contents, channels).toInt();
94 });
95}
96
97/**
98 * Decode the first frame of a BMP-encoded image to a 3D Tensor of dtype

Callers 1

decodeImageFunction · 0.85

Calls 5

ensureTensorflowBackendFunction · 0.90
tidyFunction · 0.90
nodeBackendFunction · 0.90
toIntMethod · 0.80
decodePngMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…