EdgeBench is a benchmarking framework for evaluating edge AI models, specifically focused on pose estimation models. The framework enables performance testing across various devices and model configurations with metrics for both latency and accuracy.
EdgeBench provides a client-server architecture using MQTT communication for benchmarking TensorFlow Lite models on edge devices. It supports:
- Latency testing with customizable iteration counts
- Accuracy testing using PCK (Percentage of Correct Keypoints) metrics
- Testing on both standard clients and microcontroller devices
- Automated reporting and analysis
edgebench/
├── analyze.py # Analysis tools for benchmark results
├── client.py # Python client implementation
├── manager.py # Test manager implementation
├── mmpose_eval.py # MMPose-specific evaluation helpers
├── pck_eval.py # PCK metrics evaluation
├── requirements.txt # Python dependencies
├── shared.py # Shared utilities and constants
├── data/ # Test data and ground truth
├── micro_client/ # Microcontroller client implementations
├── models/ # TFLite models
└── reports/ # Generated test reports
- Clone the repository
- Install dependencies:
pip install -r requirements.txt
The manager controls the testing process and communicates with clients:
python manager.py --device [DEVICE_ID] --broker-host [MQTT_HOST] --broker-port [MQTT_PORT] [OPTIONS]
Options:
--device
: Device ID (required)--broker-host
: MQTT broker host (default: 127.0.0.1)--broker-port
: MQTT broker port (default: 1883)--micro
: Specify if using a micro client--latency
: Run latency test--accuracy
: Run accuracy test--model
: Specific model to test or "*" for all models--iterations
: Number of iterations for latency test (default: 100)--quick
: Run a quick test (reduced iterations/samples)--energy
: Enable energy measurement
Clients execute the models and report results back to the manager:
python client.py --device [DEVICE_ID] --broker-host [MQTT_HOST] --broker-port [MQTT_PORT]
After running tests, analyze the results with:
python analyze.py
This will generate comparison reports between different models based on metrics like latency, accuracy, and resource utilization.
- The manager connects to the MQTT broker
- Clients connect and subscribe to configuration topics
- The manager sends test configuration (mode, iterations, model)
- Clients load models and prepare for testing
- The manager initiates tests and clients execute them
- Results are collected and saved to the reports directory
- Optional analysis can be performed on the collected data