Documentation ¶
Index ¶
- func ColorFormatBGR(r, g, b float32) (first, second, third float32)
- func ColorFormatRGB(r, g, b float32) (first, second, third float32)
- func DestroyEnvironment() error
- func InitOnnxRuntime(libPath string)
- type Classifier
- type ColorFormatFunc
- type CoreMLConfig
- type CudaConfig
- type DirectMLConfig
- type LabelProb
- type ModelConfig
- type OpenVINOConfig
- type Output
- type OutputConfig
- type PreprocessConfig
- type ProcessFloatImageFunc
- type ProcessImageFunc
- type SessionConfig
- type Shape
- type TensorRTConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColorFormatBGR ¶
func ColorFormatRGB ¶
func DestroyEnvironment ¶
func DestroyEnvironment() error
func InitOnnxRuntime ¶
func InitOnnxRuntime(libPath string)
Types ¶
type Classifier ¶
type Classifier struct {
// contains filtered or unexported fields
}
func NewClassifier ¶
func NewClassifier(modelConf *ModelConfig, preprocessConf *PreprocessConfig, sessionConf *SessionConfig) (*Classifier, error)
func (*Classifier) Close ¶
func (c *Classifier) Close()
type ColorFormatFunc ¶
type CoreMLConfig ¶
type CoreMLConfig struct { Enabled bool //https://github.com/microsoft/onnxruntime/blob/291a5352b27ded5714e5748b381f2efb88f28fb9/include/onnxruntime/core/providers/coreml/coreml_provider_factory.h#L12 Flags uint32 }
type CudaConfig ¶
type CudaConfig struct { Enabled bool // https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#configuration-options Options map[string]string }
type DirectMLConfig ¶
type ModelConfig ¶
type ModelConfig struct { ModelPath string InputName string Outputs []OutputConfig Shape Shape }
type OpenVINOConfig ¶
type OpenVINOConfig struct { Enabled bool //https://onnxruntime.ai/docs/execution-providers/OpenVINO-ExecutionProvider.html#summary-of-options Options map[string]string }
type OutputConfig ¶
type PreprocessConfig ¶
type PreprocessConfig struct { ColorFormatFunc ColorFormatFunc ProcessImageFuncs []ProcessImageFunc ProcessFloatImageFuncs []ProcessFloatImageFunc }
type ProcessFloatImageFunc ¶
func Normalize ¶
func Normalize(mean, std float32) ProcessFloatImageFunc
func Rescale ¶
func Rescale() ProcessFloatImageFunc
type ProcessImageFunc ¶
func ResizeImage ¶
func ResizeImage(size int, interp resize.InterpolationFunction) ProcessImageFunc
func ResizeWithPadding ¶
func ResizeWithPadding(size int, padColor color.Color, interp resize.InterpolationFunction) ProcessImageFunc
type SessionConfig ¶
type SessionConfig struct { Cuda CudaConfig TensortRT TensorRTConfig CoreML CoreMLConfig DirectML DirectMLConfig CpuMemArena *bool MemPattern *bool InterOpNumThreads int IntraOpNumThreads int }
type Shape ¶
type TensorRTConfig ¶
type TensorRTConfig struct { Enabled bool // https://onnxruntime.ai/docs/execution-providers/TensorRT-ExecutionProvider.html#execution-provider-options Options map[string]string }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.