Tool to benchmark speed of machine learning models on real mobile devices
Project description
Edge Benchmark
Measure the speed of your machine learning models on real devices!
Installation
pip install edgebenchmark
First Use
Before you can use Edge Benchmark, register at https://edgebenchmark.com/app#/register and generate your secret token in profiel section.
Then, run following command
edgebenchmark configure
and insert your secret token when you see prompt as shown below.
Edge Benchmark Token [None]:
Your secret token is saved at ~/.edgebenchmark/token
.
Edge Benchmark Usage
Edge Benchmark can be either used directly from command line with edgebenchmark
command, or from Python script.
Edge Benchmark CLI
Edge Benchmark CLI tool offers several commands: configure
, ncnn
and tflite
.
edgebenchmark --help
Usage: edgebenchmark [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
configure
ncnn
tflite
configure
command is explained in the First use section.
tflite
command is for benchmarking the speed of TensorFlow Lite models.
You can setup many parameters to control the benchmarking process and also select devices (--devices
) which you want to benchmark with.
Below, you can see all options for tflite
command.
edgebenchmark tflite --help
Usage: edgebenchmark tflite [OPTIONS]
Options:
--features FEATURES
-d, --devices TEXT [required]
--model_path MODEL_PATH [required]
--num_threads INTEGER
--warmup_runs INTEGER
--num_runs INTEGER
--run_delay FLOAT
--use_nnapi / --no-use_nnapi
--use_legacy_nnapi / --no-use_legacy_nnapi
--use_gpu / --no-use_gpu
--help Show this message and exit.
Edge Benchmark Python Package
If you prefer to benchmark your machine learning models directly from Python, you can use our Python package edgebenchmark
.
from edgebenchmark import TFLiteBenchmark
benchmark = TFLiteBenchmark()
benchmark.num_threads = 2
benchmark.warmup_runs = 10
benchmark.num_runs = 13
benchmark.run_delay = 3.3
benchmark.use_nnapi = False
benchmark.use_legacy_nnapi = False
benchmark.use_gpu = False
benchmark.features = "{}"
benchmark.devices = ["SamsungGalaxyNote3"]
model_path = "model.tflite"
benchmark.run(model_path)
Licence
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for edgebenchmark-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 699673d9ab878c1b12cbecdc8182265638f00cff748026b95180b9da3c365275 |
|
MD5 | 30e18b97579ea7ea065bad51b25584bb |
|
BLAKE2b-256 | 5f81cf5fc453b2e3c7af05ea376187bf0dd286db95f53a908c7dbeedbbcf8d7d |