Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrMaxTimeout = fmt.Errorf("max timeout is 1 minute")
)
Functions ¶
This section is empty.
Types ¶
type Configuration ¶ added in v1.3.0
type Configuration struct { ServerConf serverInstanceConfiguration `toml:"server"` YOLOPlates yoloConfiguration `toml:"yolo_plates"` YOLOOCR yoloConfiguration `toml:"yolo_ocr"` }
type Detections ¶
type Detections []*darknet.Detection
Detections slice of image.Rectangle (for sorting)
func (Detections) Len ¶
func (r Detections) Len() int
func (Detections) Less ¶
func (r Detections) Less(i, j int) bool
func (Detections) Swap ¶
func (r Detections) Swap(i, j int)
type LPRQueue ¶ added in v1.3.0
type LPRQueue struct {
// contains filtered or unexported fields
}
LPRQueue is a queue to handle asynchronous requests to neural network
func NewLPRQueue ¶ added in v1.3.0
func NewLPRQueue(network *YOLONetwork, queueLimit int, saveDetected bool) *LPRQueue
func (*LPRQueue) SendToQueue ¶ added in v1.3.0
func (q *LPRQueue) SendToQueue(req *QueueRequest) (*QueueResponse, error)
SendToQueue is wrapper around request and its context
func (*LPRQueue) WaitRequests ¶ added in v1.3.0
func (q *LPRQueue) WaitRequests()
WaitRequests is endless loop for waiting frames
type PlateResponse ¶
type PlateResponse struct { Text string Probability float64 Rect image.Rectangle CroppedNumber *image.NRGBA OCRClassesIDs []int OCRRects []image.Rectangle }
PlateResponse Detected license plate information
func (*PlateResponse) String ¶
func (presp *PlateResponse) String() string
type QueueRequest ¶ added in v1.3.0
QueueRequest is wrapping around image and response channel
func NewQueueRequest ¶ added in v1.3.0
func NewQueueRequest(ctx context.Context, image *image.NRGBA) QueueRequest
type QueueResponse ¶ added in v1.3.0
type QueueResponse struct { Resp *YOLOResponse Error error }
QueueResponse is just response from YOLO
type YOLONetwork ¶
type YOLONetwork struct { LicensePlates *darknet.YOLONetwork OCR *darknet.YOLONetwork }
YOLONetwork Aggregate two neural networks: one is for finding license plates, another is for OCR
func NewYOLONetwork ¶
func NewYOLONetwork(platesCfg, platesWeights, ocrCfg, ocrWeights string, platesThreshold, ocrThreshold float32) (*YOLONetwork, error)
NewYOLONetwork Return pointer to YOLONetwork
func (*YOLONetwork) ReadLicensePlates ¶
func (net *YOLONetwork) ReadLicensePlates(imgSrc image.Image, saveCrop bool) (*YOLOResponse, error)
ReadLicensePlates Returns found license plates with information about each one
type YOLOResponse ¶
type YOLOResponse struct { Plates []PlateResponse Elapsed time.Duration }
YOLOResponse Neural net's response
func (*YOLOResponse) String ¶
func (resp *YOLOResponse) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.