(
contents: Uint8Array, channels = 0, ratio = 1, fancyUpscaling = true,
tryRecoverTruncated = false, acceptableFraction = 1,
dctMethod = '')
| 55 | * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} |
| 56 | */ |
| 57 | export 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`. |
no test coverage detected
searching dependent graphs…