Documentation
¶
Index ¶
Constants ¶
View Source
const ( MeanG = 0.456 MeanB = 0.406 MeanR = 0.485 StdG = 0.224 StdB = 0.225 StdR = 0.229 )
均值和方差常量
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// 必填参数
OnnxRuntimeLibPath string // onnxruntime.dll (或 .so, .dylib) 的路径
EncodeModelPath string // 图片特征提取模型
DecodeModelPath string // Mask解码模型
// 可选参数
UseCuda bool // (可选) 是否启用 CUDA
NumThreads int // (可选) ONNX 线程数, 默认由CPU核心数决定
EnableCpuMemArena bool // (可选) 是否开启 ONNX 内存池
}
Config 配置项
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine 持有 ONNX Session,负责创建 ImageContext
func (*Engine) EncodeImage ¶
func (e *Engine) EncodeImage(img image.Image) (*ImageContext, error)
EncodeImage 图像特征提取
type ImageContext ¶
type ImageContext struct {
// contains filtered or unexported fields
}
ImageContext 包含特定图像的特征缓存和参数
Click to show internal directories.
Click to hide internal directories.