diff --git a/tensor-groups/ultra-lightweight-face-detection-rfb-320-v1-without-postproc-out.md b/tensor-groups/ultra-lightweight-face-detection-rfb-320-v1-without-postproc-out.md new file mode 100644 index 0000000..2a30b5a --- /dev/null +++ b/tensor-groups/ultra-lightweight-face-detection-rfb-320-v1-without-postproc-out.md @@ -0,0 +1,52 @@ +# Classification +- tensor-group: yes +- layer-type: output +- use-case: face-detection + +# Description + +A specialized model that detects faces + +Ultra-Light-Fast-Generic-Face-Detector Output Tensors: + +| Name |shape | +|--- |--- | +| [boxes] |1 x COUNT x 4 | +| [scores] |1 x COUNT x 2 | + +Where COUNT is a value selected at training time. + +# Tensor Decoding Logic + +``` +Foreach i in count: + X = boxes_processed(i, 0) + Y = boxes_processed(i, 1) + W = boxes_processed(i, 2) + H = boxes_processed(i, 3) + S = scores[i][1] + If S > threshold: + detection_candidates[j++] = [X, Y, W, H, S] +detections = non_max_suppression(detection_candidates) + +``` + +Where X, Y, W and H are values between 0 and 1. The boxes have been processed +from the anchors. + +# External References +* https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB + +# Models +* [Model source](https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB/tree/master) +* [ONNX pre-trained model](https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB/tree/master/models/) + +# Tensor Decoders +|Framework | Links | +|--- |--- | +|GStreamer | [perm](https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/main/subprojects/gst-plugins-bad/gst/tensordecoders/gstfacedetectortensordecoder.c) | + + +[boxes]: /tensors/ultra-lightweight-face-detection-rfb-320-v1-variant-1-out-boxes-without-postproc.md +[scores]: /tensors/ultra-lightweight-face-detection-rfb-320-v1-variant-1-out-scores.md + diff --git a/tensor-id-register.md b/tensor-id-register.md index c5e663a..e4f0a57 100644 --- a/tensor-id-register.md +++ b/tensor-id-register.md @@ -9,6 +9,7 @@ |classification-generic-out | [details](/tensors/classification-generic-out.md) | |classification-generic-softmaxed-out | [details](/tensors/classification-generic-softmaxed-out.md) | |ultra-lightweight-face-detection-rfb-320-v1-variant-1-out-scores | [details](/tensors/ultra-lightweight-face-detection-rfb-320-v1-variant-1-out-scores.md) | +|ultra-lightweight-face-detection-rfb-320-v1-variant-1-out-boxes-without-postproc | [details](/tensors/ultra-lightweight-face-detection-rfb-320-v1-variant-1-out-boxes-without-postproc.md) | |yolo-v8-pose-out | [details](/tensors/yolo-v8-pose-out.md) | |yolo-v8-segmentation-out-detections | [details](/tensors/yolo-v8-segmentation-out-detections.md) | |yolo-v8-segmentation-out-protos | [details](/tensors/yolo-v8-segmentation-out-protos.md) | @@ -19,4 +20,5 @@ |--- |--- | |ssd-mobilenet-v1-variant-1-out | [details](/tensor-groups/ssd-mobilenet-v1-variant-1-out.md) | |ultra-lightweight-face-detection-rfb-320-v1-variant-1-out | [details](/tensor-groups/ultra-lightweight-face-detection-rfb-320-v1-variant-1-out.md) | +|ultra-lightweight-face-detection-rfb-320-v1-without-postproc-out | [details](/tensor-groups/ultra-lightweight-face-detection-rfb-320-v1-without-postproc-out.md) | |yolo-v8-segmentation-out | [details](/tensor-groups/yolo-v8-segmentation-out.md) | diff --git a/tensors/ssd-mobilenet-v1-variant-1-out-boxes.md b/tensors/ssd-mobilenet-v1-variant-1-out-boxes.md index 070f79e..b210ae8 100644 --- a/tensors/ssd-mobilenet-v1-variant-1-out-boxes.md +++ b/tensors/ssd-mobilenet-v1-variant-1-out-boxes.md @@ -5,6 +5,8 @@ - use-case: object-detection - part-of-tensor-groups: - [ssd-mobilenet-v1-variant-1-out](/tensor-groups/ssd-mobilenet-v1-variant-1-out.md) + - [ultra-lightweight-face-detection-rfb-320-v1-variant-1-out](/tensor-groups/ultra-lightweight-face-detection-rfb-320-v1-variant-1-out.md) + # Description Location of objects detected diff --git a/tensors/ultra-lightweight-face-detection-rfb-320-v1-variant-1-out-boxes-without-postproc.md b/tensors/ultra-lightweight-face-detection-rfb-320-v1-variant-1-out-boxes-without-postproc.md new file mode 100644 index 0000000..6521675 --- /dev/null +++ b/tensors/ultra-lightweight-face-detection-rfb-320-v1-variant-1-out-boxes-without-postproc.md @@ -0,0 +1,80 @@ +# Classification + +- tensor-group: no +- layer-type: output +- use-case: face-detection +- part-of-tensor-groups: + - [ultra-lightweight-face-detection-rfb-320-v1-without-postproc-out](/tensor-groups/ultra-lightweight-face-detection-rfb-320-v1-without-postproc-out.md) + +# Description +Location of faces detected + +## Boxes Tensor + +- tensor-shape: 1 x COUNT x 4 +- tensor-datatype: float32 +- tensor-id: ultra-lightweight-face-detection-rfb-320-v1-variant-1-out-boxes-without-postproc + +### Encoding + +Scheme: (top left X, top left Y, width, height) + +The COUNT is variable and depends on the model training. + +Other constants are extracted from the training process: +- CENTER_VARIANCE = 0.1 +- SIZE_VARIANCE = 0.2 +- COUNT + +The COUNT can be retrieved from the tensor dimensions. + +Each entry in the table is the variance on the matching anchor which +is also defined at training time. Each anchor is defined as the +following tuple: +`(anchor-center-x, anchor-center-y, anchor-width anchor-height)` + +Once the following formulas have been applied, the bounding boxes +center is calculated along with its size. + +``` +bounding-box-center-x = top-left-x * CENTER_VARIANCE * anchor-width + anchor-center-x +bounding-box-center-y = top-left-y * CENTER_VARIANCE * anchor-height + anchor-center-y +bounding-box-width = expf (width * SIZE_VARIANCE) * anchor-width +bounding-box-height = expf (height * SIZE_VARIANCE) * anchor-height +``` + +|box-1 | box-1 | box-1 | box-1 | box-2 | box-2 | box-2 | box-2 | ... | COUNT|COUNT|COUNT|COUNT| +|--- |--- |--- |--- |--- |--- |--- |--- |--- |--- |--- |--- |--- | +| top-left-X | top-left-Y | width | height | top-left-X | top-left-Y | width | height | ... top-left-X | top-left-Y | width | height | + +Memory layout of tensor data: + +|Index |Value | +|--- |--- | +| - | - | +|0 |top-left-x | +|1 |top-left-y | +|2 |width | +|3 |height | +|4 |top-left-x | +|5 |top-left-y | +|6 |width | +|7 |height | +|... | ... | +|(COUNT - 1) x 4 |top-left-x | +|(COUNT - 1) x 4 + 1 |top-left-y | +|(COUNT - 1) x 4 + 2 |width | +|(COUNT - 1) x 4 + 3 |height | + + + +# Models + +* [Model source](https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB/tree/master) +* [ONNX pre-trained model](https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB/tree/master/models/) + +# Tensor Decoders +|Framework | Links | +|--- |--- | +|GStreamer | [perm](https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/main/subprojects/gst-plugins-bad/gst/tensordecoders/gstfacedetectortensordecoder.c) | + diff --git a/tensors/ultra-lightweight-face-detection-rfb-320-v1-variant-1-out-scores.md b/tensors/ultra-lightweight-face-detection-rfb-320-v1-variant-1-out-scores.md index f82abff..8405d35 100644 --- a/tensors/ultra-lightweight-face-detection-rfb-320-v1-variant-1-out-scores.md +++ b/tensors/ultra-lightweight-face-detection-rfb-320-v1-variant-1-out-scores.md @@ -5,6 +5,7 @@ - use-case: face-detection - part-of-tensor-groups: - [ultra-lightweight-face-detection-rfb-320-v1-variant-1-out](/tensor-groups/ultra-lightweight-face-detection-rfb-320-v1-variant-1-out.md) + - [ultra-lightweight-face-detection-rfb-320-v1-without-postproc-out](/tensor-groups/ultra-lightweight-face-detection-rfb-320-v1-without-postproc-out.md) # Description