`import "github.com/owulveryck/gofaces"`

Package gofaces is a set of functions to handle the input and output of a Tint YOLO v2 model.

- Constants
- func GetTensorFromImage(r io.Reader) (tensor.Tensor, error)
- type Box
- func ProcessOutput(dense *tensor.Dense) ([]Box, error)
- func Sanitize(boxes []Box) []Box
- func (b Box) String() string
- type Element

app.go config.go doc.go geometry.go image.go io.go math.go sort.go structure.go

❖

const ( // HSize is the height of the input picture HSize = 416 // WSize is the width of the input picture WSize = 416 )

GetTensorFromImage reads an image from r and returns a tensor suitable to run in tiny yolo. The tensor is BWHC and is normalized; its shape is (1,wSize,hSize,3)

❖

type Box struct { R image.Rectangle Confidence float64 // The confidence the model has that there is at least one element in this box Elements []Element // contains filtered or unexported fields }

Box is holding a bounding box A bunding box is a rectangle R containing an object with Confidence. The object is one of the Elements (most likely the one with the highest probability)

ProcessOutput analyze the tensor dense and output the bouding boxes filled with the predictions

Sanitize the output from https://medium.com/@jonathan_hui/real-time-object-detection-with-yolo-yolov2-28b1b93e2088

- Sort the predictions by the confidence scores.

- Start from the top scores, ignore any current prediction if we find any previous predictions that have the same class and IoU > 0.5 with the current prediction.

- Repeat step 2 until all predictions are checked.

Element in a box

Path | Synopsis |
---|---|

cmd | |

draw |

Package gofaces imports 13 packages (graph) and is imported by 2 packages. Updated 2019-08-26. Refresh now. Tools for package owners.