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

Function DecodeJpeg

tensorflow/go/op/wrappers.go:31176–31193  ·  view source on GitHub ↗

Decode a JPEG-encoded image to a uint8 tensor. The attr `channels` indicates the desired number of color channels for the decoded image. Accepted values are: * 0: Use the number of channels in the JPEG-encoded image. * 1: output a grayscale image. * 3: output an RGB image. If needed, the J

(scope *Scope, contents tf.Output, optional ...DecodeJpegAttr)

Source from the content-addressed store, hash-verified

31174//
31175// Returns 3-D with shape `[height, width, channels]`..
31176func DecodeJpeg(scope *Scope, contents tf.Output, optional ...DecodeJpegAttr) (image tf.Output) {
31177 if scope.Err() != nil {
31178 return
31179 }
31180 attrs := map[string]interface{}{}
31181 for _, a := range optional {
31182 a(attrs)
31183 }
31184 opspec := tf.OpSpec{
31185 Type: "DecodeJpeg",
31186 Input: []tf.Input{
31187 contents,
31188 },
31189 Attrs: attrs,
31190 }
31191 op := scope.AddOperation(opspec)
31192 return op.Output(0)
31193}
31194
31195// AudioSpectrogramAttr is an optional argument to AudioSpectrogram.
31196type AudioSpectrogramAttr func(optionalAttr)

Callers 3

ComputeMethod · 0.85
ReadTensorFromImageFileFunction · 0.85
ReadTensorFromImageFileFunction · 0.85

Calls 4

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

Tested by

no test coverage detected