ocr

package
v0.0.0-...-d62c078 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadImage

func ReadImage(image_path string) gocv.Mat

func ReadYaml

func ReadYaml(yamlPath string) (map[string]interface{}, error)

Types

type ClsResult

type ClsResult struct {
	Score float32
	Label int64
}

type DBDetector

type DBDetector struct {
	*PaddleModel
	// contains filtered or unexported fields
}

func NewDBDetector

func NewDBDetector(modelDir string, args map[string]interface{}) *DBDetector

func (*DBDetector) Run

func (det *DBDetector) Run(img gocv.Mat) [][][]int

type DBPostProcess

type DBPostProcess struct {
	// contains filtered or unexported fields
}

func NewDBPostProcess

func NewDBPostProcess(thresh, boxThresh, unClipRatio float64) *DBPostProcess

func (*DBPostProcess) Run

func (d *DBPostProcess) Run(output *paddle.ZeroCopyTensor, oriH, oriW int, ratioH, ratioW float64) [][][]int

type DBPreProcess

type DBPreProcess struct {
	// contains filtered or unexported fields
}

func NewDBProcess

func NewDBProcess(shape []int, sideLen int) *DBPreProcess

func (*DBPreProcess) Run

func (d *DBPreProcess) Run(img gocv.Mat) ([]float32, int, int)

type DetPostProcess

type DetPostProcess interface {
	Run(output *paddle.ZeroCopyTensor, oriH, oriW int, ratioH, ratioW float64) [][][]int
}

type DetPreProcess

type DetPreProcess interface {
	Run(gocv.Mat) ([]float32, int, int)
}

type OCRSystem

type OCRSystem struct {
	// contains filtered or unexported fields
}

func NewOCRSystem

func NewOCRSystem(confFile string, a map[string]interface{}) *OCRSystem

func (*OCRSystem) PredictDirImages

func (ocr *OCRSystem) PredictDirImages(dirname string) map[string][]OCRText

func (*OCRSystem) PredictOneImage

func (ocr *OCRSystem) PredictOneImage(img gocv.Mat) []OCRText

func (*OCRSystem) StartServer

func (ocr *OCRSystem) StartServer(port string)

type OCRText

type OCRText struct {
	BBox  [][]int `json:"bbox"`
	Text  string  `json:"text"`
	Score float64 `json:"score"`
}

type PaddleModel

type PaddleModel struct {
	// contains filtered or unexported fields
}

func NewPaddleModel

func NewPaddleModel(args map[string]interface{}) *PaddleModel

func (*PaddleModel) LoadModel

func (model *PaddleModel) LoadModel(modelDir string)

type TextClassifier

type TextClassifier struct {
	*PaddleModel
	// contains filtered or unexported fields
}

func NewTextClassifier

func NewTextClassifier(modelDir string, args map[string]interface{}) *TextClassifier

func (*TextClassifier) Run

func (cls *TextClassifier) Run(imgs []gocv.Mat) []gocv.Mat

type TextPredictSystem

type TextPredictSystem struct {
	// contains filtered or unexported fields
}

func NewTextPredictSystem

func NewTextPredictSystem(args map[string]interface{}) *TextPredictSystem

func (*TextPredictSystem) Run

func (sys *TextPredictSystem) Run(img gocv.Mat) []OCRText

type TextRecognizer

type TextRecognizer struct {
	*PaddleModel
	// contains filtered or unexported fields
}

func NewTextRecognizer

func NewTextRecognizer(modelDir string, args map[string]interface{}) *TextRecognizer

func (*TextRecognizer) Run

func (rec *TextRecognizer) Run(imgs []gocv.Mat, bboxes [][][]int) []OCRText

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL