esp-detection-skill

Train, quantize, and deploy YOLOv11 object detection models on ESP32-P4 and ESP32-S3 chips.

28|3|Updated Jun 24, 2026
One-click install
npx skills add https://github.com/JasonYANG170/esp-dev-skill --skill esp-detection-skill-jasonyang170
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: esp-detection-skill
Source: https://github.com/JasonYANG170/esp-dev-skill/tree/main/repos/esp-detection
Command: npx skills add https://github.com/JasonYANG170/esp-dev-skill --skill esp-detection-skill-jasonyang170

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ultralytics, torch, torchvision, onnx, onnxsim, onnxruntime, opencv-python, numpy, esp-ppq, and includes references (resource) components.

What problem does it solve? Developing custom object detection for Espressif chips requires coordinating two separate toolchains—Python training/quantization on PC and ESP-IDF C++ firmware on device—with many failure-prone details like custom module registration, ONNX opset constraints, calibration data, and Kconfig model placement. This Skill guides AI agents through the entire esp-detection workflow using only verified repository source code. ## Core Features & Use Cases - Scenario Recipes: Nine step-by-step recipes covering environment setup, YOLO dataset preparation, square and rectangular (rect=True) training, ONNX export (opset 13), INT8 quantization to ESP-DL .espdl via esp-ppq, quantized mAP evaluation, one-command pipeline, and firmware deployment. - API & Config Reference: Complete signatures for Train/Export/quant_espdet, custom network modules (DSConv, ESPBlock, ESPDetect), C++ classes (ESPDetDetect), plus Kconfig, sdkconfig, and partition table references. - Pitfall Prevention: 26 documented pitfalls with WRONG/CORRECT code comparisons, such as injecting custom_parse_model before training and enabling RGB565 big-endian on ESP32-S3. - Use Case: Train a custom cat detector at 224x224, quantize it to INT8, generate an ESP-IDF project automatically via espdet_run.py, and flash it to an ESP32-P4 board to see detection results over serial. ## Quick Start Ask the AI agent to train and deploy a custom object detection model on ESP32-P4 using esp-detection, and it will follow the all-in-one pipeline recipe from dataset preparation through firmware flashing.

Frequently Asked Questions about esp-detection-skill

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I train a custom object detection model for ESP32-P4?

Use the espdet_run.py one-command pipeline with your class name, dataset YAML, input size, target chip, calibration images, and output .espdl path. It chains training, ONNX export, quantization, and ESP-IDF project generation automatically.

How to quantize a YOLOv11 model to ESP-DL .espdl format?

Call quant_espdet() from deploy/quantize.py with your ONNX model, target chip (esp32p4 or esp32s3), image size, and a calibration image directory. It uses esp-ppq PTQ with Equalization to produce an INT8 .espdl file.

Why does my esp-detection training fail with KeyError on ESPBlock?

The custom modules DSConv, ESPBlock, and ESPDetect are not registered with Ultralytics by default. You must execute tasks.parse_model = custom_parse_model before creating the YOLO model in any training or export script.

Does esp-detection support ESP32-S3 deployment?

Yes, both ESP32-P4 and ESP32-S3 are supported targets. On ESP32-S3 the firmware must enable DL_IMAGE_CAP_RGB565_BIG_ENDIAN in the ImagePreprocessor and call enable_letterbox, and the quantization target must match the chip.

What are the limitations of esp-detection?

It only supports object detection tasks, not classification, pose estimation, or segmentation. It targets only ESP-DL inference on ESP32-P4/S3 chips, so other backends like TFLite or OpenVINO and non-Espressif hardware are not applicable.