├── .clang-format
├── .github
└── workflows
│ ├── github_workflows_issue_comment.yml
│ ├── github_workflows_new_issues.yml
│ ├── github_workflows_new_prs.yml
│ └── upload_component.yml
├── .gitignore
├── .gitlab-ci.yml
├── .gitlab
├── ci
│ ├── build.yml
│ ├── danger.yml
│ ├── deploy.yml
│ ├── gen_test_cases.yml
│ ├── pre_check.yml
│ ├── rules.yml
│ └── target_test.yml
└── tool
│ ├── check_readme_links.py
│ ├── push_to_github.sh
│ └── utils.sh
├── .pre-commit-config.yaml
├── LICENSE
├── README.md
├── README_cn.md
├── conftest.py
├── docs
├── README.md
├── _static
│ ├── api-guides.png
│ ├── api-reference.png
│ ├── architecture_cn.drawio.svg
│ ├── architecture_en.drawio.svg
│ ├── doc_latest.svg
│ ├── docs_version.js
│ ├── get-started.png
│ └── tensor_3d_sequence.svg
├── check_lang_folder_sync.sh
├── conf_common.py
├── doxygen-known-warnings.txt
├── doxygen
│ └── Doxyfile
├── en
│ ├── api_reference
│ │ ├── flatbuffers_api.rst
│ │ ├── index.rst
│ │ ├── model_api.rst
│ │ ├── module_api.rst
│ │ └── tensor_api.rst
│ ├── conf.py
│ ├── getting_started
│ │ └── readme.rst
│ ├── index.rst
│ ├── introduction
│ │ ├── esp_dl_project.rst
│ │ ├── index.rst
│ │ └── readme.rst
│ └── tutorials
│ │ ├── how_to_add_a_new_module(operator).rst
│ │ ├── how_to_deploy_mobilenetv2.rst
│ │ ├── how_to_deploy_streaming_model.rst
│ │ ├── how_to_deploy_yolo11n-pose.rst
│ │ ├── how_to_deploy_yolo11n.rst
│ │ ├── how_to_load_test_profile_model.rst
│ │ ├── how_to_quantize_model.rst
│ │ ├── how_to_run_model.rst
│ │ └── index.rst
├── requirements.txt
└── zh_CN
│ ├── api_reference
│ ├── flatbuffers_api.rst
│ ├── index.rst
│ ├── model_api.rst
│ ├── module_api.rst
│ └── tensor_api.rst
│ ├── conf.py
│ ├── getting_started
│ └── readme.rst
│ ├── index.rst
│ ├── introduction
│ ├── esp_dl_project.rst
│ ├── index.rst
│ └── readme.rst
│ └── tutorials
│ ├── how_to_add_a_new_module(operator).rst
│ ├── how_to_deploy_mobilenetv2.rst
│ ├── how_to_deploy_streaming_model.rst
│ ├── how_to_deploy_yolo11n-pose.rst
│ ├── how_to_deploy_yolo11n.rst
│ ├── how_to_load_test_profile_model.rst
│ ├── how_to_quantize_model.rst
│ ├── how_to_run_model.rst
│ └── index.rst
├── esp-dl
├── CMakeLists.txt
├── LICENSE
├── README.md
├── dl
│ ├── base
│ │ ├── dl_base.hpp
│ │ ├── dl_base_activate_buffer.hpp
│ │ ├── dl_base_activate_output.hpp
│ │ ├── dl_base_add.cpp
│ │ ├── dl_base_add.hpp
│ │ ├── dl_base_add2d.cpp
│ │ ├── dl_base_add2d.hpp
│ │ ├── dl_base_and.cpp
│ │ ├── dl_base_and.hpp
│ │ ├── dl_base_avg_pool2d.cpp
│ │ ├── dl_base_avg_pool2d.hpp
│ │ ├── dl_base_conv2d.cpp
│ │ ├── dl_base_conv2d.hpp
│ │ ├── dl_base_depthwise_conv2d.cpp
│ │ ├── dl_base_depthwise_conv2d.hpp
│ │ ├── dl_base_div.cpp
│ │ ├── dl_base_div.hpp
│ │ ├── dl_base_elemwise.cpp
│ │ ├── dl_base_elemwise.hpp
│ │ ├── dl_base_equal.cpp
│ │ ├── dl_base_equal.hpp
│ │ ├── dl_base_greater.cpp
│ │ ├── dl_base_greater.hpp
│ │ ├── dl_base_greaterorequal.cpp
│ │ ├── dl_base_greaterorequal.hpp
│ │ ├── dl_base_leakyrelu.cpp
│ │ ├── dl_base_leakyrelu.hpp
│ │ ├── dl_base_less.cpp
│ │ ├── dl_base_less.hpp
│ │ ├── dl_base_lessorequal.cpp
│ │ ├── dl_base_lessorequal.hpp
│ │ ├── dl_base_max.cpp
│ │ ├── dl_base_max.hpp
│ │ ├── dl_base_max2d.cpp
│ │ ├── dl_base_max2d.hpp
│ │ ├── dl_base_max_pool2d.cpp
│ │ ├── dl_base_max_pool2d.hpp
│ │ ├── dl_base_min.cpp
│ │ ├── dl_base_min.hpp
│ │ ├── dl_base_min2d.cpp
│ │ ├── dl_base_min2d.hpp
│ │ ├── dl_base_mul.cpp
│ │ ├── dl_base_mul.hpp
│ │ ├── dl_base_mul2d.cpp
│ │ ├── dl_base_mul2d.hpp
│ │ ├── dl_base_or.cpp
│ │ ├── dl_base_or.hpp
│ │ ├── dl_base_pad.cpp
│ │ ├── dl_base_pad.hpp
│ │ ├── dl_base_pool2d.hpp
│ │ ├── dl_base_prelu.cpp
│ │ ├── dl_base_prelu.hpp
│ │ ├── dl_base_relu.cpp
│ │ ├── dl_base_relu.hpp
│ │ ├── dl_base_requantize_linear.cpp
│ │ ├── dl_base_requantize_linear.hpp
│ │ ├── dl_base_resize.cpp
│ │ ├── dl_base_resize.hpp
│ │ ├── dl_base_shape.cpp
│ │ ├── dl_base_shape.hpp
│ │ ├── dl_base_sub.cpp
│ │ ├── dl_base_sub.hpp
│ │ ├── dl_base_sub2d.cpp
│ │ ├── dl_base_sub2d.hpp
│ │ ├── dl_base_xor.cpp
│ │ ├── dl_base_xor.hpp
│ │ └── isa
│ │ │ ├── dl_base_isa.hpp
│ │ │ ├── esp32p4
│ │ │ ├── dl_esp32p4_common.S
│ │ │ ├── dl_esp32p4_prelu.S
│ │ │ ├── dl_esp32p4_s16.S
│ │ │ ├── dl_esp32p4_s16_add.S
│ │ │ ├── dl_esp32p4_s16_add2d.S
│ │ │ ├── dl_esp32p4_s16_and4d.S
│ │ │ ├── dl_esp32p4_s16_conv2d.S
│ │ │ ├── dl_esp32p4_s16_depthwise_conv2d.S
│ │ │ ├── dl_esp32p4_s16_equal.S
│ │ │ ├── dl_esp32p4_s16_greater.S
│ │ │ ├── dl_esp32p4_s16_greaterorequal.S
│ │ │ ├── dl_esp32p4_s16_less.S
│ │ │ ├── dl_esp32p4_s16_lessorequal.S
│ │ │ ├── dl_esp32p4_s16_max4d.S
│ │ │ ├── dl_esp32p4_s16_min4d.S
│ │ │ ├── dl_esp32p4_s16_mul.S
│ │ │ ├── dl_esp32p4_s16_mul2d.S
│ │ │ ├── dl_esp32p4_s16_not4d.S
│ │ │ ├── dl_esp32p4_s16_or4d.S
│ │ │ ├── dl_esp32p4_s16_requantize_linear.S
│ │ │ ├── dl_esp32p4_s16_sub.S
│ │ │ ├── dl_esp32p4_s16_unaligned_conv2d.S
│ │ │ ├── dl_esp32p4_s16_unaligned_depthwise_conv2d.S
│ │ │ ├── dl_esp32p4_s16_xor4d.S
│ │ │ ├── dl_esp32p4_s8.S
│ │ │ ├── dl_esp32p4_s8_add.S
│ │ │ ├── dl_esp32p4_s8_add2d.S
│ │ │ ├── dl_esp32p4_s8_and4d.S
│ │ │ ├── dl_esp32p4_s8_avg_pool2d.S
│ │ │ ├── dl_esp32p4_s8_conv2d.S
│ │ │ ├── dl_esp32p4_s8_depthwise_conv2d.S
│ │ │ ├── dl_esp32p4_s8_equal.S
│ │ │ ├── dl_esp32p4_s8_greater.S
│ │ │ ├── dl_esp32p4_s8_greaterorequal.S
│ │ │ ├── dl_esp32p4_s8_less.S
│ │ │ ├── dl_esp32p4_s8_lessorequal.S
│ │ │ ├── dl_esp32p4_s8_max4d.S
│ │ │ ├── dl_esp32p4_s8_max_pool2d.S
│ │ │ ├── dl_esp32p4_s8_min4d.S
│ │ │ ├── dl_esp32p4_s8_mul.S
│ │ │ ├── dl_esp32p4_s8_mul2d.S
│ │ │ ├── dl_esp32p4_s8_not4d.S
│ │ │ ├── dl_esp32p4_s8_or4d.S
│ │ │ ├── dl_esp32p4_s8_requantize_linear.S
│ │ │ ├── dl_esp32p4_s8_resize.S
│ │ │ ├── dl_esp32p4_s8_sub.S
│ │ │ ├── dl_esp32p4_s8_unaligned_conv2d.S
│ │ │ ├── dl_esp32p4_s8_unaligned_depthwise_conv2d.S
│ │ │ └── dl_esp32p4_s8_xor4d.S
│ │ │ ├── tie728
│ │ │ ├── dl_tie728_s16.S
│ │ │ ├── dl_tie728_s16_add.S
│ │ │ ├── dl_tie728_s16_add2d.S
│ │ │ ├── dl_tie728_s16_avg_pool2d.S
│ │ │ ├── dl_tie728_s16_conv2d.S
│ │ │ ├── dl_tie728_s16_depthwise_conv2d_block.S
│ │ │ ├── dl_tie728_s16_equal.S
│ │ │ ├── dl_tie728_s16_greater.S
│ │ │ ├── dl_tie728_s16_greaterorequal.S
│ │ │ ├── dl_tie728_s16_less.S
│ │ │ ├── dl_tie728_s16_lessorequal.S
│ │ │ ├── dl_tie728_s16_max2d.S
│ │ │ ├── dl_tie728_s16_max_pool2d.S
│ │ │ ├── dl_tie728_s16_min2d.S
│ │ │ ├── dl_tie728_s16_mul.S
│ │ │ ├── dl_tie728_s16_mul2d.S
│ │ │ ├── dl_tie728_s16_prelu.S
│ │ │ ├── dl_tie728_s16_relu.S
│ │ │ ├── dl_tie728_s16_requantize_linear.S
│ │ │ ├── dl_tie728_s16_sub.S
│ │ │ ├── dl_tie728_s16_sub2d.S
│ │ │ ├── dl_tie728_s16_unaligned.S
│ │ │ ├── dl_tie728_s16_unaligned_conv2d.S
│ │ │ ├── dl_tie728_s16_unaligned_depthwise_conv2d.S
│ │ │ ├── dl_tie728_s8.S
│ │ │ ├── dl_tie728_s8_add.S
│ │ │ ├── dl_tie728_s8_add2d.S
│ │ │ ├── dl_tie728_s8_avg_pool2d.S
│ │ │ ├── dl_tie728_s8_conv2d.S
│ │ │ ├── dl_tie728_s8_depthwise_conv2d.S
│ │ │ ├── dl_tie728_s8_equal.S
│ │ │ ├── dl_tie728_s8_greater.S
│ │ │ ├── dl_tie728_s8_greaterorequal.S
│ │ │ ├── dl_tie728_s8_less.S
│ │ │ ├── dl_tie728_s8_lessorequal.S
│ │ │ ├── dl_tie728_s8_max2d.S
│ │ │ ├── dl_tie728_s8_max_pool2d.S
│ │ │ ├── dl_tie728_s8_min2d.S
│ │ │ ├── dl_tie728_s8_mul.S
│ │ │ ├── dl_tie728_s8_mul2d.S
│ │ │ ├── dl_tie728_s8_prelu.S
│ │ │ ├── dl_tie728_s8_relu.S
│ │ │ ├── dl_tie728_s8_requantize_linear.S
│ │ │ ├── dl_tie728_s8_resize.S
│ │ │ ├── dl_tie728_s8_sub.S
│ │ │ └── dl_tie728_s8_sub2d.S
│ │ │ └── xtensa
│ │ │ └── dl_xtensa_s16_block.S
│ ├── dl_define.hpp
│ ├── dl_define_private.hpp
│ ├── math
│ │ ├── include
│ │ │ ├── dl_math.hpp
│ │ │ └── dl_math_matrix.hpp
│ │ └── src
│ │ │ ├── dl_math.cpp
│ │ │ └── dl_math_matrix.cpp
│ ├── model
│ │ ├── include
│ │ │ ├── dl_memory_manager.hpp
│ │ │ ├── dl_memory_manager_greedy.hpp
│ │ │ ├── dl_model_base.hpp
│ │ │ └── dl_model_context.hpp
│ │ └── src
│ │ │ ├── dl_memory_manager.cpp
│ │ │ ├── dl_memory_manager_greedy.cpp
│ │ │ ├── dl_model_base.cpp
│ │ │ └── dl_model_context.cpp
│ ├── module
│ │ ├── include
│ │ │ ├── dl_module_add.hpp
│ │ │ ├── dl_module_and.hpp
│ │ │ ├── dl_module_average_pool.hpp
│ │ │ ├── dl_module_base.hpp
│ │ │ ├── dl_module_clip.hpp
│ │ │ ├── dl_module_concat.hpp
│ │ │ ├── dl_module_conv.hpp
│ │ │ ├── dl_module_creator.hpp
│ │ │ ├── dl_module_div.hpp
│ │ │ ├── dl_module_elu.hpp
│ │ │ ├── dl_module_equal.hpp
│ │ │ ├── dl_module_exp.hpp
│ │ │ ├── dl_module_flatten.hpp
│ │ │ ├── dl_module_gather.hpp
│ │ │ ├── dl_module_gemm.hpp
│ │ │ ├── dl_module_global_average_pool.hpp
│ │ │ ├── dl_module_greater.hpp
│ │ │ ├── dl_module_greater_or_equal.hpp
│ │ │ ├── dl_module_hard_sigmoid.hpp
│ │ │ ├── dl_module_hard_swish.hpp
│ │ │ ├── dl_module_identity.hpp
│ │ │ ├── dl_module_leaky_relu.hpp
│ │ │ ├── dl_module_less.hpp
│ │ │ ├── dl_module_less_or_equal.hpp
│ │ │ ├── dl_module_log.hpp
│ │ │ ├── dl_module_lut.hpp
│ │ │ ├── dl_module_matmul.hpp
│ │ │ ├── dl_module_max.hpp
│ │ │ ├── dl_module_max_pool.hpp
│ │ │ ├── dl_module_min.hpp
│ │ │ ├── dl_module_mul.hpp
│ │ │ ├── dl_module_not.hpp
│ │ │ ├── dl_module_or.hpp
│ │ │ ├── dl_module_pad.hpp
│ │ │ ├── dl_module_prelu.hpp
│ │ │ ├── dl_module_relu.hpp
│ │ │ ├── dl_module_requantize_linear.hpp
│ │ │ ├── dl_module_reshape.hpp
│ │ │ ├── dl_module_resize.hpp
│ │ │ ├── dl_module_reverse_sequence.hpp
│ │ │ ├── dl_module_sigmoid.hpp
│ │ │ ├── dl_module_slice.hpp
│ │ │ ├── dl_module_softmax.hpp
│ │ │ ├── dl_module_split.hpp
│ │ │ ├── dl_module_sqrt.hpp
│ │ │ ├── dl_module_squeeze.hpp
│ │ │ ├── dl_module_sub.hpp
│ │ │ ├── dl_module_tanh.hpp
│ │ │ ├── dl_module_transpose.hpp
│ │ │ ├── dl_module_unsqueeze.hpp
│ │ │ └── dl_module_xor.hpp
│ │ └── src
│ │ │ └── dl_module_base.cpp
│ ├── tensor
│ │ ├── include
│ │ │ └── dl_tensor_base.hpp
│ │ └── src
│ │ │ └── dl_tensor_base.cpp
│ └── tool
│ │ ├── include
│ │ ├── dl_esp32p4_cache_reg.hpp
│ │ ├── dl_tool.hpp
│ │ └── dl_tool_cache.hpp
│ │ ├── isa
│ │ ├── esp32p4
│ │ │ ├── dl_esp32p4_memcpy.S
│ │ │ └── dl_esp32p4_round.S
│ │ ├── tie728
│ │ │ ├── dl_tie728_bzero.S
│ │ │ ├── dl_tie728_memcpy.S
│ │ │ └── dl_tie728_memset.S
│ │ └── xtensa
│ │ │ └── dl_xtensa_bzero.S
│ │ └── src
│ │ ├── dl_tool.cpp
│ │ └── dl_tool_cache.cpp
├── fbs_loader
│ ├── cmake
│ │ ├── data_file_embed_asm_aligned.cmake
│ │ └── utilities.cmake
│ ├── include
│ │ ├── fbs_loader.hpp
│ │ └── fbs_model.hpp
│ ├── lib
│ │ ├── esp32p4
│ │ │ └── libfbs_model.a
│ │ └── esp32s3
│ │ │ └── libfbs_model.a
│ ├── pack_espdl_models.py
│ └── src
│ │ └── fbs_loader.cpp
├── idf_component.yml
└── vision
│ ├── classification
│ ├── dl_cls_base.cpp
│ ├── dl_cls_base.hpp
│ ├── dl_cls_define.hpp
│ ├── dl_cls_postprocessor.cpp
│ ├── dl_cls_postprocessor.hpp
│ ├── imagenet_category_name.hpp
│ ├── imagenet_cls_postprocessor.cpp
│ └── imagenet_cls_postprocessor.hpp
│ ├── detect
│ ├── dl_detect_base.cpp
│ ├── dl_detect_base.hpp
│ ├── dl_detect_define.hpp
│ ├── dl_detect_espdet_postprocessor.cpp
│ ├── dl_detect_espdet_postprocessor.hpp
│ ├── dl_detect_mnp_postprocessor.cpp
│ ├── dl_detect_mnp_postprocessor.hpp
│ ├── dl_detect_msr_postprocessor.cpp
│ ├── dl_detect_msr_postprocessor.hpp
│ ├── dl_detect_pico_postprocessor.cpp
│ ├── dl_detect_pico_postprocessor.hpp
│ ├── dl_detect_postprocessor.cpp
│ ├── dl_detect_postprocessor.hpp
│ ├── dl_detect_yolo11_postprocessor.cpp
│ ├── dl_detect_yolo11_postprocessor.hpp
│ ├── dl_pose_yolo11_postprocessor.cpp
│ └── dl_pose_yolo11_postprocessor.hpp
│ ├── image
│ ├── dl_image.hpp
│ ├── dl_image_bmp.cpp
│ ├── dl_image_bmp.hpp
│ ├── dl_image_color.cpp
│ ├── dl_image_color.hpp
│ ├── dl_image_define.hpp
│ ├── dl_image_draw.cpp
│ ├── dl_image_draw.hpp
│ ├── dl_image_jpeg.cpp
│ ├── dl_image_jpeg.hpp
│ ├── dl_image_preprocessor.cpp
│ ├── dl_image_preprocessor.hpp
│ ├── dl_image_process.cpp
│ └── dl_image_process.hpp
│ └── recognition
│ ├── dl_feat_base.cpp
│ ├── dl_feat_base.hpp
│ ├── dl_feat_image_preprocessor.cpp
│ ├── dl_feat_image_preprocessor.hpp
│ ├── dl_feat_postprocessor.cpp
│ ├── dl_feat_postprocessor.hpp
│ ├── dl_recognition_database.cpp
│ ├── dl_recognition_database.hpp
│ └── dl_recognition_define.hpp
├── examples
├── cat_detect
│ ├── CMakeLists.txt
│ ├── README.md
│ ├── img
│ │ ├── cat_fp32.jpg
│ │ ├── cat_n_p4.jpg
│ │ ├── cat_n_s3.jpg
│ │ ├── cat_s_p4.jpg
│ │ └── cat_s_s3.jpg
│ ├── main
│ │ ├── CMakeLists.txt
│ │ ├── app_main.cpp
│ │ ├── cat.jpg
│ │ └── idf_component.yml
│ ├── partitions.csv
│ ├── partitions2.csv
│ ├── sdkconfig.defaults
│ ├── sdkconfig.defaults.esp32p4
│ └── sdkconfig.defaults.esp32s3
├── human_face_detect
│ ├── CMakeLists.txt
│ ├── README.md
│ ├── main
│ │ ├── CMakeLists.txt
│ │ ├── app_main.cpp
│ │ ├── human_face.jpg
│ │ └── idf_component.yml
│ ├── partitions.csv
│ ├── partitions2.csv
│ ├── sdkconfig.defaults
│ ├── sdkconfig.defaults.esp32p4
│ └── sdkconfig.defaults.esp32s3
├── human_face_recognition
│ ├── CMakeLists.txt
│ ├── README.md
│ ├── components
│ │ └── spiflash_fatfs
│ │ │ ├── CMakeLists.txt
│ │ │ ├── Kconfig
│ │ │ ├── spiflash_fatfs.cpp
│ │ │ └── spiflash_fatfs.hpp
│ ├── faces
│ │ ├── bill1.jpg
│ │ ├── bill2.jpg
│ │ ├── musk1.jpg
│ │ └── musk2.jpg
│ ├── main
│ │ ├── CMakeLists.txt
│ │ ├── Kconfig.projbuild
│ │ ├── app_main.cpp
│ │ └── idf_component.yml
│ ├── partitions.csv
│ ├── partitions2.csv
│ ├── sdkconfig.defaults
│ ├── sdkconfig.defaults.esp32p4
│ └── sdkconfig.defaults.esp32s3
├── mobilenetv2_cls
│ ├── CMakeLists.txt
│ ├── README.md
│ ├── main
│ │ ├── CMakeLists.txt
│ │ ├── app_main.cpp
│ │ ├── cat.jpg
│ │ └── idf_component.yml
│ ├── partitions.csv
│ ├── partitions2.csv
│ ├── sdkconfig.defaults
│ ├── sdkconfig.defaults.esp32p4
│ └── sdkconfig.defaults.esp32s3
├── pedestrian_detect
│ ├── CMakeLists.txt
│ ├── README.md
│ ├── main
│ │ ├── CMakeLists.txt
│ │ ├── app_main.cpp
│ │ ├── idf_component.yml
│ │ └── pedestrian.jpg
│ ├── partitions.csv
│ ├── partitions2.csv
│ ├── sdkconfig.defaults
│ ├── sdkconfig.defaults.esp32p4
│ └── sdkconfig.defaults.esp32s3
├── tutorial
│ ├── README.md
│ ├── how_to_load_test_profile_model
│ │ ├── model_in_flash_partition
│ │ │ ├── CMakeLists.txt
│ │ │ ├── main
│ │ │ │ ├── CMakeLists.txt
│ │ │ │ ├── app_main.cpp
│ │ │ │ ├── idf_component.yml
│ │ │ │ └── models
│ │ │ │ │ ├── p4
│ │ │ │ │ └── model.espdl
│ │ │ │ │ └── s3
│ │ │ │ │ └── model.espdl
│ │ │ ├── partitions.csv
│ │ │ ├── sdkconfig.defaults
│ │ │ ├── sdkconfig.defaults.esp32p4
│ │ │ └── sdkconfig.defaults.esp32s3
│ │ ├── model_in_flash_rodata
│ │ │ ├── CMakeLists.txt
│ │ │ ├── main
│ │ │ │ ├── CMakeLists.txt
│ │ │ │ ├── app_main.cpp
│ │ │ │ ├── idf_component.yml
│ │ │ │ └── models
│ │ │ │ │ ├── p4
│ │ │ │ │ └── model.espdl
│ │ │ │ │ └── s3
│ │ │ │ │ └── model.espdl
│ │ │ ├── partitions.csv
│ │ │ ├── sdkconfig.defaults
│ │ │ ├── sdkconfig.defaults.esp32p4
│ │ │ └── sdkconfig.defaults.esp32s3
│ │ └── model_in_sdcard
│ │ │ ├── CMakeLists.txt
│ │ │ ├── main
│ │ │ ├── CMakeLists.txt
│ │ │ ├── app_main.cpp
│ │ │ ├── idf_component.yml
│ │ │ └── models
│ │ │ │ ├── p4
│ │ │ │ └── model.espdl
│ │ │ │ └── s3
│ │ │ │ └── model.espdl
│ │ │ ├── partitions.csv
│ │ │ ├── sdkconfig.defaults
│ │ │ ├── sdkconfig.defaults.esp32p4
│ │ │ └── sdkconfig.defaults.esp32s3
│ ├── how_to_quantize_model
│ │ ├── quantize_mobilenetv2
│ │ │ ├── README.md
│ │ │ ├── datasets
│ │ │ │ ├── README.md
│ │ │ │ ├── __init__.py
│ │ │ │ └── imagenet_util.py
│ │ │ ├── models
│ │ │ │ └── torch
│ │ │ │ │ ├── mobilenet_v2.onnx
│ │ │ │ │ └── mobilenet_v2_relu.onnx
│ │ │ ├── quantize_onnx_model.py
│ │ │ ├── quantize_tf_model.py
│ │ │ └── quantize_torch_model.py
│ │ ├── quantize_sin_model
│ │ │ ├── quantize_onnx_model.py
│ │ │ ├── quantize_torch_model.py
│ │ │ └── sin_model.py
│ │ ├── quantize_streaming_model
│ │ │ ├── model_cfg.toml
│ │ │ ├── quantize_streaming_model.py
│ │ │ └── test_model.py
│ │ ├── quantize_yolo11n-pose
│ │ │ ├── quantize_onnx_model.py
│ │ │ ├── trainer.py
│ │ │ ├── yolo11n-pose_qat.py
│ │ │ └── yolo11n_eval.py
│ │ └── quantize_yolo11n
│ │ │ ├── quantize_onnx_model.py
│ │ │ ├── trainer.py
│ │ │ ├── yolo11n_eval.py
│ │ │ └── yolo11n_qat.py
│ ├── how_to_run_model
│ │ ├── CMakeLists.txt
│ │ ├── main
│ │ │ ├── CMakeLists.txt
│ │ │ ├── app_main.cpp
│ │ │ ├── idf_component.yml
│ │ │ └── models
│ │ │ │ ├── p4
│ │ │ │ └── model.espdl
│ │ │ │ └── s3
│ │ │ │ └── model.espdl
│ │ ├── partitions.csv
│ │ ├── sdkconfig.defaults
│ │ ├── sdkconfig.defaults.esp32p4
│ │ └── sdkconfig.defaults.esp32s3
│ └── how_to_run_streaming_model
│ │ ├── CMakeLists.txt
│ │ ├── main
│ │ ├── CMakeLists.txt
│ │ ├── app_main.cpp
│ │ ├── idf_component.yml
│ │ ├── models
│ │ │ ├── p4
│ │ │ │ ├── model_0_ishap_1_64_36_kshap_3_s8_streaming.espdl
│ │ │ │ ├── model_1_ishap_1_64_36_kshap_3_s8_streaming.espdl
│ │ │ │ └── model_2_ishap_1_64_36_kshap_3_s8_streaming.espdl
│ │ │ └── s3
│ │ │ │ ├── model_0_ishap_1_64_36_kshap_3_s8_streaming.espdl
│ │ │ │ ├── model_1_ishap_1_64_36_kshap_3_s8_streaming.espdl
│ │ │ │ └── model_2_ishap_1_64_36_kshap_3_s8_streaming.espdl
│ │ ├── streaming_model.hpp
│ │ ├── test_data_esp32p4.hpp
│ │ └── test_data_esp32s3.hpp
│ │ ├── partitions.csv
│ │ ├── sdkconfig.defaults
│ │ ├── sdkconfig.defaults.esp32p4
│ │ └── sdkconfig.defaults.esp32s3
├── yolo11_detect
│ ├── CMakeLists.txt
│ ├── README.md
│ ├── img
│ │ ├── bus_fp32.jpg
│ │ ├── bus_int8.jpg
│ │ ├── bus_int8_qat.jpg
│ │ └── bus_mixedprecision_layersplit.jpg
│ ├── main
│ │ ├── CMakeLists.txt
│ │ ├── app_main.cpp
│ │ ├── bus.jpg
│ │ └── idf_component.yml
│ ├── partitions.csv
│ ├── partitions2.csv
│ ├── sdkconfig.defaults
│ ├── sdkconfig.defaults.esp32p4
│ └── sdkconfig.defaults.esp32s3
└── yolo11_pose
│ ├── CMakeLists.txt
│ ├── README.md
│ ├── img
│ └── bus_int8.jpg
│ ├── main
│ ├── CMakeLists.txt
│ ├── app_main.cpp
│ ├── bus.jpg
│ └── idf_component.yml
│ ├── partitions.csv
│ ├── partitions2.csv
│ ├── sdkconfig.defaults
│ ├── sdkconfig.defaults.esp32p4
│ └── sdkconfig.defaults.esp32s3
├── models
├── cat_detect
│ ├── CMakeLists.txt
│ ├── Kconfig
│ ├── LICENSE
│ ├── README.md
│ ├── cat_detect.cpp
│ ├── cat_detect.hpp
│ ├── idf_component.yml
│ └── models
│ │ ├── p4
│ │ ├── espdet_pico_224_224_cat.espdl
│ │ └── espdet_pico_416_416_cat.espdl
│ │ └── s3
│ │ ├── espdet_pico_224_224_cat.espdl
│ │ └── espdet_pico_416_416_cat.espdl
├── coco_detect
│ ├── CMakeLists.txt
│ ├── Kconfig
│ ├── LICENSE
│ ├── README.md
│ ├── coco_detect.cpp
│ ├── coco_detect.hpp
│ ├── idf_component.yml
│ └── models
│ │ ├── export_onnx.py
│ │ ├── p4
│ │ ├── coco_detect_yolo11n_320_s8_v3.espdl
│ │ ├── coco_detect_yolo11n_s8_v1.espdl
│ │ ├── coco_detect_yolo11n_s8_v2.espdl
│ │ └── coco_detect_yolo11n_s8_v3.espdl
│ │ ├── s3
│ │ ├── coco_detect_yolo11n_320_s8_v3.espdl
│ │ ├── coco_detect_yolo11n_s8_v1.espdl
│ │ ├── coco_detect_yolo11n_s8_v2.espdl
│ │ └── coco_detect_yolo11n_s8_v3.espdl
│ │ ├── yolo11n.onnx
│ │ └── yolo11n_320.onnx
├── coco_pose
│ ├── CMakeLists.txt
│ ├── Kconfig
│ ├── LICENSE
│ ├── README.md
│ ├── coco_pose.cpp
│ ├── coco_pose.hpp
│ ├── idf_component.yml
│ └── models
│ │ ├── export_onnx.py
│ │ ├── p4
│ │ ├── coco_pose_yolo11n_pose_s8_v1.espdl
│ │ └── coco_pose_yolo11n_pose_s8_v2.espdl
│ │ ├── s3
│ │ ├── coco_pose_yolo11n_pose_s8_v1.espdl
│ │ └── coco_pose_yolo11n_pose_s8_v2.espdl
│ │ └── yolo11n-pose.onnx
├── human_face_detect
│ ├── CMakeLists.txt
│ ├── Kconfig
│ ├── LICENSE
│ ├── README.md
│ ├── human_face_detect.cpp
│ ├── human_face_detect.hpp
│ ├── idf_component.yml
│ └── models
│ │ ├── p4
│ │ ├── human_face_detect_mnp_s8_v1.espdl
│ │ └── human_face_detect_msr_s8_v1.espdl
│ │ └── s3
│ │ ├── human_face_detect_mnp_s8_v1.espdl
│ │ └── human_face_detect_msr_s8_v1.espdl
├── human_face_recognition
│ ├── CMakeLists.txt
│ ├── Kconfig
│ ├── LICENSE
│ ├── README.md
│ ├── human_face_recognition.cpp
│ ├── human_face_recognition.hpp
│ ├── idf_component.yml
│ └── models
│ │ ├── p4
│ │ ├── human_face_feat_mbf_s8_v1.espdl
│ │ └── human_face_feat_mfn_s8_v1.espdl
│ │ └── s3
│ │ ├── human_face_feat_mbf_s8_v1.espdl
│ │ └── human_face_feat_mfn_s8_v1.espdl
├── imagenet_cls
│ ├── CMakeLists.txt
│ ├── Kconfig
│ ├── LICENSE
│ ├── README.md
│ ├── idf_component.yml
│ ├── imagenet_cls.cpp
│ ├── imagenet_cls.hpp
│ └── models
│ │ ├── p4
│ │ └── imagenet_cls_mobilenetv2_s8_v1.espdl
│ │ └── s3
│ │ └── imagenet_cls_mobilenetv2_s8_v1.espdl
└── pedestrian_detect
│ ├── CMakeLists.txt
│ ├── Kconfig
│ ├── LICENSE
│ ├── README.md
│ ├── idf_component.yml
│ ├── models
│ ├── p4
│ │ └── pedestrian_detect_pico_s8_v1.espdl
│ └── s3
│ │ └── pedestrian_detect_pico_s8_v1.espdl
│ ├── pedestrian_detect.cpp
│ └── pedestrian_detect.hpp
├── operator_support_state.md
├── pytest.ini
├── test_apps
├── README.md
├── build_apps.py
├── dl_fft
│ ├── CMakeLists.txt
│ ├── gen_test_cases.py
│ ├── main
│ │ ├── CMakeLists.txt
│ │ ├── app_main.cpp
│ │ ├── idf_component.yml
│ │ ├── kiss_fft
│ │ │ ├── _kiss_fft_guts.h
│ │ │ ├── kfc.c
│ │ │ ├── kfc.h
│ │ │ ├── kiss_fft.c
│ │ │ ├── kiss_fft.h
│ │ │ ├── kiss_fft_log.h
│ │ │ ├── kiss_fftnd.c
│ │ │ ├── kiss_fftnd.h
│ │ │ ├── kiss_fftndr.c
│ │ │ ├── kiss_fftndr.h
│ │ │ ├── kiss_fftr.c
│ │ │ └── kiss_fftr.h
│ │ ├── test_data
│ │ │ ├── fft_test_1024.h
│ │ │ ├── fft_test_128.h
│ │ │ ├── fft_test_2048.h
│ │ │ ├── fft_test_256.h
│ │ │ ├── fft_test_512.h
│ │ │ ├── rfft_test_1024.h
│ │ │ ├── rfft_test_128.h
│ │ │ ├── rfft_test_2048.h
│ │ │ ├── rfft_test_256.h
│ │ │ └── rfft_test_512.h
│ │ ├── test_dl_fft.cpp
│ │ ├── test_dsp_fft.cpp
│ │ ├── test_fft.c
│ │ ├── test_fft.h
│ │ └── test_kiss_fft.cpp
│ ├── pytest_dl_fft.py
│ └── sdkconfig.defaults
├── dl_image
│ ├── CMakeLists.txt
│ ├── imgs
│ │ ├── color_320x240.jpg
│ │ ├── color_405x540.jpg
│ │ └── gray_320x240.jpg
│ ├── main
│ │ ├── CMakeLists.txt
│ │ ├── app_main.cpp
│ │ ├── idf_component.yml
│ │ └── test_dl_image.cpp
│ ├── partitions.csv
│ ├── pytest_dl_image.py
│ ├── sdkconfig.defaults
│ ├── sdkconfig.defaults.esp32p4
│ └── sdkconfig.defaults.esp32s3
├── esp-dl
│ ├── CMakeLists.txt
│ ├── gen_op_test.py
│ ├── logs
│ │ └── 20240826.txt
│ ├── main
│ │ ├── CMakeLists.txt
│ │ ├── Kconfig.projbuild
│ │ ├── app_main.cpp
│ │ ├── test_dl_api.cpp
│ │ └── test_dl_model.cpp
│ ├── models
│ │ ├── esp32p4
│ │ │ └── Conv
│ │ │ │ ├── conv2d_ishap_1_16_120_120_kshap_32_16_1_1_s16.espdl
│ │ │ │ ├── conv2d_ishap_1_16_120_120_kshap_32_16_1_1_s8.espdl
│ │ │ │ ├── conv2d_ishap_1_16_32_32_kshap_32_16_1_1_s16.espdl
│ │ │ │ ├── conv2d_ishap_1_16_32_32_kshap_32_16_1_1_s8.espdl
│ │ │ │ ├── conv2d_ishap_1_16_32_32_kshap_32_16_5_5_relu_s16.espdl
│ │ │ │ ├── conv2d_ishap_1_16_32_32_kshap_32_16_5_5_relu_s8.espdl
│ │ │ │ ├── conv2d_ishap_1_16_32_32_kshap_32_16_7_7_relu_s16.espdl
│ │ │ │ ├── conv2d_ishap_1_16_32_32_kshap_32_16_7_7_relu_s8.espdl
│ │ │ │ ├── conv2d_ishap_1_33_19_29_kshap_55_33_3_3_s16.espdl
│ │ │ │ ├── conv2d_ishap_1_33_19_29_kshap_55_33_3_3_s8.espdl
│ │ │ │ ├── conv2d_ishap_1_3_224_224_kshap_16_3_3_3_s16.espdl
│ │ │ │ ├── conv2d_ishap_1_3_224_224_kshap_16_3_3_3_s8.espdl
│ │ │ │ ├── conv2d_ishap_1_48_19_29_kshap_16_48_3_3_s16.espdl
│ │ │ │ ├── conv2d_ishap_1_48_19_29_kshap_16_48_3_3_s8.espdl
│ │ │ │ ├── depthwise_conv2d_ishap_1_16_20_20_kshap_16_1_5_5_relu_s16.espdl
│ │ │ │ ├── depthwise_conv2d_ishap_1_16_20_20_kshap_16_1_5_5_relu_s8.espdl
│ │ │ │ ├── depthwise_conv2d_ishap_1_16_20_20_kshap_16_1_7_7_relu_s16.espdl
│ │ │ │ ├── depthwise_conv2d_ishap_1_16_20_20_kshap_16_1_7_7_relu_s8.espdl
│ │ │ │ ├── depthwise_conv2d_ishap_1_16_3_3_kshap_16_1_3_3_relu_s16.espdl
│ │ │ │ ├── depthwise_conv2d_ishap_1_16_3_3_kshap_16_1_3_3_relu_s8.espdl
│ │ │ │ ├── depthwise_conv2d_ishap_1_30_20_20_kshap_30_1_7_7_relu_s16.espdl
│ │ │ │ ├── depthwise_conv2d_ishap_1_30_20_20_kshap_30_1_7_7_relu_s8.espdl
│ │ │ │ ├── depthwise_conv2d_ishap_1_32_120_120_kshap_32_1_3_3_relu_s16.espdl
│ │ │ │ └── depthwise_conv2d_ishap_1_32_120_120_kshap_32_1_3_3_relu_s8.espdl
│ │ └── esp32s3
│ │ │ └── Conv
│ │ │ ├── conv2d_ishap_1_16_120_120_kshap_32_16_1_1_s16.espdl
│ │ │ ├── conv2d_ishap_1_16_120_120_kshap_32_16_1_1_s8.espdl
│ │ │ ├── conv2d_ishap_1_16_32_32_kshap_32_16_1_1_s16.espdl
│ │ │ ├── conv2d_ishap_1_16_32_32_kshap_32_16_1_1_s8.espdl
│ │ │ ├── conv2d_ishap_1_16_32_32_kshap_32_16_5_5_relu_s16.espdl
│ │ │ ├── conv2d_ishap_1_16_32_32_kshap_32_16_5_5_relu_s8.espdl
│ │ │ ├── conv2d_ishap_1_16_32_32_kshap_32_16_7_7_relu_s16.espdl
│ │ │ ├── conv2d_ishap_1_16_32_32_kshap_32_16_7_7_relu_s8.espdl
│ │ │ ├── conv2d_ishap_1_33_19_29_kshap_55_33_3_3_s16.espdl
│ │ │ ├── conv2d_ishap_1_33_19_29_kshap_55_33_3_3_s8.espdl
│ │ │ ├── conv2d_ishap_1_3_224_224_kshap_16_3_3_3_s16.espdl
│ │ │ ├── conv2d_ishap_1_3_224_224_kshap_16_3_3_3_s8.espdl
│ │ │ ├── conv2d_ishap_1_48_19_29_kshap_16_48_3_3_s16.espdl
│ │ │ ├── conv2d_ishap_1_48_19_29_kshap_16_48_3_3_s8.espdl
│ │ │ ├── depthwise_conv2d_ishap_1_16_20_20_kshap_16_1_5_5_relu_s16.espdl
│ │ │ ├── depthwise_conv2d_ishap_1_16_20_20_kshap_16_1_5_5_relu_s8.espdl
│ │ │ ├── depthwise_conv2d_ishap_1_16_20_20_kshap_16_1_7_7_relu_s16.espdl
│ │ │ ├── depthwise_conv2d_ishap_1_16_20_20_kshap_16_1_7_7_relu_s8.espdl
│ │ │ ├── depthwise_conv2d_ishap_1_16_3_3_kshap_16_1_3_3_relu_s16.espdl
│ │ │ ├── depthwise_conv2d_ishap_1_16_3_3_kshap_16_1_3_3_relu_s8.espdl
│ │ │ ├── depthwise_conv2d_ishap_1_30_20_20_kshap_30_1_7_7_relu_s16.espdl
│ │ │ ├── depthwise_conv2d_ishap_1_30_20_20_kshap_30_1_7_7_relu_s8.espdl
│ │ │ ├── depthwise_conv2d_ishap_1_32_120_120_kshap_32_1_3_3_relu_s16.espdl
│ │ │ └── depthwise_conv2d_ishap_1_32_120_120_kshap_32_1_3_3_relu_s8.espdl
│ ├── partitions.csv
│ ├── pytest_espdl_api.py
│ ├── sdkconfig.defaults
│ ├── sdkconfig.defaults.esp32p4
│ └── sdkconfig.defaults.esp32s3
└── requirements.txt
└── tools
├── dl_fft
├── CMakeLists.txt
├── README.md
├── base
│ ├── dl_fft2r_fc32_ansi.c
│ ├── dl_fft2r_sc16_ansi.c
│ ├── dl_fft4r_fc32_ansi.c
│ ├── dl_fft_base.c
│ ├── dl_fft_base.h
│ ├── dl_fft_dtype.h
│ └── isa
│ │ ├── dl_fft_platform.h
│ │ ├── esp32
│ │ ├── dl_fft2r_fc32_ae32.S
│ │ └── dl_fft4r_fc32_ae32.S
│ │ ├── esp32p4
│ │ ├── dl_fft2r_fc32_arp4.S
│ │ └── dl_fft4r_fc32_arp4.S
│ │ └── esp32s3
│ │ ├── dl_fft2r_fc32_aes3.S
│ │ └── dl_fft4r_fc32_aes3.S
├── benchmark_esp32c5.md
├── benchmark_esp32p4.md
├── benchmark_esp32s3.md
├── dl_fft.h
├── dl_fft_f32.c
├── dl_fft_s16.c
├── dl_rfft.h
├── dl_rfft_f32.c
├── dl_rfft_s16.c
└── idf_component.yml
└── ops_test
├── README.md
├── config
├── model_cfg.toml
└── op_cfg.toml
├── gen_ops_markdown.py
├── gen_test_cases.py
├── onnx_ops_test.py
└── torch_ops_test.py
/.github/workflows/github_workflows_issue_comment.yml:
--------------------------------------------------------------------------------
1 | name: Sync issue comments to JIRA
2 |
3 | # This workflow will be triggered when new issue comment is created (including PR comments)
4 | on: issue_comment
5 |
6 | jobs:
7 | sync_issue_comments_to_jira:
8 | name: Sync Issue Comments to Jira
9 | runs-on: ubuntu-latest
10 | steps:
11 | - uses: actions/checkout@master
12 | - name: Sync issue comments to JIRA
13 | uses: espressif/github-actions/sync_issues_to_jira@master
14 | env:
15 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 | JIRA_PASS: ${{ secrets.JIRA_PASS }}
17 | JIRA_PROJECT: AIV
18 | JIRA_URL: ${{ secrets.JIRA_URL }}
19 | JIRA_USER: ${{ secrets.JIRA_USER }}
20 |
--------------------------------------------------------------------------------
/.github/workflows/github_workflows_new_issues.yml:
--------------------------------------------------------------------------------
1 | name: Sync issues to Jira
2 |
3 | # This workflow will be triggered when a new issue is opened
4 | on: issues
5 |
6 | jobs:
7 | sync_issues_to_jira:
8 | name: Sync issues to Jira
9 | runs-on: ubuntu-latest
10 | steps:
11 | - uses: actions/checkout@master
12 | - name: Sync GitHub issues to Jira project
13 | uses: espressif/github-actions/sync_issues_to_jira@master
14 | env:
15 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 | JIRA_PASS: ${{ secrets.JIRA_PASS }}
17 | JIRA_PROJECT: AIV
18 | JIRA_URL: ${{ secrets.JIRA_URL }}
19 | JIRA_USER: ${{ secrets.JIRA_USER }}
20 |
--------------------------------------------------------------------------------
/.github/workflows/github_workflows_new_prs.yml:
--------------------------------------------------------------------------------
1 | name: Sync remain PRs to Jira
2 |
3 | # This workflow will be triggered every hour, to sync remaining PRs (i.e. PRs with zero comment) to Jira project
4 | # Note that, PRs can also get synced when new PR comment is created
5 | on:
6 | schedule:
7 | - cron: "0 * * * *"
8 |
9 | jobs:
10 | sync_prs_to_jira:
11 | name: Sync PRs to Jira
12 | runs-on: ubuntu-latest
13 | steps:
14 | - uses: actions/checkout@master
15 | - name: Sync PRs to Jira project
16 | uses: espressif/github-actions/sync_issues_to_jira@master
17 | with:
18 | cron_job: true
19 | env:
20 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 | JIRA_PASS: ${{ secrets.JIRA_PASS }}
22 | JIRA_PROJECT: AIV
23 | JIRA_URL: ${{ secrets.JIRA_URL }}
24 | JIRA_USER: ${{ secrets.JIRA_USER }}
25 |
--------------------------------------------------------------------------------
/.github/workflows/upload_component.yml:
--------------------------------------------------------------------------------
1 | name: Push component to https://components.espressif.com
2 | on:
3 | push:
4 | branches:
5 | - master
6 | jobs:
7 | upload_components:
8 | runs-on: ubuntu-latest
9 | steps:
10 | - uses: actions/checkout@v4
11 | with:
12 | submodules: "recursive"
13 | - name: Upload component to the component registry
14 | uses: espressif/upload-components-ci-action@v1
15 | with:
16 | directories: >
17 | esp-dl;
18 | models/coco_detect;
19 | models/coco_pose;
20 | models/human_face_detect;
21 | models/human_face_recognition;
22 | models/pedestrian_detect;
23 | models/imagenet_cls;
24 | models/cat_detect;
25 | tools/dl_fft;
26 | namespace: "espressif"
27 | api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
28 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .vscode/
2 | build/
3 | sdkconfig.old
4 | sdkconfig
5 | bin/
6 | .idea/
7 | __pycache__/
8 |
9 | # unit test
10 | test_apps/*/*/build_*
11 | test_apps/*/override-result.sdkconfig
12 | pytest_log
13 |
14 | dependencies.lock*
15 | managed_components/
16 | **/*/sdkconfig.model.*
17 |
18 | examples/*/**/build_*
19 | test_apps/esp-dl/models/*/**/*.onnx
20 | test_apps/esp-dl/models/*/**/*.info
21 | test_apps/esp-dl/models/*/**/*.json
22 |
23 | .DS_Store
24 | docs/_build/
25 |
--------------------------------------------------------------------------------
/.gitlab-ci.yml:
--------------------------------------------------------------------------------
1 | stages:
2 | - pre_check
3 | - gen_test_cases
4 | - build
5 | - target_test
6 | - deploy
7 |
8 | workflow:
9 | rules:
10 | # Disable those non-protected push triggered pipelines
11 | - if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && $CI_PIPELINE_SOURCE == "push"'
12 | when: never
13 | # when running merged result pipelines, it would create a temp commit id. use $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA instead of $CI_COMMIT_SHA.
14 | # Please use PIPELINE_COMMIT_SHA at all places that require a commit sha
15 | - if: $CI_OPEN_MERGE_REQUESTS != null
16 | variables:
17 | PIPELINE_COMMIT_SHA: $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA
18 | - if: $CI_OPEN_MERGE_REQUESTS == null
19 | variables:
20 | PIPELINE_COMMIT_SHA: $CI_COMMIT_SHA
21 | - when: always
22 |
23 | variables:
24 | ESP_BOX_PATH: "$CI_PROJECT_DIR"
25 | BATCH_BUILD: "1"
26 | V: "0"
27 | IDF_CI_BUILD: "1"
28 |
29 | include:
30 | - '.gitlab/ci/rules.yml'
31 | - '.gitlab/ci/pre_check.yml'
32 | - '.gitlab/ci/gen_test_cases.yml'
33 | - '.gitlab/ci/build.yml'
34 | - '.gitlab/ci/target_test.yml'
35 | - '.gitlab/ci/deploy.yml'
--------------------------------------------------------------------------------
/.gitlab/ci/danger.yml:
--------------------------------------------------------------------------------
1 | # External DangerJS
2 | include:
3 | - project: espressif/shared-ci-dangerjs
4 | ref: master
5 | file: danger.yaml
6 |
7 | run-danger-mr-linter:
8 | stage: pre_check
9 | tags:
10 | - dangerjs
--------------------------------------------------------------------------------
/.gitlab/tool/push_to_github.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # gitlab-ci script to push current tested revision (tag or branch) to github
4 |
5 | set -ex
6 |
7 | if [ -n "${CI_COMMIT_TAG}" ]; then
8 | # for tags
9 | git push github "${CI_COMMIT_TAG}"
10 | else
11 | # for branches
12 | git push github "${CI_COMMIT_SHA}:refs/heads/${CI_COMMIT_REF_NAME}"
13 | fi
14 |
--------------------------------------------------------------------------------
/.gitlab/tool/utils.sh:
--------------------------------------------------------------------------------
1 | # Modified from https://gitlab.com/gitlab-org/gitlab/-/blob/master/scripts/utils.sh
2 |
3 | function add_ssh_keys() {
4 | local key_string="${1}"
5 | mkdir -p ~/.ssh
6 | chmod 700 ~/.ssh
7 | echo -n "${key_string}" >~/.ssh/id_rsa_base64
8 | base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 >~/.ssh/id_rsa
9 | chmod 600 ~/.ssh/id_rsa
10 | }
11 |
12 | function add_doc_server_ssh_keys() {
13 | local key_string="${1}"
14 | local server_url="${2}"
15 | local server_user="${3}"
16 | add_ssh_keys "${key_string}"
17 | echo -e "Host ${server_url}\n\tStrictHostKeyChecking no\n\tUser ${server_user}\n" >>~/.ssh/config
18 | }
19 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/docs/README.md:
--------------------------------------------------------------------------------
1 | Upcoming
2 |
--------------------------------------------------------------------------------
/docs/_static/api-guides.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/docs/_static/api-guides.png
--------------------------------------------------------------------------------
/docs/_static/api-reference.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/docs/_static/api-reference.png
--------------------------------------------------------------------------------
/docs/_static/doc_latest.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/docs/_static/docs_version.js:
--------------------------------------------------------------------------------
1 |
2 | var DOCUMENTATION_VERSIONS = {
3 | DEFAULTS: { has_targets: false,
4 | supported_targets: [ "esp32" ]
5 | },
6 | VERSIONS: [
7 | //latest
8 | { name: "latest", has_targets: true, supported_targets: [ "esp32", "esp32s2", "esp32s3", "esp32c3"] },
9 |
10 | //
11 | { name: "release-v1.1", has_targets: true, supported_targets: [ "esp32", "esp32s2", "esp32s3", "esp32c3"] },
12 | ],
13 | IDF_TARGETS: [
14 | { text: "ESP32", value: "esp32"},
15 | { text: "ESP32-S2", value: "esp32s2"},
16 | { text: "ESP32-S3", value: "esp32s3"},
17 | { text: "ESP32-C3", value: "esp32c3"},
18 | ]
19 | };
20 |
--------------------------------------------------------------------------------
/docs/_static/get-started.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/docs/_static/get-started.png
--------------------------------------------------------------------------------
/docs/check_lang_folder_sync.sh:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/docs/check_lang_folder_sync.sh
--------------------------------------------------------------------------------
/docs/conf_common.py:
--------------------------------------------------------------------------------
1 | from esp_docs.conf_docs import * # noqa: F403,F401
2 |
3 | languages = ["en", "zh_CN"]
4 | # idf_targets = ["esp32", "esp32s2", "esp32s3", "esp32c3"]
5 |
6 | extensions += [
7 | "sphinx_copybutton",
8 | # Needed as a trigger for running doxygen
9 | "esp_docs.esp_extensions.dummy_build_system",
10 | "esp_docs.esp_extensions.run_doxygen",
11 | ]
12 |
13 | # link roles config
14 | github_repo = "espressif/esp-dl"
15 |
16 | # context used by sphinx_idf_theme
17 | html_context["github_user"] = "espressif"
18 | html_context["github_repo"] = "esp-dl"
19 |
20 | html_static_path = ["../_static"]
21 |
22 | # Extra options required by sphinx_idf_theme
23 | project_slug = "esp-dl"
24 |
25 | # Contains info used for constructing target and version selector
26 | # Can also be hosted externally, see esp-idf for example
27 | versions_url = "./_static/docs_version.js"
28 |
29 | # Final PDF filename will contains target and version
30 | pdf_file_prefix = "esp-dl"
31 |
32 | # add Tracking ID for Google Analytics
33 | google_analytics_id = "G-KTJ5YS7QWC"
34 |
--------------------------------------------------------------------------------
/docs/en/api_reference/flatbuffers_api.rst:
--------------------------------------------------------------------------------
1 | Fbs API Reference
2 | =====================
3 |
4 | The esp-dl model utilizes FlatBuffers to store information about parameters and the computation graph. Taking into account the encryption requirements of some models, this part has not been open-sourced. However, we provide a set of APIs to facilitate users in loading and parsing esp-dl models.
5 |
6 | .. include-build-file:: inc/fbs_loader.inc
7 | .. include-build-file:: inc/fbs_model.inc
--------------------------------------------------------------------------------
/docs/en/api_reference/index.rst:
--------------------------------------------------------------------------------
1 | *************
2 | API Reference
3 | *************
4 |
5 | :link_to_translation:`zh_CN:[中文]`
6 |
7 | .. toctree::
8 | :maxdepth: 1
9 |
10 | tensor_api
11 | module_api
12 | model_api
13 | flatbuffers_api
--------------------------------------------------------------------------------
/docs/en/api_reference/model_api.rst:
--------------------------------------------------------------------------------
1 | Model API Reference
2 | ===============================
3 |
4 | .. _configuration-options-reference:
5 |
6 | This section covers model loading and static memory planning, making it convenient for users to directly load and run ESPDL models.
7 |
8 | .. include-build-file:: inc/dl_model_base.inc
9 | .. include-build-file:: inc/dl_model_context.inc
10 | .. include-build-file:: inc/dl_memory_manager.inc
11 | .. include-build-file:: inc/dl_memory_manager_greedy.inc
--------------------------------------------------------------------------------
/docs/en/api_reference/module_api.rst:
--------------------------------------------------------------------------------
1 | Module API Reference
2 | =====================
3 |
4 | The Module is the base class for operators in esp-dl, and all operators inherit from this base class. This base class defines the basic interfaces for operators, enabling the model layer to automatically execute operators and manage memory planning.
5 |
6 | .. include-build-file:: inc/dl_module_base.inc
7 | .. include-build-file:: inc/dl_module_creator.inc
--------------------------------------------------------------------------------
/docs/en/api_reference/tensor_api.rst:
--------------------------------------------------------------------------------
1 | Tensor API Reference
2 | =====================
3 |
4 | Tensor is the fundamental data type in esp-dl, used for storing multi-type data such as int8, int16, float, etc., similar to the tensor in PyTorch. We have implemented some common tensor operations. Please refer to the following APIs for details.
5 |
6 | .. include-build-file:: inc/dl_tensor_base.inc
--------------------------------------------------------------------------------
/docs/en/conf.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | #
3 | # English Language RTD & Sphinx config file
4 | #
5 | # Uses ../conf_common.py for most non-language-specific settings.
6 |
7 | # Importing conf_common adds all the non-language-specific
8 | # parts to this conf module
9 |
10 | try:
11 | from conf_common import * # noqa: F403,F401
12 | except ImportError:
13 | import os
14 | import sys
15 |
16 | sys.path.insert(0, os.path.abspath("../"))
17 | from conf_common import * # noqa: F403,F401
18 |
19 | import datetime
20 |
21 | current_year = datetime.datetime.now().year
22 |
23 | # General information about the project.
24 | project = "ESP-DL User Guide"
25 | copyright = "2018 - {}, Espressif Systems (Shanghai) Co., Ltd".format(current_year)
26 | pdf_title = "ESP-DL User Guide"
27 |
28 | # The language for content autogenerated by Sphinx. Refer to documentation
29 | # for a list of supported languages.
30 | language = "en"
31 |
--------------------------------------------------------------------------------
/docs/en/index.rst:
--------------------------------------------------------------------------------
1 | ESP-DL User Guide
2 | =================
3 |
4 | :link_to_translation:`zh_CN:[中文]`
5 |
6 | ================== ================== ==================
7 | |Get Started|_ |Tutorials|_ |API Reference|_
8 | ------------------ ------------------ ------------------
9 | `Get Started`_ `Tutorials`_ `API Reference`_
10 | ================== ================== ==================
11 |
12 | .. |Get Started| image:: ../_static/get-started.png
13 | .. _Get Started: getting_started/readme.html
14 |
15 | .. |Tutorials| image:: ../_static/api-guides.png
16 | .. _Tutorials: tutorials/index.html
17 |
18 | .. |API Reference| image:: ../_static/api-reference.png
19 | .. _API Reference: api_reference/index.html
20 |
21 | .. toctree::
22 | :hidden:
23 |
24 | Introduction
25 | Getting Started
26 | Tutorials
27 | API Reference
--------------------------------------------------------------------------------
/docs/en/introduction/index.rst:
--------------------------------------------------------------------------------
1 | *************
2 | Introduction
3 | *************
4 |
5 | :link_to_translation:`zh_CN:[中文]`
6 |
7 | .. toctree::
8 | :maxdepth: 1
9 |
10 | readme
11 | esp_dl_project
--------------------------------------------------------------------------------
/docs/en/tutorials/index.rst:
--------------------------------------------------------------------------------
1 | *************
2 | Tutorials
3 | *************
4 |
5 | :link_to_translation:`zh_CN:[中文]`
6 |
7 | .. toctree::
8 | :maxdepth: 1
9 |
10 | how_to_quantize_model
11 | how_to_load_test_profile_model
12 | how_to_run_model
13 | how_to_add_a_new_module(operator)
14 | how_to_deploy_mobilenetv2
15 | how_to_deploy_yolo11n
16 | how_to_deploy_yolo11n-pose
17 | how_to_deploy_streaming_model
--------------------------------------------------------------------------------
/docs/requirements.txt:
--------------------------------------------------------------------------------
1 | esp-docs==1.*
2 |
--------------------------------------------------------------------------------
/docs/zh_CN/api_reference/flatbuffers_api.rst:
--------------------------------------------------------------------------------
1 | Fbs API Reference
2 | =====================
3 |
4 | The esp-dl model utilizes FlatBuffers to store information about parameters and the computation graph. Taking into account the encryption requirements of some models, this part has not been open-sourced. However, we provide a set of APIs to facilitate users in loading and parsing esp-dl models.
5 |
6 | .. include-build-file:: inc/fbs_loader.inc
7 | .. include-build-file:: inc/fbs_model.inc
--------------------------------------------------------------------------------
/docs/zh_CN/api_reference/index.rst:
--------------------------------------------------------------------------------
1 | *************
2 | API Reference
3 | *************
4 |
5 | :link_to_translation:`en:[English]`
6 |
7 | .. toctree::
8 | :maxdepth: 1
9 |
10 | tensor_api
11 | module_api
12 | model_api
13 | flatbuffers_api
--------------------------------------------------------------------------------
/docs/zh_CN/api_reference/model_api.rst:
--------------------------------------------------------------------------------
1 | Model API Reference
2 | ===============================
3 |
4 | .. _configuration-options-reference:
5 |
6 | This section covers model loading and static memory planning, making it convenient for users to directly load and run ESPDL models.
7 |
8 | .. include-build-file:: inc/dl_model_base.inc
9 | .. include-build-file:: inc/dl_model_context.inc
10 | .. include-build-file:: inc/dl_memory_manager.inc
11 | .. include-build-file:: inc/dl_memory_manager_greedy.inc
--------------------------------------------------------------------------------
/docs/zh_CN/api_reference/module_api.rst:
--------------------------------------------------------------------------------
1 | Module API Reference
2 | =====================
3 |
4 | The Module is the base class for operators in esp-dl, and all operators inherit from this base class. This base class defines the basic interfaces for operators, enabling the model layer to automatically execute operators and manage memory planning.
5 |
6 | .. include-build-file:: inc/dl_module_base.inc
7 | .. include-build-file:: inc/dl_module_creator.inc
--------------------------------------------------------------------------------
/docs/zh_CN/api_reference/tensor_api.rst:
--------------------------------------------------------------------------------
1 | Tensor API Reference
2 | =====================
3 |
4 | Tensor is the fundamental data type in esp-dl, used for storing multi-type data such as int8, int16, float, etc., similar to the tensor in PyTorch. We have implemented some common tensor operations. Please refer to the following APIs for details.
5 |
6 | .. include-build-file:: inc/dl_tensor_base.inc
--------------------------------------------------------------------------------
/docs/zh_CN/conf.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | #
3 | # English Language RTD & Sphinx config file
4 | #
5 | # Uses ../conf_common.py for most non-language-specific settings.
6 |
7 | # Importing conf_common adds all the non-language-specific
8 | # parts to this conf module
9 | try:
10 | from conf_common import * # noqa: F403,F401
11 | except ImportError:
12 | import os
13 | import sys
14 |
15 | sys.path.insert(0, os.path.abspath(".."))
16 | from conf_common import * # noqa: F403,F401
17 |
18 | import datetime
19 |
20 | current_year = datetime.datetime.now().year
21 |
22 | # General information about the project.
23 | project = "ESP-DL 用户指南"
24 | copyright = "2018 - {} 乐鑫信息科技(上海)股份有限公司".format(current_year)
25 | pdf_title = "ESP-DL 用户指南"
26 |
27 | # The language for content autogenerated by Sphinx. Refer to documentation
28 | # for a list of supported languages.
29 | language = "zh_CN"
30 |
--------------------------------------------------------------------------------
/docs/zh_CN/index.rst:
--------------------------------------------------------------------------------
1 | ESP-DL 用户手册
2 | =================
3 | :link_to_translation:`en:[English]`
4 |
5 | ================== ================== ==================
6 | |入门指南|_ |使用教程|_ |API Reference|_
7 | ------------------ ------------------ ------------------
8 | `入门指南`_ `使用教程`_ `API Reference`_
9 | ================== ================== ==================
10 |
11 | .. |入门指南| image:: ../_static/get-started.png
12 | .. _入门指南: getting_started/readme.html
13 |
14 | .. |使用教程| image:: ../_static/api-guides.png
15 | .. _使用教程: tutorials/index.html
16 |
17 | .. |API Reference| image:: ../_static/api-reference.png
18 | .. _API Reference: api_reference/index.html
19 |
20 |
21 | .. toctree::
22 | :hidden:
23 |
24 | ESP-DL 简介
25 | 入门指南
26 | 使用教程
27 | API Reference
--------------------------------------------------------------------------------
/docs/zh_CN/introduction/index.rst:
--------------------------------------------------------------------------------
1 | *************
2 | Introduction
3 | *************
4 |
5 | :link_to_translation:`en:[English]`
6 |
7 | .. toctree::
8 | :maxdepth: 1
9 |
10 | readme
11 | esp_dl_project
--------------------------------------------------------------------------------
/docs/zh_CN/introduction/readme.rst:
--------------------------------------------------------------------------------
1 | ***********
2 | ESP-DL 简介
3 | ***********
4 |
5 | :link_to_translation:`en:[English]`
6 |
7 | ESP-DL 是一个专为 ESP 系列芯片设计的轻量级且高效的神经网络推理框架。通过 ESP-DL,您可以轻松快速地使用乐鑫的系统级芯片 (SoC) 开发 AI 应用。
8 |
9 | 概述
10 | --------
11 |
12 | ESP-DL 提供了加载、调试和运行 AI 模型的 API。该框架易于使用,并且可以与其他乐鑫 SDK 无缝集成。ESP-PPQ 作为 ESP-DL 的量化工具,能够量化来自 ONNX、Pytorch 和 TensorFlow 的模型,并将其导出为 ESP-DL 标准模型格式。
13 |
14 | - **ESP-DL 标准模型格式**: 该格式类似于 ONNX,但使用 FlatBuffers 而不是 Protobuf,使其更轻量级并支持零拷贝反序列化,文件后缀为`.espdl`。
15 |
16 | - **高效算子实现:** ESP-DL 高效地实现了常见的 AI 算子,如 Conv、Pool、Gemm、Add 和 Mul等。 目前支持的算子 :project_file:`operator_support_state.md`
17 |
18 | - **静态内存规划器:** 内存规划器根据用户指定的内部 RAM 大小,自动将不同层分配到最佳内存位置,确保高效的整体运行速度同时最小化内存使用。
19 |
20 | - **双核调度:** 自动双核调度允许计算密集型算子充分利用双核计算能力。目前,Conv2D 和 DepthwiseConv2D 支持双核调度。
21 |
22 | - **8bit LUT Activation:** 除了Relu, PRelu(n>1)之外的所有激活函数,ESP-DL 默认使用 8bit LUT(Look Up Table)方式实现,以加速推理。
23 |
24 | ESP-DL系统框架图如下所示:
25 |
26 | .. image:: ../../_static/architecture_cn.drawio.svg
27 | :alt: ESP-DL 架构
28 | :align: center
29 |
30 |
--------------------------------------------------------------------------------
/docs/zh_CN/tutorials/index.rst:
--------------------------------------------------------------------------------
1 | *************
2 | Tutorials
3 | *************
4 |
5 | :link_to_translation:`en:[English]`
6 |
7 | .. toctree::
8 | :maxdepth: 1
9 |
10 | how_to_quantize_model
11 | how_to_load_test_profile_model
12 | how_to_run_model
13 | how_to_add_a_new_module(operator)
14 | how_to_deploy_mobilenetv2
15 | how_to_deploy_yolo11n
16 | how_to_deploy_yolo11n-pose
17 | how_to_deploy_streaming_model
--------------------------------------------------------------------------------
/esp-dl/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_add.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 | #include "dl_base_elemwise.hpp"
5 |
6 | namespace dl {
7 | namespace base {
8 | /**
9 | * @brief int8 element-wise add, support multidirectional broadcasting from 1D to 4D
10 | *
11 | * @param args elemwiseArgsType
12 | */
13 | void elemwise_add(elemwiseArgsType *args);
14 |
15 | /**
16 | * @brief int16 element-wise add, support multidirectional broadcasting from 1D to 4D
17 | *
18 | * @param args elemwiseArgsType
19 | */
20 | void elemwise_add(elemwiseArgsType *args);
21 |
22 | } // namespace base
23 | } // namespace dl
24 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_add2d.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 |
5 | namespace dl {
6 | namespace base {
7 | /**
8 | * @brief add2d
9 | *
10 | * @tparam feature_t
11 | * @param args_ptr
12 | */
13 | template
14 | void add2d(void *const args_ptr);
15 |
16 | } // namespace base
17 | } // namespace dl
18 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_and.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 | #include "dl_base_elemwise.hpp"
5 |
6 | namespace dl {
7 | namespace base {
8 | /**
9 | * @brief int8 element-wise add, support andtidirectional broadcasting from 1D to 4D
10 | *
11 | * @param args elemwiseArgsType
12 | */
13 | void elemwise_and(elemwiseArgsType *args);
14 |
15 | /**
16 | * @brief int16 element-wise add, support andtidirectional broadcasting from 1D to 4D
17 | *
18 | * @param args elemwiseArgsType
19 | */
20 | void elemwise_and(elemwiseArgsType *args);
21 |
22 | } // namespace base
23 | } // namespace dl
24 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_avg_pool2d.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base_pool2d.hpp"
4 |
5 | namespace dl {
6 | namespace base {
7 | /**
8 | * @brief
9 | *
10 | * @tparam feature_t
11 | * @param args_ptr
12 | */
13 | template
14 | void avg_pool2d(void *args_ptr);
15 | } // namespace base
16 | } // namespace dl
17 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_conv2d.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 |
5 | namespace dl {
6 | namespace base {
7 | /**
8 | * @brief conv2d
9 | *
10 | * @tparam feature_t
11 | * @tparam bias_t
12 | * @tparam buffer_t
13 | * @param args_ptr
14 | */
15 | template
16 | void conv2d(void *const args_ptr);
17 | } // namespace base
18 | } // namespace dl
19 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_depthwise_conv2d.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 |
5 | namespace dl {
6 | namespace base {
7 | /**
8 | * @brief
9 | * NOTE: support [H, W, C, 1] only by now
10 | * NOTE: in tensorflow, when dilation > 1 the stride must be 1. Our api has no such limitation. But we didn't test this
11 | * oppsite situation. https://tensorflow.google.cn/api_docs/python/tf/nn/depthwise_conv2d
12 | * TODO: support [H, W, C, M] take tensorflow for reference
13 | *
14 | * NOTE: support: feature_t == filter_t == bias_t == activate_t == buffer_t == int16_t
15 | * TODO: support: feature_t == filter_t == bias_t == activate_t == buffer_t == int8_t
16 | *
17 | * @tparam feature_t
18 | * @tparam bias_t
19 | * @tparam buffer_t
20 | * @param args_ptr
21 | */
22 | template
23 | void depthwise_conv2d(void *args_ptr);
24 | } // namespace base
25 | } // namespace dl
26 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_div.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 | #include "dl_base_elemwise.hpp"
5 |
6 | namespace dl {
7 | namespace base {
8 |
9 | // Get element-wise div operation args
10 | template
11 | elemwiseArgsType *get_elemwise_div_args(TensorBase *output,
12 | TensorBase *input0,
13 | TensorBase *input1,
14 | const runtime_mode_t runtime_mode);
15 |
16 | /**
17 | * @brief int8 element-wise div, support multidirectional broadcasting from 1D to 4D
18 | *
19 | * @param args elemwiseArgsType
20 | */
21 | void elemwise_div(elemwiseArgsType *args);
22 |
23 | /**
24 | * @brief int16 element-wise div, support multidirectional broadcasting from 1D to 4D
25 | *
26 | * @param args elemwiseArgsType
27 | */
28 | void elemwise_div(elemwiseArgsType *args);
29 |
30 | } // namespace base
31 | } // namespace dl
32 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_equal.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 | #include "dl_base_elemwise.hpp"
5 |
6 | namespace dl {
7 | namespace base {
8 | /**
9 | * @brief int8 element-wise add, support equaltidirectional broadcasting from 1D to 4D
10 | *
11 | * @param args elemwiseArgsType
12 | */
13 | void elemwise_equal(elemwiseArgsType *args);
14 |
15 | /**
16 | * @brief int16 element-wise add, support equaltidirectional broadcasting from 1D to 4D
17 | *
18 | * @param args elemwiseArgsType
19 | */
20 | void elemwise_equal(elemwiseArgsType *args);
21 |
22 | } // namespace base
23 | } // namespace dl
24 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_greater.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 | #include "dl_base_elemwise.hpp"
5 |
6 | namespace dl {
7 | namespace base {
8 | /**
9 | * @brief int8 element-wise add, support greatertidirectional broadcasting from 1D to 4D
10 | *
11 | * @param args elemwiseArgsType
12 | */
13 | void elemwise_greater(elemwiseArgsType *args);
14 |
15 | /**
16 | * @brief int16 element-wise add, support greatertidirectional broadcasting from 1D to 4D
17 | *
18 | * @param args elemwiseArgsType
19 | */
20 | void elemwise_greater(elemwiseArgsType *args);
21 |
22 | } // namespace base
23 | } // namespace dl
24 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_greaterorequal.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 | #include "dl_base_elemwise.hpp"
5 |
6 | namespace dl {
7 | namespace base {
8 | /**
9 | * @brief int8 element-wise add, support greaterorequaltidirectional broadcasting from 1D to 4D
10 | *
11 | * @param args elemwiseArgsType
12 | */
13 | void elemwise_greaterorequal(elemwiseArgsType *args);
14 |
15 | /**
16 | * @brief int16 element-wise add, support greaterorequaltidirectional broadcasting from 1D to 4D
17 | *
18 | * @param args elemwiseArgsType
19 | */
20 | void elemwise_greaterorequal(elemwiseArgsType *args);
21 |
22 | } // namespace base
23 | } // namespace dl
24 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_leakyrelu.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 |
5 | namespace dl {
6 | namespace base {
7 | /**
8 | * @brief leakyrelu
9 | *
10 | * @tparam feature_t
11 | */
12 | template
13 | void leakyrelu(void *const args_ptr);
14 | } // namespace base
15 | } // namespace dl
16 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_less.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 | #include "dl_base_elemwise.hpp"
5 |
6 | namespace dl {
7 | namespace base {
8 | /**
9 | * @brief int8 element-wise add, support lesstidirectional broadcasting from 1D to 4D
10 | *
11 | * @param args elemwiseArgsType
12 | */
13 | void elemwise_less(elemwiseArgsType *args);
14 |
15 | /**
16 | * @brief int16 element-wise add, support lesstidirectional broadcasting from 1D to 4D
17 | *
18 | * @param args elemwiseArgsType
19 | */
20 | void elemwise_less(elemwiseArgsType *args);
21 |
22 | } // namespace base
23 | } // namespace dl
24 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_lessorequal.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 | #include "dl_base_elemwise.hpp"
5 |
6 | namespace dl {
7 | namespace base {
8 | /**
9 | * @brief int8 element-wise add, support lessorequaltidirectional broadcasting from 1D to 4D
10 | *
11 | * @param args elemwiseArgsType
12 | */
13 | void elemwise_lessorequal(elemwiseArgsType *args);
14 |
15 | /**
16 | * @brief int16 element-wise add, support lessorequaltidirectional broadcasting from 1D to 4D
17 | *
18 | * @param args elemwiseArgsType
19 | */
20 | void elemwise_lessorequal(elemwiseArgsType *args);
21 |
22 | } // namespace base
23 | } // namespace dl
24 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_max.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 | #include "dl_base_elemwise.hpp"
5 |
6 | namespace dl {
7 | namespace base {
8 | /**
9 | * @brief int8 element-wise add, support maxtidirectional broadcasting from 1D to 4D
10 | *
11 | * @param args elemwiseArgsType
12 | */
13 | void elemwise_max(elemwiseArgsType *args);
14 |
15 | /**
16 | * @brief int16 element-wise add, support maxtidirectional broadcasting from 1D to 4D
17 | *
18 | * @param args elemwiseArgsType
19 | */
20 | void elemwise_max(elemwiseArgsType *args);
21 |
22 | } // namespace base
23 | } // namespace dl
24 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_max2d.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 |
5 | namespace dl {
6 | namespace base {
7 | /**
8 | * @brief max2d
9 | *
10 | * @tparam feature_t
11 | * @param args_ptr
12 | */
13 | template
14 | void max2d(void *const args_ptr);
15 |
16 | } // namespace base
17 | } // namespace dl
18 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_max_pool2d.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base_pool2d.hpp"
4 |
5 | namespace dl {
6 | namespace base {
7 | /**
8 | * @brief
9 | *
10 | * @tparam feature_t
11 | * @param args_ptr
12 | */
13 | template
14 | void max_pool2d(void *args_ptr);
15 | } // namespace base
16 | } // namespace dl
17 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_min.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 | #include "dl_base_elemwise.hpp"
5 |
6 | namespace dl {
7 | namespace base {
8 | /**
9 | * @brief int8 element-wise add, support mintidirectional broadcasting from 1D to 4D
10 | *
11 | * @param args elemwiseArgsType
12 | */
13 | void elemwise_min(elemwiseArgsType *args);
14 |
15 | /**
16 | * @brief int16 element-wise add, support mintidirectional broadcasting from 1D to 4D
17 | *
18 | * @param args elemwiseArgsType
19 | */
20 | void elemwise_min(elemwiseArgsType *args);
21 |
22 | } // namespace base
23 | } // namespace dl
24 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_min2d.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 |
5 | namespace dl {
6 | namespace base {
7 | /**
8 | * @brief min2d
9 | *
10 | * @tparam feature_t
11 | * @param args_ptr
12 | */
13 | template
14 | void min2d(void *const args_ptr);
15 |
16 | } // namespace base
17 | } // namespace dl
18 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_mul.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 | #include "dl_base_elemwise.hpp"
5 |
6 | namespace dl {
7 | namespace base {
8 | /**
9 | * @brief int8 element-wise add, support multidirectional broadcasting from 1D to 4D
10 | *
11 | * @param args elemwiseArgsType
12 | */
13 | void elemwise_mul(elemwiseArgsType *args);
14 |
15 | /**
16 | * @brief int16 element-wise add, support multidirectional broadcasting from 1D to 4D
17 | *
18 | * @param args elemwiseArgsType
19 | */
20 | void elemwise_mul(elemwiseArgsType *args);
21 |
22 | } // namespace base
23 | } // namespace dl
24 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_mul2d.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 |
5 | namespace dl {
6 | namespace base {
7 | /**
8 | * @brief mul2d
9 | *
10 | * @tparam feature_t
11 | * @param args_ptr
12 | */
13 | template
14 | void mul2d(void *const args_ptr);
15 |
16 | } // namespace base
17 | } // namespace dl
18 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_or.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 | #include "dl_base_elemwise.hpp"
5 |
6 | namespace dl {
7 | namespace base {
8 | /**
9 | * @brief int8 element-wise add, support ortidirectional broadcasting from 1D to 4D
10 | *
11 | * @param args elemwiseArgsType
12 | */
13 | void elemwise_or(elemwiseArgsType *args);
14 |
15 | /**
16 | * @brief int16 element-wise add, support ortidirectional broadcasting from 1D to 4D
17 | *
18 | * @param args elemwiseArgsType
19 | */
20 | void elemwise_or(elemwiseArgsType *args);
21 |
22 | } // namespace base
23 | } // namespace dl
24 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_pad.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 |
5 | namespace dl {
6 | namespace base {
7 |
8 | std::vector get_pad_shape(const std::vector &shape, const std::vector &pads);
9 |
10 | template
11 | void pad1D(T *input_element,
12 | T *output_element,
13 | std::vector input_shape,
14 | const std::vector pads,
15 | const padding_mode_t mode,
16 | const T const_value);
17 |
18 | template
19 | void pad2D(T *input_element,
20 | T *output_element,
21 | std::vector input_shape,
22 | const std::vector pads,
23 | const padding_mode_t mode,
24 | const T const_value);
25 |
26 | template
27 | void pad3D(T *input_element,
28 | T *output_element,
29 | std::vector input_shape,
30 | const std::vector pads,
31 | const padding_mode_t mode,
32 | const T const_value);
33 |
34 | template
35 | void pad4D(T *input_element,
36 | T *output_element,
37 | std::vector input_shape,
38 | const std::vector pads,
39 | const padding_mode_t mode,
40 | const T const_value);
41 | } // namespace base
42 | } // namespace dl
43 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_prelu.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 |
5 | namespace dl {
6 | namespace base {
7 | /**
8 | * @brief prelu
9 | *
10 | * @tparam feature_t
11 | */
12 | template
13 | void prelu(void *const args_ptr);
14 | } // namespace base
15 | } // namespace dl
16 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_relu.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 |
5 | namespace dl {
6 | namespace base {
7 | /**
8 | * @brief relu
9 | *
10 | * @tparam feature_t
11 | */
12 | template
13 | void relu(void *const args_ptr);
14 | } // namespace base
15 | } // namespace dl
16 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_requantize_linear.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 | #include "dl_tensor_base.hpp"
5 |
6 | namespace dl {
7 | namespace base {
8 |
9 | std::vector get_requantize_operation_args(TensorBase *output,
10 | TensorBase *input,
11 | const runtime_mode_t runtime_mode = RUNTIME_MODE_AUTO);
12 |
13 | /**
14 | * @brief requantize_linear
15 | *
16 | * @tparam out_feature_t
17 | * @tparam in_feature_t
18 | * @param args_ptr
19 | */
20 | template
21 | void requantize_linear(void *const args_ptr);
22 | } // namespace base
23 | } // namespace dl
24 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_sub.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 | #include "dl_base_elemwise.hpp"
5 |
6 | namespace dl {
7 | namespace base {
8 | /**
9 | * @brief int8 element-wise add, support multidirectional broadcasting from 1D to 4D
10 | *
11 | * @param args elemwiseArgsType
12 | */
13 | void elemwise_sub(elemwiseArgsType *args);
14 |
15 | /**
16 | * @brief int16 element-wise add, support multidirectional broadcasting from 1D to 4D
17 | *
18 | * @param args elemwiseArgsType
19 | */
20 | void elemwise_sub(elemwiseArgsType *args);
21 |
22 | } // namespace base
23 | } // namespace dl
24 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_sub2d.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 |
5 | namespace dl {
6 | namespace base {
7 | /**
8 | * @brief sub2d
9 | *
10 | * @tparam feature_t
11 | * @param args_ptr
12 | */
13 | template
14 | void sub2d(void *const args_ptr);
15 |
16 | } // namespace base
17 | } // namespace dl
18 |
--------------------------------------------------------------------------------
/esp-dl/dl/base/dl_base_xor.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_base.hpp"
4 | #include "dl_base_elemwise.hpp"
5 |
6 | namespace dl {
7 | namespace base {
8 | /**
9 | * @brief int8 element-wise add, support xortidirectional broadcasting from 1D to 4D
10 | *
11 | * @param args elemwiseArgsType
12 | */
13 | void elemwise_xor(elemwiseArgsType *args);
14 |
15 | /**
16 | * @brief int16 element-wise add, support xortidirectional broadcasting from 1D to 4D
17 | *
18 | * @param args elemwiseArgsType
19 | */
20 | void elemwise_xor(elemwiseArgsType *args);
21 |
22 | } // namespace base
23 | } // namespace dl
24 |
--------------------------------------------------------------------------------
/esp-dl/dl/dl_define_private.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | * @file dl_define_private.hpp
3 | * @brief All macro here is for internal only. Once the project is compiled to static library, these macro is not
4 | * effective.
5 | * @version 0.1
6 | * @date 2021-07-02
7 | *
8 | * @copyright Copyright (c) 2021
9 | *
10 | */
11 |
12 | #pragma once
13 | #include "sdkconfig.h"
14 |
15 | #define DL_S16_BUFFER_TYPE \
16 | int64_t /*!< int32_t or int64_t. int32_t is twice as fast as int64_t in C/C++ implement. But int32_t may have \
17 | value overflow. */
18 | #define DL_LOG_DETECT_LATENCY 0 /*!< - 1: print the latency of each parts of detect */
19 | /*!< - 0: mute */
20 |
21 | #if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S3
22 | #define CONFIG_XTENSA_BOOST 1
23 | #else
24 | #define CONFIG_XTENSA_BOOST 0
25 | #endif
26 |
27 | #if CONFIG_IDF_TARGET_ESP32S3
28 | #define CONFIG_TIE728_BOOST 1
29 | #else
30 | #define CONFIG_TIE728_BOOST 0
31 | #endif
32 |
33 | #if CONFIG_IDF_TARGET_ESP32P4
34 | #define CONFIG_ESP32P4_BOOST 1
35 | #else
36 | #define CONFIG_ESP32P4_BOOST 0
37 | #endif
38 |
39 | #define CONFIG_ACCURATE_INFER 1
40 |
--------------------------------------------------------------------------------
/esp-dl/dl/math/src/dl_math.cpp:
--------------------------------------------------------------------------------
1 | #include "dl_math.hpp"
2 |
3 | namespace dl {
4 | namespace math {
5 | }
6 | } // namespace dl
7 |
--------------------------------------------------------------------------------
/esp-dl/dl/tool/isa/esp32p4/dl_esp32p4_round.S:
--------------------------------------------------------------------------------
1 | .text
2 | .global dl_esp32p4_cfg_round
3 | .type dl_esp32p4_cfg_round, @function
4 | .balign 4
5 | .option norvc
6 | dl_esp32p4_cfg_round:
7 |
8 | # a0: int8_t round_mode
9 | # a1:
10 | # a2:
11 |
12 | # a3:
13 | # a4:
14 | # a5:
15 | # t3:
16 | # t4:
17 | # t5:
18 | # t6:
19 |
20 | # s0:
21 | # s1:
22 | # s8:
23 | # s9:
24 | # s10:
25 | # s11:
26 |
27 | slli a0, a0, 4
28 | esp.movx.r.cfg a1
29 | or a1, a1, a0
30 | esp.movx.w.cfg a1
31 | ret
32 |
33 |
34 |
35 | .text
36 | .global dl_esp32p4_round_half_even
37 | .type dl_esp32p4_round_half_even, @function
38 | .balign 4
39 | .option norvc
40 | dl_esp32p4_round_half_even:
41 |
42 | # fa0: float value
43 |
44 | # a0: int32_t ret
45 | # a1:
46 | # a2:
47 |
48 | # a3:
49 | # a4:
50 | # a5:
51 | # t3:
52 | # t4:
53 | # t5:
54 | # t6:
55 |
56 | # s0:
57 | # s1:
58 | # s8:
59 | # s9:
60 | # s10:
61 | # s11:
62 |
63 | fcvt.w.s a0, fa0, rne
64 | ret
65 |
--------------------------------------------------------------------------------
/esp-dl/dl/tool/isa/xtensa/dl_xtensa_bzero.S:
--------------------------------------------------------------------------------
1 | .align 4
2 | .text
3 | .global dl_xtensa_bzero_32b
4 | .type dl_xtensa_bzero_32b, @function
5 | .section .iram1
6 | dl_xtensa_bzero_32b:
7 | .align 4
8 | entry sp, 32
9 |
10 | # a2: ptr
11 | # a3: n
12 |
13 | srli a3, a3, 2 # a3: n // 4
14 | movi a4, 0 # a4: zero
15 |
16 | loopgtz a3, 1f
17 | s32i a4, a2, 0
18 | addi a2, a2, 4
19 | 1:
20 | retw
21 |
--------------------------------------------------------------------------------
/esp-dl/fbs_loader/lib/esp32p4/libfbs_model.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/esp-dl/fbs_loader/lib/esp32p4/libfbs_model.a
--------------------------------------------------------------------------------
/esp-dl/fbs_loader/lib/esp32s3/libfbs_model.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/esp-dl/fbs_loader/lib/esp32s3/libfbs_model.a
--------------------------------------------------------------------------------
/esp-dl/idf_component.yml:
--------------------------------------------------------------------------------
1 | version: "3.1.3"
2 | license: "MIT"
3 | targets:
4 | - esp32s3
5 | - esp32p4
6 | description: esp-dl is a lightweight and efficient neural network inference framework designed specifically for ESP series chips.
7 | url: https://github.com/espressif/esp-dl/tree/master/esp-dl
8 | dependencies:
9 | idf: ">=5.3"
10 | espressif/esp_new_jpeg: "^0.6.1"
11 | examples:
12 | - path: ../examples/human_face_detect
13 | - path: ../examples/human_face_recognition
14 | - path: ../examples/pedestrian_detect
15 | - path: ../examples/mobilenetv2_cls
16 | - path: ../examples/yolo11_detect
17 | - path: ../examples/tutorial/how_to_load_test_profile_model/model_in_flash_partition
18 | - path: ../examples/tutorial/how_to_load_test_profile_model/model_in_flash_rodata
19 | - path: ../examples/tutorial/how_to_load_test_profile_model/model_in_sdcard
20 | - path: ../examples/tutorial/how_to_run_model
21 | - path: ../examples/tutorial/how_to_run_streaming_model
--------------------------------------------------------------------------------
/esp-dl/vision/classification/dl_cls_base.cpp:
--------------------------------------------------------------------------------
1 | #include "dl_cls_base.hpp"
2 |
3 | namespace dl {
4 | namespace cls {
5 |
6 | ClsImpl::~ClsImpl()
7 | {
8 | delete m_model;
9 | delete m_image_preprocessor;
10 | delete m_postprocessor;
11 | }
12 |
13 | std::vector &ClsImpl::run(const dl::image::img_t &img)
14 | {
15 | DL_LOG_INFER_LATENCY_INIT();
16 | DL_LOG_INFER_LATENCY_START();
17 | m_image_preprocessor->preprocess(img);
18 | DL_LOG_INFER_LATENCY_END_PRINT("cls", "pre");
19 |
20 | DL_LOG_INFER_LATENCY_START();
21 | m_model->run();
22 | DL_LOG_INFER_LATENCY_END_PRINT("cls", "model");
23 |
24 | DL_LOG_INFER_LATENCY_START();
25 | std::vector &result = m_postprocessor->postprocess();
26 | DL_LOG_INFER_LATENCY_END_PRINT("cls", "post");
27 |
28 | return result;
29 | }
30 |
31 | } // namespace cls
32 | } // namespace dl
33 |
--------------------------------------------------------------------------------
/esp-dl/vision/classification/dl_cls_base.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_cls_postprocessor.hpp"
4 | #include "dl_image_preprocessor.hpp"
5 | #include "dl_model_base.hpp"
6 |
7 | namespace dl {
8 | namespace cls {
9 | class Cls {
10 | public:
11 | virtual ~Cls() {};
12 | virtual std::vector &run(const dl::image::img_t &img) = 0;
13 | };
14 |
15 | class ClsWrapper : public Cls {
16 | protected:
17 | Cls *m_model;
18 |
19 | public:
20 | ~ClsWrapper() { delete m_model; }
21 | std::vector &run(const dl::image::img_t &img) { return m_model->run(img); }
22 | };
23 |
24 | class ClsImpl : public Cls {
25 | protected:
26 | dl::Model *m_model;
27 | dl::image::ImagePreprocessor *m_image_preprocessor;
28 | dl::cls::ClsPostprocessor *m_postprocessor;
29 |
30 | public:
31 | ~ClsImpl();
32 | std::vector &run(const dl::image::img_t &img) override;
33 | };
34 | } // namespace cls
35 | } // namespace dl
36 |
--------------------------------------------------------------------------------
/esp-dl/vision/classification/dl_cls_define.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 |
4 | namespace dl {
5 | namespace cls {
6 | typedef struct {
7 | const char *cat_name;
8 | float score;
9 | } result_t;
10 |
11 | } // namespace cls
12 | } // namespace dl
13 |
--------------------------------------------------------------------------------
/esp-dl/vision/classification/dl_cls_postprocessor.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "dl_cls_define.hpp"
3 | #include "dl_model_base.hpp"
4 | #include "dl_module_softmax.hpp"
5 | #include "dl_tensor_base.hpp"
6 | #include
7 |
8 | namespace dl {
9 | namespace cls {
10 | class ClsPostprocessor {
11 | public:
12 | ClsPostprocessor(
13 | Model *model, const int top_k, const float score_thr, bool need_softmax, const std::string &output_name);
14 | virtual ~ClsPostprocessor();
15 | virtual std::vector &postprocess();
16 |
17 | protected:
18 | const char **m_cat_names;
19 |
20 | private:
21 | TensorBase *m_model_output;
22 | int m_top_k;
23 | float m_score_thr;
24 | bool m_need_softmax;
25 | dl::module::Softmax *m_softmax_module;
26 | TensorBase *m_output;
27 | std::vector m_cls_result;
28 | };
29 | } // namespace cls
30 | } // namespace dl
31 |
--------------------------------------------------------------------------------
/esp-dl/vision/classification/imagenet_cls_postprocessor.cpp:
--------------------------------------------------------------------------------
1 | #include "imagenet_cls_postprocessor.hpp"
2 | #include "imagenet_category_name.hpp"
3 |
4 | namespace dl {
5 | namespace cls {
6 | ImageNetClsPostprocessor::ImageNetClsPostprocessor(
7 | Model *model, const int top_k, const float score_thr, bool need_softmax, const std::string &output_name) :
8 | ClsPostprocessor(model, top_k, score_thr, need_softmax, output_name)
9 | {
10 | m_cat_names = imagenet_cat_names;
11 | }
12 | } // namespace cls
13 | } // namespace dl
14 |
--------------------------------------------------------------------------------
/esp-dl/vision/classification/imagenet_cls_postprocessor.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "dl_cls_postprocessor.hpp"
3 |
4 | namespace dl {
5 | namespace cls {
6 | class ImageNetClsPostprocessor : public ClsPostprocessor {
7 | public:
8 | ImageNetClsPostprocessor(
9 | Model *model, const int top_k, const float score_thr, bool need_softmax, const std::string &output_name = "");
10 | };
11 | } // namespace cls
12 | } // namespace dl
13 |
--------------------------------------------------------------------------------
/esp-dl/vision/detect/dl_detect_base.cpp:
--------------------------------------------------------------------------------
1 | #include "dl_detect_base.hpp"
2 |
3 | namespace dl {
4 | namespace detect {
5 |
6 | DetectImpl::~DetectImpl()
7 | {
8 | delete m_model;
9 | delete m_image_preprocessor;
10 | delete m_postprocessor;
11 | }
12 |
13 | std::list &DetectImpl::run(const dl::image::img_t &img)
14 | {
15 | DL_LOG_INFER_LATENCY_INIT();
16 | DL_LOG_INFER_LATENCY_START();
17 | m_image_preprocessor->preprocess(img);
18 | DL_LOG_INFER_LATENCY_END_PRINT("detect", "pre");
19 |
20 | DL_LOG_INFER_LATENCY_START();
21 | m_model->run();
22 | DL_LOG_INFER_LATENCY_END_PRINT("detect", "model");
23 |
24 | DL_LOG_INFER_LATENCY_START();
25 | m_postprocessor->clear_result();
26 | m_postprocessor->set_resize_scale_x(m_image_preprocessor->get_resize_scale_x());
27 | m_postprocessor->set_resize_scale_y(m_image_preprocessor->get_resize_scale_y());
28 | m_postprocessor->postprocess();
29 | std::list &result = m_postprocessor->get_result(img.width, img.height);
30 | DL_LOG_INFER_LATENCY_END_PRINT("detect", "post");
31 |
32 | return result;
33 | }
34 |
35 | } // namespace detect
36 | } // namespace dl
37 |
--------------------------------------------------------------------------------
/esp-dl/vision/detect/dl_detect_base.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_detect_postprocessor.hpp"
4 | #include "dl_image_preprocessor.hpp"
5 | #include "dl_model_base.hpp"
6 |
7 | namespace dl {
8 | namespace detect {
9 | class Detect {
10 | public:
11 | virtual ~Detect() {};
12 | virtual std::list &run(const dl::image::img_t &img) = 0;
13 | };
14 |
15 | class DetectWrapper : public Detect {
16 | protected:
17 | Detect *m_model;
18 |
19 | public:
20 | ~DetectWrapper() { delete m_model; }
21 | std::list &run(const dl::image::img_t &img) { return m_model->run(img); }
22 | };
23 |
24 | class DetectImpl : public Detect {
25 | protected:
26 | dl::Model *m_model;
27 | dl::image::ImagePreprocessor *m_image_preprocessor;
28 | dl::detect::DetectPostprocessor *m_postprocessor;
29 |
30 | public:
31 | ~DetectImpl();
32 | std::list &run(const dl::image::img_t &img) override;
33 | };
34 | } // namespace detect
35 | } // namespace dl
36 |
--------------------------------------------------------------------------------
/esp-dl/vision/detect/dl_detect_espdet_postprocessor.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "dl_detect_postprocessor.hpp"
3 |
4 | namespace dl {
5 | namespace detect {
6 | class ESPDetPostProcessor : public AnchorPointDetectPostprocessor {
7 | private:
8 | template
9 | void parse_stage(TensorBase *score, TensorBase *box, const int stage_index);
10 |
11 | public:
12 | void postprocess() override;
13 | using AnchorPointDetectPostprocessor::AnchorPointDetectPostprocessor;
14 | };
15 | } // namespace detect
16 | } // namespace dl
17 |
--------------------------------------------------------------------------------
/esp-dl/vision/detect/dl_detect_mnp_postprocessor.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "dl_detect_postprocessor.hpp"
3 |
4 | namespace dl {
5 | namespace detect {
6 | class MNPPostprocessor : public AnchorBoxDetectPostprocessor {
7 | private:
8 | template
9 | void parse_stage(TensorBase *score, TensorBase *box, TensorBase *landmark, const int stage_index);
10 |
11 | public:
12 | void postprocess() override;
13 | using AnchorBoxDetectPostprocessor::AnchorBoxDetectPostprocessor;
14 | };
15 | } // namespace detect
16 | } // namespace dl
17 |
--------------------------------------------------------------------------------
/esp-dl/vision/detect/dl_detect_msr_postprocessor.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "dl_detect_postprocessor.hpp"
3 |
4 | namespace dl {
5 | namespace detect {
6 | class MSRPostprocessor : public AnchorBoxDetectPostprocessor {
7 | private:
8 | template
9 | void parse_stage(TensorBase *score, TensorBase *box, const int stage_index);
10 |
11 | public:
12 | void postprocess() override;
13 | using AnchorBoxDetectPostprocessor::AnchorBoxDetectPostprocessor;
14 | };
15 | } // namespace detect
16 | } // namespace dl
17 |
--------------------------------------------------------------------------------
/esp-dl/vision/detect/dl_detect_pico_postprocessor.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "dl_detect_postprocessor.hpp"
3 |
4 | namespace dl {
5 | namespace detect {
6 | class PicoPostprocessor : public AnchorPointDetectPostprocessor {
7 | private:
8 | template
9 | void parse_stage(TensorBase *score, TensorBase *box, const int stage_index);
10 |
11 | public:
12 | void postprocess() override;
13 | using AnchorPointDetectPostprocessor::AnchorPointDetectPostprocessor;
14 | };
15 | } // namespace detect
16 | } // namespace dl
17 |
--------------------------------------------------------------------------------
/esp-dl/vision/detect/dl_detect_yolo11_postprocessor.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "dl_detect_postprocessor.hpp"
3 |
4 | namespace dl {
5 | namespace detect {
6 | class yolo11PostProcessor : public AnchorPointDetectPostprocessor {
7 | private:
8 | template
9 | void parse_stage(TensorBase *score, TensorBase *box, const int stage_index);
10 |
11 | public:
12 | void postprocess() override;
13 | using AnchorPointDetectPostprocessor::AnchorPointDetectPostprocessor;
14 | };
15 | } // namespace detect
16 | } // namespace dl
17 |
--------------------------------------------------------------------------------
/esp-dl/vision/detect/dl_pose_yolo11_postprocessor.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "dl_detect_postprocessor.hpp"
3 |
4 | namespace dl {
5 | namespace detect {
6 | class yolo11posePostProcessor : public AnchorPointDetectPostprocessor {
7 | private:
8 | template
9 | void parse_stage(TensorBase *score, TensorBase *box, TensorBase *kpt, const int stage_index);
10 |
11 | public:
12 | void postprocess() override;
13 | using AnchorPointDetectPostprocessor::AnchorPointDetectPostprocessor;
14 | };
15 | } // namespace detect
16 | } // namespace dl
17 |
--------------------------------------------------------------------------------
/esp-dl/vision/image/dl_image.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "dl_image_bmp.hpp"
3 | #include "dl_image_color.hpp"
4 | #include "dl_image_draw.hpp"
5 | #include "dl_image_jpeg.hpp"
6 | #include "dl_image_process.hpp"
7 |
--------------------------------------------------------------------------------
/esp-dl/vision/image/dl_image_bmp.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "dl_image_color.hpp"
3 | #include "dl_image_define.hpp"
4 | #include "esp_err.h"
5 | #include "esp_heap_caps.h"
6 | #include "esp_log.h"
7 |
8 | namespace dl {
9 | namespace image {
10 | /**
11 | * @brief Save a BGR or GRAY image to BMP.
12 | *
13 | * @param img Image to save.
14 | * @param file_name Save path of the BMP image.
15 | * @return esp_err_t
16 | */
17 | esp_err_t write_bmp_base(const img_t &img, const char *file_name);
18 | /**
19 | * @brief Extend write_bmp_base, add support to save RGB565/RGB888 in RGB to BMP with additional convert.
20 | *
21 | * @param img Image to save.
22 | * @param file_name Save path of the BMP image.
23 | * @param caps Default to 0, save RGB565 in little endian RGB/ RGB888 in BGR.
24 | * @return esp_err_t
25 | */
26 | esp_err_t write_bmp(const img_t &img, const char *file_name, uint32_t caps = 0);
27 | /**
28 | * @brief Read a BMP.
29 | *
30 | * @param file_name Read path of the BMP image.
31 | * @return esp_err_t
32 | */
33 | img_t read_bmp(const char *file_name);
34 | } // namespace image
35 | } // namespace dl
36 |
--------------------------------------------------------------------------------
/esp-dl/vision/image/dl_image_draw.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "dl_image_color.hpp"
3 | #include "dl_image_define.hpp"
4 |
5 | namespace dl {
6 | namespace image {
7 | template
8 | void draw_point(const img_t &img, int x, int y, uint8_t radius, const pix_t &pix);
9 | void draw_point(const img_t &img, int x, int y, const std::vector &color, uint8_t radius, uint32_t caps = 0);
10 |
11 | template
12 | void draw_hollow_rectangle(const img_t &img, int x1, int y1, int x2, int y2, uint8_t line_width, const pix_t &pix);
13 | void draw_hollow_rectangle(const img_t &img,
14 | int x1,
15 | int y1,
16 | int x2,
17 | int y2,
18 | const std::vector &color,
19 | uint8_t line_width,
20 | uint32_t caps = 0);
21 |
22 | } // namespace image
23 | } // namespace dl
24 |
--------------------------------------------------------------------------------
/esp-dl/vision/recognition/dl_feat_base.cpp:
--------------------------------------------------------------------------------
1 | #include "dl_feat_base.hpp"
2 |
3 | namespace dl {
4 | namespace feat {
5 |
6 | FeatImpl::~FeatImpl()
7 | {
8 | delete m_model;
9 | delete m_image_preprocessor;
10 | delete m_postprocessor;
11 | }
12 |
13 | TensorBase *FeatImpl::run(const dl::image::img_t &img, const std::vector &landmarks)
14 | {
15 | DL_LOG_INFER_LATENCY_INIT();
16 | DL_LOG_INFER_LATENCY_START();
17 | m_image_preprocessor->preprocess(img, landmarks);
18 | DL_LOG_INFER_LATENCY_END_PRINT("feat", "pre");
19 |
20 | DL_LOG_INFER_LATENCY_START();
21 | m_model->run();
22 | DL_LOG_INFER_LATENCY_END_PRINT("feat", "model");
23 |
24 | DL_LOG_INFER_LATENCY_START();
25 | dl::TensorBase *feat = m_postprocessor->postprocess();
26 | DL_LOG_INFER_LATENCY_END_PRINT("feat", "post");
27 |
28 | return feat;
29 | }
30 |
31 | } // namespace feat
32 | } // namespace dl
33 |
--------------------------------------------------------------------------------
/esp-dl/vision/recognition/dl_feat_base.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "dl_feat_image_preprocessor.hpp"
4 | #include "dl_feat_postprocessor.hpp"
5 | #include "dl_model_base.hpp"
6 |
7 | namespace dl {
8 | namespace feat {
9 | class Feat {
10 | public:
11 | virtual ~Feat() {};
12 | virtual TensorBase *run(const dl::image::img_t &img, const std::vector &landmarks) = 0;
13 | int m_feat_len;
14 | };
15 |
16 | class FeatWrapper : public Feat {
17 | protected:
18 | Feat *m_model;
19 |
20 | public:
21 | ~FeatWrapper() { delete m_model; }
22 | TensorBase *run(const dl::image::img_t &img, const std::vector &landmarks)
23 | {
24 | return m_model->run(img, landmarks);
25 | }
26 | };
27 |
28 | class FeatImpl : public Feat {
29 | protected:
30 | dl::Model *m_model;
31 | dl::image::FeatImagePreprocessor *m_image_preprocessor;
32 | dl::feat::FeatPostprocessor *m_postprocessor;
33 |
34 | public:
35 | ~FeatImpl();
36 | TensorBase *run(const dl::image::img_t &img, const std::vector &landmarks) override;
37 | };
38 | } // namespace feat
39 | } // namespace dl
40 |
--------------------------------------------------------------------------------
/esp-dl/vision/recognition/dl_feat_image_preprocessor.cpp:
--------------------------------------------------------------------------------
1 | #include "dl_feat_image_preprocessor.hpp"
2 |
3 | namespace dl {
4 | namespace image {
5 | std::vector FeatImagePreprocessor::s_std_ldks_112 = {
6 | 38.2946, 51.6963, 41.5493, 92.3655, 56.0252, 71.7366, 73.5318, 51.5014, 70.7299, 92.2041};
7 |
8 | FeatImagePreprocessor::~FeatImagePreprocessor()
9 | {
10 | delete m_image_preprocessor;
11 | }
12 |
13 | void FeatImagePreprocessor::preprocess(const dl::image::img_t &img, const std::vector &landmarks)
14 | {
15 | assert(landmarks.size() == 10);
16 | // align face
17 | float h_scale = (float)m_image_preprocessor->m_model_input->shape[1] / 112.0;
18 | float w_scale = (float)m_image_preprocessor->m_model_input->shape[2] / 112.0;
19 | dl::math::Matrix source_coord(5, 2);
20 | dl::math::Matrix dest_coord(5, 2);
21 | dest_coord.set_value(landmarks);
22 | for (int i = 0; i < source_coord.h; i++) {
23 | source_coord.array[i][0] = w_scale * s_std_ldks_112[2 * i];
24 | source_coord.array[i][1] = h_scale * s_std_ldks_112[2 * i + 1];
25 | }
26 | dl::math::Matrix M_inv = dl::math::get_similarity_transform(source_coord, dest_coord);
27 | m_image_preprocessor->preprocess(img, &M_inv);
28 | }
29 | } // namespace image
30 | } // namespace dl
31 |
--------------------------------------------------------------------------------
/esp-dl/vision/recognition/dl_feat_image_preprocessor.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "dl_image_preprocessor.hpp"
3 | #include "dl_math_matrix.hpp"
4 |
5 | namespace dl {
6 | namespace image {
7 | class FeatImagePreprocessor {
8 | public:
9 | FeatImagePreprocessor(Model *model,
10 | const std::vector &mean,
11 | const std::vector &std,
12 | uint32_t caps = 0,
13 | const std::string &input_name = "") :
14 | m_image_preprocessor(new dl::image::ImagePreprocessor(model, mean, std, caps, input_name)) {};
15 |
16 | ~FeatImagePreprocessor();
17 |
18 | void preprocess(const dl::image::img_t &img, const std::vector &landmarks);
19 |
20 | private:
21 | static std::vector s_std_ldks_112;
22 | dl::image::ImagePreprocessor *m_image_preprocessor;
23 | };
24 | } // namespace image
25 | } // namespace dl
26 |
--------------------------------------------------------------------------------
/esp-dl/vision/recognition/dl_feat_postprocessor.cpp:
--------------------------------------------------------------------------------
1 | #include "dl_feat_postprocessor.hpp"
2 |
3 | namespace dl {
4 | namespace feat {
5 |
6 | FeatPostprocessor::FeatPostprocessor(Model *model, const std::string &output_name)
7 | {
8 | m_model_output = model->get_output(output_name);
9 | m_feat = new TensorBase(m_model_output->shape, nullptr, 0, DATA_TYPE_FLOAT);
10 | }
11 |
12 | TensorBase *FeatPostprocessor::postprocess()
13 | {
14 | m_feat->assign(m_model_output);
15 | l2_norm();
16 | return m_feat;
17 | }
18 |
19 | void FeatPostprocessor::l2_norm()
20 | {
21 | float norm = 0;
22 | float *ptr = (float *)m_feat->data;
23 | for (int i = 0; i < m_feat->get_size(); i++) {
24 | norm += (ptr[i] * ptr[i]);
25 | }
26 | norm = dl::math::sqrt_newton(norm);
27 | for (int i = 0; i < m_feat->get_size(); i++) {
28 | ptr[i] /= norm;
29 | }
30 | }
31 | } // namespace feat
32 | } // namespace dl
33 |
--------------------------------------------------------------------------------
/esp-dl/vision/recognition/dl_feat_postprocessor.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "dl_math.hpp"
3 | #include "dl_model_base.hpp"
4 | #include "dl_tensor_base.hpp"
5 | #include