MCPcopy Index your code
hub / github.com/tensorflow/tfjs / decodeJpeg

Function decodeJpeg

tfjs-node/src/image.ts:57–69  ·  view source on GitHub ↗
(
    contents: Uint8Array, channels = 0, ratio = 1, fancyUpscaling = true,
    tryRecoverTruncated = false, acceptableFraction = 1,
    dctMethod = '')

Source from the content-addressed store, hash-verified

55 * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'}
56 */
57export function decodeJpeg(
58 contents: Uint8Array, channels = 0, ratio = 1, fancyUpscaling = true,
59 tryRecoverTruncated = false, acceptableFraction = 1,
60 dctMethod = ''): Tensor3D {
61 ensureTensorflowBackend();
62 return tidy(() => {
63 return nodeBackend()
64 .decodeJpeg(
65 contents, channels, ratio, fancyUpscaling, tryRecoverTruncated,
66 acceptableFraction, dctMethod)
67 .toInt();
68 });
69}
70
71/**
72 * Decode a PNG-encoded image to a 3D Tensor of dtype `int32`.

Callers 1

decodeImageFunction · 0.70

Calls 5

ensureTensorflowBackendFunction · 0.90
tidyFunction · 0.90
nodeBackendFunction · 0.90
toIntMethod · 0.80
decodeJpegMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…