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