yolov3

package
v0.0.0-...-bac2d7c Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const Grid0 = 19
View Source
const Grid1 = 38
View Source
const Grid2 = 76
View Source
const InputImageSize = 608
View Source
const NumLabels = 80

Variables

View Source
var Anchors = [3][3][2]int{{{116, 90}, {156, 198}, {373, 326}}, {{30, 61}, {62, 45}, {59, 119}}, {{10, 13}, {16, 30}, {33, 23}}}
View Source
var Labels = []string{"person", "bicycle", "car", "motorbike", "aeroplane", "bus", "train", "truck",
	"boat", "traffic", "light", "fire", "hydrant", "stop", "sign", "parking", "meter", "bench", "bird",
	"cat", "dog", "horse", "sheep", "cow", "elephant", "bear", "zebra", "giraffe", "backpack", "umbrella",
	"handbag", "tie", "suitcase", "frisbee", "skis", "snowboard", "sports", "ball", "kite", "baseball", "bat",
	"baseball", "glove", "skateboard", "surfboard", "tennis", "racket", "bottle", "wine", "glass", "cup", "fork",
	"knife", "spoon", "bowl", "banana", "apple", "sandwich", "orange", "broccoli", "carrot", "hot", "dog", "pizza",
	"donut", "cake", "chair", "sofa", "pottedplant", "bed", "diningtable", "toilet", "tvmonitor", "laptop", "mouse",
	"remote", "keyboard", "cell", "phone", "microwave", "oven", "toaster", "sink", "refrigerator", "book", "clock",
	"vase", "scissors", "teddy", "bear", "hair", "drier", "toothbrush"}

Functions

func IOU

func IOU(b1, b2 Box) float32

func Max

func Max(a, b float32) float32

func MaxFloat32

func MaxFloat32(a []float32) float32

func MaxIndexFloat32

func MaxIndexFloat32(a []float32) int

func Min

func Min(a, b float32) float32

Types

type Box

type Box struct {
	X, Y, W, H float32
	Label      int
	Prob       float32
}

func GetBoxes

func GetBoxes(data []float32, grid int, thres, nmsThres float32, anchors [3][2]int) []Box

type InferenceInput

type InferenceInput [InputImageSize * InputImageSize * 3]float32

type InferenceOutput

type InferenceOutput struct {
	Output0 [3 * (NumLabels + 5) * Grid0 * Grid0]float32
	Output1 [3 * (NumLabels + 5) * Grid1 * Grid1]float32
	Output2 [3 * (NumLabels + 5) * Grid2 * Grid2]float32
}

type Yolov3

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

func NewYolov3

func NewYolov3(modelPath string) (a Yolov3, err error)

func (Yolov3) Close

func (a Yolov3) Close() error

func (Yolov3) Inference

func (a Yolov3) Inference(input InferenceInput) (ret InferenceOutput, err error)

func (Yolov3) PostProcess

func (a Yolov3) PostProcess(output InferenceOutput) []Box

func (Yolov3) PreProcess

func (a Yolov3) PreProcess(img image.Image) (ret InferenceInput)

Jump to

Keyboard shortcuts

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