MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / EncodePng

Function EncodePng

tensorflow/go/op/wrappers.go:41481–41498  ·  view source on GitHub ↗

PNG-encode an image. `image` is a 3-D uint8 or uint16 Tensor of shape `[height, width, channels]` where `channels` is: * 1: for grayscale. * 2: for grayscale + alpha. * 3: for RGB. * 4: for RGBA. The ZLIB compression level, `compression`, can be -1 for the PNG-encoder default or a value f

(scope *Scope, image tf.Output, optional ...EncodePngAttr)

Source from the content-addressed store, hash-verified

41479//
41480// Returns 0-D. PNG-encoded image.
41481func EncodePng(scope *Scope, image tf.Output, optional ...EncodePngAttr) (contents tf.Output) {
41482 if scope.Err() != nil {
41483 return
41484 }
41485 attrs := map[string]interface{}{}
41486 for _, a := range optional {
41487 a(attrs)
41488 }
41489 opspec := tf.OpSpec{
41490 Type: "EncodePng",
41491 Input: []tf.Input{
41492 image,
41493 },
41494 Attrs: attrs,
41495 }
41496 op := scope.AddOperation(opspec)
41497 return op.Output(0)
41498}
41499
41500// Decode the frame(s) of a GIF-encoded image to a uint8 tensor.
41501//

Callers 2

SaveImageFunction · 0.85
WavToSpectrogramFunction · 0.85

Calls 4

aClass · 0.85
ErrMethod · 0.45
AddOperationMethod · 0.45
OutputMethod · 0.45

Tested by 1

WavToSpectrogramFunction · 0.68