Skip to content

Commit 232adb9

Browse files
committed
Add tensor for Ultra-Light-Fast-Generic-Face-Detector without post processing
Ref: https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB/
1 parent b3d0fc4 commit 232adb9

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed

tensor-id-register.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
|classification-generic-out | [details](/tensors/classification-generic-out.md) |
1010
|classification-generic-softmaxed-out | [details](/tensors/classification-generic-softmaxed-out.md) |
1111
|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) |
12+
|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) |
1213
|yolo-v8-pose-out | [details](/tensors/yolo-v8-pose-out.md) |
1314
|yolo-v8-segmentation-out-detections | [details](/tensors/yolo-v8-segmentation-out-detections.md) |
1415
|yolo-v8-segmentation-out-protos | [details](/tensors/yolo-v8-segmentation-out-protos.md) |
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Classification
2+
3+
- tensor-group: no
4+
- layer-type: output
5+
- use-case: face-detection
6+
7+
# Description
8+
Location of faces detected
9+
10+
## Boxes Tensor
11+
12+
- tensor-shape: 1 x COUNT x 4
13+
- tensor-datatype: float32
14+
- tensor-id: ultra-lightweight-face-detection-rfb-320-v1-variant-1-out-boxes-without-postproc
15+
16+
### Encoding
17+
18+
Scheme: (top left X, top left Y, width, height)
19+
20+
The COUNT is variable and depends on the model training.
21+
22+
Other constants are extracted from the training process:
23+
- CENTER_VARIANCE = 0.1
24+
- SIZE_VARIANCE = 0.2
25+
- COUNT
26+
27+
The COUNT can be retrieved from the tensor dimensions.
28+
29+
Each entry in the table is the variance on the matching anchor which
30+
is also defined at training time. Each anchor is defined as the
31+
following tuple:
32+
`(anchor-center-x, anchor-center-y, anchor-width anchor-height)`
33+
34+
Once the following formulas have been applied, the bounding boxes
35+
center is calculated along with its size.
36+
37+
```
38+
bounding-box-center-x = top-left-x * CENTER_VARIANCE * anchor-width + anchor-center-x
39+
bounding-box-center-y = top-left-y * CENTER_VARIANCE * anchor-height + anchor-center-y
40+
bounding-box-width = expf (width * SIZE_VARIANCE) * anchor-width
41+
bounding-box-height = expf (height * SIZE_VARIANCE) * anchor-height
42+
```
43+
44+
|box-1 | box-1 | box-1 | box-1 | box-2 | box-2 | box-2 | box-2 | ... | COUNT|COUNT|COUNT|COUNT|
45+
|--- |--- |--- |--- |--- |--- |--- |--- |--- |--- |--- |--- |--- |
46+
| top-left-X | top-left-Y | width | height | top-left-X | top-left-Y | width | height | ... top-left-X | top-left-Y | width | height |
47+
48+
Memory layout of tensor data:
49+
50+
|Index |Value |
51+
|--- |--- |
52+
| - | - |
53+
|0 |top-left-x |
54+
|1 |top-left-y |
55+
|2 |width |
56+
|3 |height |
57+
|4 |top-left-x |
58+
|5 |top-left-y |
59+
|6 |width |
60+
|7 |height |
61+
|... | ... |
62+
|(COUNT - 1) x 4 |top-left-x |
63+
|(COUNT - 1) x 4 + 1 |top-left-y |
64+
|(COUNT - 1) x 4 + 2 |width |
65+
|(COUNT - 1) x 4 + 3 |height |
66+
67+
68+
69+
# Models
70+
71+
* [Model source](https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB/tree/master)
72+
* [ONNX pre-trained model](https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB/tree/master/models/)
73+
74+
# Tensor Decoders
75+
|Framework | Links |
76+
|--- |--- |
77+
|GStreamer | [perm](https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/main/subprojects/gst-plugins-bad/gst/tensordecoders/gstfacedetectortensordecoder.c) |
78+

0 commit comments

Comments
 (0)