Documentation
¶
Index ¶
- type Predictor
- func (p *Predictor) Close()
- func (p *Predictor) DetectFileImage(imgDir, imgName string, padding, maxSideLen int, ...) string
- func (p *Predictor) DetectMemoryImage(imgBuffer []byte, padding, maxSideLen int, ...) string
- func (p *Predictor) InitModels(detPath, clsPath, recPath, keysPath string) bool
- func (p *Predictor) SetNumThread(numOfThread int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Predictor ¶
type Predictor struct {
// contains filtered or unexported fields
}
func (*Predictor) DetectFileImage ¶
func (p *Predictor) DetectFileImage(imgDir, imgName string, padding, maxSideLen int, boxScoreThresh, boxThresh, unClipRatio float32, doAngle, mostAngle bool) string
DetectFileImage 识别文件图片
imgPath 目标图片路径,可以相对路径也可以绝对路径。 imgName 图片的文件名 padding 图像预处理,在图片外周添加白边,用于提升识别率,文字框没有正确框住所有文字时,增加此值。 maxSideLen 按图片最长边的长度,此值为0代表不缩放,例:1024,如果图片长边大于1024则把图像整体缩小到1024再进行图像分割计算,如果图片长边小于1024则不缩放,如果图片长边小于32,则缩放到32。 boxScoreThresh 文字框置信度阈值,文字框没有正确框住所有文字时,减小此值。 boxThresh unClipRatio 单个文字框大小倍率,越大时单个文字框越大。此项与图片的大小相关,越大的图片此值应该越大。 doAngle 启用文字方向检测,只有图片倒置的情况下(旋转90~270度的图片),才需要启用文字方向检测。 mostAngle
func (*Predictor) DetectMemoryImage ¶
func (p *Predictor) DetectMemoryImage(imgBuffer []byte, padding, maxSideLen int, boxScoreThresh, boxThresh, unClipRatio float32, doAngle, mostAngle bool) string
DetectMemoryImage 识别内存图片
func (*Predictor) InitModels ¶
InitModels 初始化模型
detPath dbNet模型文件名(含扩展名) clsPath angleNet模型文件名(含扩展名) recPath crnnNet模型文件名(含扩展名) keysPath keys.txt文件名(含扩展名)
func (*Predictor) SetNumThread ¶
SetNumThread 设置工作线程数
Click to show internal directories.
Click to hide internal directories.