This repository is an implementation of this article.
It is a toy to run face detection on a picture with a neural network.
Installation an usage
- Go with modules support,
- Git LFS. It's needed in order to get the file model.onnx when cloning the repo. If you don’t have this, running will fail with an error: proto: can’t skip unknown wire type 6
git clone https://github.com/owulveryck/gofaces cd gofaces git lfs install git lfs fetch git lfs checkout model/model.onnx cd cmd go run main.go -h
Package gofaces is a set of functions to handle the input and output of a Tint YOLO v2 model.
const ( // HSize is the height of the input picture HSize = 416 // WSize is the width of the input picture WSize = 416 )
This section is empty.
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)
func ProcessOutput ¶
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.