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

Function DecodeBmp

tensorflow/go/op/wrappers.go:33813–33830  ·  view source on GitHub ↗

Decode the first frame of a BMP-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 BMP-encoded image. * 3: output an RGB image. * 4: output an RGBA image. Arg

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

Source from the content-addressed store, hash-verified

33811//
33812// Returns 3-D with shape `[height, width, channels]`. RGB order
33813func DecodeBmp(scope *Scope, contents tf.Output, optional ...DecodeBmpAttr) (image tf.Output) {
33814 if scope.Err() != nil {
33815 return
33816 }
33817 attrs := map[string]interface{}{}
33818 for _, a := range optional {
33819 a(attrs)
33820 }
33821 opspec := tf.OpSpec{
33822 Type: "DecodeBmp",
33823 Input: []tf.Input{
33824 contents,
33825 },
33826 Attrs: attrs,
33827 }
33828 op := scope.AddOperation(opspec)
33829 return op.Output(0)
33830}
33831
33832// Computes natural logarithm of x element-wise.
33833//

Callers 1

ReadTensorFromImageFileFunction · 0.85

Calls 4

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

Tested by

no test coverage detected