├── .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 | docs: latestdocslatest 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 6 | 7 | namespace dl { 8 | namespace feat { 9 | class FeatPostprocessor { 10 | private: 11 | TensorBase *m_model_output; 12 | TensorBase *m_feat; 13 | void l2_norm(); 14 | 15 | public: 16 | FeatPostprocessor(Model *model, const std::string &output_name = ""); 17 | TensorBase *postprocess(); 18 | ~FeatPostprocessor() { delete m_feat; } 19 | }; 20 | } // namespace feat 21 | } // namespace dl 22 | -------------------------------------------------------------------------------- /esp-dl/vision/recognition/dl_recognition_database.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "dl_recognition_define.hpp" 3 | #include "dl_tensor_base.hpp" 4 | #include "esp_check.h" 5 | #include "esp_system.h" 6 | #include 7 | #include 8 | 9 | namespace dl { 10 | namespace recognition { 11 | class DataBase { 12 | public: 13 | DataBase(const char *db_path, int feat_len); 14 | virtual ~DataBase(); 15 | esp_err_t clear_all_feats(); 16 | esp_err_t enroll_feat(TensorBase *feat); 17 | esp_err_t delete_feat(uint16_t id); 18 | esp_err_t delete_last_feat(); 19 | std::vector query_feat(TensorBase *feat, float thr, int top_k); 20 | void print(); 21 | int get_num_feats() { return m_meta.num_feats_valid; } 22 | 23 | private: 24 | char *m_db_path; 25 | std::list m_feats; 26 | database_meta m_meta; 27 | 28 | esp_err_t create_empty_database_in_storage(int feat_len); 29 | esp_err_t load_database_from_storage(int feat_len); 30 | void clear_all_feats_in_memory(); 31 | float cal_similarity(float *feat1, float *feat2); 32 | }; 33 | } // namespace recognition 34 | } // namespace dl 35 | -------------------------------------------------------------------------------- /esp-dl/vision/recognition/dl_recognition_define.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace dl { 5 | namespace recognition { 6 | typedef struct { 7 | uint16_t num_feats_total; 8 | uint16_t num_feats_valid; 9 | uint16_t feat_len; 10 | } database_meta; 11 | 12 | typedef struct { 13 | uint16_t id; 14 | float *feat; 15 | } database_feat; 16 | 17 | typedef struct { 18 | uint16_t id; 19 | float similarity; 20 | } result_t; 21 | 22 | } // namespace recognition 23 | } // namespace dl 24 | -------------------------------------------------------------------------------- /examples/cat_detect/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | 5 | add_compile_options(-fdiagnostics-color=always) 6 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 7 | project(cat_detect) 8 | -------------------------------------------------------------------------------- /examples/cat_detect/img/cat_fp32.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/cat_detect/img/cat_fp32.jpg -------------------------------------------------------------------------------- /examples/cat_detect/img/cat_n_p4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/cat_detect/img/cat_n_p4.jpg -------------------------------------------------------------------------------- /examples/cat_detect/img/cat_n_s3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/cat_detect/img/cat_n_s3.jpg -------------------------------------------------------------------------------- /examples/cat_detect/img/cat_s_p4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/cat_detect/img/cat_s_p4.jpg -------------------------------------------------------------------------------- /examples/cat_detect/img/cat_s_s3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/cat_detect/img/cat_s_s3.jpg -------------------------------------------------------------------------------- /examples/cat_detect/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(src_dirs ./) 2 | 3 | set(include_dirs ./) 4 | 5 | set(requires cat_detect) 6 | 7 | if (IDF_TARGET STREQUAL "esp32s3") 8 | list(APPEND requires esp32_s3_eye_noglib 9 | esp_lcd) 10 | elseif (IDF_TARGET STREQUAL "esp32p4") 11 | list(APPEND requires esp32_p4_function_ev_board_noglib 12 | esp_lcd) 13 | endif() 14 | 15 | set(embed_files "cat.jpg") 16 | 17 | idf_component_register(SRC_DIRS ${src_dirs} INCLUDE_DIRS ${include_dirs} REQUIRES ${requires} EMBED_FILES ${embed_files}) 18 | -------------------------------------------------------------------------------- /examples/cat_detect/main/app_main.cpp: -------------------------------------------------------------------------------- 1 | #include "cat_detect.hpp" 2 | #include "esp_log.h" 3 | #include "bsp/esp-bsp.h" 4 | 5 | extern const uint8_t cat_jpg_start[] asm("_binary_cat_jpg_start"); 6 | extern const uint8_t cat_jpg_end[] asm("_binary_cat_jpg_end"); 7 | const char *TAG = "cat_detect"; 8 | 9 | extern "C" void app_main(void) 10 | { 11 | #if CONFIG_CAT_DETECT_MODEL_IN_SDCARD 12 | ESP_ERROR_CHECK(bsp_sdcard_mount()); 13 | #endif 14 | 15 | dl::image::jpeg_img_t jpeg_img = {.data = (void *)cat_jpg_start, .data_len = (size_t)(cat_jpg_end - cat_jpg_start)}; 16 | auto img = sw_decode_jpeg(jpeg_img, dl::image::DL_IMAGE_PIX_TYPE_RGB888); 17 | 18 | CatDetect *detect = new CatDetect(); 19 | auto &detect_results = detect->run(img); 20 | for (const auto &res : detect_results) { 21 | ESP_LOGI(TAG, 22 | "[category: %d, score: %f, x1: %d, y1: %d, x2: %d, y2: %d]", 23 | res.category, 24 | res.score, 25 | res.box[0], 26 | res.box[1], 27 | res.box[2], 28 | res.box[3]); 29 | } 30 | delete detect; 31 | heap_caps_free(img.data); 32 | 33 | #if CONFIG_CAT_DETECT_MODEL_IN_SDCARD 34 | ESP_ERROR_CHECK(bsp_sdcard_unmount()); 35 | #endif 36 | } 37 | -------------------------------------------------------------------------------- /examples/cat_detect/main/cat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/cat_detect/main/cat.jpg -------------------------------------------------------------------------------- /examples/cat_detect/main/idf_component.yml: -------------------------------------------------------------------------------- 1 | ## IDF Component Manager Manifest File 2 | dependencies: 3 | espressif/cat_detect: 4 | version: "^0.1.0" 5 | override_path: "../../../models/cat_detect" 6 | espressif/esp32_p4_function_ev_board_noglib: 7 | version: "^4.0.1" 8 | rules: 9 | - if: "target == esp32p4" 10 | espressif/esp32_s3_eye_noglib: 11 | version: "^3.1.0~1" 12 | rules: 13 | - if: "target == esp32s3" 14 | -------------------------------------------------------------------------------- /examples/cat_detect/partitions.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild 3 | 4 | nvs, data, nvs, 0x9000, 24K, 5 | phy_init, data, phy, 0xf000, 4K, 6 | factory, app, factory, 0x010000, 8000K, 7 | -------------------------------------------------------------------------------- /examples/cat_detect/partitions2.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild 3 | 4 | nvs, data, nvs, 0x9000, 24K, 5 | phy_init, data, phy, 0xf000, 4K, 6 | factory, app, factory, 0x010000, 2000K, 7 | cat_det, data, spiffs, , 4M, 8 | -------------------------------------------------------------------------------- /examples/cat_detect/sdkconfig.defaults: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/cat_detect/sdkconfig.defaults -------------------------------------------------------------------------------- /examples/cat_detect/sdkconfig.defaults.esp32p4: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32p4" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_COMPILER_OPTIMIZATION_PERF=y 9 | CONFIG_SPIRAM=y 10 | CONFIG_SPIRAM_SPEED_200M=y 11 | CONFIG_SPIRAM_XIP_FROM_PSRAM=y 12 | CONFIG_CACHE_L2_CACHE_256KB=y 13 | CONFIG_CACHE_L2_CACHE_LINE_128B=y 14 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 15 | CONFIG_FATFS_LFN_HEAP=y 16 | CONFIG_BSP_SD_FORMAT_ON_MOUNT_FAIL=y 17 | CONFIG_JD_FASTDECODE_BASIC=y 18 | CONFIG_IDF_EXPERIMENTAL_FEATURES=y 19 | -------------------------------------------------------------------------------- /examples/cat_detect/sdkconfig.defaults.esp32s3: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32s3" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_COMPILER_OPTIMIZATION_PERF=y 9 | CONFIG_SPIRAM=y 10 | CONFIG_SPIRAM_MODE_OCT=y 11 | CONFIG_SPIRAM_SPEED_80M=y 12 | CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y 13 | CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y 14 | CONFIG_ESP32S3_DATA_CACHE_64KB=y 15 | CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y 16 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 17 | CONFIG_ESP_TASK_WDT_TIMEOUT_S=40 18 | CONFIG_FATFS_LFN_HEAP=y 19 | CONFIG_BSP_SD_FORMAT_ON_MOUNT_FAIL=y 20 | -------------------------------------------------------------------------------- /examples/human_face_detect/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | 5 | add_compile_options(-fdiagnostics-color=always) 6 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 7 | project(human_face_detect) 8 | -------------------------------------------------------------------------------- /examples/human_face_detect/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(src_dirs ./) 2 | 3 | set(include_dirs ./) 4 | 5 | set(requires human_face_detect) 6 | 7 | if (IDF_TARGET STREQUAL "esp32s3") 8 | list(APPEND requires esp32_s3_eye_noglib 9 | esp_lcd) 10 | elseif (IDF_TARGET STREQUAL "esp32p4") 11 | list(APPEND requires esp32_p4_function_ev_board_noglib 12 | esp_lcd) 13 | endif() 14 | 15 | set(embed_files "human_face.jpg") 16 | 17 | idf_component_register(SRC_DIRS ${src_dirs} INCLUDE_DIRS ${include_dirs} REQUIRES ${requires} EMBED_FILES ${embed_files}) 18 | -------------------------------------------------------------------------------- /examples/human_face_detect/main/human_face.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/human_face_detect/main/human_face.jpg -------------------------------------------------------------------------------- /examples/human_face_detect/main/idf_component.yml: -------------------------------------------------------------------------------- 1 | ## IDF Component Manager Manifest File 2 | dependencies: 3 | espressif/human_face_detect: 4 | version: "^0.2.0" 5 | override_path: "../../../models/human_face_detect" 6 | espressif/esp32_p4_function_ev_board_noglib: 7 | version: "^4.0.1" 8 | rules: 9 | - if: "target == esp32p4" 10 | espressif/esp32_s3_eye_noglib: 11 | version: "^3.1.0~1" 12 | rules: 13 | - if: "target == esp32s3" -------------------------------------------------------------------------------- /examples/human_face_detect/partitions.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild 3 | 4 | nvs, data, nvs, 0x9000, 24K, 5 | phy_init, data, phy, 0xf000, 4K, 6 | factory, app, factory, 0x010000, 8000K, 7 | -------------------------------------------------------------------------------- /examples/human_face_detect/partitions2.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild 3 | 4 | nvs, data, nvs, 0x9000, 24K, 5 | phy_init, data, phy, 0xf000, 4K, 6 | factory, app, factory, 0x010000, 2000K, 7 | human_face_det, data, spiffs, , 200K, 8 | -------------------------------------------------------------------------------- /examples/human_face_detect/sdkconfig.defaults: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/human_face_detect/sdkconfig.defaults -------------------------------------------------------------------------------- /examples/human_face_detect/sdkconfig.defaults.esp32p4: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32p4" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_COMPILER_OPTIMIZATION_PERF=y 9 | CONFIG_SPIRAM=y 10 | CONFIG_SPIRAM_SPEED_200M=y 11 | CONFIG_SPIRAM_XIP_FROM_PSRAM=y 12 | CONFIG_CACHE_L2_CACHE_256KB=y 13 | CONFIG_CACHE_L2_CACHE_LINE_128B=y 14 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 15 | CONFIG_FATFS_LFN_HEAP=y 16 | CONFIG_BSP_SD_FORMAT_ON_MOUNT_FAIL=y 17 | CONFIG_JD_FASTDECODE_BASIC=y 18 | CONFIG_IDF_EXPERIMENTAL_FEATURES=y 19 | -------------------------------------------------------------------------------- /examples/human_face_detect/sdkconfig.defaults.esp32s3: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32s3" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_COMPILER_OPTIMIZATION_PERF=y 9 | CONFIG_SPIRAM=y 10 | CONFIG_SPIRAM_MODE_OCT=y 11 | CONFIG_SPIRAM_XIP_FROM_PSRAM=y 12 | CONFIG_SPIRAM_SPEED_80M=y 13 | CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y 14 | CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y 15 | CONFIG_ESP32S3_DATA_CACHE_64KB=y 16 | CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y 17 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 18 | CONFIG_FATFS_LFN_HEAP=y 19 | CONFIG_BSP_SD_FORMAT_ON_MOUNT_FAIL=y 20 | -------------------------------------------------------------------------------- /examples/human_face_recognition/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | 5 | add_compile_options(-fdiagnostics-color=always) 6 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 7 | project(human_face_recognition) 8 | -------------------------------------------------------------------------------- /examples/human_face_recognition/components/spiflash_fatfs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(src_dirs .) 2 | 3 | set(include_dirs .) 4 | 5 | set(requires fatfs vfs) 6 | 7 | idf_component_register(SRC_DIRS ${src_dirs} INCLUDE_DIRS ${include_dirs} REQUIRES ${requires}) 8 | -------------------------------------------------------------------------------- /examples/human_face_recognition/components/spiflash_fatfs/Kconfig: -------------------------------------------------------------------------------- 1 | menu "models: human_face_recognition" 2 | config SPIFLASH_MOUNT_POINT 3 | string "spiflash fatfs mount point" 4 | default "/spiflash" 5 | 6 | config SPIFLASH_MOUNT_PARTITION 7 | string "spiflash fatfs mount partition" 8 | default "storage" 9 | endmenu 10 | -------------------------------------------------------------------------------- /examples/human_face_recognition/components/spiflash_fatfs/spiflash_fatfs.cpp: -------------------------------------------------------------------------------- 1 | #include "spiflash_fatfs.hpp" 2 | 3 | static const char *TAG = "spiflash_fatfs"; 4 | static wl_handle_t wl_handle; 5 | 6 | esp_err_t fatfs_flash_mount() 7 | { 8 | esp_vfs_fat_mount_config_t mount_config; 9 | memset(&mount_config, 0, sizeof(esp_vfs_fat_mount_config_t)); 10 | mount_config.max_files = 5; 11 | mount_config.format_if_mount_failed = true; 12 | ESP_ERROR_CHECK(esp_vfs_fat_spiflash_mount_rw_wl( 13 | CONFIG_SPIFLASH_MOUNT_POINT, CONFIG_SPIFLASH_MOUNT_PARTITION, &mount_config, &wl_handle)); 14 | return ESP_OK; 15 | } 16 | 17 | esp_err_t fatfs_flash_unmount() 18 | { 19 | ESP_RETURN_ON_ERROR( 20 | esp_vfs_fat_spiflash_unmount_rw_wl(CONFIG_SPIFLASH_MOUNT_POINT, wl_handle), TAG, "Failed to unmount."); 21 | return ESP_OK; 22 | } 23 | -------------------------------------------------------------------------------- /examples/human_face_recognition/components/spiflash_fatfs/spiflash_fatfs.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "esp_check.h" 4 | #include "esp_err.h" 5 | #include "esp_log.h" 6 | #include "esp_vfs.h" 7 | #include "esp_vfs_fat.h" 8 | 9 | esp_err_t fatfs_flash_mount(); 10 | esp_err_t fatfs_flash_unmount(); 11 | -------------------------------------------------------------------------------- /examples/human_face_recognition/faces/bill1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/human_face_recognition/faces/bill1.jpg -------------------------------------------------------------------------------- /examples/human_face_recognition/faces/bill2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/human_face_recognition/faces/bill2.jpg -------------------------------------------------------------------------------- /examples/human_face_recognition/faces/musk1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/human_face_recognition/faces/musk1.jpg -------------------------------------------------------------------------------- /examples/human_face_recognition/faces/musk2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/human_face_recognition/faces/musk2.jpg -------------------------------------------------------------------------------- /examples/human_face_recognition/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(src_dirs ./) 2 | 3 | set(include_dirs ./) 4 | 5 | set(requires human_face_recognition 6 | spiflash_fatfs) 7 | 8 | if (IDF_TARGET STREQUAL "esp32s3") 9 | list(APPEND requires esp32_s3_eye_noglib 10 | esp_lcd) 11 | elseif (IDF_TARGET STREQUAL "esp32p4") 12 | list(APPEND requires esp32_p4_function_ev_board_noglib 13 | esp_lcd) 14 | endif() 15 | 16 | file(GLOB embed_files "${PROJECT_DIR}/faces/*.jpg") 17 | 18 | idf_component_register(SRC_DIRS ${src_dirs} INCLUDE_DIRS ${include_dirs} REQUIRES ${requires} EMBED_FILES ${embed_files}) 19 | -------------------------------------------------------------------------------- /examples/human_face_recognition/main/Kconfig.projbuild: -------------------------------------------------------------------------------- 1 | menu "example: human_face_recognition" 2 | choice DB_FILE_SYSTEM 3 | prompt "database file system" 4 | default DB_FATFS_FLASH 5 | help 6 | fatfs support flash/sdcard. spiffs only support flash. 7 | config DB_FATFS_FLASH 8 | bool "fatfs_flash" 9 | config DB_FATFS_SDCARD 10 | bool "fatfs_sdcard" 11 | config DB_SPIFFS 12 | bool "spiffs" 13 | endchoice 14 | endmenu 15 | -------------------------------------------------------------------------------- /examples/human_face_recognition/main/idf_component.yml: -------------------------------------------------------------------------------- 1 | ## IDF Component Manager Manifest File 2 | dependencies: 3 | espressif/human_face_recognition: 4 | version: "^0.2.0" 5 | override_path: "../../../models/human_face_recognition" 6 | espressif/esp32_p4_function_ev_board_noglib: 7 | version: "^4.0.1" 8 | rules: 9 | - if: "target == esp32p4" 10 | espressif/esp32_s3_eye_noglib: 11 | version: "^3.1.0~1" 12 | rules: 13 | - if: "target == esp32s3" -------------------------------------------------------------------------------- /examples/human_face_recognition/partitions.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild 3 | 4 | nvs, data, nvs, 0x9000, 24K, 5 | phy_init, data, phy, 0xf000, 4K, 6 | factory, app, factory, 0x010000, 7000K, 7 | storage, data, fat, , 1M, 8 | -------------------------------------------------------------------------------- /examples/human_face_recognition/partitions2.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild 3 | 4 | nvs, data, nvs, 0x9000, 24K, 5 | phy_init, data, phy, 0xf000, 4K, 6 | factory, app, factory, 0x010000, 1900K, 7 | human_face_det, data, spiffs, , 200K, 8 | human_face_feat, data, spiffs, , 5000K, 9 | storage, data, fat, , 1M, 10 | -------------------------------------------------------------------------------- /examples/human_face_recognition/sdkconfig.defaults: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/human_face_recognition/sdkconfig.defaults -------------------------------------------------------------------------------- /examples/human_face_recognition/sdkconfig.defaults.esp32p4: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32p4" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_COMPILER_OPTIMIZATION_PERF=y 9 | CONFIG_SPIRAM=y 10 | CONFIG_SPIRAM_SPEED_200M=y 11 | CONFIG_SPIRAM_XIP_FROM_PSRAM=y 12 | CONFIG_CACHE_L2_CACHE_256KB=y 13 | CONFIG_CACHE_L2_CACHE_LINE_128B=y 14 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 15 | CONFIG_FATFS_LFN_HEAP=y 16 | CONFIG_BSP_SD_FORMAT_ON_MOUNT_FAIL=y 17 | CONFIG_BSP_SPIFFS_FORMAT_ON_MOUNT_FAIL=y 18 | CONFIG_JD_FASTDECODE_BASIC=y 19 | CONFIG_IDF_EXPERIMENTAL_FEATURES=y 20 | -------------------------------------------------------------------------------- /examples/human_face_recognition/sdkconfig.defaults.esp32s3: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32s3" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_COMPILER_OPTIMIZATION_PERF=y 9 | CONFIG_SPIRAM=y 10 | CONFIG_SPIRAM_MODE_OCT=y 11 | CONFIG_SPIRAM_XIP_FROM_PSRAM=y 12 | CONFIG_SPIRAM_SPEED_80M=y 13 | CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y 14 | CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y 15 | CONFIG_ESP32S3_DATA_CACHE_64KB=y 16 | CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y 17 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 18 | CONFIG_FATFS_LFN_HEAP=y 19 | CONFIG_BSP_SPIFFS_FORMAT_ON_MOUNT_FAIL=y 20 | CONFIG_BSP_SD_FORMAT_ON_MOUNT_FAIL=y 21 | -------------------------------------------------------------------------------- /examples/mobilenetv2_cls/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | 5 | set(EXTRA_COMPONENT_DIRS ../../models/imagenet_cls) 6 | 7 | add_compile_options(-fdiagnostics-color=always) 8 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 9 | project(imagenet_cls) 10 | -------------------------------------------------------------------------------- /examples/mobilenetv2_cls/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(src_dirs ./) 2 | 3 | set(include_dirs ./) 4 | 5 | set(requires imagenet_cls) 6 | 7 | if (IDF_TARGET STREQUAL "esp32s3") 8 | list(APPEND requires esp32_s3_eye_noglib 9 | esp_lcd) 10 | elseif (IDF_TARGET STREQUAL "esp32p4") 11 | list(APPEND requires esp32_p4_function_ev_board_noglib 12 | esp_lcd) 13 | endif() 14 | 15 | set(embed_files "cat.jpg") 16 | 17 | idf_component_register(SRC_DIRS ${src_dirs} INCLUDE_DIRS ${include_dirs} REQUIRES ${requires} EMBED_FILES ${embed_files}) 18 | -------------------------------------------------------------------------------- /examples/mobilenetv2_cls/main/app_main.cpp: -------------------------------------------------------------------------------- 1 | #include "esp_log.h" 2 | #include "imagenet_cls.hpp" 3 | #include "bsp/esp-bsp.h" 4 | 5 | extern const uint8_t cat_jpg_start[] asm("_binary_cat_jpg_start"); 6 | extern const uint8_t cat_jpg_end[] asm("_binary_cat_jpg_end"); 7 | const char *TAG = "mobilenetv2_cls"; 8 | 9 | extern "C" void app_main(void) 10 | { 11 | #if CONFIG_IMAGENET_CLS_MODEL_IN_SDCARD 12 | ESP_ERROR_CHECK(bsp_sdcard_mount()); 13 | #endif 14 | 15 | dl::image::jpeg_img_t jpeg_img = {.data = (void *)cat_jpg_start, .data_len = (size_t)(cat_jpg_end - cat_jpg_start)}; 16 | auto img = sw_decode_jpeg(jpeg_img, dl::image::DL_IMAGE_PIX_TYPE_RGB888); 17 | 18 | ImageNetCls *cls = new ImageNetCls(); 19 | 20 | auto &results = cls->run(img); 21 | for (const auto &res : results) { 22 | ESP_LOGI(TAG, "category: %s, score: %f", res.cat_name, res.score); 23 | } 24 | delete cls; 25 | heap_caps_free(img.data); 26 | 27 | #if CONFIG_IMAGENET_CLS_MODEL_IN_SDCARD 28 | ESP_ERROR_CHECK(bsp_sdcard_unmount()); 29 | #endif 30 | } 31 | -------------------------------------------------------------------------------- /examples/mobilenetv2_cls/main/cat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/mobilenetv2_cls/main/cat.jpg -------------------------------------------------------------------------------- /examples/mobilenetv2_cls/main/idf_component.yml: -------------------------------------------------------------------------------- 1 | ## IDF Component Manager Manifest File 2 | dependencies: 3 | espressif/imagenet_cls: 4 | version: "^0.2.0" 5 | override_path: "../../../models/imagenet_cls" 6 | espressif/esp32_p4_function_ev_board_noglib: 7 | version: "^4.0.1" 8 | rules: 9 | - if: "target == esp32p4" 10 | espressif/esp32_s3_eye_noglib: 11 | version: "^3.1.0~1" 12 | rules: 13 | - if: "target == esp32s3" -------------------------------------------------------------------------------- /examples/mobilenetv2_cls/partitions.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild 3 | 4 | nvs, data, nvs, 0x9000, 24K, 5 | phy_init, data, phy, 0xf000, 4K, 6 | factory, app, factory, 0x010000, 8000K, 7 | -------------------------------------------------------------------------------- /examples/mobilenetv2_cls/partitions2.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild 3 | 4 | nvs, data, nvs, 0x9000, 24K, 5 | phy_init, data, phy, 0xf000, 4K, 6 | factory, app, factory, 0x010000, 2000K, 7 | imagenet_cls, data, spiffs, , 4M, 8 | -------------------------------------------------------------------------------- /examples/mobilenetv2_cls/sdkconfig.defaults: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/mobilenetv2_cls/sdkconfig.defaults -------------------------------------------------------------------------------- /examples/mobilenetv2_cls/sdkconfig.defaults.esp32p4: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32p4" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_COMPILER_OPTIMIZATION_PERF=y 9 | CONFIG_SPIRAM=y 10 | CONFIG_SPIRAM_SPEED_200M=y 11 | CONFIG_SPIRAM_XIP_FROM_PSRAM=y 12 | CONFIG_CACHE_L2_CACHE_256KB=y 13 | CONFIG_CACHE_L2_CACHE_LINE_128B=y 14 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 15 | CONFIG_FATFS_LFN_HEAP=y 16 | CONFIG_BSP_SD_FORMAT_ON_MOUNT_FAIL=y 17 | CONFIG_JD_FASTDECODE_BASIC=y 18 | CONFIG_IDF_EXPERIMENTAL_FEATURES=y 19 | -------------------------------------------------------------------------------- /examples/mobilenetv2_cls/sdkconfig.defaults.esp32s3: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32s3" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_COMPILER_OPTIMIZATION_PERF=y 9 | CONFIG_SPIRAM=y 10 | CONFIG_SPIRAM_MODE_OCT=y 11 | CONFIG_SPIRAM_XIP_FROM_PSRAM=y 12 | CONFIG_SPIRAM_SPEED_80M=y 13 | CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y 14 | CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y 15 | CONFIG_ESP32S3_DATA_CACHE_64KB=y 16 | CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y 17 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 18 | CONFIG_FATFS_LFN_HEAP=y 19 | CONFIG_BSP_SD_FORMAT_ON_MOUNT_FAIL=y 20 | -------------------------------------------------------------------------------- /examples/pedestrian_detect/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | 5 | add_compile_options(-fdiagnostics-color=always) 6 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 7 | project(pedestrian_detect) 8 | -------------------------------------------------------------------------------- /examples/pedestrian_detect/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(src_dirs ./) 2 | 3 | set(include_dirs ./) 4 | 5 | set(requires pedestrian_detect) 6 | 7 | if (IDF_TARGET STREQUAL "esp32s3") 8 | list(APPEND requires esp32_s3_eye_noglib 9 | esp_lcd) 10 | elseif (IDF_TARGET STREQUAL "esp32p4") 11 | list(APPEND requires esp32_p4_function_ev_board_noglib 12 | esp_lcd) 13 | endif() 14 | 15 | set(embed_files "pedestrian.jpg") 16 | 17 | idf_component_register(SRC_DIRS ${src_dirs} INCLUDE_DIRS ${include_dirs} REQUIRES ${requires} EMBED_FILES ${embed_files}) 18 | -------------------------------------------------------------------------------- /examples/pedestrian_detect/main/app_main.cpp: -------------------------------------------------------------------------------- 1 | #include "esp_log.h" 2 | #include "pedestrian_detect.hpp" 3 | #include "bsp/esp-bsp.h" 4 | 5 | extern const uint8_t pedestrian_jpg_start[] asm("_binary_pedestrian_jpg_start"); 6 | extern const uint8_t pedestrian_jpg_end[] asm("_binary_pedestrian_jpg_end"); 7 | const char *TAG = "pedestrian_detect"; 8 | 9 | extern "C" void app_main(void) 10 | { 11 | #if CONFIG_PEDESTRIAN_DETECT_MODEL_IN_SDCARD 12 | ESP_ERROR_CHECK(bsp_sdcard_mount()); 13 | #endif 14 | 15 | dl::image::jpeg_img_t jpeg_img = {.data = (void *)pedestrian_jpg_start, 16 | .data_len = (size_t)(pedestrian_jpg_end - pedestrian_jpg_start)}; 17 | auto img = sw_decode_jpeg(jpeg_img, dl::image::DL_IMAGE_PIX_TYPE_RGB888); 18 | 19 | PedestrianDetect *detect = new PedestrianDetect(); 20 | 21 | auto &detect_results = detect->run(img); 22 | for (const auto &res : detect_results) { 23 | ESP_LOGI(TAG, 24 | "[score: %f, x1: %d, y1: %d, x2: %d, y2: %d]", 25 | res.score, 26 | res.box[0], 27 | res.box[1], 28 | res.box[2], 29 | res.box[3]); 30 | } 31 | delete detect; 32 | heap_caps_free(img.data); 33 | 34 | #if CONFIG_PEDESTRIAN_DETECT_MODEL_IN_SDCARD 35 | ESP_ERROR_CHECK(bsp_sdcard_unmount()); 36 | #endif 37 | } 38 | -------------------------------------------------------------------------------- /examples/pedestrian_detect/main/idf_component.yml: -------------------------------------------------------------------------------- 1 | ## IDF Component Manager Manifest File 2 | dependencies: 3 | espressif/pedestrian_detect: 4 | version: "^0.2.0" 5 | override_path: "../../../models/pedestrian_detect" 6 | espressif/esp32_p4_function_ev_board_noglib: 7 | version: "^4.0.1" 8 | rules: 9 | - if: "target == esp32p4" 10 | espressif/esp32_s3_eye_noglib: 11 | version: "^3.1.0~1" 12 | rules: 13 | - if: "target == esp32s3" -------------------------------------------------------------------------------- /examples/pedestrian_detect/main/pedestrian.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/pedestrian_detect/main/pedestrian.jpg -------------------------------------------------------------------------------- /examples/pedestrian_detect/partitions.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild 3 | 4 | nvs, data, nvs, 0x9000, 24K, 5 | phy_init, data, phy, 0xf000, 4K, 6 | factory, app, factory, 0x010000, 8000K, 7 | -------------------------------------------------------------------------------- /examples/pedestrian_detect/partitions2.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild 3 | 4 | nvs, data, nvs, 0x9000, 24K, 5 | phy_init, data, phy, 0xf000, 4K, 6 | factory, app, factory, 0x010000, 2000K, 7 | pedestrian_det, data, spiffs, , 500K, 8 | -------------------------------------------------------------------------------- /examples/pedestrian_detect/sdkconfig.defaults: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/pedestrian_detect/sdkconfig.defaults -------------------------------------------------------------------------------- /examples/pedestrian_detect/sdkconfig.defaults.esp32p4: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32p4" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_COMPILER_OPTIMIZATION_PERF=y 9 | CONFIG_SPIRAM=y 10 | CONFIG_SPIRAM_SPEED_200M=y 11 | CONFIG_SPIRAM_XIP_FROM_PSRAM=y 12 | CONFIG_CACHE_L2_CACHE_256KB=y 13 | CONFIG_CACHE_L2_CACHE_LINE_128B=y 14 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 15 | CONFIG_FATFS_LFN_HEAP=y 16 | CONFIG_BSP_SD_FORMAT_ON_MOUNT_FAIL=y 17 | CONFIG_JD_FASTDECODE_BASIC=y 18 | CONFIG_IDF_EXPERIMENTAL_FEATURES=y 19 | -------------------------------------------------------------------------------- /examples/pedestrian_detect/sdkconfig.defaults.esp32s3: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32s3" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_COMPILER_OPTIMIZATION_PERF=y 9 | CONFIG_SPIRAM=y 10 | CONFIG_SPIRAM_MODE_OCT=y 11 | CONFIG_SPIRAM_XIP_FROM_PSRAM=y 12 | CONFIG_SPIRAM_SPEED_80M=y 13 | CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y 14 | CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y 15 | CONFIG_ESP32S3_DATA_CACHE_64KB=y 16 | CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y 17 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 18 | CONFIG_FATFS_LFN_HEAP=y 19 | CONFIG_BSP_SD_FORMAT_ON_MOUNT_FAIL=y 20 | -------------------------------------------------------------------------------- /examples/tutorial/README.md: -------------------------------------------------------------------------------- 1 | # Tutorial example 2 | 3 | More details, see [Tutorial](https://docs.espressif.com/projects/esp-dl/en/latest/tutorials/index.html). 4 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_flash_partition/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | 5 | add_compile_options(-fdiagnostics-color=always) 6 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 7 | idf_build_set_property(DEPENDENCIES_LOCK dependencies.lock.${IDF_TARGET}) 8 | project(model_in_flash_rodata) 9 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_flash_partition/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(srcs app_main.cpp) 2 | 3 | set(requires esp-dl) 4 | 5 | idf_component_register(SRCS ${srcs} 6 | REQUIRES ${requires}) 7 | 8 | if (IDF_TARGET STREQUAL "esp32s3") 9 | set(image_file ${COMPONENT_DIR}/models/s3/model.espdl) 10 | elseif (IDF_TARGET STREQUAL "esp32p4") 11 | set(image_file ${COMPONENT_DIR}/models/p4/model.espdl) 12 | endif() 13 | 14 | esptool_py_flash_to_partition(flash "model" "${image_file}") 15 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_flash_partition/main/app_main.cpp: -------------------------------------------------------------------------------- 1 | #include "dl_model_base.hpp" 2 | 3 | extern "C" void app_main(void) 4 | { 5 | // dl::Model *model = new dl::Model("model", fbs::MODEL_LOCATION_IN_FLASH_PARTITION); 6 | // Keep parameter in flash, saves PSRAM/internal RAM, lower performance. 7 | dl::Model *model = 8 | new dl::Model("model", fbs::MODEL_LOCATION_IN_FLASH_PARTITION, 0, dl::MEMORY_MANAGER_GREEDY, nullptr, false); 9 | 10 | // Use test inputs and test outputs embedded in model when exported with esp-ppq to test if inference result is 11 | // correct. 12 | ESP_ERROR_CHECK(model->test()); 13 | 14 | // print summary in module topological order 15 | model->profile(); 16 | // print summary in module latency decreasing order 17 | // model->profile(true); 18 | 19 | // profile() is the combination of profile_memroy() and profile_module(). 20 | // model->profile_memory(); 21 | // model->profile_module(); 22 | // model->profile_module(true); 23 | delete model; 24 | } 25 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_flash_partition/main/idf_component.yml: -------------------------------------------------------------------------------- 1 | ## IDF Component Manager Manifest File 2 | dependencies: 3 | espressif/esp-dl: 4 | version: "^3.1.0" 5 | override_path: "../../../../../esp-dl" -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_flash_partition/main/models/p4/model.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/tutorial/how_to_load_test_profile_model/model_in_flash_partition/main/models/p4/model.espdl -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_flash_partition/main/models/s3/model.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/tutorial/how_to_load_test_profile_model/model_in_flash_partition/main/models/s3/model.espdl -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_flash_partition/partitions.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild 3 | 4 | factory, app, factory, 0x010000, 3000K, 5 | model, data, spiffs, , 5000K, 6 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_flash_partition/sdkconfig.defaults: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/tutorial/how_to_load_test_profile_model/model_in_flash_partition/sdkconfig.defaults -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_flash_partition/sdkconfig.defaults.esp32p4: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32p4" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" 9 | CONFIG_SPIRAM=y 10 | CONFIG_SPIRAM_SPEED_200M=y 11 | CONFIG_CACHE_L2_CACHE_256KB=y 12 | CONFIG_CACHE_L2_CACHE_LINE_128B=y 13 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 14 | CONFIG_ESP_INT_WDT=n 15 | CONFIG_ESP_TASK_WDT_EN=n 16 | CONFIG_IDF_EXPERIMENTAL_FEATURES=y 17 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_flash_partition/sdkconfig.defaults.esp32s3: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32s3" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_COMPILER_OPTIMIZATION_PERF=y 9 | CONFIG_SPIRAM=y 10 | CONFIG_SPIRAM_MODE_OCT=y 11 | CONFIG_SPIRAM_SPEED_80M=y 12 | CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y 13 | CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y 14 | CONFIG_ESP32S3_DATA_CACHE_64KB=y 15 | CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y 16 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 17 | CONFIG_FATFS_LFN_HEAP=y 18 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_flash_rodata/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | 5 | add_compile_options(-fdiagnostics-color=always) 6 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 7 | idf_build_set_property(DEPENDENCIES_LOCK dependencies.lock.${IDF_TARGET}) 8 | project(model_in_flash_rodata) 9 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_flash_rodata/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(srcs app_main.cpp) 2 | 3 | set(requires esp-dl) 4 | 5 | idf_build_get_property(component_targets __COMPONENT_TARGETS) 6 | if ("___idf_espressif__esp-dl" IN_LIST component_targets) 7 | idf_component_get_property(espdl_dir espressif__esp-dl COMPONENT_DIR) 8 | elseif("___idf_esp-dl" IN_LIST component_targets) 9 | idf_component_get_property(espdl_dir esp-dl COMPONENT_DIR) 10 | endif() 11 | set(cmake_dir ${espdl_dir}/fbs_loader/cmake) 12 | include(${cmake_dir}/utilities.cmake) 13 | 14 | if (IDF_TARGET STREQUAL "esp32s3") 15 | set(embed_files models/s3/model.espdl) 16 | elseif (IDF_TARGET STREQUAL "esp32p4") 17 | set(embed_files models/p4/model.espdl) 18 | endif() 19 | 20 | idf_component_register(SRCS ${srcs} 21 | REQUIRES ${requires}) 22 | 23 | target_add_aligned_binary_data(${COMPONENT_LIB} ${embed_files} BINARY) 24 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_flash_rodata/main/app_main.cpp: -------------------------------------------------------------------------------- 1 | #include "dl_model_base.hpp" 2 | 3 | extern const uint8_t model_espdl[] asm("_binary_model_espdl_start"); 4 | 5 | extern "C" void app_main(void) 6 | { 7 | dl::Model *model = new dl::Model((const char *)model_espdl, fbs::MODEL_LOCATION_IN_FLASH_RODATA); 8 | // Keep parameter in FLASH, saves PSRAM/internal RAM, lower performance. 9 | // dl::Model *model = new dl::Model((const char *)model_espdl, fbs::MODEL_LOCATION_IN_FLASH_RODATA, 0, 10 | // dl::MEMORY_MANAGER_GREEDY, nullptr, false); 11 | 12 | // Use test inputs and test outputs embedded in model when exported with esp-ppq to test if inference result is 13 | // correct. 14 | ESP_ERROR_CHECK(model->test()); 15 | 16 | // print summary in module topological order 17 | model->profile(); 18 | // print summary in module latency decreasing order 19 | // model->profile(true); 20 | 21 | // profile() is the combination of profile_memroy() and profile_module(). 22 | // model->profile_memory(); 23 | // model->profile_module(); 24 | // model->profile_module(true); 25 | delete model; 26 | } 27 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_flash_rodata/main/idf_component.yml: -------------------------------------------------------------------------------- 1 | ## IDF Component Manager Manifest File 2 | dependencies: 3 | espressif/esp-dl: 4 | version: "^3.1.0" 5 | override_path: "../../../../../esp-dl" -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_flash_rodata/main/models/p4/model.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/tutorial/how_to_load_test_profile_model/model_in_flash_rodata/main/models/p4/model.espdl -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_flash_rodata/main/models/s3/model.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/tutorial/how_to_load_test_profile_model/model_in_flash_rodata/main/models/s3/model.espdl -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_flash_rodata/partitions.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild 3 | 4 | factory, app, factory, 0x010000, 8000K, 5 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_flash_rodata/sdkconfig.defaults: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/tutorial/how_to_load_test_profile_model/model_in_flash_rodata/sdkconfig.defaults -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_flash_rodata/sdkconfig.defaults.esp32p4: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32p4" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" 9 | CONFIG_SPIRAM=y 10 | CONFIG_SPIRAM_SPEED_200M=y 11 | CONFIG_CACHE_L2_CACHE_256KB=y 12 | CONFIG_CACHE_L2_CACHE_LINE_128B=y 13 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 14 | CONFIG_ESP_INT_WDT=n 15 | CONFIG_ESP_TASK_WDT_EN=n 16 | CONFIG_IDF_EXPERIMENTAL_FEATURES=y 17 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_flash_rodata/sdkconfig.defaults.esp32s3: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32s3" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_COMPILER_OPTIMIZATION_PERF=y 9 | CONFIG_SPIRAM=y 10 | CONFIG_SPIRAM_MODE_OCT=y 11 | CONFIG_SPIRAM_SPEED_80M=y 12 | CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y 13 | CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y 14 | CONFIG_ESP32S3_DATA_CACHE_64KB=y 15 | CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y 16 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 17 | CONFIG_FATFS_LFN_HEAP=y 18 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_sdcard/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | 5 | add_compile_options(-fdiagnostics-color=always) 6 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 7 | idf_build_set_property(DEPENDENCIES_LOCK dependencies.lock.${IDF_TARGET}) 8 | project(model_in_sdcard) 9 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_sdcard/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(srcs app_main.cpp) 2 | 3 | set(requires esp-dl) 4 | 5 | if (IDF_TARGET STREQUAL "esp32s3") 6 | list(APPEND requires esp32_s3_eye_noglib 7 | esp_lcd) 8 | elseif (IDF_TARGET STREQUAL "esp32p4") 9 | list(APPEND requires esp32_p4_function_ev_board_noglib 10 | esp_lcd) 11 | endif() 12 | 13 | idf_component_register(SRCS ${srcs} 14 | REQUIRES ${requires}) 15 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_sdcard/main/app_main.cpp: -------------------------------------------------------------------------------- 1 | #include "dl_model_base.hpp" 2 | #include "bsp/esp-bsp.h" 3 | 4 | extern "C" void app_main(void) 5 | { 6 | ESP_ERROR_CHECK(bsp_sdcard_mount()); 7 | dl::Model *model = new dl::Model("/sdcard/model.espdl", fbs::MODEL_LOCATION_IN_SDCARD); 8 | 9 | // Use test inputs and test outputs embedded in model when exported with esp-ppq to test if inference result is 10 | // correct. 11 | ESP_ERROR_CHECK(model->test()); 12 | 13 | // print summary in module topological order 14 | model->profile(); 15 | // print summary in module latency decreasing order 16 | // model->profile(true); 17 | 18 | // profile() is the combination of profile_memroy() and profile_module(). 19 | // model->profile_memory(); 20 | // model->profile_module(); 21 | // model->profile_module(true); 22 | delete model; 23 | ESP_ERROR_CHECK(bsp_sdcard_unmount()); 24 | } 25 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_sdcard/main/idf_component.yml: -------------------------------------------------------------------------------- 1 | ## IDF Component Manager Manifest File 2 | dependencies: 3 | espressif/esp-dl: 4 | version: "^3.1.0" 5 | override_path: "../../../../../esp-dl" 6 | espressif/esp32_p4_function_ev_board_noglib: 7 | version: "^4.0.1" 8 | rules: 9 | - if: "target == esp32p4" 10 | espressif/esp32_s3_eye_noglib: 11 | version: "^3.1.0~1" 12 | rules: 13 | - if: "target == esp32s3" -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_sdcard/main/models/p4/model.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/tutorial/how_to_load_test_profile_model/model_in_sdcard/main/models/p4/model.espdl -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_sdcard/main/models/s3/model.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/tutorial/how_to_load_test_profile_model/model_in_sdcard/main/models/s3/model.espdl -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_sdcard/partitions.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild 3 | 4 | factory, app, factory, 0x010000, 8000K, 5 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_sdcard/sdkconfig.defaults: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/tutorial/how_to_load_test_profile_model/model_in_sdcard/sdkconfig.defaults -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_sdcard/sdkconfig.defaults.esp32p4: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32p4" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" 9 | CONFIG_SPIRAM=y 10 | CONFIG_SPIRAM_SPEED_200M=y 11 | CONFIG_CACHE_L2_CACHE_256KB=y 12 | CONFIG_CACHE_L2_CACHE_LINE_128B=y 13 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 14 | CONFIG_ESP_INT_WDT=n 15 | CONFIG_ESP_TASK_WDT_EN=n 16 | CONFIG_FATFS_LFN_HEAP=y 17 | CONFIG_IDF_EXPERIMENTAL_FEATURES=y 18 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_load_test_profile_model/model_in_sdcard/sdkconfig.defaults.esp32s3: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32s3" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_COMPILER_OPTIMIZATION_PERF=y 9 | CONFIG_SPIRAM=y 10 | CONFIG_SPIRAM_MODE_OCT=y 11 | CONFIG_SPIRAM_SPEED_80M=y 12 | CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y 13 | CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y 14 | CONFIG_ESP32S3_DATA_CACHE_64KB=y 15 | CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y 16 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 17 | CONFIG_FATFS_LFN_HEAP=y 18 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_quantize_model/quantize_mobilenetv2/README.md: -------------------------------------------------------------------------------- 1 | ## Best Practice 2 | 3 | ### Step1: default quantization 4 | A series of general quantization settings has been established to achieve a good quantization accuracy. Please start by using the following script to quantize your model: 5 | 6 | - quantize_torch_model.py: quantize torch model by default quantization setting 7 | - quantize_onnx_model.py: quantize onnx model by default quantization setting 8 | - quantize_tf_model.py: convert tflite model to onnx model 9 | 10 | ### Step2: layerwise equalization quantization 11 | If the model experiences significant accuracy loss after quantization, you can continue to use this method to reduce the error. 12 | This method relies on equalizing the weight ranges in the network by making use of a scale-equivariance property of activation functions, 13 | which is proposed by [Data-Free Quantization Through Weight Equalization and Bias Correction](https://arxiv.org/abs/1906.04721). 14 | 15 | ### Step3: mixed precision quantization 16 | The mixed-precision quantization here is a combination of 8-bit fixed-point and 16-bit fixed-point. Some layers may experience significant errors when quantized to 8-bit fixed-point, so you can dispatch some layers to 16-bit fixed-point to reduce quantization errors. 17 | 18 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_quantize_model/quantize_mobilenetv2/datasets/README.md: -------------------------------------------------------------------------------- 1 | `imagenet_util.py` copy from [ppq/samples/Imagenet/Utilities/Imagenet](https://github.com/OpenPPL/ppq/tree/e39eecb9f7e5f017c28f180cb423f8a685c3db48/ppq/samples/Imagenet/Utilities/Imagenet) -------------------------------------------------------------------------------- /examples/tutorial/how_to_quantize_model/quantize_mobilenetv2/datasets/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/tutorial/how_to_quantize_model/quantize_mobilenetv2/datasets/__init__.py -------------------------------------------------------------------------------- /examples/tutorial/how_to_quantize_model/quantize_mobilenetv2/models/torch/mobilenet_v2.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/tutorial/how_to_quantize_model/quantize_mobilenetv2/models/torch/mobilenet_v2.onnx -------------------------------------------------------------------------------- /examples/tutorial/how_to_quantize_model/quantize_mobilenetv2/models/torch/mobilenet_v2_relu.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/tutorial/how_to_quantize_model/quantize_mobilenetv2/models/torch/mobilenet_v2_relu.onnx -------------------------------------------------------------------------------- /examples/tutorial/how_to_quantize_model/quantize_mobilenetv2/quantize_tf_model.py: -------------------------------------------------------------------------------- 1 | import os 2 | import subprocess 3 | 4 | TF_PATH = "./models/tf/" 5 | 6 | # ------------------------------------------ 7 | # Convert Tensorflow Model to ONNX 8 | # ------------------------------------------ 9 | 10 | # Using tf2onnx to convert a tflite model to ONNX format 11 | # Install tf2onnx by "pip install tf2onnx" 12 | # Please refer to https://onnxruntime.ai/docs/tutorials/tf-get-started.html for more details 13 | 14 | os.makedirs(TF_PATH, exist_ok=True) 15 | tflite_model_path = os.path.join(TF_PATH, "mobilenet_v2_1.0_224.tflite") 16 | onnx_model_path = os.path.join(TF_PATH, "mobilenet_v2_1.0_224.onnx") 17 | subprocess.run( 18 | [ 19 | "python", 20 | "-m", 21 | "tf2onnx.convert", 22 | "--tflite", 23 | tflite_model_path, 24 | "--output", 25 | onnx_model_path, 26 | "--opset", 27 | 13, 28 | ] 29 | ) 30 | 31 | # Note: the inputs of this model is [1, 224, 224, 3] 32 | 33 | # ------------------------------------------- 34 | # Please use `quantize_onnx_model.py` to quantize ONNX model 35 | # -------------------------------------------- 36 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_quantize_model/quantize_streaming_model/model_cfg.toml: -------------------------------------------------------------------------------- 1 | [meta] 2 | seed = 0 3 | batch_size = 1 4 | calib_steps = 8 # The minimum value for calib_steps is 8. 5 | 6 | [model_0_config] 7 | offline_input_shape = [1, 64, 36] 8 | export_name_prefix = "model_0_ishap_1_64_36_kshap_3" 9 | in_channels = 64 10 | expand_channels = 128 11 | out_channels = 64 12 | kernel_size = 3 13 | stride = 1 14 | padding = 4 15 | dilation = 2 16 | streaming_input_shape = [1, 64, 3] 17 | streaming_cache_shape = [1, 128, 4] 18 | 19 | [model_1_config] 20 | offline_input_shape = [1, 64, 36] 21 | export_name_prefix = "model_1_ishap_1_64_36_kshap_3" 22 | in_channels = 64 23 | expand_channels = 128 24 | out_channels = 64 25 | streaming_input_shape = [1, 64, 3] 26 | 27 | [model_2_config] 28 | offline_input_shape = [1, 64, 36] 29 | export_name_prefix = "model_2_ishap_1_64_36_kshap_3" 30 | in_channels = 64 31 | expand_channels = 128 32 | out_channels = 64 33 | kernel_size = 3 34 | stride = 1 35 | padding = 4 36 | dilation = 2 37 | streaming_input_shape = [1, 64, 3] 38 | streaming_cache_shape = [1, 128, 4] 39 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_run_model/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | 5 | add_compile_options(-fdiagnostics-color=always) 6 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 7 | idf_build_set_property(DEPENDENCIES_LOCK dependencies.lock.${IDF_TARGET}) 8 | project(model_in_flash_rodata) 9 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_run_model/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(srcs app_main.cpp) 2 | 3 | set(requires esp-dl) 4 | 5 | idf_build_get_property(component_targets __COMPONENT_TARGETS) 6 | if ("___idf_espressif__esp-dl" IN_LIST component_targets) 7 | idf_component_get_property(espdl_dir espressif__esp-dl COMPONENT_DIR) 8 | elseif("___idf_esp-dl" IN_LIST component_targets) 9 | idf_component_get_property(espdl_dir esp-dl COMPONENT_DIR) 10 | endif() 11 | set(cmake_dir ${espdl_dir}/fbs_loader/cmake) 12 | include(${cmake_dir}/utilities.cmake) 13 | 14 | if (IDF_TARGET STREQUAL "esp32s3") 15 | set(embed_files models/s3/model.espdl) 16 | elseif (IDF_TARGET STREQUAL "esp32p4") 17 | set(embed_files models/p4/model.espdl) 18 | endif() 19 | 20 | idf_component_register(SRCS ${srcs} 21 | REQUIRES ${requires}) 22 | 23 | target_add_aligned_binary_data(${COMPONENT_LIB} ${embed_files} BINARY) 24 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_run_model/main/idf_component.yml: -------------------------------------------------------------------------------- 1 | ## IDF Component Manager Manifest File 2 | dependencies: 3 | espressif/esp-dl: 4 | version: "^3.1.0" 5 | override_path: "../../../../esp-dl" -------------------------------------------------------------------------------- /examples/tutorial/how_to_run_model/main/models/p4/model.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/tutorial/how_to_run_model/main/models/p4/model.espdl -------------------------------------------------------------------------------- /examples/tutorial/how_to_run_model/main/models/s3/model.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/tutorial/how_to_run_model/main/models/s3/model.espdl -------------------------------------------------------------------------------- /examples/tutorial/how_to_run_model/partitions.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild 3 | 4 | factory, app, factory, 0x010000, 8000K, 5 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_run_model/sdkconfig.defaults: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/tutorial/how_to_run_model/sdkconfig.defaults -------------------------------------------------------------------------------- /examples/tutorial/how_to_run_model/sdkconfig.defaults.esp32p4: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32p4" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" 9 | CONFIG_SPIRAM=y 10 | CONFIG_SPIRAM_SPEED_200M=y 11 | CONFIG_CACHE_L2_CACHE_256KB=y 12 | CONFIG_CACHE_L2_CACHE_LINE_128B=y 13 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 14 | CONFIG_ESP_INT_WDT=n 15 | CONFIG_ESP_TASK_WDT_EN=n 16 | CONFIG_IDF_EXPERIMENTAL_FEATURES=y 17 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_run_model/sdkconfig.defaults.esp32s3: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32s3" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_COMPILER_OPTIMIZATION_PERF=y 9 | CONFIG_SPIRAM=y 10 | CONFIG_SPIRAM_MODE_OCT=y 11 | CONFIG_SPIRAM_SPEED_80M=y 12 | CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y 13 | CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y 14 | CONFIG_ESP32S3_DATA_CACHE_64KB=y 15 | CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y 16 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 17 | CONFIG_FATFS_LFN_HEAP=y 18 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_run_streaming_model/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | 5 | add_compile_options(-fdiagnostics-color=always) 6 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 7 | idf_build_set_property(DEPENDENCIES_LOCK dependencies.lock.${IDF_TARGET}) 8 | project(run_streaming_model) 9 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_run_streaming_model/main/idf_component.yml: -------------------------------------------------------------------------------- 1 | ## IDF Component Manager Manifest File 2 | dependencies: 3 | espressif/esp-dl: 4 | version: "^3.1.3" 5 | override_path: "../../../../esp-dl" -------------------------------------------------------------------------------- /examples/tutorial/how_to_run_streaming_model/main/models/p4/model_0_ishap_1_64_36_kshap_3_s8_streaming.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/tutorial/how_to_run_streaming_model/main/models/p4/model_0_ishap_1_64_36_kshap_3_s8_streaming.espdl -------------------------------------------------------------------------------- /examples/tutorial/how_to_run_streaming_model/main/models/p4/model_1_ishap_1_64_36_kshap_3_s8_streaming.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/tutorial/how_to_run_streaming_model/main/models/p4/model_1_ishap_1_64_36_kshap_3_s8_streaming.espdl -------------------------------------------------------------------------------- /examples/tutorial/how_to_run_streaming_model/main/models/p4/model_2_ishap_1_64_36_kshap_3_s8_streaming.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/tutorial/how_to_run_streaming_model/main/models/p4/model_2_ishap_1_64_36_kshap_3_s8_streaming.espdl -------------------------------------------------------------------------------- /examples/tutorial/how_to_run_streaming_model/main/models/s3/model_0_ishap_1_64_36_kshap_3_s8_streaming.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/tutorial/how_to_run_streaming_model/main/models/s3/model_0_ishap_1_64_36_kshap_3_s8_streaming.espdl -------------------------------------------------------------------------------- /examples/tutorial/how_to_run_streaming_model/main/models/s3/model_1_ishap_1_64_36_kshap_3_s8_streaming.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/tutorial/how_to_run_streaming_model/main/models/s3/model_1_ishap_1_64_36_kshap_3_s8_streaming.espdl -------------------------------------------------------------------------------- /examples/tutorial/how_to_run_streaming_model/main/models/s3/model_2_ishap_1_64_36_kshap_3_s8_streaming.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/tutorial/how_to_run_streaming_model/main/models/s3/model_2_ishap_1_64_36_kshap_3_s8_streaming.espdl -------------------------------------------------------------------------------- /examples/tutorial/how_to_run_streaming_model/partitions.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild 3 | 4 | factory, app, factory, 0x010000, 8000K, 5 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_run_streaming_model/sdkconfig.defaults: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/tutorial/how_to_run_streaming_model/sdkconfig.defaults -------------------------------------------------------------------------------- /examples/tutorial/how_to_run_streaming_model/sdkconfig.defaults.esp32p4: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32p4" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" 9 | CONFIG_SPIRAM=y 10 | CONFIG_SPIRAM_SPEED_200M=y 11 | CONFIG_CACHE_L2_CACHE_256KB=y 12 | CONFIG_CACHE_L2_CACHE_LINE_128B=y 13 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 14 | CONFIG_ESP_INT_WDT=n 15 | CONFIG_ESP_TASK_WDT_EN=n 16 | CONFIG_IDF_EXPERIMENTAL_FEATURES=y 17 | -------------------------------------------------------------------------------- /examples/tutorial/how_to_run_streaming_model/sdkconfig.defaults.esp32s3: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32s3" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_COMPILER_OPTIMIZATION_PERF=y 9 | CONFIG_SPIRAM=y 10 | CONFIG_SPIRAM_MODE_OCT=y 11 | CONFIG_SPIRAM_SPEED_80M=y 12 | CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y 13 | CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y 14 | CONFIG_ESP32S3_DATA_CACHE_64KB=y 15 | CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y 16 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 17 | CONFIG_FATFS_LFN_HEAP=y 18 | -------------------------------------------------------------------------------- /examples/yolo11_detect/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | 5 | add_compile_options(-fdiagnostics-color=always) 6 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 7 | project(yolo11_detect) 8 | -------------------------------------------------------------------------------- /examples/yolo11_detect/img/bus_fp32.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/yolo11_detect/img/bus_fp32.jpg -------------------------------------------------------------------------------- /examples/yolo11_detect/img/bus_int8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/yolo11_detect/img/bus_int8.jpg -------------------------------------------------------------------------------- /examples/yolo11_detect/img/bus_int8_qat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/yolo11_detect/img/bus_int8_qat.jpg -------------------------------------------------------------------------------- /examples/yolo11_detect/img/bus_mixedprecision_layersplit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/yolo11_detect/img/bus_mixedprecision_layersplit.jpg -------------------------------------------------------------------------------- /examples/yolo11_detect/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(src_dirs ./) 2 | 3 | set(include_dirs ./) 4 | 5 | set(requires coco_detect) 6 | 7 | if (IDF_TARGET STREQUAL "esp32s3") 8 | list(APPEND requires esp32_s3_eye_noglib 9 | esp_lcd) 10 | elseif (IDF_TARGET STREQUAL "esp32p4") 11 | list(APPEND requires esp32_p4_function_ev_board_noglib 12 | esp_lcd) 13 | endif() 14 | 15 | set(embed_files "bus.jpg") 16 | 17 | idf_component_register(SRC_DIRS ${src_dirs} INCLUDE_DIRS ${include_dirs} REQUIRES ${requires} EMBED_FILES ${embed_files}) 18 | -------------------------------------------------------------------------------- /examples/yolo11_detect/main/app_main.cpp: -------------------------------------------------------------------------------- 1 | #include "coco_detect.hpp" 2 | #include "esp_log.h" 3 | #include "bsp/esp-bsp.h" 4 | 5 | extern const uint8_t bus_jpg_start[] asm("_binary_bus_jpg_start"); 6 | extern const uint8_t bus_jpg_end[] asm("_binary_bus_jpg_end"); 7 | const char *TAG = "yolo11n"; 8 | 9 | extern "C" void app_main(void) 10 | { 11 | #if CONFIG_COCO_DETECT_MODEL_IN_SDCARD 12 | ESP_ERROR_CHECK(bsp_sdcard_mount()); 13 | #endif 14 | 15 | dl::image::jpeg_img_t jpeg_img = {.data = (void *)bus_jpg_start, .data_len = (size_t)(bus_jpg_end - bus_jpg_start)}; 16 | auto img = sw_decode_jpeg(jpeg_img, dl::image::DL_IMAGE_PIX_TYPE_RGB888); 17 | 18 | COCODetect *detect = new COCODetect(); 19 | auto &detect_results = detect->run(img); 20 | for (const auto &res : detect_results) { 21 | ESP_LOGI(TAG, 22 | "[category: %d, score: %f, x1: %d, y1: %d, x2: %d, y2: %d]", 23 | res.category, 24 | res.score, 25 | res.box[0], 26 | res.box[1], 27 | res.box[2], 28 | res.box[3]); 29 | } 30 | delete detect; 31 | heap_caps_free(img.data); 32 | 33 | #if CONFIG_COCO_DETECT_MODEL_IN_SDCARD 34 | ESP_ERROR_CHECK(bsp_sdcard_unmount()); 35 | #endif 36 | } 37 | -------------------------------------------------------------------------------- /examples/yolo11_detect/main/bus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/yolo11_detect/main/bus.jpg -------------------------------------------------------------------------------- /examples/yolo11_detect/main/idf_component.yml: -------------------------------------------------------------------------------- 1 | ## IDF Component Manager Manifest File 2 | dependencies: 3 | espressif/coco_detect: 4 | version: "^0.1.0" 5 | override_path: "../../../models/coco_detect" 6 | espressif/esp32_p4_function_ev_board_noglib: 7 | version: "^4.0.1" 8 | rules: 9 | - if: "target == esp32p4" 10 | espressif/esp32_s3_eye_noglib: 11 | version: "^3.1.0~1" 12 | rules: 13 | - if: "target == esp32s3" 14 | -------------------------------------------------------------------------------- /examples/yolo11_detect/partitions.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild 3 | 4 | nvs, data, nvs, 0x9000, 24K, 5 | phy_init, data, phy, 0xf000, 4K, 6 | factory, app, factory, 0x010000, 8000K, 7 | -------------------------------------------------------------------------------- /examples/yolo11_detect/partitions2.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild 3 | 4 | nvs, data, nvs, 0x9000, 24K, 5 | phy_init, data, phy, 0xf000, 4K, 6 | factory, app, factory, 0x010000, 2000K, 7 | coco_det, data, spiffs, , 4M, 8 | -------------------------------------------------------------------------------- /examples/yolo11_detect/sdkconfig.defaults: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/yolo11_detect/sdkconfig.defaults -------------------------------------------------------------------------------- /examples/yolo11_detect/sdkconfig.defaults.esp32p4: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32p4" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_COMPILER_OPTIMIZATION_PERF=y 9 | CONFIG_SPIRAM=y 10 | CONFIG_SPIRAM_SPEED_200M=y 11 | CONFIG_SPIRAM_XIP_FROM_PSRAM=y 12 | CONFIG_CACHE_L2_CACHE_256KB=y 13 | CONFIG_CACHE_L2_CACHE_LINE_128B=y 14 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 15 | CONFIG_FATFS_LFN_HEAP=y 16 | CONFIG_BSP_SD_FORMAT_ON_MOUNT_FAIL=y 17 | CONFIG_JD_FASTDECODE_BASIC=y 18 | CONFIG_IDF_EXPERIMENTAL_FEATURES=y 19 | -------------------------------------------------------------------------------- /examples/yolo11_detect/sdkconfig.defaults.esp32s3: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32s3" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_COMPILER_OPTIMIZATION_PERF=y 9 | CONFIG_SPIRAM=y 10 | CONFIG_SPIRAM_MODE_OCT=y 11 | CONFIG_SPIRAM_SPEED_80M=y 12 | CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y 13 | CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y 14 | CONFIG_ESP32S3_DATA_CACHE_64KB=y 15 | CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y 16 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 17 | CONFIG_ESP_TASK_WDT_TIMEOUT_S=40 18 | CONFIG_FATFS_LFN_HEAP=y 19 | CONFIG_BSP_SD_FORMAT_ON_MOUNT_FAIL=y 20 | -------------------------------------------------------------------------------- /examples/yolo11_pose/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | 5 | add_compile_options(-fdiagnostics-color=always) 6 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 7 | project(yolo11_pose) 8 | -------------------------------------------------------------------------------- /examples/yolo11_pose/img/bus_int8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/yolo11_pose/img/bus_int8.jpg -------------------------------------------------------------------------------- /examples/yolo11_pose/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(src_dirs ./) 2 | 3 | set(include_dirs ./) 4 | 5 | set(requires coco_pose) 6 | 7 | if (IDF_TARGET STREQUAL "esp32s3") 8 | list(APPEND requires esp32_s3_eye_noglib 9 | esp_lcd) 10 | elseif (IDF_TARGET STREQUAL "esp32p4") 11 | list(APPEND requires esp32_p4_function_ev_board_noglib 12 | esp_lcd) 13 | endif() 14 | 15 | set(embed_files "bus.jpg") 16 | 17 | idf_component_register(SRC_DIRS ${src_dirs} INCLUDE_DIRS ${include_dirs} REQUIRES ${requires} EMBED_FILES ${embed_files}) 18 | -------------------------------------------------------------------------------- /examples/yolo11_pose/main/bus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/yolo11_pose/main/bus.jpg -------------------------------------------------------------------------------- /examples/yolo11_pose/main/idf_component.yml: -------------------------------------------------------------------------------- 1 | ## IDF Component Manager Manifest File 2 | dependencies: 3 | espressif/coco_pose: 4 | version: "^0.1.0" 5 | override_path: "../../../models/coco_pose" 6 | espressif/esp32_p4_function_ev_board_noglib: 7 | version: "^4.0.1" 8 | rules: 9 | - if: "target == esp32p4" 10 | espressif/esp32_s3_eye_noglib: 11 | version: "^3.1.0~1" 12 | rules: 13 | - if: "target == esp32s3" 14 | -------------------------------------------------------------------------------- /examples/yolo11_pose/partitions.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild 3 | 4 | nvs, data, nvs, 0x9000, 24K, 5 | phy_init, data, phy, 0xf000, 4K, 6 | factory, app, factory, 0x010000, 8000K, 7 | -------------------------------------------------------------------------------- /examples/yolo11_pose/partitions2.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild 3 | 4 | nvs, data, nvs, 0x9000, 24K, 5 | phy_init, data, phy, 0xf000, 4K, 6 | factory, app, factory, 0x010000, 2000K, 7 | coco_pose, data, spiffs, , 4M, 8 | -------------------------------------------------------------------------------- /examples/yolo11_pose/sdkconfig.defaults: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/examples/yolo11_pose/sdkconfig.defaults -------------------------------------------------------------------------------- /examples/yolo11_pose/sdkconfig.defaults.esp32p4: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32p4" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_COMPILER_OPTIMIZATION_PERF=y 9 | CONFIG_SPIRAM=y 10 | CONFIG_SPIRAM_SPEED_200M=y 11 | CONFIG_SPIRAM_XIP_FROM_PSRAM=y 12 | CONFIG_CACHE_L2_CACHE_256KB=y 13 | CONFIG_CACHE_L2_CACHE_LINE_128B=y 14 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 15 | CONFIG_FATFS_LFN_HEAP=y 16 | CONFIG_BSP_SD_FORMAT_ON_MOUNT_FAIL=y 17 | CONFIG_JD_FASTDECODE_BASIC=y 18 | CONFIG_IDF_EXPERIMENTAL_FEATURES=y 19 | -------------------------------------------------------------------------------- /examples/yolo11_pose/sdkconfig.defaults.esp32s3: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32s3" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_COMPILER_OPTIMIZATION_PERF=y 9 | CONFIG_SPIRAM=y 10 | CONFIG_SPIRAM_MODE_OCT=y 11 | CONFIG_SPIRAM_SPEED_80M=y 12 | CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y 13 | CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y 14 | CONFIG_ESP32S3_DATA_CACHE_64KB=y 15 | CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y 16 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 17 | CONFIG_ESP_TASK_WDT_TIMEOUT_S=40 18 | CONFIG_FATFS_LFN_HEAP=y 19 | CONFIG_BSP_SD_FORMAT_ON_MOUNT_FAIL=y 20 | -------------------------------------------------------------------------------- /models/cat_detect/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 | -------------------------------------------------------------------------------- /models/cat_detect/cat_detect.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "dl_detect_base.hpp" 3 | #include "dl_detect_espdet_postprocessor.hpp" 4 | 5 | namespace cat_detect { 6 | class ESPDet : public dl::detect::DetectImpl { 7 | public: 8 | ESPDet(const char *model_name); 9 | }; 10 | } // namespace cat_detect 11 | 12 | class CatDetect : public dl::detect::DetectWrapper { 13 | public: 14 | typedef enum { 15 | ESPDET_PICO_224_224_CAT, 16 | ESPDET_PICO_416_416_CAT, 17 | } model_type_t; 18 | CatDetect(model_type_t model_type = static_cast(CONFIG_DEFAULT_CAT_DETECT_MODEL)); 19 | }; 20 | -------------------------------------------------------------------------------- /models/cat_detect/idf_component.yml: -------------------------------------------------------------------------------- 1 | version: "0.1.1" 2 | license: "MIT" 3 | description: cat detect model. 4 | url: https://github.com/espressif/esp-dl/tree/master/models/cat_detect 5 | dependencies: 6 | espressif/esp-dl: 7 | version: "^3.1.3" 8 | override_path: "../../esp-dl" 9 | -------------------------------------------------------------------------------- /models/cat_detect/models/p4/espdet_pico_224_224_cat.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/cat_detect/models/p4/espdet_pico_224_224_cat.espdl -------------------------------------------------------------------------------- /models/cat_detect/models/p4/espdet_pico_416_416_cat.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/cat_detect/models/p4/espdet_pico_416_416_cat.espdl -------------------------------------------------------------------------------- /models/cat_detect/models/s3/espdet_pico_224_224_cat.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/cat_detect/models/s3/espdet_pico_224_224_cat.espdl -------------------------------------------------------------------------------- /models/cat_detect/models/s3/espdet_pico_416_416_cat.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/cat_detect/models/s3/espdet_pico_416_416_cat.espdl -------------------------------------------------------------------------------- /models/coco_detect/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 | -------------------------------------------------------------------------------- /models/coco_detect/coco_detect.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "dl_detect_base.hpp" 3 | #include "dl_detect_yolo11_postprocessor.hpp" 4 | 5 | namespace coco_detect { 6 | class Yolo11n : public dl::detect::DetectImpl { 7 | public: 8 | Yolo11n(const char *model_name); 9 | }; 10 | } // namespace coco_detect 11 | 12 | class COCODetect : public dl::detect::DetectWrapper { 13 | public: 14 | typedef enum { 15 | YOLO11N_S8_V1, 16 | YOLO11N_S8_V2, 17 | YOLO11N_S8_V3, 18 | YOLO11N_320_S8_V3, 19 | } model_type_t; 20 | COCODetect(model_type_t model_type = static_cast(CONFIG_DEFAULT_COCO_DETECT_MODEL)); 21 | }; 22 | -------------------------------------------------------------------------------- /models/coco_detect/idf_component.yml: -------------------------------------------------------------------------------- 1 | version: "0.1.3" 2 | license: "MIT" 3 | description: coco detect model. 4 | url: https://github.com/espressif/esp-dl/tree/master/models/coco_detect 5 | dependencies: 6 | espressif/esp-dl: 7 | version: "^3.1.3" 8 | override_path: "../../esp-dl" 9 | -------------------------------------------------------------------------------- /models/coco_detect/models/p4/coco_detect_yolo11n_320_s8_v3.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/coco_detect/models/p4/coco_detect_yolo11n_320_s8_v3.espdl -------------------------------------------------------------------------------- /models/coco_detect/models/p4/coco_detect_yolo11n_s8_v1.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/coco_detect/models/p4/coco_detect_yolo11n_s8_v1.espdl -------------------------------------------------------------------------------- /models/coco_detect/models/p4/coco_detect_yolo11n_s8_v2.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/coco_detect/models/p4/coco_detect_yolo11n_s8_v2.espdl -------------------------------------------------------------------------------- /models/coco_detect/models/p4/coco_detect_yolo11n_s8_v3.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/coco_detect/models/p4/coco_detect_yolo11n_s8_v3.espdl -------------------------------------------------------------------------------- /models/coco_detect/models/s3/coco_detect_yolo11n_320_s8_v3.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/coco_detect/models/s3/coco_detect_yolo11n_320_s8_v3.espdl -------------------------------------------------------------------------------- /models/coco_detect/models/s3/coco_detect_yolo11n_s8_v1.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/coco_detect/models/s3/coco_detect_yolo11n_s8_v1.espdl -------------------------------------------------------------------------------- /models/coco_detect/models/s3/coco_detect_yolo11n_s8_v2.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/coco_detect/models/s3/coco_detect_yolo11n_s8_v2.espdl -------------------------------------------------------------------------------- /models/coco_detect/models/s3/coco_detect_yolo11n_s8_v3.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/coco_detect/models/s3/coco_detect_yolo11n_s8_v3.espdl -------------------------------------------------------------------------------- /models/coco_detect/models/yolo11n.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/coco_detect/models/yolo11n.onnx -------------------------------------------------------------------------------- /models/coco_detect/models/yolo11n_320.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/coco_detect/models/yolo11n_320.onnx -------------------------------------------------------------------------------- /models/coco_pose/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 | -------------------------------------------------------------------------------- /models/coco_pose/coco_pose.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "dl_detect_base.hpp" 3 | #include "dl_pose_yolo11_postprocessor.hpp" 4 | 5 | namespace coco_pose { 6 | class Yolo11nPose : public dl::detect::DetectImpl { 7 | public: 8 | Yolo11nPose(const char *model_name); 9 | }; 10 | } // namespace coco_pose 11 | 12 | class COCOPose : public dl::detect::DetectWrapper { 13 | public: 14 | typedef enum { 15 | YOLO11N_POSE_S8_V1, 16 | YOLO11N_POSE_S8_V2, 17 | } model_type_t; 18 | COCOPose(model_type_t model_type = static_cast(CONFIG_DEFAULT_COCO_POSE_MODEL)); 19 | }; 20 | -------------------------------------------------------------------------------- /models/coco_pose/idf_component.yml: -------------------------------------------------------------------------------- 1 | version: "0.1.0" 2 | license: "MIT" 3 | description: coco pose model. 4 | url: https://github.com/espressif/esp-dl/tree/master/models/coco_pose 5 | dependencies: 6 | espressif/esp-dl: 7 | version: "^3.1.2" 8 | override_path: "../../esp-dl" 9 | -------------------------------------------------------------------------------- /models/coco_pose/models/p4/coco_pose_yolo11n_pose_s8_v1.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/coco_pose/models/p4/coco_pose_yolo11n_pose_s8_v1.espdl -------------------------------------------------------------------------------- /models/coco_pose/models/p4/coco_pose_yolo11n_pose_s8_v2.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/coco_pose/models/p4/coco_pose_yolo11n_pose_s8_v2.espdl -------------------------------------------------------------------------------- /models/coco_pose/models/s3/coco_pose_yolo11n_pose_s8_v1.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/coco_pose/models/s3/coco_pose_yolo11n_pose_s8_v1.espdl -------------------------------------------------------------------------------- /models/coco_pose/models/s3/coco_pose_yolo11n_pose_s8_v2.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/coco_pose/models/s3/coco_pose_yolo11n_pose_s8_v2.espdl -------------------------------------------------------------------------------- /models/coco_pose/models/yolo11n-pose.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/coco_pose/models/yolo11n-pose.onnx -------------------------------------------------------------------------------- /models/human_face_detect/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 | -------------------------------------------------------------------------------- /models/human_face_detect/idf_component.yml: -------------------------------------------------------------------------------- 1 | version: "0.2.3" 2 | license: "MIT" 3 | description: human face detect model. 4 | url: https://github.com/espressif/esp-dl/tree/master/models/human_face_detect 5 | dependencies: 6 | espressif/esp-dl: 7 | version: "^3.1.3" 8 | override_path: "../../esp-dl" -------------------------------------------------------------------------------- /models/human_face_detect/models/p4/human_face_detect_mnp_s8_v1.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/human_face_detect/models/p4/human_face_detect_mnp_s8_v1.espdl -------------------------------------------------------------------------------- /models/human_face_detect/models/p4/human_face_detect_msr_s8_v1.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/human_face_detect/models/p4/human_face_detect_msr_s8_v1.espdl -------------------------------------------------------------------------------- /models/human_face_detect/models/s3/human_face_detect_mnp_s8_v1.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/human_face_detect/models/s3/human_face_detect_mnp_s8_v1.espdl -------------------------------------------------------------------------------- /models/human_face_detect/models/s3/human_face_detect_msr_s8_v1.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/human_face_detect/models/s3/human_face_detect_msr_s8_v1.espdl -------------------------------------------------------------------------------- /models/human_face_recognition/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 | -------------------------------------------------------------------------------- /models/human_face_recognition/idf_component.yml: -------------------------------------------------------------------------------- 1 | version: "0.2.3" 2 | license: "MIT" 3 | description: human face recognition model. 4 | url: https://github.com/espressif/esp-dl/tree/master/models/human_face_recognition 5 | dependencies: 6 | espressif/human_face_detect: 7 | version: "^0.2.3" 8 | override_path: "../human_face_detect" -------------------------------------------------------------------------------- /models/human_face_recognition/models/p4/human_face_feat_mbf_s8_v1.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/human_face_recognition/models/p4/human_face_feat_mbf_s8_v1.espdl -------------------------------------------------------------------------------- /models/human_face_recognition/models/p4/human_face_feat_mfn_s8_v1.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/human_face_recognition/models/p4/human_face_feat_mfn_s8_v1.espdl -------------------------------------------------------------------------------- /models/human_face_recognition/models/s3/human_face_feat_mbf_s8_v1.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/human_face_recognition/models/s3/human_face_feat_mbf_s8_v1.espdl -------------------------------------------------------------------------------- /models/human_face_recognition/models/s3/human_face_feat_mfn_s8_v1.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/human_face_recognition/models/s3/human_face_feat_mfn_s8_v1.espdl -------------------------------------------------------------------------------- /models/imagenet_cls/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 | -------------------------------------------------------------------------------- /models/imagenet_cls/idf_component.yml: -------------------------------------------------------------------------------- 1 | version: "0.2.3" 2 | license: "MIT" 3 | description: imagenet classification model. 4 | url: https://github.com/espressif/esp-dl/tree/master/models/imagenet_cls 5 | dependencies: 6 | espressif/esp-dl: 7 | version: "^3.1.3" 8 | override_path: "../../esp-dl" -------------------------------------------------------------------------------- /models/imagenet_cls/imagenet_cls.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "dl_cls_base.hpp" 4 | #include "imagenet_cls_postprocessor.hpp" 5 | 6 | namespace imagenet_cls { 7 | 8 | class MobileNetV2 : public dl::cls::ClsImpl { 9 | public: 10 | MobileNetV2(const char *model_name, const int top_k); 11 | }; 12 | 13 | } // namespace imagenet_cls 14 | 15 | class ImageNetCls : public dl::cls::ClsWrapper { 16 | public: 17 | typedef enum { MOBILENETV2_S8_V1 } model_type_t; 18 | ImageNetCls(model_type_t model_type = static_cast(CONFIG_DEFAULT_IMAGENET_CLS_MODEL), 19 | const int top_k = 5); 20 | }; 21 | -------------------------------------------------------------------------------- /models/imagenet_cls/models/p4/imagenet_cls_mobilenetv2_s8_v1.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/imagenet_cls/models/p4/imagenet_cls_mobilenetv2_s8_v1.espdl -------------------------------------------------------------------------------- /models/imagenet_cls/models/s3/imagenet_cls_mobilenetv2_s8_v1.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/imagenet_cls/models/s3/imagenet_cls_mobilenetv2_s8_v1.espdl -------------------------------------------------------------------------------- /models/pedestrian_detect/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 | -------------------------------------------------------------------------------- /models/pedestrian_detect/idf_component.yml: -------------------------------------------------------------------------------- 1 | version: "0.2.3" 2 | license: "MIT" 3 | description: pedestrian detect model. 4 | url: https://github.com/espressif/esp-dl/tree/master/models/pedestrian_detect 5 | dependencies: 6 | espressif/esp-dl: 7 | version: "^3.1.3" 8 | override_path: "../../esp-dl" -------------------------------------------------------------------------------- /models/pedestrian_detect/models/p4/pedestrian_detect_pico_s8_v1.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/pedestrian_detect/models/p4/pedestrian_detect_pico_s8_v1.espdl -------------------------------------------------------------------------------- /models/pedestrian_detect/models/s3/pedestrian_detect_pico_s8_v1.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/models/pedestrian_detect/models/s3/pedestrian_detect_pico_s8_v1.espdl -------------------------------------------------------------------------------- /models/pedestrian_detect/pedestrian_detect.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "dl_detect_base.hpp" 4 | #include "dl_detect_pico_postprocessor.hpp" 5 | 6 | namespace pedestrian_detect { 7 | class Pico : public dl::detect::DetectImpl { 8 | public: 9 | Pico(const char *model_name); 10 | }; 11 | } // namespace pedestrian_detect 12 | 13 | class PedestrianDetect : public dl::detect::DetectWrapper { 14 | public: 15 | typedef enum { PICO_S8_V1 } model_type_t; 16 | PedestrianDetect(model_type_t model_type = static_cast(CONFIG_DEFAULT_PEDESTRIAN_DETECT_MODEL)); 17 | }; 18 | -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | # exclude examples/ota/simple_ota_example/pytest_simple_ota.py 3 | norecursedirs = examples/ota/* 4 | # only the files with prefix `pytest_` would be recognized as pytest test scripts. 5 | python_files = pytest_*.py 6 | 7 | # set traceback to "short" to prevent the overwhelming tracebacks 8 | addopts = 9 | -s 10 | --embedded-services esp,idf 11 | --tb short 12 | --skip-check-coredump y 13 | 14 | # ignore PytestExperimentalApiWarning for record_xml_attribute 15 | filterwarnings = 16 | ignore::_pytest.warning_types.PytestExperimentalApiWarning 17 | 18 | 19 | markers = 20 | # target markers 21 | target: target chip name (--target) 22 | # env markers 23 | env: target test env name (--env) 24 | # config markers 25 | config: choose specific bins built by `sdkconfig.ci.` 26 | # app_path markers 27 | app_path: choose specific app_path, [/build_xxx] 28 | 29 | 30 | # log related 31 | log_cli = True 32 | log_cli_level = INFO 33 | log_cli_format = %(asctime)s %(levelname)s %(message)s 34 | log_cli_date_format = %Y-%m-%d %H:%M:%S 35 | 36 | # junit related 37 | junit_family = xunit1 38 | 39 | 40 | ## log all to `system-out` when case fail 41 | junit_logging = stdout 42 | junit_log_passing_tests = False -------------------------------------------------------------------------------- /test_apps/README.md: -------------------------------------------------------------------------------- 1 | 2 | Steps to run esp-dl cases: 3 | 4 | - Build 5 | - . ${IDF_PATH}/export.sh 6 | - pip install idf_build_apps 7 | - python test_apps/build_apps.py test_apps/esp-dl -t esp32p4 -m test_apps/esp-dl/models 8 | 9 | - Test 10 | - pip install -r test_apps/requirement.txt 11 | - pytest test_apps/esp-dl --target esp32p4 -------------------------------------------------------------------------------- /test_apps/dl_fft/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | 5 | set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components" 6 | "../../tools/dl_fft") 7 | 8 | add_compile_options(-fdiagnostics-color=always) 9 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 10 | project(dl_fft_test) 11 | -------------------------------------------------------------------------------- /test_apps/dl_fft/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(srcs "app_main.cpp" 2 | "test_fft.c" 3 | "test_dl_fft.cpp" 4 | # "test_dsp_fft.cpp" 5 | "test_kiss_fft.cpp" 6 | "kiss_fft/kiss_fft.c" 7 | "kiss_fft/kiss_fftr.c" 8 | "kiss_fft/kiss_fftnd.c" 9 | "kiss_fft/kiss_fftndr.c") 10 | 11 | set(include_dirs "test_data" 12 | "kiss_fft") 13 | 14 | set(requires unity 15 | dl_fft 16 | esp_timer) 17 | 18 | idf_component_register(SRCS ${srcs} 19 | INCLUDE_DIRS ${include_dirs} 20 | REQUIRES ${requires} 21 | WHOLE_ARCHIVE) 22 | 23 | 24 | component_compile_options(-Wno-error=format=-Wno-format) 25 | -------------------------------------------------------------------------------- /test_apps/dl_fft/main/idf_component.yml: -------------------------------------------------------------------------------- 1 | dependencies: 2 | espressif/esp-dsp: ">=1.6.0" 3 | -------------------------------------------------------------------------------- /test_apps/dl_fft/main/kiss_fft/kiss_fft_log.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2003-2010, Mark Borgerding. All rights reserved. 3 | * This file is part of KISS FFT - https://github.com/mborgerding/kissfft 4 | * 5 | * SPDX-License-Identifier: BSD-3-Clause 6 | * See COPYING file for more information. 7 | */ 8 | 9 | #ifndef kiss_fft_log_h 10 | #define kiss_fft_log_h 11 | 12 | #define ERROR 1 13 | #define WARNING 2 14 | #define INFO 3 15 | #define DEBUG 4 16 | 17 | #define STRINGIFY(x) #x 18 | #define TOSTRING(x) STRINGIFY(x) 19 | 20 | #if defined(NDEBUG) 21 | #define KISS_FFT_LOG_MSG(severity, ...) ((void)0) 22 | #else 23 | #define KISS_FFT_LOG_MSG(severity, ...) \ 24 | fprintf(stderr, "[" #severity "] " __FILE__ ":" TOSTRING(__LINE__) " "); \ 25 | fprintf(stderr, __VA_ARGS__); \ 26 | fprintf(stderr, "\n") 27 | #endif 28 | 29 | #define KISS_FFT_ERROR(...) KISS_FFT_LOG_MSG(ERROR, __VA_ARGS__) 30 | #define KISS_FFT_WARNING(...) KISS_FFT_LOG_MSG(WARNING, __VA_ARGS__) 31 | #define KISS_FFT_INFO(...) KISS_FFT_LOG_MSG(INFO, __VA_ARGS__) 32 | #define KISS_FFT_DEBUG(...) KISS_FFT_LOG_MSG(DEBUG, __VA_ARGS__) 33 | 34 | #endif /* kiss_fft_log_h */ 35 | -------------------------------------------------------------------------------- /test_apps/dl_fft/main/kiss_fft/kiss_fftnd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2003-2004, Mark Borgerding. All rights reserved. 3 | * This file is part of KISS FFT - https://github.com/mborgerding/kissfft 4 | * 5 | * SPDX-License-Identifier: BSD-3-Clause 6 | * See COPYING file for more information. 7 | */ 8 | 9 | #ifndef KISS_FFTND_H 10 | #define KISS_FFTND_H 11 | 12 | #include "kiss_fft.h" 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | typedef struct kiss_fftnd_state *kiss_fftnd_cfg; 19 | 20 | kiss_fftnd_cfg KISS_FFT_API kiss_fftnd_alloc(const int *dims, int ndims, int inverse_fft, void *mem, size_t *lenmem); 21 | void KISS_FFT_API kiss_fftnd(kiss_fftnd_cfg cfg, const kiss_fft_cpx *fin, kiss_fft_cpx *fout); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | #endif 27 | -------------------------------------------------------------------------------- /test_apps/dl_fft/main/test_fft.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "rfft_test_1024.h" 4 | #include "rfft_test_128.h" 5 | #include "rfft_test_2048.h" 6 | #include "rfft_test_256.h" 7 | #include "rfft_test_512.h" 8 | 9 | #include "fft_test_1024.h" 10 | #include "fft_test_128.h" 11 | #include "fft_test_2048.h" 12 | #include "fft_test_256.h" 13 | #include "fft_test_512.h" 14 | 15 | #include "esp_heap_caps.h" 16 | #include "esp_timer.h" 17 | #include "unity.h" 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | float cal_snr_item(float x, float y); 24 | 25 | float get_snr(const float *x, const float *gt, int size); 26 | 27 | float get_rmse(const float *x, const float *gt, int size); 28 | 29 | bool check_fft_results(const float *x, const float *gt, int size, float snr_threshold, float rmse_threshold); 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /test_apps/dl_fft/pytest_dl_fft.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_embedded import Dut 3 | 4 | 5 | @pytest.mark.target("esp32p4") 6 | @pytest.mark.target("esp32s3") 7 | @pytest.mark.env("esp32p4") 8 | @pytest.mark.env("esp32s3") 9 | def test_model_common(dut: Dut) -> None: 10 | dut.expect_exact("Press ENTER to see the list of tests.") 11 | dut.write("[dl_fft]") 12 | dut.expect_unity_test_output(timeout=1000) 13 | -------------------------------------------------------------------------------- /test_apps/dl_fft/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.1 Project Minimal Configuration 3 | # 4 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 5 | CONFIG_ESP_INT_WDT=n 6 | CONFIG_ESP_TASK_WDT_EN=n 7 | -------------------------------------------------------------------------------- /test_apps/dl_image/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | 5 | set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components" 6 | "../../esp-dl") 7 | 8 | add_compile_options(-fdiagnostics-color=always) 9 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 10 | project(dl_image_test) 11 | -------------------------------------------------------------------------------- /test_apps/dl_image/imgs/color_320x240.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/dl_image/imgs/color_320x240.jpg -------------------------------------------------------------------------------- /test_apps/dl_image/imgs/color_405x540.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/dl_image/imgs/color_405x540.jpg -------------------------------------------------------------------------------- /test_apps/dl_image/imgs/gray_320x240.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/dl_image/imgs/gray_320x240.jpg -------------------------------------------------------------------------------- /test_apps/dl_image/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(src_dirs .) 2 | 3 | file(GLOB embed_files ${PROJECT_DIR}/imgs/*.jpg) 4 | 5 | set(requires unity 6 | esp-dl) 7 | 8 | if (IDF_TARGET STREQUAL "esp32s3") 9 | list(APPEND requires esp32_s3_eye_noglib 10 | esp_lcd) 11 | elseif (IDF_TARGET STREQUAL "esp32p4") 12 | list(APPEND requires esp32_p4_function_ev_board_noglib 13 | esp_lcd) 14 | endif() 15 | 16 | idf_component_register(SRC_DIRS ${src_dirs} 17 | REQUIRES ${requires} 18 | EMBED_FILES ${embed_files} 19 | WHOLE_ARCHIVE) 20 | -------------------------------------------------------------------------------- /test_apps/dl_image/main/idf_component.yml: -------------------------------------------------------------------------------- 1 | ## IDF Component Manager Manifest File 2 | dependencies: 3 | espressif/esp32_p4_function_ev_board_noglib: 4 | version: "^4.0.1" 5 | rules: 6 | - if: "target == esp32p4" 7 | espressif/esp32_s3_eye_noglib: 8 | version: "^3.1.0~1" 9 | rules: 10 | - if: "target == esp32s3" -------------------------------------------------------------------------------- /test_apps/dl_image/partitions.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild 3 | 4 | factory, app, factory, 0x010000, 8000K 5 | -------------------------------------------------------------------------------- /test_apps/dl_image/pytest_dl_image.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_embedded import Dut 3 | 4 | 5 | @pytest.mark.target("esp32p4") 6 | @pytest.mark.target("esp32s3") 7 | @pytest.mark.env("esp32p4") 8 | @pytest.mark.env("esp32s3") 9 | def test_dl_image(dut: Dut) -> None: 10 | dut.run_all_single_board_cases() 11 | -------------------------------------------------------------------------------- /test_apps/dl_image/sdkconfig.defaults: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/dl_image/sdkconfig.defaults -------------------------------------------------------------------------------- /test_apps/dl_image/sdkconfig.defaults.esp32p4: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32p4" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_COMPILER_OPTIMIZATION_PERF=y 9 | CONFIG_ESP32P4_REV_MIN_0=y 10 | CONFIG_SPIRAM=y 11 | CONFIG_SPIRAM_SPEED_200M=y 12 | CONFIG_CACHE_L2_CACHE_256KB=y 13 | CONFIG_CACHE_L2_CACHE_LINE_128B=y 14 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 15 | CONFIG_ESP_INT_WDT=n 16 | CONFIG_ESP_TASK_WDT_EN=n 17 | CONFIG_FATFS_LFN_HEAP=y 18 | CONFIG_FREERTOS_HZ=1000 19 | CONFIG_IDF_EXPERIMENTAL_FEATURES=y 20 | -------------------------------------------------------------------------------- /test_apps/dl_image/sdkconfig.defaults.esp32s3: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32s3" 5 | CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF=y 6 | CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y 7 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 8 | CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y 9 | CONFIG_PARTITION_TABLE_CUSTOM=y 10 | CONFIG_SPIRAM=y 11 | CONFIG_SPIRAM_MODE_OCT=y 12 | CONFIG_SPIRAM_SPEED_80M=y 13 | CONFIG_SPIRAM_MEMTEST=n 14 | CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y 15 | CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y 16 | CONFIG_ESP32S3_DATA_CACHE_64KB=y 17 | CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y 18 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 19 | CONFIG_ESP_INT_WDT=n 20 | CONFIG_ESP_TASK_WDT_EN=n 21 | CONFIG_FATFS_LFN_HEAP=y 22 | -------------------------------------------------------------------------------- /test_apps/esp-dl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | 5 | set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components" 6 | "../../esp-dl") 7 | 8 | add_compile_options(-fdiagnostics-color=always) 9 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 10 | project(dl_ops_test) 11 | -------------------------------------------------------------------------------- /test_apps/esp-dl/logs/20240826.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/logs/20240826.txt -------------------------------------------------------------------------------- /test_apps/esp-dl/main/Kconfig.projbuild: -------------------------------------------------------------------------------- 1 | menu "Test Model" 2 | 3 | config MODEL_FILE_PATH 4 | string "test" 5 | default "" 6 | 7 | endmenu 8 | -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_16_120_120_kshap_32_16_1_1_s16.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_16_120_120_kshap_32_16_1_1_s16.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_16_120_120_kshap_32_16_1_1_s8.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_16_120_120_kshap_32_16_1_1_s8.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_16_32_32_kshap_32_16_1_1_s16.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_16_32_32_kshap_32_16_1_1_s16.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_16_32_32_kshap_32_16_1_1_s8.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_16_32_32_kshap_32_16_1_1_s8.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_16_32_32_kshap_32_16_5_5_relu_s16.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_16_32_32_kshap_32_16_5_5_relu_s16.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_16_32_32_kshap_32_16_5_5_relu_s8.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_16_32_32_kshap_32_16_5_5_relu_s8.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_16_32_32_kshap_32_16_7_7_relu_s16.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_16_32_32_kshap_32_16_7_7_relu_s16.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_16_32_32_kshap_32_16_7_7_relu_s8.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_16_32_32_kshap_32_16_7_7_relu_s8.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_33_19_29_kshap_55_33_3_3_s16.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_33_19_29_kshap_55_33_3_3_s16.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_33_19_29_kshap_55_33_3_3_s8.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_33_19_29_kshap_55_33_3_3_s8.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_3_224_224_kshap_16_3_3_3_s16.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_3_224_224_kshap_16_3_3_3_s16.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_3_224_224_kshap_16_3_3_3_s8.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_3_224_224_kshap_16_3_3_3_s8.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_48_19_29_kshap_16_48_3_3_s16.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_48_19_29_kshap_16_48_3_3_s16.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_48_19_29_kshap_16_48_3_3_s8.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32p4/Conv/conv2d_ishap_1_48_19_29_kshap_16_48_3_3_s8.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32p4/Conv/depthwise_conv2d_ishap_1_16_20_20_kshap_16_1_5_5_relu_s16.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32p4/Conv/depthwise_conv2d_ishap_1_16_20_20_kshap_16_1_5_5_relu_s16.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32p4/Conv/depthwise_conv2d_ishap_1_16_20_20_kshap_16_1_5_5_relu_s8.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32p4/Conv/depthwise_conv2d_ishap_1_16_20_20_kshap_16_1_5_5_relu_s8.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32p4/Conv/depthwise_conv2d_ishap_1_16_20_20_kshap_16_1_7_7_relu_s16.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32p4/Conv/depthwise_conv2d_ishap_1_16_20_20_kshap_16_1_7_7_relu_s16.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32p4/Conv/depthwise_conv2d_ishap_1_16_20_20_kshap_16_1_7_7_relu_s8.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32p4/Conv/depthwise_conv2d_ishap_1_16_20_20_kshap_16_1_7_7_relu_s8.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32p4/Conv/depthwise_conv2d_ishap_1_16_3_3_kshap_16_1_3_3_relu_s16.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32p4/Conv/depthwise_conv2d_ishap_1_16_3_3_kshap_16_1_3_3_relu_s16.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32p4/Conv/depthwise_conv2d_ishap_1_16_3_3_kshap_16_1_3_3_relu_s8.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32p4/Conv/depthwise_conv2d_ishap_1_16_3_3_kshap_16_1_3_3_relu_s8.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32p4/Conv/depthwise_conv2d_ishap_1_30_20_20_kshap_30_1_7_7_relu_s16.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32p4/Conv/depthwise_conv2d_ishap_1_30_20_20_kshap_30_1_7_7_relu_s16.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32p4/Conv/depthwise_conv2d_ishap_1_30_20_20_kshap_30_1_7_7_relu_s8.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32p4/Conv/depthwise_conv2d_ishap_1_30_20_20_kshap_30_1_7_7_relu_s8.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32p4/Conv/depthwise_conv2d_ishap_1_32_120_120_kshap_32_1_3_3_relu_s16.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32p4/Conv/depthwise_conv2d_ishap_1_32_120_120_kshap_32_1_3_3_relu_s16.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32p4/Conv/depthwise_conv2d_ishap_1_32_120_120_kshap_32_1_3_3_relu_s8.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32p4/Conv/depthwise_conv2d_ishap_1_32_120_120_kshap_32_1_3_3_relu_s8.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_16_120_120_kshap_32_16_1_1_s16.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_16_120_120_kshap_32_16_1_1_s16.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_16_120_120_kshap_32_16_1_1_s8.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_16_120_120_kshap_32_16_1_1_s8.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_16_32_32_kshap_32_16_1_1_s16.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_16_32_32_kshap_32_16_1_1_s16.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_16_32_32_kshap_32_16_1_1_s8.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_16_32_32_kshap_32_16_1_1_s8.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_16_32_32_kshap_32_16_5_5_relu_s16.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_16_32_32_kshap_32_16_5_5_relu_s16.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_16_32_32_kshap_32_16_5_5_relu_s8.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_16_32_32_kshap_32_16_5_5_relu_s8.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_16_32_32_kshap_32_16_7_7_relu_s16.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_16_32_32_kshap_32_16_7_7_relu_s16.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_16_32_32_kshap_32_16_7_7_relu_s8.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_16_32_32_kshap_32_16_7_7_relu_s8.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_33_19_29_kshap_55_33_3_3_s16.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_33_19_29_kshap_55_33_3_3_s16.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_33_19_29_kshap_55_33_3_3_s8.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_33_19_29_kshap_55_33_3_3_s8.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_3_224_224_kshap_16_3_3_3_s16.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_3_224_224_kshap_16_3_3_3_s16.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_3_224_224_kshap_16_3_3_3_s8.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_3_224_224_kshap_16_3_3_3_s8.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_48_19_29_kshap_16_48_3_3_s16.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_48_19_29_kshap_16_48_3_3_s16.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_48_19_29_kshap_16_48_3_3_s8.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32s3/Conv/conv2d_ishap_1_48_19_29_kshap_16_48_3_3_s8.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32s3/Conv/depthwise_conv2d_ishap_1_16_20_20_kshap_16_1_5_5_relu_s16.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32s3/Conv/depthwise_conv2d_ishap_1_16_20_20_kshap_16_1_5_5_relu_s16.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32s3/Conv/depthwise_conv2d_ishap_1_16_20_20_kshap_16_1_5_5_relu_s8.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32s3/Conv/depthwise_conv2d_ishap_1_16_20_20_kshap_16_1_5_5_relu_s8.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32s3/Conv/depthwise_conv2d_ishap_1_16_20_20_kshap_16_1_7_7_relu_s16.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32s3/Conv/depthwise_conv2d_ishap_1_16_20_20_kshap_16_1_7_7_relu_s16.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32s3/Conv/depthwise_conv2d_ishap_1_16_20_20_kshap_16_1_7_7_relu_s8.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32s3/Conv/depthwise_conv2d_ishap_1_16_20_20_kshap_16_1_7_7_relu_s8.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32s3/Conv/depthwise_conv2d_ishap_1_16_3_3_kshap_16_1_3_3_relu_s16.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32s3/Conv/depthwise_conv2d_ishap_1_16_3_3_kshap_16_1_3_3_relu_s16.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32s3/Conv/depthwise_conv2d_ishap_1_16_3_3_kshap_16_1_3_3_relu_s8.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32s3/Conv/depthwise_conv2d_ishap_1_16_3_3_kshap_16_1_3_3_relu_s8.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32s3/Conv/depthwise_conv2d_ishap_1_30_20_20_kshap_30_1_7_7_relu_s16.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32s3/Conv/depthwise_conv2d_ishap_1_30_20_20_kshap_30_1_7_7_relu_s16.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32s3/Conv/depthwise_conv2d_ishap_1_30_20_20_kshap_30_1_7_7_relu_s8.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32s3/Conv/depthwise_conv2d_ishap_1_30_20_20_kshap_30_1_7_7_relu_s8.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32s3/Conv/depthwise_conv2d_ishap_1_32_120_120_kshap_32_1_3_3_relu_s16.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32s3/Conv/depthwise_conv2d_ishap_1_32_120_120_kshap_32_1_3_3_relu_s16.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/models/esp32s3/Conv/depthwise_conv2d_ishap_1_32_120_120_kshap_32_1_3_3_relu_s8.espdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/models/esp32s3/Conv/depthwise_conv2d_ishap_1_32_120_120_kshap_32_1_3_3_relu_s8.espdl -------------------------------------------------------------------------------- /test_apps/esp-dl/partitions.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild 3 | 4 | factory, app, factory, 0x010000, 8000K, 5 | model, data, spiffs, , 7900K, 6 | -------------------------------------------------------------------------------- /test_apps/esp-dl/pytest_espdl_api.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_embedded import Dut 3 | 4 | 5 | @pytest.mark.target("esp32p4") 6 | @pytest.mark.target("esp32s3") 7 | @pytest.mark.env("esp32p4") 8 | @pytest.mark.env("esp32s3") 9 | @pytest.mark.parametrize( 10 | "config", 11 | [ 12 | "Conv", 13 | ], 14 | ) 15 | def test_model_common(dut: Dut) -> None: 16 | dut.expect_exact("Press ENTER to see the list of tests.") 17 | dut.write("[api]") 18 | dut.expect_unity_test_output(timeout=1000) 19 | -------------------------------------------------------------------------------- /test_apps/esp-dl/sdkconfig.defaults: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-dl/578ca7ada61dadc2ff769c46a3e7b689cc37e3ab/test_apps/esp-dl/sdkconfig.defaults -------------------------------------------------------------------------------- /test_apps/esp-dl/sdkconfig.defaults.esp32p4: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.3.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32p4" 5 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 6 | CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y 7 | CONFIG_PARTITION_TABLE_CUSTOM=y 8 | CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" 9 | CONFIG_MODEL_FILE_PATH="" 10 | CONFIG_COMPILER_OPTIMIZATION_PERF=y 11 | CONFIG_ESP32P4_REV_MIN_0=y 12 | CONFIG_SPIRAM=y 13 | CONFIG_SPIRAM_SPEED_200M=y 14 | CONFIG_CACHE_L2_CACHE_256KB=y 15 | CONFIG_CACHE_L2_CACHE_LINE_128B=y 16 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 17 | CONFIG_ESP_INT_WDT=n 18 | CONFIG_ESP_TASK_WDT_EN=n 19 | CONFIG_FREERTOS_HZ=1000 20 | CONFIG_MBEDTLS_CMAC_C=y 21 | CONFIG_IDF_EXPERIMENTAL_FEATURES=y 22 | -------------------------------------------------------------------------------- /test_apps/esp-dl/sdkconfig.defaults.esp32s3: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) 5.3.0 Project Minimal Configuration 3 | # 4 | CONFIG_IDF_TARGET="esp32s3" 5 | CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF=y 6 | CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y 7 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 8 | CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y 9 | CONFIG_PARTITION_TABLE_CUSTOM=y 10 | CONFIG_MODEL_FILE_PATH="" 11 | CONFIG_SPIRAM=y 12 | CONFIG_SPIRAM_MODE_OCT=y 13 | CONFIG_SPIRAM_SPEED_80M=y 14 | CONFIG_SPIRAM_MEMTEST=n 15 | CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y 16 | CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y 17 | CONFIG_ESP32S3_DATA_CACHE_64KB=y 18 | CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y 19 | CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=n 20 | CONFIG_ESP_INT_WDT=n 21 | CONFIG_ESP_TASK_WDT_EN=n 22 | -------------------------------------------------------------------------------- /test_apps/requirements.txt: -------------------------------------------------------------------------------- 1 | idf-build-apps 2 | pytest 3 | pytest-embedded-idf 4 | pytest-embedded-serial-esp 5 | pytest-rerunfailures 6 | pytest-timeout 7 | toml 8 | -------------------------------------------------------------------------------- /tools/dl_fft/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_build_get_property(target IDF_TARGET) 2 | 3 | set(srcs "dl_fft_f32.c" 4 | "dl_fft_s16.c" 5 | "dl_rfft_f32.c" 6 | "dl_rfft_s16.c" 7 | "base/dl_fft2r_fc32_ansi.c" 8 | "base/dl_fft4r_fc32_ansi.c" 9 | "base/dl_fft2r_sc16_ansi.c" 10 | "base/dl_fft_base.c" 11 | ) 12 | 13 | set(include_dirs "." 14 | "base" 15 | "base/isa" 16 | ) 17 | 18 | if(CONFIG_IDF_TARGET_ESP32) 19 | list(APPEND srcs "base/isa/esp32/dl_fft2r_fc32_ae32.S" 20 | "base/isa/esp32/dl_fft4r_fc32_ae32.S" ) 21 | 22 | elseif(CONFIG_IDF_TARGET_ESP32S3) 23 | list(APPEND srcs "base/isa/esp32s3/dl_fft2r_fc32_aes3.S" 24 | "base/isa/esp32s3/dl_fft4r_fc32_aes3.S" ) 25 | 26 | elseif(CONFIG_IDF_TARGET_ESP32P4) 27 | list(APPEND srcs "base/isa/esp32p4/dl_fft2r_fc32_arp4.S" 28 | "base/isa/esp32p4/dl_fft4r_fc32_arp4.S" ) 29 | 30 | endif() 31 | 32 | 33 | set(requires esp-dsp) 34 | 35 | idf_component_register(SRCS ${srcs} INCLUDE_DIRS ${include_dirs} REQUIRES ${requires}) 36 | 37 | component_compile_options(-ffast-math -O2) 38 | -------------------------------------------------------------------------------- /tools/dl_fft/base/dl_fft_dtype.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | // union to simplify access to the 16 bit data 12 | typedef union dl_sc16_u { 13 | struct { 14 | int16_t re; 15 | int16_t im; 16 | }; 17 | uint32_t data; 18 | } dl_sc16_t; 19 | 20 | typedef union dl_fc32_u { 21 | struct { 22 | float re; 23 | float im; 24 | }; 25 | uint64_t data; 26 | } dl_fc32_t; 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | -------------------------------------------------------------------------------- /tools/dl_fft/idf_component.yml: -------------------------------------------------------------------------------- 1 | version: "0.1.0" 2 | license: "MIT" 3 | description: dl_fft is a lightweight and efficient fft library for all espressif chips. 4 | url: https://github.com/espressif/esp-dl/tree/master/esp-dl/tools/dl_fft 5 | dependencies: 6 | idf: ">=5.0" -------------------------------------------------------------------------------- /tools/ops_test/config/model_cfg.toml: -------------------------------------------------------------------------------- 1 | [meta] 2 | seed = 0 3 | quant_bits = 8 # Only support 8 or 16 now. 4 | batch_size = 32 5 | calib_steps = 32 # The minimum value for calib_steps is 8. 6 | model_version = 1 7 | target = "esp32p4" 8 | 9 | 10 | [models_test] 11 | [models_test.picodet] 12 | input_shape = [1, 3, 224, 224] 13 | onnx_model_path = "picodet_xs_224_mod_chns_relu_rep_sim.onnx" 14 | export_path = "" 15 | export_name_prefix = "picodet_xs_224_mod_chns_relu_rep_sim" 16 | 17 | [models_test.mobilenet_v2] 18 | input_shape = [1, 3, 224, 224] 19 | onnx_model_path = "mobilenet_v2.onnx" 20 | export_path = "" 21 | export_name_prefix = "mobilenet_v2" 22 | --------------------------------------------------------------------------------