(
contents: Uint8Array, channels: number, ratio: number,
fancyUpscaling: boolean, tryRecoverTruncated: boolean,
acceptableFraction: number, dctMethod: string)
| 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 = |
no test coverage detected