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

Method decodeJpeg

tfjs-node/src/nodejs_kernel_backend.ts:338–364  ·  view source on GitHub ↗
(
      contents: Uint8Array, channels: number, ratio: number,
      fancyUpscaling: boolean, tryRecoverTruncated: boolean,
      acceptableFraction: number, dctMethod: string)

Source from the content-addressed store, hash-verified

336 }
337
338 decodeJpeg(
339 contents: Uint8Array, channels: number, ratio: number,
340 fancyUpscaling: boolean, tryRecoverTruncated: boolean,
341 acceptableFraction: number, dctMethod: string): Tensor3D {
342 const opAttrs = [
343 {name: 'channels', type: this.binding.TF_ATTR_INT, value: channels},
344 {name: 'ratio', type: this.binding.TF_ATTR_INT, value: ratio}, {
345 name: 'fancy_upscaling',
346 type: this.binding.TF_ATTR_BOOL,
347 value: fancyUpscaling
348 },
349 {
350 name: 'try_recover_truncated',
351 type: this.binding.TF_ATTR_BOOL,
352 value: tryRecoverTruncated
353 },
354 {
355 name: 'acceptable_fraction',
356 type: this.binding.TF_ATTR_FLOAT,
357 value: acceptableFraction
358 },
359 {name: 'dct_method', type: this.binding.TF_ATTR_STRING, value: dctMethod}
360 ];
361 const inputArgs = [scalar(contents, 'string')];
362 return this.executeSingleOutput('DecodeJpeg', opAttrs, inputArgs) as
363 Tensor<Rank.R3>;
364 }
365
366 decodePng(contents: Uint8Array, channels: number): Tensor3D {
367 const opAttrs =

Callers 3

image_test.tsFile · 0.80
decodeJpegFunction · 0.80

Calls 2

executeSingleOutputMethod · 0.95
scalarFunction · 0.90

Tested by

no test coverage detected