This model is a lightweight facedetection model designed for edge computing devices.
Model | Download | Download (with sample test data) | ONNX version | Opset version |
---|---|---|---|---|
version-RFB-320 | 1.21 MB | 1.92 MB | 1.4 | 9 |
version-RFB-640 | 1.51 MB | 4.59 MB | 1.4 | 9 |
The training set is the VOC format data set generated by using the cleaned widerface labels provided by Retinaface in conjunction with the widerface dataset.
You can find the source code here.
Run demo.py python scripts example.
Input tensor is 1 x 3 x height x width
with mean values 127, 127, 127
and scale factor 1.0 / 128
. Input image have to be previously converted to RGB
format and resized to 320 x 240
pixels for version-RFB-320 model (or 640 x 480
for version-RFB-640 model).
Given a path image_path
to the image you would like to score:
image = cv2.cvtColor(orig_image, cv2.COLOR_BGR2RGB)
image = cv2.resize(image, (320, 240))
image_mean = np.array([127, 127, 127])
image = (image - image_mean) / 128
image = np.transpose(image, [2, 0, 1])
image = np.expand_dims(image, axis=0)
image = image.astype(np.float32)
The model outputs two arrays (1 x 4420 x 2)
and (1 x 4420 x 4)
of scores and boxes.
In postprocessing, threshold filtration and non-max suppression are applied to the scores and boxes arrays.
Valery Asiryan (asiryan)
MIT