Documentation
¶
Index ¶
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 ImageNRGBA2Float32 ¶ added in v1.3.8
func ImageNRGBA2Float32(img *image.NRGBA) (*DarknetImage, error)
ImageNRGBA2Float32 converts *image.NRGBA directly to darknet image without intermediate RGBA allocation.
func ImageRGBA2Float32 ¶ added in v1.3.7
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) InitFromDefinedCfg ¶ added in v1.3.8
func (n *YOLONetwork) InitFromDefinedCfg() error
EXPERIMENTAL By default AlexeyAB's Darknet doesn't export any functions in darknet.h to give ability to create network from scratch via code. So I can't modify `parse_network_cfg_custom` to load `list *sections = read_cfg(filename);` from memory. So, the point of this method is to be able create network configuration via Golang and then pass it to `C.load_network` This code is portable for Windows/Linux/MacOS. See the ref.: https://github.com/edsrzf/mmap-go#mmap-go
Source Files
¶
Click to show internal directories.
Click to hide internal directories.