Benchmarking the speed of OpenCV DNN inferring different models in the zoo. Result of each model includes the time of its preprocessing, inference and postprocessing stages.
Data for benchmarking will be downloaded and loaded in data based on given config.
- Install
python >= 3.6
. - Install dependencies:
pip install -r requirements.txt
. - Download data for benchmarking.
- Download all data:
python download_data.py
- Download one or more specified data:
python download_data.py face text
. Available names can be found indownload_data.py
. - You can also download all data from https://pan.baidu.com/s/18sV8D4vXUb2xC9EG45k7bg (code: pvrw). Please place and extract data packages under ./data.
- Download all data:
Linux:
export PYTHONPATH=$PYTHONPATH:..
python benchmark.py --cfg ./config/face_detection_yunet.yaml
Windows:
-
CMD
set PYTHONPATH=%PYTHONPATH%;.. python benchmark.py --cfg ./config/face_detection_yunet.yaml
-
PowerShell
$env:PYTHONPATH=$env:PYTHONPATH+";.." python benchmark.py --cfg ./config/face_detection_yunet.yaml