Chip | MFN_S8_V1 | MBF_S8_V1 |
---|---|---|
ESP32-S3 | ||
ESP32-P4 |
name | input(hwc) | preprocess(us) | model(us) | postprocess(us) |
---|---|---|---|---|
mfn_s8_v1_s3 | 112 * 112 * 3 | 8380 | 248803 | 80 |
mfn_s8_v1_p4 | 112 * 112 * 3 | 5198 | 93003 | 51 |
mbf_s8_v1_s3 | 112 * 112 * 3 | 8386 | 1072427 | 81 |
mbf_s8_v1_p4 | 112 * 112 * 3 | 5197 | 188221 | 52 |
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
Cpp
HumanFaceFeat *feat = new HumanFaceFeat();
Cpp
// 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 mutiple 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.
Whether to flash the model when model location is set to FLASH rodata or FLASH partition.
Default model to use if no parameter is passed to HumanFaceFeat
.
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.
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.
Cpp
HumanFaceRecognizer *human_face_recognizer = new HumanFaceRecognizer("path/to/database");
Cpp
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
.
Cpp
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
.
Cpp
human_face_recognizer->clear_all_feats();
Cpp
human_face_recognizer->delete_last_feat();
Cpp
human_face_recognizer->delete_feat(index);
7f50fd4259d4220f8bd043995a4ac61c8a0035e3
idf.py add-dependency "espressif/human_face_recognition^0.2.3~2"