Welcome to OVMobileBench! This guide will help you get up and running with your first benchmark in minutes.
Before you begin, ensure you have:
- Python 3.11+ installed
- Git for cloning repositories
- Android device with USB debugging enabled
- Android NDK r26d+ (for building from source)
- CMake 3.24+ and Ninja 1.11+ (for building)
git clone https://github.com/embedded-dev-research/OVMobileBench.git
cd OVMobileBench
pip install -e .[dev]git clone https://github.com/embedded-dev-research/OVMobileBench.git
cd OVMobileBench
pip install -r requirements.txt
pip install -e .For Android device testing, you need to install Android SDK and NDK. We provide an automated installer module:
from ovmobilebench.android import ensure_android_tools
# Automated installation
result = ensure_android_tools(
sdk_root="~/Android/sdk",
api=30,
target="google_atd",
arch="arm64-v8a",
ndk="r26d"
)Or via command line:
# Install Android SDK and NDK
ovmobilebench-android-installer setup \
--sdk-root ~/Android/sdk \
--api 30 \
--ndk r26d
# Verify installation
ovmobilebench-android-installer verify --sdk-root ~/Android/sdkFor detailed instructions, see Android Installer Module Documentation or Android Setup Guide.
export ANDROID_NDK_HOME=/path/to/android-ndk-r26d
export ANDROID_HOME=/path/to/android-sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH# Check OVMobileBench installation
ovmobilebench --version
# Check build tools
cmake --version
ninja --versionFor Android devices:
- Enable Developer Options and USB Debugging on your device
- Connect via USB
- Run OVMobileBench to list devices:
ovmobilebench list-devices
# Example output:
# Available Android devices:
# - R3CN30XXXX (device)
# - emulator-5554 (device)# Create models directory
mkdir -p models
# Download a sample model (ResNet-50)
# You can use Open Model Zoo tools or download manually
omz_downloader --name resnet-50-tf -o models/
omz_converter --name resnet-50-tf --precision FP16 -d models/Create experiments/quick_test.yaml:
project:
name: "quick-test"
run_id: "first-run"
build:
enabled: false # Use prebuilt OpenVINO if available
openvino_repo: "/path/to/openvino" # Update this path
device:
kind: "android"
serials: ["YOUR_DEVICE_SERIAL"] # From 'ovmobilebench list-devices'
push_dir: "/data/local/tmp/ovmobilebench"
models:
- name: "resnet50"
path: "models/public/resnet-50-tf/FP16/resnet-50-tf.xml"
precision: "FP16"
run:
repeats: 3
matrix:
niter: [100]
api: ["sync"]
nireq: [1]
nstreams: ["1"]
device: ["CPU"]
threads: [4]
report:
sinks:
- type: "csv"
path: "experiments/results/quick_test.csv"
- type: "json"
path: "experiments/results/quick_test.json"# Run the complete pipeline
ovmobilebench all -c experiments/quick_test.yaml --verbose
# Or run individual stages
ovmobilebench build -c experiments/quick_test.yaml
ovmobilebench package -c experiments/quick_test.yaml
ovmobilebench deploy -c experiments/quick_test.yaml
ovmobilebench run -c experiments/quick_test.yaml
ovmobilebench report -c experiments/quick_test.yaml# View CSV results
cat experiments/results/quick_test.csv
# View JSON results (pretty-printed)
python -m json.tool experiments/results/quick_test.jsonA typical benchmark result includes:
- Throughput (FPS): Frames/inferences per second
- Latency metrics: Average, median, min, max (in milliseconds)
- Device information: Serial, SoC, memory
- Configuration: Threads, streams, precision used
- Build provenance: OpenVINO version, build flags
Example CSV output:
model,device,threads,nstreams,throughput_fps,latency_avg_ms
resnet50,CPU,4,1,25.3,39.5
resnet50,CPU,4,2,31.2,32.1
If you need to build OpenVINO:
# Clone OpenVINO
git clone https://github.com/openvinotoolkit/openvino.git
cd openvino
git submodule update --init --recursive
# Update your config to enable building
# Set build.enabled: true in your YAMLdevice:
kind: "android"
serials: ["device1", "device2", "device3"]run:
matrix:
threads: [1, 2, 4, 8]
nstreams: ["1", "2", "AUTO"]
api: ["sync", "async"]- Device Setup Guide - Configure Android/Linux devices
- Configuration Reference - Full YAML schema
- Build Guide - Building OpenVINO for mobile
- User Guide - Complete usage documentation
- Check the Troubleshooting Guide
- File issues on GitHub
- See FAQ for common questions
- Start simple: Begin with one model and one device
- Use prebuilt OpenVINO: Avoid building from source initially
- Monitor thermals: Let devices cool between runs
- Validate results: Run benchmarks multiple times
- Keep logs: Use
--verboseflag for debugging
Happy benchmarking!