Skip to content

Latest commit

 

History

History
 
 

ultraface

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Ultra-lightweight face detection model

Description

This model is a lightweight facedetection model designed for edge computing devices.

Model

Model Download ONNX version Opset version
version-RFB-320 1.21 MB 1.4 9
version-RFB-640 1.51 MB 1.4 9

Dataset

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.

Source

You can find the source code here.

Demo

Run demo.py python scripts example.

Inference

Input

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

Preprocessing

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)

Output

The model outputs two arrays (1 x 4420 x 2) and (1 x 4420 x 4) of scores and boxes.

Postprocessing

In postprocessing, threshold filtration and non-max suppression are applied to the scores and boxes arrays.

Contributors

Valery Asiryan (asiryan)

License

MIT