Open Model Zoo モデルの動作¶
この Jupyter ノートブックはオンラインで起動でき、ブラウザーのウィンドウで対話型環境を開きます。ローカルにインストールすることもできます。次のオプションのいずれかを選択します。
このチュートリアルでは、Open Model Zoo からモデルをダウンロードし、OpenVINO™ IR 形式に変換し、モデルに関する情報を表示し、モデルのベンチマークを実行する方法を示します。
目次¶
OpenVINO および Open Model Zoo ツール¶
OpenVINO および Open Model Zoo ツールを以下の表に示します。
ツール |
コマンド |
説明 |
---|---|---|
モデル・ダウンローダー |
|
Open Model Zoo からモデルをダウンロードします。 |
モデル・コンバーター |
|
Open Model Zoo モデルを OpenVINO の IR 形式に変換します。 |
情報ダンパー |
|
Open Model Zoo のモデルに関する情報を印刷します。 |
ベンチマーク・ツール |
|
推論時間を計算してモデルのパフォーマンスをベンチマークします。 |
# Install openvino package
%pip install -q "openvino-dev>=2023.1.0"
Note: you may need to restart the kernel to use updated packages.
準備¶
モデル名¶
model_name
を、このノートブックで使用する Open Model Zoo モデルの名前に設定します。使用できるモデルの完全なリストについては、公開モデルおよびインテルの事前トレーニング済みモデルのリストを参照してください。model_name
を使用するモデルに設定します。
# model_name = "resnet-50-pytorch"
model_name = "mobilenet-v2-pytorch"
インポート¶
import json
from pathlib import Path
import openvino as ov
from IPython.display import Markdown, display
# Fetch `notebook_utils` module
import urllib.request
urllib.request.urlretrieve(
url='https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/main/notebooks/utils/notebook_utils.py',
filename='notebook_utils.py'
)
from notebook_utils import DeviceNotFoundAlert, NotebookAlert
設定と構成¶
ファイルとディレクトリーのパスを設定します。デフォルトでは、このノートブックは Open Model Zoo から $HOME
ディレクトリーの open_model_zoo_models
にモデルをダウンロードします。Windows* では、$HOME ディレクトリーは通常 c:\users\username
、Linux* では /home/username
です。フォルダーを変更するには、下のセルの base_model_dir
を変更します。
次の設定を変更できます。
base_model_dir
: モデルは、このディレクトリー内のintel
とpublic
フォルダーにダウンロードされます。omz_cache_dir
: Open Model Zoo のキャッシュフォルダー。モデル・ダウンローダーとモデル・コンバーターではキャッシュ・ディレクトリーを指定する必要はありませんが、指定すると後続のダウンロードが高速化されます。precision
: 指定した場合、その精度を持つモデルのみがダウンロードおよび変換されます。
base_model_dir = Path("model")
omz_cache_dir = Path("cache")
precision = "FP16"
# Check if an iGPU is available on this system to use with Benchmark App.
core = ov.Core()
gpu_available = "GPU" in core.available_devices
print(
f"base_model_dir: {base_model_dir}, omz_cache_dir: {omz_cache_dir}, gpu_availble: {gpu_available}"
)
base_model_dir: model, omz_cache_dir: cache, gpu_availble: False
Open Model Zoo からモデルをダウンロード¶
モデル・ダウンローダー・コマンドを指定、表示、実行してモデルをダウンロードします。
## Uncomment the next line to show help in omz_downloader which explains the command-line options.
# !omz_downloader --help
download_command = (
f"omz_downloader --name {model_name} --output_dir {base_model_dir} --cache_dir {omz_cache_dir}"
)
display(Markdown(f"Download command: `{download_command}`"))
display(Markdown(f"Downloading {model_name}..."))
! $download_command
ダウンロード・コマンド:
omz_downloader --name mobilenet-v2-pytorch --output_dir model --cache_dir cache
Downloading mobilenet-v2-pytorch…
################|| Downloading mobilenet-v2-pytorch ||################
========== Downloading model/public/mobilenet-v2-pytorch/mobilenet_v2-b0353104.pth
... 0%, 32 KB, 1147 KB/s, 0 seconds passed
… 0%, 64 KB, 1047 KB/s, 0 seconds passed
... 0%, 96 KB, 1108 KB/s, 0 seconds passed
… 0%, 128 KB, 1467 KB/s, 0 seconds passed … 1%, 160 KB, 1676 KB/s, 0 seconds passed … 1%, 192 KB, 1999 KB/s, 0 seconds passed … 1%, 224 KB, 1847 KB/s, 0 seconds passed … 1%, 256 KB, 2102 KB/s, 0 seconds passed
... 2%, 288 KB, 2214 KB/s, 0 seconds passed
… 2%, 320 KB, 2445 KB/s, 0 seconds passed … 2%, 352 KB, 2259 KB/s, 0 seconds passed … 2%, 384 KB, 2457 KB/s, 0 seconds passed … 2%, 416 KB, 2526 KB/s, 0 seconds passed … 3%, 448 KB, 2712 KB/s, 0 seconds passed
... 3%, 480 KB, 2525 KB/s, 0 seconds passed
… 3%, 512 KB, 2682 KB/s, 0 seconds passed … 3%, 544 KB, 2734 KB/s, 0 seconds passed … 4%, 576 KB, 2884 KB/s, 0 seconds passed … 4%, 608 KB, 2702 KB/s, 0 seconds passed … 4%, 640 KB, 2834 KB/s, 0 seconds passed
... 4%, 672 KB, 2871 KB/s, 0 seconds passed
… 5%, 704 KB, 2999 KB/s, 0 seconds passed … 5%, 736 KB, 2837 KB/s, 0 seconds passed … 5%, 768 KB, 2950 KB/s, 0 seconds passed … 5%, 800 KB, 2978 KB/s, 0 seconds passed … 5%, 832 KB, 3091 KB/s, 0 seconds passed
... 6%, 864 KB, 2935 KB/s, 0 seconds passed
… 6%, 896 KB, 3035 KB/s, 0 seconds passed … 6%, 928 KB, 3064 KB/s, 0 seconds passed … 6%, 960 KB, 3161 KB/s, 0 seconds passed … 7%, 992 KB, 3022 KB/s, 0 seconds passed … 7%, 1024 KB, 3109 KB/s, 0 seconds passed
... 7%, 1056 KB, 3127 KB/s, 0 seconds passed
… 7%, 1088 KB, 3216 KB/s, 0 seconds passed … 8%, 1120 KB, 3088 KB/s, 0 seconds passed … 8%, 1152 KB, 3165 KB/s, 0 seconds passed … 8%, 1184 KB, 3177 KB/s, 0 seconds passed … 8%, 1216 KB, 3258 KB/s, 0 seconds passed
... 8%, 1248 KB, 3135 KB/s, 0 seconds passed
… 9%, 1280 KB, 3208 KB/s, 0 seconds passed … 9%, 1312 KB, 3219 KB/s, 0 seconds passed … 9%, 1344 KB, 3294 KB/s, 0 seconds passed … 9%, 1376 KB, 3183 KB/s, 0 seconds passed … 10%, 1408 KB, 3249 KB/s, 0 seconds passed
... 10%, 1440 KB, 3262 KB/s, 0 seconds passed
… 10%, 1472 KB, 3325 KB/s, 0 seconds passed … 10%, 1504 KB, 3218 KB/s, 0 seconds passed … 11%, 1536 KB, 3281 KB/s, 0 seconds passed … 11%, 1568 KB, 3288 KB/s, 0 seconds passed … 11%, 1600 KB, 3351 KB/s, 0 seconds passed
... 11%, 1632 KB, 3249 KB/s, 0 seconds passed
… 11%, 1664 KB, 3309 KB/s, 0 seconds passed … 12%, 1696 KB, 3314 KB/s, 0 seconds passed … 12%, 1728 KB, 3374 KB/s, 0 seconds passed … 12%, 1760 KB, 3288 KB/s, 0 seconds passed … 12%, 1792 KB, 3335 KB/s, 0 seconds passed
... 13%, 1824 KB, 3350 KB/s, 0 seconds passed
… 13%, 1856 KB, 3394 KB/s, 0 seconds passed … 13%, 1888 KB, 3312 KB/s, 0 seconds passed … 13%, 1920 KB, 3357 KB/s, 0 seconds passed … 14%, 1952 KB, 3372 KB/s, 0 seconds passed … 14%, 1984 KB, 3413 KB/s, 0 seconds passed
... 14%, 2016 KB, 3335 KB/s, 0 seconds passed
… 14%, 2048 KB, 3378 KB/s, 0 seconds passed … 14%, 2080 KB, 3388 KB/s, 0 seconds passed … 15%, 2112 KB, 3430 KB/s, 0 seconds passed … 15%, 2144 KB, 3356 KB/s, 0 seconds passed … 15%, 2176 KB, 3394 KB/s, 0 seconds passed
... 15%, 2208 KB, 3404 KB/s, 0 seconds passed
… 16%, 2240 KB, 3445 KB/s, 0 seconds passed … 16%, 2272 KB, 3373 KB/s, 0 seconds passed … 16%, 2304 KB, 3409 KB/s, 0 seconds passed … 16%, 2336 KB, 3417 KB/s, 0 seconds passed … 17%, 2368 KB, 3457 KB/s, 0 seconds passed
... 17%, 2400 KB, 3390 KB/s, 0 seconds passed
… 17%, 2432 KB, 3422 KB/s, 0 seconds passed … 17%, 2464 KB, 3429 KB/s, 0 seconds passed … 17%, 2496 KB, 3366 KB/s, 0 seconds passed … 18%, 2528 KB, 3399 KB/s, 0 seconds passed
... 18%, 2560 KB, 3433 KB/s, 0 seconds passed
… 18%, 2592 KB, 3440 KB/s, 0 seconds passed … 18%, 2624 KB, 3478 KB/s, 0 seconds passed … 19%, 2656 KB, 3415 KB/s, 0 seconds passed … 19%, 2688 KB, 3444 KB/s, 0 seconds passed … 19%, 2720 KB, 3450 KB/s, 0 seconds passed
... 19%, 2752 KB, 3396 KB/s, 0 seconds passed
… 20%, 2784 KB, 3424 KB/s, 0 seconds passed … 20%, 2816 KB, 3453 KB/s, 0 seconds passed … 20%, 2848 KB, 3461 KB/s, 0 seconds passed … 20%, 2880 KB, 3409 KB/s, 0 seconds passed
... 20%, 2912 KB, 3434 KB/s, 0 seconds passed
… 21%, 2944 KB, 3451 KB/s, 0 seconds passed … 21%, 2976 KB, 3468 KB/s, 0 seconds passed … 21%, 3008 KB, 3418 KB/s, 0 seconds passed … 21%, 3040 KB, 3445 KB/s, 0 seconds passed … 22%, 3072 KB, 3461 KB/s, 0 seconds passed … 22%, 3104 KB, 3476 KB/s, 0 seconds passed
... 22%, 3136 KB, 3432 KB/s, 0 seconds passed
… 22%, 3168 KB, 3457 KB/s, 0 seconds passed … 23%, 3200 KB, 3485 KB/s, 0 seconds passed … 23%, 3232 KB, 3489 KB/s, 0 seconds passed … 23%, 3264 KB, 3442 KB/s, 0 seconds passed
... 23%, 3296 KB, 3465 KB/s, 0 seconds passed
… 23%, 3328 KB, 3493 KB/s, 0 seconds passed … 24%, 3360 KB, 3497 KB/s, 0 seconds passed … 24%, 3392 KB, 3452 KB/s, 0 seconds passed … 24%, 3424 KB, 3475 KB/s, 0 seconds passed … 24%, 3456 KB, 3501 KB/s, 0 seconds passed … 25%, 3488 KB, 3503 KB/s, 0 seconds passed
... 25%, 3520 KB, 3460 KB/s, 1 seconds passed
… 25%, 3552 KB, 3479 KB/s, 1 seconds passed … 25%, 3584 KB, 3506 KB/s, 1 seconds passed … 26%, 3616 KB, 3508 KB/s, 1 seconds passed
... 26%, 3648 KB, 3466 KB/s, 1 seconds passed
… 26%, 3680 KB, 3485 KB/s, 1 seconds passed … 26%, 3712 KB, 3512 KB/s, 1 seconds passed … 26%, 3744 KB, 3515 KB/s, 1 seconds passed … 27%, 3776 KB, 3474 KB/s, 1 seconds passed … 27%, 3808 KB, 3495 KB/s, 1 seconds passed … 27%, 3840 KB, 3519 KB/s, 1 seconds passed … 27%, 3872 KB, 3522 KB/s, 1 seconds passed
... 28%, 3904 KB, 3481 KB/s, 1 seconds passed
… 28%, 3936 KB, 3502 KB/s, 1 seconds passed … 28%, 3968 KB, 3525 KB/s, 1 seconds passed … 28%, 4000 KB, 3527 KB/s, 1 seconds passed
... 29%, 4032 KB, 3491 KB/s, 1 seconds passed
… 29%, 4064 KB, 3508 KB/s, 1 seconds passed … 29%, 4096 KB, 3531 KB/s, 1 seconds passed … 29%, 4128 KB, 3532 KB/s, 1 seconds passed … 29%, 4160 KB, 3497 KB/s, 1 seconds passed … 30%, 4192 KB, 3515 KB/s, 1 seconds passed … 30%, 4224 KB, 3536 KB/s, 1 seconds passed … 30%, 4256 KB, 3537 KB/s, 1 seconds passed
... 30%, 4288 KB, 3498 KB/s, 1 seconds passed
… 31%, 4320 KB, 3515 KB/s, 1 seconds passed … 31%, 4352 KB, 3529 KB/s, 1 seconds passed … 31%, 4384 KB, 3539 KB/s, 1 seconds passed
... 31%, 4416 KB, 3505 KB/s, 1 seconds passed
… 32%, 4448 KB, 3522 KB/s, 1 seconds passed … 32%, 4480 KB, 3535 KB/s, 1 seconds passed … 32%, 4512 KB, 3544 KB/s, 1 seconds passed … 32%, 4544 KB, 3511 KB/s, 1 seconds passed … 32%, 4576 KB, 3527 KB/s, 1 seconds passed … 33%, 4608 KB, 3549 KB/s, 1 seconds passed … 33%, 4640 KB, 3548 KB/s, 1 seconds passed
... 33%, 4672 KB, 3517 KB/s, 1 seconds passed
… 33%, 4704 KB, 3533 KB/s, 1 seconds passed … 34%, 4736 KB, 3545 KB/s, 1 seconds passed … 34%, 4768 KB, 3553 KB/s, 1 seconds passed
... 34%, 4800 KB, 3522 KB/s, 1 seconds passed
… 34%, 4832 KB, 3537 KB/s, 1 seconds passed … 35%, 4864 KB, 3550 KB/s, 1 seconds passed … 35%, 4896 KB, 3557 KB/s, 1 seconds passed … 35%, 4928 KB, 3525 KB/s, 1 seconds passed … 35%, 4960 KB, 3539 KB/s, 1 seconds passed … 35%, 4992 KB, 3553 KB/s, 1 seconds passed … 36%, 5024 KB, 3561 KB/s, 1 seconds passed
... 36%, 5056 KB, 3532 KB/s, 1 seconds passed
… 36%, 5088 KB, 3546 KB/s, 1 seconds passed … 36%, 5120 KB, 3558 KB/s, 1 seconds passed … 37%, 5152 KB, 3564 KB/s, 1 seconds passed
... 37%, 5184 KB, 3534 KB/s, 1 seconds passed
… 37%, 5216 KB, 3546 KB/s, 1 seconds passed … 37%, 5248 KB, 3559 KB/s, 1 seconds passed … 38%, 5280 KB, 3566 KB/s, 1 seconds passed … 38%, 5312 KB, 3536 KB/s, 1 seconds passed … 38%, 5344 KB, 3549 KB/s, 1 seconds passed … 38%, 5376 KB, 3563 KB/s, 1 seconds passed
... 38%, 5408 KB, 3570 KB/s, 1 seconds passed
… 39%, 5440 KB, 3540 KB/s, 1 seconds passed … 39%, 5472 KB, 3554 KB/s, 1 seconds passed … 39%, 5504 KB, 3565 KB/s, 1 seconds passed … 39%, 5536 KB, 3573 KB/s, 1 seconds passed
... 40%, 5568 KB, 3543 KB/s, 1 seconds passed
… 40%, 5600 KB, 3557 KB/s, 1 seconds passed … 40%, 5632 KB, 3567 KB/s, 1 seconds passed … 40%, 5664 KB, 3575 KB/s, 1 seconds passed … 41%, 5696 KB, 3545 KB/s, 1 seconds passed … 41%, 5728 KB, 3560 KB/s, 1 seconds passed … 41%, 5760 KB, 3570 KB/s, 1 seconds passed
... 41%, 5792 KB, 3577 KB/s, 1 seconds passed
… 41%, 5824 KB, 3548 KB/s, 1 seconds passed … 42%, 5856 KB, 3561 KB/s, 1 seconds passed … 42%, 5888 KB, 3572 KB/s, 1 seconds passed … 42%, 5920 KB, 3579 KB/s, 1 seconds passed
... 42%, 5952 KB, 3551 KB/s, 1 seconds passed
… 43%, 5984 KB, 3564 KB/s, 1 seconds passed … 43%, 6016 KB, 3574 KB/s, 1 seconds passed … 43%, 6048 KB, 3582 KB/s, 1 seconds passed … 43%, 6080 KB, 3555 KB/s, 1 seconds passed … 44%, 6112 KB, 3568 KB/s, 1 seconds passed … 44%, 6144 KB, 3577 KB/s, 1 seconds passed
... 44%, 6176 KB, 3585 KB/s, 1 seconds passed
… 44%, 6208 KB, 3558 KB/s, 1 seconds passed … 44%, 6240 KB, 3570 KB/s, 1 seconds passed … 45%, 6272 KB, 3580 KB/s, 1 seconds passed … 45%, 6304 KB, 3587 KB/s, 1 seconds passed
... 45%, 6336 KB, 3561 KB/s, 1 seconds passed
… 45%, 6368 KB, 3574 KB/s, 1 seconds passed … 46%, 6400 KB, 3582 KB/s, 1 seconds passed … 46%, 6432 KB, 3589 KB/s, 1 seconds passed … 46%, 6464 KB, 3562 KB/s, 1 seconds passed … 46%, 6496 KB, 3575 KB/s, 1 seconds passed … 47%, 6528 KB, 3585 KB/s, 1 seconds passed
... 47%, 6560 KB, 3593 KB/s, 1 seconds passed
… 47%, 6592 KB, 3567 KB/s, 1 seconds passed … 47%, 6624 KB, 3579 KB/s, 1 seconds passed … 47%, 6656 KB, 3588 KB/s, 1 seconds passed … 48%, 6688 KB, 3593 KB/s, 1 seconds passed
... 48%, 6720 KB, 3567 KB/s, 1 seconds passed
… 48%, 6752 KB, 3581 KB/s, 1 seconds passed … 48%, 6784 KB, 3590 KB/s, 1 seconds passed … 49%, 6816 KB, 3597 KB/s, 1 seconds passed … 49%, 6848 KB, 3572 KB/s, 1 seconds passed … 49%, 6880 KB, 3583 KB/s, 1 seconds passed … 49%, 6912 KB, 3592 KB/s, 1 seconds passed
... 50%, 6944 KB, 3599 KB/s, 1 seconds passed
… 50%, 6976 KB, 3574 KB/s, 1 seconds passed … 50%, 7008 KB, 3585 KB/s, 1 seconds passed … 50%, 7040 KB, 3593 KB/s, 1 seconds passed … 50%, 7072 KB, 3600 KB/s, 1 seconds passed
... 51%, 7104 KB, 3575 KB/s, 1 seconds passed
… 51%, 7136 KB, 3586 KB/s, 1 seconds passed … 51%, 7168 KB, 3595 KB/s, 1 seconds passed … 51%, 7200 KB, 3602 KB/s, 1 seconds passed … 52%, 7232 KB, 3579 KB/s, 2 seconds passed … 52%, 7264 KB, 3590 KB/s, 2 seconds passed … 52%, 7296 KB, 3598 KB/s, 2 seconds passed
... 52%, 7328 KB, 3604 KB/s, 2 seconds passed
… 53%, 7360 KB, 3579 KB/s, 2 seconds passed … 53%, 7392 KB, 3591 KB/s, 2 seconds passed … 53%, 7424 KB, 3599 KB/s, 2 seconds passed
... 53%, 7456 KB, 3573 KB/s, 2 seconds passed
… 53%, 7488 KB, 3580 KB/s, 2 seconds passed … 54%, 7520 KB, 3591 KB/s, 2 seconds passed … 54%, 7552 KB, 3599 KB/s, 2 seconds passed … 54%, 7584 KB, 3574 KB/s, 2 seconds passed … 54%, 7616 KB, 3581 KB/s, 2 seconds passed … 55%, 7648 KB, 3593 KB/s, 2 seconds passed
... 55%, 7680 KB, 3598 KB/s, 2 seconds passed
… 55%, 7712 KB, 3575 KB/s, 2 seconds passed … 55%, 7744 KB, 3583 KB/s, 2 seconds passed … 56%, 7776 KB, 3593 KB/s, 2 seconds passed … 56%, 7808 KB, 3598 KB/s, 2 seconds passed
... 56%, 7840 KB, 3577 KB/s, 2 seconds passed
… 56%, 7872 KB, 3584 KB/s, 2 seconds passed … 56%, 7904 KB, 3595 KB/s, 2 seconds passed … 57%, 7936 KB, 3600 KB/s, 2 seconds passed … 57%, 7968 KB, 3578 KB/s, 2 seconds passed … 57%, 8000 KB, 3586 KB/s, 2 seconds passed … 57%, 8032 KB, 3597 KB/s, 2 seconds passed
... 58%, 8064 KB, 3601 KB/s, 2 seconds passed
… 58%, 8096 KB, 3579 KB/s, 2 seconds passed … 58%, 8128 KB, 3588 KB/s, 2 seconds passed … 58%, 8160 KB, 3598 KB/s, 2 seconds passed … 59%, 8192 KB, 3602 KB/s, 2 seconds passed
... 59%, 8224 KB, 3581 KB/s, 2 seconds passed
… 59%, 8256 KB, 3589 KB/s, 2 seconds passed … 59%, 8288 KB, 3599 KB/s, 2 seconds passed … 59%, 8320 KB, 3604 KB/s, 2 seconds passed … 60%, 8352 KB, 3582 KB/s, 2 seconds passed … 60%, 8384 KB, 3591 KB/s, 2 seconds passed
... 60%, 8416 KB, 3602 KB/s, 2 seconds passed
… 60%, 8448 KB, 3605 KB/s, 2 seconds passed … 61%, 8480 KB, 3584 KB/s, 2 seconds passed … 61%, 8512 KB, 3594 KB/s, 2 seconds passed … 61%, 8544 KB, 3604 KB/s, 2 seconds passed … 61%, 8576 KB, 3611 KB/s, 2 seconds passed
... 62%, 8608 KB, 3588 KB/s, 2 seconds passed
… 62%, 8640 KB, 3596 KB/s, 2 seconds passed … 62%, 8672 KB, 3606 KB/s, 2 seconds passed … 62%, 8704 KB, 3613 KB/s, 2 seconds passed … 62%, 8736 KB, 3589 KB/s, 2 seconds passed … 63%, 8768 KB, 3599 KB/s, 2 seconds passed
... 63%, 8800 KB, 3607 KB/s, 2 seconds passed
… 63%, 8832 KB, 3615 KB/s, 2 seconds passed … 63%, 8864 KB, 3594 KB/s, 2 seconds passed … 64%, 8896 KB, 3600 KB/s, 2 seconds passed … 64%, 8928 KB, 3608 KB/s, 2 seconds passed … 64%, 8960 KB, 3616 KB/s, 2 seconds passed
... 64%, 8992 KB, 3596 KB/s, 2 seconds passed
… 65%, 9024 KB, 3600 KB/s, 2 seconds passed … 65%, 9056 KB, 3609 KB/s, 2 seconds passed … 65%, 9088 KB, 3617 KB/s, 2 seconds passed … 65%, 9120 KB, 3594 KB/s, 2 seconds passed
... 65%, 9152 KB, 3601 KB/s, 2 seconds passed
… 66%, 9184 KB, 3610 KB/s, 2 seconds passed … 66%, 9216 KB, 3613 KB/s, 2 seconds passed … 66%, 9248 KB, 3593 KB/s, 2 seconds passed … 66%, 9280 KB, 3601 KB/s, 2 seconds passed … 67%, 9312 KB, 3611 KB/s, 2 seconds passed … 67%, 9344 KB, 3613 KB/s, 2 seconds passed
... 67%, 9376 KB, 3595 KB/s, 2 seconds passed
… 67%, 9408 KB, 3603 KB/s, 2 seconds passed … 68%, 9440 KB, 3612 KB/s, 2 seconds passed … 68%, 9472 KB, 3616 KB/s, 2 seconds passed … 68%, 9504 KB, 3596 KB/s, 2 seconds passed
... 68%, 9536 KB, 3605 KB/s, 2 seconds passed
… 68%, 9568 KB, 3613 KB/s, 2 seconds passed … 69%, 9600 KB, 3617 KB/s, 2 seconds passed … 69%, 9632 KB, 3597 KB/s, 2 seconds passed … 69%, 9664 KB, 3605 KB/s, 2 seconds passed … 69%, 9696 KB, 3614 KB/s, 2 seconds passed … 70%, 9728 KB, 3618 KB/s, 2 seconds passed
... 70%, 9760 KB, 3598 KB/s, 2 seconds passed
… 70%, 9792 KB, 3606 KB/s, 2 seconds passed … 70%, 9824 KB, 3614 KB/s, 2 seconds passed … 71%, 9856 KB, 3619 KB/s, 2 seconds passed
... 71%, 9888 KB, 3599 KB/s, 2 seconds passed
… 71%, 9920 KB, 3607 KB/s, 2 seconds passed … 71%, 9952 KB, 3615 KB/s, 2 seconds passed … 71%, 9984 KB, 3620 KB/s, 2 seconds passed … 72%, 10016 KB, 3601 KB/s, 2 seconds passed … 72%, 10048 KB, 3608 KB/s, 2 seconds passed … 72%, 10080 KB, 3617 KB/s, 2 seconds passed … 72%, 10112 KB, 3621 KB/s, 2 seconds passed
... 73%, 10144 KB, 3602 KB/s, 2 seconds passed
… 73%, 10176 KB, 3609 KB/s, 2 seconds passed … 73%, 10208 KB, 3617 KB/s, 2 seconds passed … 73%, 10240 KB, 3622 KB/s, 2 seconds passed
... 74%, 10272 KB, 3602 KB/s, 2 seconds passed
… 74%, 10304 KB, 3610 KB/s, 2 seconds passed … 74%, 10336 KB, 3617 KB/s, 2 seconds passed … 74%, 10368 KB, 3623 KB/s, 2 seconds passed … 74%, 10400 KB, 3603 KB/s, 2 seconds passed … 75%, 10432 KB, 3610 KB/s, 2 seconds passed … 75%, 10464 KB, 3619 KB/s, 2 seconds passed … 75%, 10496 KB, 3623 KB/s, 2 seconds passed
... 75%, 10528 KB, 3605 KB/s, 2 seconds passed
… 76%, 10560 KB, 3611 KB/s, 2 seconds passed … 76%, 10592 KB, 3620 KB/s, 2 seconds passed … 76%, 10624 KB, 3624 KB/s, 2 seconds passed
... 76%, 10656 KB, 3605 KB/s, 2 seconds passed
… 77%, 10688 KB, 3611 KB/s, 2 seconds passed … 77%, 10720 KB, 3620 KB/s, 2 seconds passed … 77%, 10752 KB, 3624 KB/s, 2 seconds passed … 77%, 10784 KB, 3606 KB/s, 2 seconds passed … 77%, 10816 KB, 3613 KB/s, 2 seconds passed … 78%, 10848 KB, 3621 KB/s, 2 seconds passed … 78%, 10880 KB, 3627 KB/s, 2 seconds passed
... 78%, 10912 KB, 3609 KB/s, 3 seconds passed
… 78%, 10944 KB, 3615 KB/s, 3 seconds passed … 79%, 10976 KB, 3623 KB/s, 3 seconds passed … 79%, 11008 KB, 3628 KB/s, 3 seconds passed
... 79%, 11040 KB, 3609 KB/s, 3 seconds passed
… 79%, 11072 KB, 3615 KB/s, 3 seconds passed … 80%, 11104 KB, 3624 KB/s, 3 seconds passed … 80%, 11136 KB, 3629 KB/s, 3 seconds passed … 80%, 11168 KB, 3611 KB/s, 3 seconds passed … 80%, 11200 KB, 3617 KB/s, 3 seconds passed … 80%, 11232 KB, 3625 KB/s, 3 seconds passed … 81%, 11264 KB, 3630 KB/s, 3 seconds passed
... 81%, 11296 KB, 3612 KB/s, 3 seconds passed
… 81%, 11328 KB, 3618 KB/s, 3 seconds passed … 81%, 11360 KB, 3626 KB/s, 3 seconds passed … 82%, 11392 KB, 3629 KB/s, 3 seconds passed
... 82%, 11424 KB, 3611 KB/s, 3 seconds passed
… 82%, 11456 KB, 3617 KB/s, 3 seconds passed … 82%, 11488 KB, 3626 KB/s, 3 seconds passed … 82%, 11520 KB, 3610 KB/s, 3 seconds passed … 83%, 11552 KB, 3612 KB/s, 3 seconds passed … 83%, 11584 KB, 3618 KB/s, 3 seconds passed … 83%, 11616 KB, 3626 KB/s, 3 seconds passed
... 83%, 11648 KB, 3611 KB/s, 3 seconds passed
… 84%, 11680 KB, 3613 KB/s, 3 seconds passed … 84%, 11712 KB, 3618 KB/s, 3 seconds passed … 84%, 11744 KB, 3627 KB/s, 3 seconds passed … 84%, 11776 KB, 3612 KB/s, 3 seconds passed
... 85%, 11808 KB, 3613 KB/s, 3 seconds passed
… 85%, 11840 KB, 3620 KB/s, 3 seconds passed … 85%, 11872 KB, 3628 KB/s, 3 seconds passed … 85%, 11904 KB, 3610 KB/s, 3 seconds passed … 85%, 11936 KB, 3614 KB/s, 3 seconds passed … 86%, 11968 KB, 3620 KB/s, 3 seconds passed … 86%, 12000 KB, 3629 KB/s, 3 seconds passed
... 86%, 12032 KB, 3610 KB/s, 3 seconds passed
… 86%, 12064 KB, 3615 KB/s, 3 seconds passed … 87%, 12096 KB, 3621 KB/s, 3 seconds passed … 87%, 12128 KB, 3630 KB/s, 3 seconds passed
... 87%, 12160 KB, 3611 KB/s, 3 seconds passed
… 87%, 12192 KB, 3612 KB/s, 3 seconds passed … 88%, 12224 KB, 3621 KB/s, 3 seconds passed … 88%, 12256 KB, 3630 KB/s, 3 seconds passed … 88%, 12288 KB, 3612 KB/s, 3 seconds passed … 88%, 12320 KB, 3614 KB/s, 3 seconds passed … 88%, 12352 KB, 3622 KB/s, 3 seconds passed … 89%, 12384 KB, 3631 KB/s, 3 seconds passed
... 89%, 12416 KB, 3617 KB/s, 3 seconds passed
… 89%, 12448 KB, 3618 KB/s, 3 seconds passed … 89%, 12480 KB, 3623 KB/s, 3 seconds passed … 90%, 12512 KB, 3632 KB/s, 3 seconds passed
... 90%, 12544 KB, 3618 KB/s, 3 seconds passed
… 90%, 12576 KB, 3615 KB/s, 3 seconds passed … 90%, 12608 KB, 3624 KB/s, 3 seconds passed … 91%, 12640 KB, 3632 KB/s, 3 seconds passed … 91%, 12672 KB, 3619 KB/s, 3 seconds passed … 91%, 12704 KB, 3619 KB/s, 3 seconds passed … 91%, 12736 KB, 3624 KB/s, 3 seconds passed … 91%, 12768 KB, 3633 KB/s, 3 seconds passed
... 92%, 12800 KB, 3616 KB/s, 3 seconds passed
… 92%, 12832 KB, 3620 KB/s, 3 seconds passed … 92%, 12864 KB, 3625 KB/s, 3 seconds passed … 92%, 12896 KB, 3633 KB/s, 3 seconds passed
... 93%, 12928 KB, 3617 KB/s, 3 seconds passed
… 93%, 12960 KB, 3621 KB/s, 3 seconds passed … 93%, 12992 KB, 3626 KB/s, 3 seconds passed … 93%, 13024 KB, 3634 KB/s, 3 seconds passed … 94%, 13056 KB, 3618 KB/s, 3 seconds passed … 94%, 13088 KB, 3622 KB/s, 3 seconds passed … 94%, 13120 KB, 3627 KB/s, 3 seconds passed … 94%, 13152 KB, 3634 KB/s, 3 seconds passed
... 94%, 13184 KB, 3619 KB/s, 3 seconds passed
… 95%, 13216 KB, 3622 KB/s, 3 seconds passed … 95%, 13248 KB, 3628 KB/s, 3 seconds passed … 95%, 13280 KB, 3635 KB/s, 3 seconds passed
... 95%, 13312 KB, 3620 KB/s, 3 seconds passed
… 96%, 13344 KB, 3623 KB/s, 3 seconds passed … 96%, 13376 KB, 3628 KB/s, 3 seconds passed … 96%, 13408 KB, 3636 KB/s, 3 seconds passed … 96%, 13440 KB, 3620 KB/s, 3 seconds passed … 97%, 13472 KB, 3624 KB/s, 3 seconds passed
... 97%, 13504 KB, 3628 KB/s, 3 seconds passed
… 97%, 13536 KB, 3636 KB/s, 3 seconds passed … 97%, 13568 KB, 3621 KB/s, 3 seconds passed … 97%, 13600 KB, 3625 KB/s, 3 seconds passed … 98%, 13632 KB, 3629 KB/s, 3 seconds passed … 98%, 13664 KB, 3637 KB/s, 3 seconds passed
... 98%, 13696 KB, 3622 KB/s, 3 seconds passed
… 98%, 13728 KB, 3625 KB/s, 3 seconds passed … 99%, 13760 KB, 3629 KB/s, 3 seconds passed … 99%, 13792 KB, 3637 KB/s, 3 seconds passed … 99%, 13824 KB, 3623 KB/s, 3 seconds passed … 99%, 13856 KB, 3623 KB/s, 3 seconds passed
... 100%, 13879 KB, 3629 KB/s, 3 seconds passed
モデルを OpenVINO IR 形式に変換¶
モデル・コンバーターのコマンドを指定、表示、実行して、モデルを OpenVINO IR 形式に変換します。モデルの変換には時間がかかる場合があります。モデル・コンバーターのコマンド出力が表示されます。変換が成功すると、出力の最後の行には次の内容が含まれます: [ SUCCESS ] Generated IR version 11 model.
。すでに OpenVINO IR 形式でダウンロードされたモデルの変換はスキップされます。
## Uncomment the next line to show Help in omz_converter which explains the command-line options.
# !omz_converter --help
convert_command = f"omz_converter --name {model_name} --precisions {precision} --download_dir {base_model_dir} --output_dir {base_model_dir}"
display(Markdown(f"Convert command: `{convert_command}`"))
display(Markdown(f"Converting {model_name}..."))
! $convert_command
変換コマンド:
omz_converter --name mobilenet-v2-pytorch --precisions FP16 --download_dir model --output_dir model
mobilenet-v2-pytorch を変換中 …
========== Converting mobilenet-v2-pytorch to ONNX
Conversion to ONNX command: /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-609/.workspace/scm/ov-notebook/.venv/bin/python -- /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-609/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/openvino/model_zoo/internal_scripts/pytorch_to_onnx.py --model-name=mobilenet_v2 --weights=model/public/mobilenet-v2-pytorch/mobilenet_v2-b0353104.pth --import-module=torchvision.models --input-shape=1,3,224,224 --output-file=model/public/mobilenet-v2-pytorch/mobilenet-v2.onnx --input-names=data --output-names=prob
ONNX check passed successfully.
========== Converting mobilenet-v2-pytorch to IR (FP16)
Conversion command: /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-609/.workspace/scm/ov-notebook/.venv/bin/python -- /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-609/.workspace/scm/ov-notebook/.venv/bin/mo --framework=onnx --output_dir=model/public/mobilenet-v2-pytorch/FP16 --model_name=mobilenet-v2-pytorch --input=data '--mean_values=data[123.675,116.28,103.53]' '--scale_values=data[58.624,57.12,57.375]' --reverse_input_channels --output=prob --input_model=model/public/mobilenet-v2-pytorch/mobilenet-v2.onnx '--layout=data(NCHW)' '--input_shape=[1, 3, 224, 224]' --compress_to_fp16=True
[ INFO ] Generated IR will be compressed to FP16. If you get lower accuracy, please consider disabling compression explicitly by adding argument --compress_to_fp16=False.
Find more information about compression to FP16 at https://docs.openvino.ai/2023.0/openvino_docs_MO_DG_FP16_Compression.html
[ INFO ] The model was converted to IR v11, the latest model format that corresponds to the source DL framework input/output format. While IR v11 is backwards compatible with OpenVINO Inference Engine API v1.0, please use API v2.0 (as of 2022.1) to take advantage of the latest improvements in IR v11.
Find more information about API v2.0 and IR v11 at https://docs.openvino.ai/2023.0/openvino_2_0_transition_guide.html
[ INFO ] MO command line tool is considered as the legacy conversion API as of OpenVINO 2023.2 release. Please use OpenVINO Model Converter (OVC). OVC represents a lightweight alternative of MO and provides simplified model conversion API.
Find more information about transition from MO to OVC at https://docs.openvino.ai/2023.2/openvino_docs_OV_Converter_UG_prepare_model_convert_model_MO_OVC_transition.html
[ SUCCESS ] Generated IR version 11 model.
[ SUCCESS ] XML file: /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-609/.workspace/scm/ov-notebook/notebooks/104-model-tools/model/public/mobilenet-v2-pytorch/FP16/mobilenet-v2-pytorch.xml
[ SUCCESS ] BIN file: /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-609/.workspace/scm/ov-notebook/notebooks/104-model-tools/model/public/mobilenet-v2-pytorch/FP16/mobilenet-v2-pytorch.bin
モデルの情報を取得¶
Info Dumper は、Open Model Zoo モデルに関する情報を出力します。
モデル名
説明
モデルのトレーニングに使用されたフレームワーク
ライセンスの URL
モデルがサポートする精度
サブディレクトリー: ダウンロードしたモデルの場所
タスクタイプ
この情報は、端末で omz_info_dumper --name model_name
を実行することで表示されます。情報は解析してスクリプトで使用することもできます。
次のセルで、Info Dumper を実行し、json
を使用して情報を辞書にロードします。
model_info_output = %sx omz_info_dumper --name $model_name
model_info = json.loads(model_info_output.get_nlstr())
if len(model_info) > 1:
NotebookAlert(
f"There are multiple IR files for the {model_name} model. The first model in the "
"omz_info_dumper output will be used for benchmarking. Change "
"`selected_model_info` in the cell below to select a different model from the list.",
"warning",
)
model_info
[{'name': 'mobilenet-v2-pytorch', 'composite_model_name': None, 'description': 'MobileNet V2 is image classification model pre-trained on ImageNet dataset. This is a PyTorch* implementation of MobileNetV2 architecture as described in the paper "Inverted Residuals and Linear Bottlenecks: Mobile Networks for Classification, Detection and Segmentation" <https://arxiv.org/abs/1801.04381>.nThe model input is a blob that consists of a single image of "1, 3, 224, 224" in "RGB" order.nThe model output is typical object classifier for the 1000 different classifications matching with those in the ImageNet database.', 'framework': 'pytorch', 'license_url': 'https://raw.githubusercontent.com/pytorch/vision/master/LICENSE', 'accuracy_config': '/opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-609/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/openvino/model_zoo/models/public/mobilenet-v2-pytorch/accuracy-check.yml', 'model_config': '/opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-609/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/openvino/model_zoo/models/public/mobilenet-v2-pytorch/model.yml', 'precisions': ['FP16', 'FP32'], 'quantization_output_precisions': ['FP16-INT8', 'FP32-INT8'], 'subdirectory': 'public/mobilenet-v2-pytorch', 'task_type': 'classification', 'input_info': [{'name': 'data', 'shape': [1, 3, 224, 224], 'layout': 'NCHW'}], 'model_stages': []}]
JSON ファイルにモデルの情報が含まれていると、モデル・ディレクトリーへのパスを抽出し、OpenVINO IR ファイルへのパスを構築できます。
selected_model_info = model_info[0]
model_path = (
base_model_dir
/ Path(selected_model_info["subdirectory"])
/ Path(f"{precision}/{selected_model_info['name']}.xml")
)
print(model_path, "exists:", model_path.exists())
model/public/mobilenet-v2-pytorch/FP16/mobilenet-v2-pytorch.xml exists: True
ベンチマークツールの実行¶
デフォルトでは、ベンチマーク・ツールは CPU 上の非同期モードで推論を 60 秒間実行します。推論速度をレイテンシー (画像あたりのミリ秒) およびスループット (1 秒あたりのフレーム数) の値として返します。
## Uncomment the next line to show Help in benchmark_app which explains the command-line options.
# !benchmark_app --help
benchmark_command = f"benchmark_app -m {model_path} -t 15"
display(Markdown(f"Benchmark command: `{benchmark_command}`"))
display(Markdown(f"Benchmarking {model_name} on CPU with async inference for 15 seconds..."))
! $benchmark_command
ベンチマーク・コマンド:
benchmark_app -m model/public/mobilenet-v2-pytorch/FP16/mobilenet-v2-pytorch.xml -t 15
15 秒間の非同期推論による CPU 上の mobilenet-v2-pytorch のベンチマーク…
[Step 1/11] Parsing and validating input arguments
[ INFO ] Parsing input parameters
[Step 2/11] Loading OpenVINO Runtime
[ INFO ] OpenVINO:
[ INFO ] Build ................................. 2023.3.0-13775-ceeafaf64f3-releases/2023/3
[ INFO ]
[ INFO ] Device info:
[ INFO ] CPU
[ INFO ] Build ................................. 2023.3.0-13775-ceeafaf64f3-releases/2023/3
[ INFO ]
[ INFO ]
[Step 3/11] Setting device configuration
[ WARNING ] Performance hint was not explicitly specified in command line. Device(CPU) performance hint will be set to PerformanceMode.THROUGHPUT.
[Step 4/11] Reading model files
[ INFO ] Loading model files
[ INFO ] Read model took 28.83 ms
[ INFO ] Original model I/O parameters:
[ INFO ] Model inputs:
[ INFO ] data (node: data) : f32 / [N,C,H,W] / [1,3,224,224]
[ INFO ] Model outputs:
[ INFO ] prob (node: prob) : f32 / [...] / [1,1000]
[Step 5/11] Resizing model to match image sizes and given batch
[ INFO ] Model batch size: 1
[Step 6/11] Configuring input of the model
[ INFO ] Model inputs:
[ INFO ] data (node: data) : u8 / [N,C,H,W] / [1,3,224,224]
[ INFO ] Model outputs:
[ INFO ] prob (node: prob) : f32 / [...] / [1,1000]
[Step 7/11] Loading the model to the device
[ INFO ] Compile model took 135.30 ms
[Step 8/11] Querying optimal runtime parameters
[ INFO ] Model:
[ INFO ] NETWORK_NAME: main_graph
[ INFO ] OPTIMAL_NUMBER_OF_INFER_REQUESTS: 6
[ INFO ] NUM_STREAMS: 6
[ INFO ] AFFINITY: Affinity.CORE
[ INFO ] INFERENCE_NUM_THREADS: 24
[ INFO ] PERF_COUNT: NO
[ INFO ] INFERENCE_PRECISION_HINT: <Type: 'float32'>
[ INFO ] PERFORMANCE_HINT: THROUGHPUT
[ INFO ] EXECUTION_MODE_HINT: ExecutionMode.PERFORMANCE
[ INFO ] PERFORMANCE_HINT_NUM_REQUESTS: 0
[ INFO ] ENABLE_CPU_PINNING: True
[ INFO ] SCHEDULING_CORE_TYPE: SchedulingCoreType.ANY_CORE
[ INFO ] ENABLE_HYPER_THREADING: True
[ INFO ] EXECUTION_DEVICES: ['CPU']
[ INFO ] CPU_DENORMALS_OPTIMIZATION: False
[ INFO ] CPU_SPARSE_WEIGHTS_DECOMPRESSION_RATE: 1.0
[Step 9/11] Creating infer requests and preparing input tensors
[ WARNING ] No input files were given for input 'data'!. This input will be filled with random values!
[ INFO ] Fill input 'data' with random values
[Step 10/11] Measuring performance (Start inference asynchronously, 6 inference requests, limits: 15000 ms duration)
[ INFO ] Benchmarking in inference only mode (inputs filling are not included in measurement loop).
[ INFO ] First inference took 6.27 ms
[Step 11/11] Dumping statistics report
[ INFO ] Execution Devices:['CPU']
[ INFO ] Count: 20346 iterations
[ INFO ] Duration: 15007.48 ms
[ INFO ] Latency:
[ INFO ] Median: 4.29 ms
[ INFO ] Average: 4.30 ms
[ INFO ] Min: 2.40 ms
[ INFO ] Max: 12.55 ms
[ INFO ] Throughput: 1355.72 FPS
さまざまな設定のベンチマーク¶
benchmark_app
ツールは、必ずしも必要ではないログ情報を表示します。出力を json
で解析すると、さらにコンパクトな結果が得られます。
次のセルは、さまざまなパラメーターを使用した benchmark_app
の例をいくつか示しています。以下にいくつか便利なパラメーターを示します。
-
-d
推論に使用するデバイス。例: CPU、GPU、MULTI。デフォルト: CPU。 -t
推論の実行にかかる時間を秒数で表します。デフォルト: 60。-
-api
非同期 (async) 推論または同期 (sync) 推論を使用します。デフォルト: 非同期 (async)。 -b
バッチサイズ。デフォルト: 1。
! benchmark_app --help
を実行して、すべてのコマンドライン・パラメーターの概要を表示します。
次のセルで、benchmark_app
を呼び出す benchmark_model()
関数を定義します。これにより、各種組み合わせを簡単に試すことができます。下のセルには、システム上で使用可能なデバイスが表示されます。
注: このノートブックでは、
benchmark_app
を 15 秒間実行してパフォーマンスを示します。より正確なパフォーマンスを得るには、t
パラメーターを 60 以上に設定して推論を少なくとも 1 分間実行し、他のアプリケーションを閉じた後にターミナル/コマンドプロンプトでbenchmark_app
を実行することを推奨します。ベンチマーク・コマンドをコピーし、openvino_env
環境をアクティブ化したコマンドプロンプトに貼り付けます。
def benchmark_model(model_xml, device="CPU", seconds=60, api="async", batch=1):
core = ov.Core()
model_path = Path(model_xml)
if ("GPU" in device) and ("GPU" not in core.available_devices):
DeviceNotFoundAlert("GPU")
else:
benchmark_command = f"benchmark_app -m {model_path} -d {device} -t {seconds} -api {api} -b {batch}"
display(Markdown(f"**Benchmark {model_path.name} with {device} for {seconds} seconds with {api} inference**"))
display(Markdown(f"Benchmark command: `{benchmark_command}`"))
benchmark_output = %sx $benchmark_command
print("command ended")
benchmark_result = [line for line in benchmark_output
if not (line.startswith(r"[") or line.startswith(" ") or line == "")]
print("\n".join(benchmark_result))
core = ov.Core()
# Show devices available for OpenVINO Runtime
for device in core.available_devices:
device_name = core.get_property(device, "FULL_DEVICE_NAME")
print(f"{device}: {device_name}")
CPU: Intel(R) Core(TM) i9-10920X CPU @ 3.50GHz
benchmark_model(model_path, device="CPU", seconds=15, api="async")
mobilenet-v2-pytorch.xml を CPU で 15 秒間、非同期推論でベンチマーク
ベンチマーク・コマンド:
benchmark_app -m model/public/mobilenet-v2-pytorch/FP16/mobilenet-v2-pytorch.xml -d CPU -t 15 -api async -b 1
command ended
benchmark_model(model_path, device="AUTO", seconds=15, api="async")
mobilenet-v2-pytorch.xml を AUTO で 15 秒間、非同期推論でベンチマーク
ベンチマーク・コマンド:
benchmark_app -m model/public/mobilenet-v2-pytorch/FP16/mobilenet-v2-pytorch.xml -d AUTO -t 15 -api async -b 1
command ended
benchmark_model(model_path, device="GPU", seconds=15, api="async")
benchmark_model(model_path, device="MULTI:CPU,GPU", seconds=15, api="async")