darknet

package module
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

README

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dispose added in v1.3.1

func Dispose() int

func GetDeviceCount added in v1.3.1

func GetDeviceCount() int

func GetDeviceName added in v1.3.1

func GetDeviceName(gpu int, name string) int

func Init added in v1.3.1

func Init(cfg, weights string, gpu int)

Types

type BBOX added in v1.3.1

type BBOX struct {
	Rect          image.Rectangle // (x,y) - top-left corner, (w, h) - width & height of bounded box
	Confidence    float32         // confidence - probability that the object was found correctly
	ObjId         uint            // class of object - from range [0, classes-1]
	TrackId       uint            // tracking id for video (0 - untracked, 1 - inf - tracked object)
	FramesCounter uint            // counter of frames on which the object was detected
	X3d, Y3d, Z3d float32         // center of object (in Meters) if ZED 3D Camera is used
}

func Detect added in v1.3.1

func Detect(name string) (result int, bboxs []BBOX)

func DetectImageMat added in v1.3.1

func DetectImageMat(data []byte) (result int, bboxs []BBOX)

func DetectMat added in v1.3.1

func DetectMat(mat gocv.Mat) (result int, bboxs []BBOX)

type BoundingBox

type BoundingBox struct {
	StartPoint image.Point
	EndPoint   image.Point
}

BoundingBox represents a bounding box.

type DarknetImage

type DarknetImage struct {
	Width  int
	Height int
	// contains filtered or unexported fields
}

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(img image.Image) (*DarknetImage, error)

Image2Float32 Returns []float32 representation of image.Image

func (*DarknetImage) Close

func (img *DarknetImage) Close() error

Close and release resources.

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) Close

func (n *YOLONetwork) Close() error

Close and release resources.

func (*YOLONetwork) Detect

func (n *YOLONetwork) Detect(img *DarknetImage) (*DetectionResult, error)

Detect specified image

func (*YOLONetwork) Init

func (n *YOLONetwork) Init() error

Init the network.

Jump to

Keyboard shortcuts

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