| Chip | MFN_S8_V1 | MBF_S8_V1 |
|---|---|---|
| ESP32-S3 | ||
| ESP32-P4 |
| name | input(hwc) | preprocess(ms) | model(ms) | postprocess(ms) |
|---|---|---|---|---|
| mfn_s8_v1_s3 | 112 * 112 * 3 | 5.6 | 248.8 | 0.1 |
| mfn_s8_v1_p4 | 112 * 112 * 3 | 2.9 | 93.0 | 0.1 |
| mbf_s8_v1_s3 | 112 * 112 * 3 | 5.6 | 1072.4 | 0.1 |
| mbf_s8_v1_p4 | 112 * 112 * 3 | 2.9 | 188.2 | 0.1 |
| Model | Params(M) | GFLOPs | TAR@FAR=1E-4 on IJB-C(%) |
|---|---|---|---|
| mfn_s8_v1 | 1.2 | 0.46 | 90.03 |
| mbf_s8_v1 | 3.4 | 0.90 | 93.94 |
HumanFaceFeat accepts a HumanFaceFeat::model_type_t parameter. It has a default value determined by default model option in menuconfig.
HumanFaceFeat *feat = new HumanFaceFeat();// use MFN_S8_V1
HumanFaceFeat *feat = new HumanFaceFeat(HumanFaceFeat::MFN_S8_V1);
// use MBF_S8_V1
// HumanFaceFeat *feat = new HumanFaceFeat(HumanFaceFeat::MBF_S8_V1);Note
If multiple models is flashed or stored in sdcard, in addition to the default model, you can pass an explicit parameter to HumanFaceFeat to use one of them.
See Kconfig.
- CONFIG_FLASH_HUMAN_FACE_FEAT_MFN_S8_V1
- CONFIG_FLASH_HUMAN_FACE_FEAT_MBF_S8_V1
Whether to flash the model when model location is set to FLASH rodata or FLASH partition.
- CONFIG_HUMAN_FACE_FEAT_MFN_S8_V1
- CONFIG_HUMAN_FACE_FEAT_MBF_S8_V1
Default model to use if no parameter is passed to HumanFaceFeat.
- CONFIG_HUMAN_FACE_FEAT_MODEL_IN_FLASH_RODATA
- CONFIG_HUMAN_FACE_FEAT_MODEL_IN_FLASH_PARTITION
- CONFIG_HUMAN_FACE_FEAT_MODEL_IN_SDCARD
This component supports to load model from three different locations.
Note
If model location is set to FLASH partition, partition.csv must contain a partition named human_face_feat, and the partition should be big enough to hold the model file.
- CONFIG_HUMAN_FACE_FEAT_MODEL_SDCARD_DIR
When model locates in sdcard, you can change the model directory relative to the sdcard mount point.
The default value of this option is models/s3 for ESP32S3 and models/p4 for ESP32P4.
When using default value, just copy models folder to sdcard root directory.
Note
Do not change the model name when copy the models to sdcard.
This component also contains HumanFaceRecognizer. It's a integration of HumanFaceFeat and dl::recognition::DataBase. If you want to enroll/recognize a human face, in addition to HumanFaceRecognizer, you also need HumanFaceDetect. See How to New HumanFaceDetect.
HumanFaceRecognizer *human_face_recognizer = new HumanFaceRecognizer("path/to/database");dl::image::img_t img = {.data=DATA, .width=WIDTH, .height=HEIGHT, .pix_type=PIX_TYPE};
human_face_recognizer->enroll(img, human_face_detect->run(img));More details, see dl::image::img_t.
dl::image::img_t img = {.data=DATA, .width=WIDTH, .height=HEIGHT, .pix_type=PIX_TYPE};
std::vector<dl::recognition::result_t> res = human_face_recognizer->recognize(img, human_face_detect->run(img));More details, see dl::image::img_t and dl::recognition::result_t.
human_face_recognizer->clear_all_feats();human_face_recognizer->delete_last_feat();human_face_recognizer->delete_feat(index);