Documentation ¶
Index ¶
- type BoundingBox
- type DarknetImage
- type Detection
- type DetectionResult
- type YOLONetwork
- func (n *YOLONetwork) Close() error
- func (n *YOLONetwork) Detect(img *DarknetImage) (*DetectionResult, error)
- func (n *YOLONetwork) DetectAndLabelOnJpeg(jpgBytes *pb.JpgBytes, outputCh *chan *pb.JpgBytes)
- func (n *YOLONetwork) DrawDetectionResult(img image.Image, dr *DetectionResult, nowTs int64) image.Image
- func (n *YOLONetwork) Init() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoundingBox ¶
BoundingBox represents a bounding box.
type DarknetImage ¶
DarknetImage represents the image buffer.
func Float32ToDarknetImage ¶
func Float32ToDarknetImage(flatten []float32, width, height int) (*DarknetImage, error)
Float32ToDarknetImage Converts []float32 to darknet image
func Image2Float32 ¶
func Image2Float32(src image.Image) (*DarknetImage, error)
func ImageRGBA2Float32 ¶
func ImageRGBA2Float32(img *image.RGBA) (*DarknetImage, error)
Image2Float32 Returns []float32 representation of image.Image
type Detection ¶
type Detection struct { BoundingBox ClassIDs []int ClassNames []string Probabilities []float32 }
Detection represents a detection.
type DetectionResult ¶
type DetectionResult struct { Detections []*Detection NetworkOnlyTimeTaken time.Duration OverallTimeTaken time.Duration }
DetectionResult represents the inference results from the network.
type YOLONetwork ¶
type YOLONetwork struct { GPUDeviceIndex int NetworkConfigurationFile string WeightsFile string Threshold float32 ClassNames []string Classes int // contains filtered or unexported fields }
YOLONetwork represents a neural network using YOLO.
func (*YOLONetwork) Detect ¶
func (n *YOLONetwork) Detect(img *DarknetImage) (*DetectionResult, error)
Detect specified image
func (*YOLONetwork) DetectAndLabelOnJpeg ¶
func (n *YOLONetwork) DetectAndLabelOnJpeg(jpgBytes *pb.JpgBytes, outputCh *chan *pb.JpgBytes)
func (*YOLONetwork) DrawDetectionResult ¶
func (n *YOLONetwork) DrawDetectionResult(img image.Image, dr *DetectionResult, nowTs int64) image.Image
Draw detected results
Click to show internal directories.
Click to hide internal directories.