diff --git a/components/esp_facenet/coefficients/component.mk b/components/esp_facenet/coefficients/component.mk new file mode 100644 index 0000000..588c770 --- /dev/null +++ b/components/esp_facenet/coefficients/component.mk @@ -0,0 +1,21 @@ +#Component makefile + +COMPONENT_ADD_INCLUDEDIRS := . +COMPONENT_SRCDIRS := . + +#Call: $(eval $(call CompileNeuralNetCoefficients,directory,nn_name,flags)) +define CompileNeuralNetCoefficients +COMPONENT_OBJS += $2.o +COMPONENT_EXTRA_CLEAN += $$(COMPILING_COMPONENT_PATH)/$2.c $$(COMPILING_COMPONENT_PATH)/$2.h + +$$(COMPONENT_PATH)/./$2.c: $$(COMPONENT_PATH)/$1/ $$(MKMODEL_PATH)/mkmodel ../include/sdkconfig.h + echo "Running mkmodel for $2, flags \"$3 $4\"" + $$(MKMODEL_PATH)/mkmodel $$(COMPONENT_PATH)/$1 $$(COMPONENT_PATH)/$2.c $$(COMPONENT_PATH)/$2.h $2 $3 $4 + +endef + +MKMODEL_PATH := $(COMPONENT_PATH)/../../lib + +$(eval $(call CompileNeuralNetCoefficients,pnet/model,pnet_model,-no-quantized,-3d)) +$(eval $(call CompileNeuralNetCoefficients,rnet/model,rnet_model,-no-quantized,-3d)) +$(eval $(call CompileNeuralNetCoefficients,onet/model,onet_model,-no-quantized,-3d)) diff --git a/components/esp_facenet/coefficients/onet/model/_MODEL_INFO_ b/components/esp_facenet/coefficients/onet/model/_MODEL_INFO_ new file mode 100644 index 0000000..ece3c66 --- /dev/null +++ b/components/esp_facenet/coefficients/onet/model/_MODEL_INFO_ @@ -0,0 +1,2 @@ +# (neural network type)_(model data version)_(lable1_detection windown length_threshold for 90%_threshold for 95%)_(lable2 ...)_... +pNet_v0_mtcnn_6_0.98_0.96 diff --git a/components/esp_facenet/coefficients/onet/model/onet_l1_bias.npy b/components/esp_facenet/coefficients/onet/model/onet_l1_bias.npy new file mode 100644 index 0000000..3d917b9 Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l1_bias.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l1_compress.npy b/components/esp_facenet/coefficients/onet/model/onet_l1_compress.npy new file mode 100644 index 0000000..0b260d3 Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l1_compress.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l1_depth.npy b/components/esp_facenet/coefficients/onet/model/onet_l1_depth.npy new file mode 100644 index 0000000..ae78f80 Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l1_depth.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l1_prelu_alpha.npy b/components/esp_facenet/coefficients/onet/model/onet_l1_prelu_alpha.npy new file mode 100644 index 0000000..137acde Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l1_prelu_alpha.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l2_bias.npy b/components/esp_facenet/coefficients/onet/model/onet_l2_bias.npy new file mode 100644 index 0000000..4495601 Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l2_bias.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l2_compress.npy b/components/esp_facenet/coefficients/onet/model/onet_l2_compress.npy new file mode 100644 index 0000000..1447850 Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l2_compress.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l2_depth.npy b/components/esp_facenet/coefficients/onet/model/onet_l2_depth.npy new file mode 100644 index 0000000..b2d07da Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l2_depth.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l2_prelu_alpha.npy b/components/esp_facenet/coefficients/onet/model/onet_l2_prelu_alpha.npy new file mode 100644 index 0000000..ea04b79 Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l2_prelu_alpha.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l3_bias.npy b/components/esp_facenet/coefficients/onet/model/onet_l3_bias.npy new file mode 100644 index 0000000..c0e6cb1 Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l3_bias.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l3_compress.npy b/components/esp_facenet/coefficients/onet/model/onet_l3_compress.npy new file mode 100644 index 0000000..3f3d330 Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l3_compress.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l3_depth.npy b/components/esp_facenet/coefficients/onet/model/onet_l3_depth.npy new file mode 100644 index 0000000..7dbc769 Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l3_depth.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l3_prelu_alpha.npy b/components/esp_facenet/coefficients/onet/model/onet_l3_prelu_alpha.npy new file mode 100644 index 0000000..97fd5be Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l3_prelu_alpha.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l4_bias.npy b/components/esp_facenet/coefficients/onet/model/onet_l4_bias.npy new file mode 100644 index 0000000..ca30d49 Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l4_bias.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l4_compress.npy b/components/esp_facenet/coefficients/onet/model/onet_l4_compress.npy new file mode 100644 index 0000000..c49be33 Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l4_compress.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l4_depth.npy b/components/esp_facenet/coefficients/onet/model/onet_l4_depth.npy new file mode 100644 index 0000000..e341444 Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l4_depth.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l4_prelu_alpha.npy b/components/esp_facenet/coefficients/onet/model/onet_l4_prelu_alpha.npy new file mode 100644 index 0000000..5ede6b5 Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l4_prelu_alpha.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l5_bias.npy b/components/esp_facenet/coefficients/onet/model/onet_l5_bias.npy new file mode 100644 index 0000000..9c7c0cd Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l5_bias.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l5_compress.npy b/components/esp_facenet/coefficients/onet/model/onet_l5_compress.npy new file mode 100644 index 0000000..f950337 Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l5_compress.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l5_depth.npy b/components/esp_facenet/coefficients/onet/model/onet_l5_depth.npy new file mode 100644 index 0000000..213694f Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l5_depth.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l5_prelu_alpha.npy b/components/esp_facenet/coefficients/onet/model/onet_l5_prelu_alpha.npy new file mode 100644 index 0000000..60ba91b Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l5_prelu_alpha.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l6_category_bias.npy b/components/esp_facenet/coefficients/onet/model/onet_l6_category_bias.npy new file mode 100644 index 0000000..5f51bf7 Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l6_category_bias.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l6_category_weight.npy b/components/esp_facenet/coefficients/onet/model/onet_l6_category_weight.npy new file mode 100644 index 0000000..0391d34 Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l6_category_weight.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l6_landmark_bias.npy b/components/esp_facenet/coefficients/onet/model/onet_l6_landmark_bias.npy new file mode 100644 index 0000000..64b87d6 Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l6_landmark_bias.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l6_landmark_weight.npy b/components/esp_facenet/coefficients/onet/model/onet_l6_landmark_weight.npy new file mode 100644 index 0000000..53f1528 Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l6_landmark_weight.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l6_offset_bias.npy b/components/esp_facenet/coefficients/onet/model/onet_l6_offset_bias.npy new file mode 100644 index 0000000..fea3648 Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l6_offset_bias.npy differ diff --git a/components/esp_facenet/coefficients/onet/model/onet_l6_offset_weight.npy b/components/esp_facenet/coefficients/onet/model/onet_l6_offset_weight.npy new file mode 100644 index 0000000..1dac7de Binary files /dev/null and b/components/esp_facenet/coefficients/onet/model/onet_l6_offset_weight.npy differ diff --git a/components/esp_facenet/coefficients/pnet/model/_MODEL_INFO_ b/components/esp_facenet/coefficients/pnet/model/_MODEL_INFO_ new file mode 100644 index 0000000..ece3c66 --- /dev/null +++ b/components/esp_facenet/coefficients/pnet/model/_MODEL_INFO_ @@ -0,0 +1,2 @@ +# (neural network type)_(model data version)_(lable1_detection windown length_threshold for 90%_threshold for 95%)_(lable2 ...)_... +pNet_v0_mtcnn_6_0.98_0.96 diff --git a/components/esp_facenet/coefficients/pnet/model/pnet_l1_mn_bias.npy b/components/esp_facenet/coefficients/pnet/model/pnet_l1_mn_bias.npy new file mode 100644 index 0000000..1ae8479 Binary files /dev/null and b/components/esp_facenet/coefficients/pnet/model/pnet_l1_mn_bias.npy differ diff --git a/components/esp_facenet/coefficients/pnet/model/pnet_l1_mn_compress.npy b/components/esp_facenet/coefficients/pnet/model/pnet_l1_mn_compress.npy new file mode 100644 index 0000000..2769d11 Binary files /dev/null and b/components/esp_facenet/coefficients/pnet/model/pnet_l1_mn_compress.npy differ diff --git a/components/esp_facenet/coefficients/pnet/model/pnet_l1_mn_depth.npy b/components/esp_facenet/coefficients/pnet/model/pnet_l1_mn_depth.npy new file mode 100644 index 0000000..4031be5 Binary files /dev/null and b/components/esp_facenet/coefficients/pnet/model/pnet_l1_mn_depth.npy differ diff --git a/components/esp_facenet/coefficients/pnet/model/pnet_l1_mn_depth_active_prelu_alpha.npy b/components/esp_facenet/coefficients/pnet/model/pnet_l1_mn_depth_active_prelu_alpha.npy new file mode 100644 index 0000000..19901e8 Binary files /dev/null and b/components/esp_facenet/coefficients/pnet/model/pnet_l1_mn_depth_active_prelu_alpha.npy differ diff --git a/components/esp_facenet/coefficients/pnet/model/pnet_l2_mn_bias.npy b/components/esp_facenet/coefficients/pnet/model/pnet_l2_mn_bias.npy new file mode 100644 index 0000000..a3231d3 Binary files /dev/null and b/components/esp_facenet/coefficients/pnet/model/pnet_l2_mn_bias.npy differ diff --git a/components/esp_facenet/coefficients/pnet/model/pnet_l2_mn_compress.npy b/components/esp_facenet/coefficients/pnet/model/pnet_l2_mn_compress.npy new file mode 100644 index 0000000..c9313ad Binary files /dev/null and b/components/esp_facenet/coefficients/pnet/model/pnet_l2_mn_compress.npy differ diff --git a/components/esp_facenet/coefficients/pnet/model/pnet_l2_mn_depth.npy b/components/esp_facenet/coefficients/pnet/model/pnet_l2_mn_depth.npy new file mode 100644 index 0000000..a389ceb Binary files /dev/null and b/components/esp_facenet/coefficients/pnet/model/pnet_l2_mn_depth.npy differ diff --git a/components/esp_facenet/coefficients/pnet/model/pnet_l2_mn_depth_active_prelu_alpha.npy b/components/esp_facenet/coefficients/pnet/model/pnet_l2_mn_depth_active_prelu_alpha.npy new file mode 100644 index 0000000..1f150d1 Binary files /dev/null and b/components/esp_facenet/coefficients/pnet/model/pnet_l2_mn_depth_active_prelu_alpha.npy differ diff --git a/components/esp_facenet/coefficients/pnet/model/pnet_l3_mn_bias.npy b/components/esp_facenet/coefficients/pnet/model/pnet_l3_mn_bias.npy new file mode 100644 index 0000000..fa17cb4 Binary files /dev/null and b/components/esp_facenet/coefficients/pnet/model/pnet_l3_mn_bias.npy differ diff --git a/components/esp_facenet/coefficients/pnet/model/pnet_l3_mn_compress.npy b/components/esp_facenet/coefficients/pnet/model/pnet_l3_mn_compress.npy new file mode 100644 index 0000000..a5031dc Binary files /dev/null and b/components/esp_facenet/coefficients/pnet/model/pnet_l3_mn_compress.npy differ diff --git a/components/esp_facenet/coefficients/pnet/model/pnet_l3_mn_depth.npy b/components/esp_facenet/coefficients/pnet/model/pnet_l3_mn_depth.npy new file mode 100644 index 0000000..5df9f3c Binary files /dev/null and b/components/esp_facenet/coefficients/pnet/model/pnet_l3_mn_depth.npy differ diff --git a/components/esp_facenet/coefficients/pnet/model/pnet_l3_mn_depth_active_prelu_alpha.npy b/components/esp_facenet/coefficients/pnet/model/pnet_l3_mn_depth_active_prelu_alpha.npy new file mode 100644 index 0000000..5cc2a97 Binary files /dev/null and b/components/esp_facenet/coefficients/pnet/model/pnet_l3_mn_depth_active_prelu_alpha.npy differ diff --git a/components/esp_facenet/coefficients/pnet/model/pnet_l4_category_cnn_bias.npy b/components/esp_facenet/coefficients/pnet/model/pnet_l4_category_cnn_bias.npy new file mode 100644 index 0000000..6028866 Binary files /dev/null and b/components/esp_facenet/coefficients/pnet/model/pnet_l4_category_cnn_bias.npy differ diff --git a/components/esp_facenet/coefficients/pnet/model/pnet_l4_category_cnn_weight.npy b/components/esp_facenet/coefficients/pnet/model/pnet_l4_category_cnn_weight.npy new file mode 100644 index 0000000..2bee80e Binary files /dev/null and b/components/esp_facenet/coefficients/pnet/model/pnet_l4_category_cnn_weight.npy differ diff --git a/components/esp_facenet/coefficients/pnet/model/pnet_l4_landmark_cnn_bias.npy b/components/esp_facenet/coefficients/pnet/model/pnet_l4_landmark_cnn_bias.npy new file mode 100644 index 0000000..c506d5f Binary files /dev/null and b/components/esp_facenet/coefficients/pnet/model/pnet_l4_landmark_cnn_bias.npy differ diff --git a/components/esp_facenet/coefficients/pnet/model/pnet_l4_landmark_cnn_weight.npy b/components/esp_facenet/coefficients/pnet/model/pnet_l4_landmark_cnn_weight.npy new file mode 100644 index 0000000..3f77836 Binary files /dev/null and b/components/esp_facenet/coefficients/pnet/model/pnet_l4_landmark_cnn_weight.npy differ diff --git a/components/esp_facenet/coefficients/pnet/model/pnet_l4_offset_cnn_bias.npy b/components/esp_facenet/coefficients/pnet/model/pnet_l4_offset_cnn_bias.npy new file mode 100644 index 0000000..022f188 Binary files /dev/null and b/components/esp_facenet/coefficients/pnet/model/pnet_l4_offset_cnn_bias.npy differ diff --git a/components/esp_facenet/coefficients/pnet/model/pnet_l4_offset_cnn_weight.npy b/components/esp_facenet/coefficients/pnet/model/pnet_l4_offset_cnn_weight.npy new file mode 100644 index 0000000..684663f Binary files /dev/null and b/components/esp_facenet/coefficients/pnet/model/pnet_l4_offset_cnn_weight.npy differ diff --git a/components/esp_facenet/coefficients/rnet/model/_MODEL_INFO_ b/components/esp_facenet/coefficients/rnet/model/_MODEL_INFO_ new file mode 100644 index 0000000..ece3c66 --- /dev/null +++ b/components/esp_facenet/coefficients/rnet/model/_MODEL_INFO_ @@ -0,0 +1,2 @@ +# (neural network type)_(model data version)_(lable1_detection windown length_threshold for 90%_threshold for 95%)_(lable2 ...)_... +pNet_v0_mtcnn_6_0.98_0.96 diff --git a/components/esp_facenet/coefficients/rnet/model/rnet_l1_compress.npy b/components/esp_facenet/coefficients/rnet/model/rnet_l1_compress.npy new file mode 100644 index 0000000..0843728 Binary files /dev/null and b/components/esp_facenet/coefficients/rnet/model/rnet_l1_compress.npy differ diff --git a/components/esp_facenet/coefficients/rnet/model/rnet_l1_depth.npy b/components/esp_facenet/coefficients/rnet/model/rnet_l1_depth.npy new file mode 100644 index 0000000..da52c0d Binary files /dev/null and b/components/esp_facenet/coefficients/rnet/model/rnet_l1_depth.npy differ diff --git a/components/esp_facenet/coefficients/rnet/model/rnet_l1_dilate.npy b/components/esp_facenet/coefficients/rnet/model/rnet_l1_dilate.npy new file mode 100644 index 0000000..5a344e5 Binary files /dev/null and b/components/esp_facenet/coefficients/rnet/model/rnet_l1_dilate.npy differ diff --git a/components/esp_facenet/coefficients/rnet/model/rnet_l2_compress.npy b/components/esp_facenet/coefficients/rnet/model/rnet_l2_compress.npy new file mode 100644 index 0000000..fd703d8 Binary files /dev/null and b/components/esp_facenet/coefficients/rnet/model/rnet_l2_compress.npy differ diff --git a/components/esp_facenet/coefficients/rnet/model/rnet_l2_depth.npy b/components/esp_facenet/coefficients/rnet/model/rnet_l2_depth.npy new file mode 100644 index 0000000..455ebab Binary files /dev/null and b/components/esp_facenet/coefficients/rnet/model/rnet_l2_depth.npy differ diff --git a/components/esp_facenet/coefficients/rnet/model/rnet_l2_dilate.npy b/components/esp_facenet/coefficients/rnet/model/rnet_l2_dilate.npy new file mode 100644 index 0000000..7519ebd Binary files /dev/null and b/components/esp_facenet/coefficients/rnet/model/rnet_l2_dilate.npy differ diff --git a/components/esp_facenet/coefficients/rnet/model/rnet_l3_compress.npy b/components/esp_facenet/coefficients/rnet/model/rnet_l3_compress.npy new file mode 100644 index 0000000..b17e77d Binary files /dev/null and b/components/esp_facenet/coefficients/rnet/model/rnet_l3_compress.npy differ diff --git a/components/esp_facenet/coefficients/rnet/model/rnet_l3_depth.npy b/components/esp_facenet/coefficients/rnet/model/rnet_l3_depth.npy new file mode 100644 index 0000000..5af5834 Binary files /dev/null and b/components/esp_facenet/coefficients/rnet/model/rnet_l3_depth.npy differ diff --git a/components/esp_facenet/coefficients/rnet/model/rnet_l3_dilate.npy b/components/esp_facenet/coefficients/rnet/model/rnet_l3_dilate.npy new file mode 100644 index 0000000..8c492df Binary files /dev/null and b/components/esp_facenet/coefficients/rnet/model/rnet_l3_dilate.npy differ diff --git a/components/esp_facenet/coefficients/rnet/model/rnet_l4_compress.npy b/components/esp_facenet/coefficients/rnet/model/rnet_l4_compress.npy new file mode 100644 index 0000000..ef30cea Binary files /dev/null and b/components/esp_facenet/coefficients/rnet/model/rnet_l4_compress.npy differ diff --git a/components/esp_facenet/coefficients/rnet/model/rnet_l4_depth.npy b/components/esp_facenet/coefficients/rnet/model/rnet_l4_depth.npy new file mode 100644 index 0000000..fb82dd1 Binary files /dev/null and b/components/esp_facenet/coefficients/rnet/model/rnet_l4_depth.npy differ diff --git a/components/esp_facenet/coefficients/rnet/model/rnet_l5_category_bias.npy b/components/esp_facenet/coefficients/rnet/model/rnet_l5_category_bias.npy new file mode 100644 index 0000000..080e573 Binary files /dev/null and b/components/esp_facenet/coefficients/rnet/model/rnet_l5_category_bias.npy differ diff --git a/components/esp_facenet/coefficients/rnet/model/rnet_l5_category_weight.npy b/components/esp_facenet/coefficients/rnet/model/rnet_l5_category_weight.npy new file mode 100644 index 0000000..dde36d6 Binary files /dev/null and b/components/esp_facenet/coefficients/rnet/model/rnet_l5_category_weight.npy differ diff --git a/components/esp_facenet/coefficients/rnet/model/rnet_l5_offset_bias.npy b/components/esp_facenet/coefficients/rnet/model/rnet_l5_offset_bias.npy new file mode 100644 index 0000000..1159221 Binary files /dev/null and b/components/esp_facenet/coefficients/rnet/model/rnet_l5_offset_bias.npy differ diff --git a/components/esp_facenet/coefficients/rnet/model/rnet_l5_offset_weight.npy b/components/esp_facenet/coefficients/rnet/model/rnet_l5_offset_weight.npy new file mode 100644 index 0000000..3de2b16 Binary files /dev/null and b/components/esp_facenet/coefficients/rnet/model/rnet_l5_offset_weight.npy differ diff --git a/components/esp_facenet/mtmn/mtmn.c b/components/esp_facenet/mtmn/mtmn.c index 261d421..3ac2efd 100644 --- a/components/esp_facenet/mtmn/mtmn.c +++ b/components/esp_facenet/mtmn/mtmn.c @@ -33,7 +33,8 @@ static int first_time[3] = {0}; mtmn_net_t *pnet (dl_matrix3du_t *in) { #define PNET_LAYER_NUM (3) - static dl_matrix3d_t *filters[PNET_LAYER_NUM * 4] = {0}; +#define PNET_COEF_PER_LAYER (5) + static dl_matrix3d_t *filters[PNET_LAYER_NUM * PNET_COEF_PER_LAYER] = {0}; char name[50]; // Get filters @@ -42,24 +43,26 @@ mtmn_net_t *pnet (dl_matrix3du_t *in) first_time[0] = 1; for (int i = 0; i < PNET_LAYER_NUM; i++) { - sprintf(name, "pnet_l%d_dilate", i+1); - filters[i * 4 + 0] = (dl_matrix3d_t *)get_coeff_pnet_model.getter_3d(name, NULL, 0); - sprintf(name, "pnet_l%d_depth", i+1); - filters[i * 4 + 1] = (dl_matrix3d_t *)get_coeff_pnet_model.getter_3d(name, NULL, 0); - sprintf(name, "pnet_l%d_compress", i+1); - filters[i * 4 + 2] = (dl_matrix3d_t *)get_coeff_pnet_model.getter_3d(name, NULL, 0); - sprintf(name, "pnet_l%d_bias", i+1); - filters[i * 4 + 3] = (dl_matrix3d_t *)get_coeff_pnet_model.getter_3d(name, NULL, 0); + sprintf(name, "pnet_l%d_mn_dilate", i+1); + filters[i * PNET_COEF_PER_LAYER + 0] = (dl_matrix3d_t *)get_coeff_pnet_model.getter_3d(name, NULL, 0); + sprintf(name, "pnet_l%d_mn_depth", i+1); + filters[i * PNET_COEF_PER_LAYER + 1] = (dl_matrix3d_t *)get_coeff_pnet_model.getter_3d(name, NULL, 0); + sprintf(name, "pnet_l%d_mn_compress", i+1); + filters[i * PNET_COEF_PER_LAYER + 2] = (dl_matrix3d_t *)get_coeff_pnet_model.getter_3d(name, NULL, 0); + sprintf(name, "pnet_l%d_mn_bias", i+1); + filters[i * PNET_COEF_PER_LAYER + 3] = (dl_matrix3d_t *)get_coeff_pnet_model.getter_3d(name, NULL, 0); + sprintf(name, "pnet_l%d_mn_depth_active_prelu_alpha", i+1); + filters[i * PNET_COEF_PER_LAYER + 4] = (dl_matrix3d_t *)get_coeff_pnet_model.getter_3d(name, NULL, 0); } } - dl_matrix3d_t **l1_f = &(filters[0]); - dl_matrix3d_t **l2_f = &(filters[4]); - dl_matrix3d_t **l3_f = &(filters[8]); + dl_matrix3d_t **l1_f = &(filters[0 * PNET_COEF_PER_LAYER]); + dl_matrix3d_t **l2_f = &(filters[1 * PNET_COEF_PER_LAYER]); + dl_matrix3d_t **l3_f = &(filters[2 * PNET_COEF_PER_LAYER]); - dl_matrix3d_t *l4_category_conv = (dl_matrix3d_t *)get_coeff_pnet_model.getter_3d("pnet_l4_category_weight", NULL, 0); - dl_matrix3d_t *l4_category_bias = (dl_matrix3d_t *)get_coeff_pnet_model.getter_3d("pnet_l4_category_bias", NULL, 0); - dl_matrix3d_t *l4_offset_conv = (dl_matrix3d_t *)get_coeff_pnet_model.getter_3d("pnet_l4_offset_weight", NULL, 0); - dl_matrix3d_t *l4_offset_bias = (dl_matrix3d_t *)get_coeff_pnet_model.getter_3d("pnet_l4_offset_bias", NULL, 0); + dl_matrix3d_t *l4_category_conv = (dl_matrix3d_t *)get_coeff_pnet_model.getter_3d("pnet_l4_category_cnn_weight", NULL, 0); + dl_matrix3d_t *l4_category_bias = (dl_matrix3d_t *)get_coeff_pnet_model.getter_3d("pnet_l4_category_cnn_bias", NULL, 0); + dl_matrix3d_t *l4_offset_conv = (dl_matrix3d_t *)get_coeff_pnet_model.getter_3d("pnet_l4_offset_cnn_weight", NULL, 0); + dl_matrix3d_t *l4_offset_bias = (dl_matrix3d_t *)get_coeff_pnet_model.getter_3d("pnet_l4_offset_cnn_bias", NULL, 0); // Layer 1 dl_matrix3d_conv_config_t config; @@ -68,16 +71,16 @@ mtmn_net_t *pnet (dl_matrix3du_t *in) config.padding = PADDING_VALID; config.mode = DL_XTENSA_IMPL; config.type = INPUT_UINT8; - dl_matrix3d_t *l1 = dl_matrix3d_mobilenet(in, l1_f[0], l1_f[1], l1_f[2], l1_f[3], NULL, &config); + dl_matrix3d_t *l1 = dl_matrix3d_mobilenet(in, l1_f[0], l1_f[1], l1_f[2], l1_f[3], l1_f[4], &config); // Layer 2 config.stride_x = 1; config.stride_y = 1; config.type = INPUT_FLOAT; - dl_matrix3d_t *l2 = dl_matrix3d_mobilenet(l1, l2_f[0], l2_f[1], l2_f[2], l2_f[3], NULL, &config); + dl_matrix3d_t *l2 = dl_matrix3d_mobilenet(l1, l2_f[0], l2_f[1], l2_f[2], l2_f[3], l2_f[4], &config); // Layer 3 - dl_matrix3d_t *l3 = dl_matrix3d_mobilenet(l2, l3_f[0], l3_f[1], l3_f[2], l3_f[3], NULL, &config); + dl_matrix3d_t *l3 = dl_matrix3d_mobilenet(l2, l3_f[0], l3_f[1], l3_f[2], l3_f[3], l3_f[4], &config); mtmn_net_t *pnet_o = (mtmn_net_t *)calloc(1, sizeof(mtmn_net_t)); // Layer 4 category diff --git a/components/lib/component.mk b/components/lib/component.mk index c777daa..2e2f02f 100644 --- a/components/lib/component.mk +++ b/components/lib/component.mk @@ -2,7 +2,7 @@ COMPONENT_ADD_INCLUDEDIRS := include COMPONENT_SRCDIRS := . -LIBS := coefficients dl_lib +LIBS := dl_lib COMPONENT_ADD_LDFLAGS += -L$(COMPONENT_PATH)/ $(addprefix -l,$(LIBS)) diff --git a/components/lib/include/onet_model.h b/components/lib/include/onet_model.h deleted file mode 100644 index 6a33448..0000000 --- a/components/lib/include/onet_model.h +++ /dev/null @@ -1,7 +0,0 @@ -//Generated by mkmodel -#pragma once -#include -#include "dl_lib_coefgetter_if.h" -#include "dl_lib.h" - -extern const model_coeff_getter_t get_coeff_onet_model; diff --git a/components/lib/include/pnet_model.h b/components/lib/include/pnet_model.h deleted file mode 100644 index 7b63ada..0000000 --- a/components/lib/include/pnet_model.h +++ /dev/null @@ -1,7 +0,0 @@ -//Generated by mkmodel -#pragma once -#include -#include "dl_lib_coefgetter_if.h" -#include "dl_lib.h" - -extern const model_coeff_getter_t get_coeff_pnet_model; diff --git a/components/lib/include/rnet_model.h b/components/lib/include/rnet_model.h deleted file mode 100644 index 17185b2..0000000 --- a/components/lib/include/rnet_model.h +++ /dev/null @@ -1,7 +0,0 @@ -//Generated by mkmodel -#pragma once -#include -#include "dl_lib_coefgetter_if.h" -#include "dl_lib.h" - -extern const model_coeff_getter_t get_coeff_rnet_model; diff --git a/components/lib/libcoefficients.a b/components/lib/libcoefficients.a deleted file mode 100644 index 2c52088..0000000 Binary files a/components/lib/libcoefficients.a and /dev/null differ diff --git a/components/lib/mkmodel b/components/lib/mkmodel new file mode 100755 index 0000000..48310ba Binary files /dev/null and b/components/lib/mkmodel differ