diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000000..61fe9498942 --- /dev/null +++ b/.flake8 @@ -0,0 +1,39 @@ +[flake8] +exclude= + # generic excludes + .git,__pycache__, + # generated files + demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/impl.py, + models/public/mozilla-deepspeech-0.8.2/mds_convert_utils/memmapped_file_system_pb2.py, + +select= + # indentation problems + E10,E11, + # closing bracket does not match indentation of opening brackets line + E123, + # whitespace before '(' + E211, + # missing whitespace after ',', ';', or ':' + E231, + # missing whitespace after keyword + E275, + # expected 1 blank line, found 0 + E301, + # blank lines found after function decorator + E304, + # the backslash is redundant between brackets + E502, + # statement style issues + E7, + # parse errors + E9, + # pyflakes checks + F4,F5,F6,F7,F8,F9, + # deprecation warnings + W6, + +ignore= + # multiple statements on one line (colon/def) + # ignored because putting a statement after a colon is harmless and + # sometimes results in more compact code + E701,E704, diff --git a/.gitattributes b/.gitattributes index 61c193bf62f..913646cceb0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,8 +7,9 @@ # so allow it. *.patch whitespace=-blank-at-eol -.git* -omz.package .editorconfig -omz.package +.flake8 -omz.package +.git* -omz.package .yamllint -omz.package /ci/** -omz.package /demos/build_demos.sh omz.package=l,m @@ -21,6 +22,7 @@ /ci/requirements-conversion.txt omz.ci.job-for-change.demos omz.ci.job-for-change.models /ci/requirements-demos.txt omz.ci.job-for-change.demos /ci/requirements-downloader.txt omz.ci.job-for-change.demos omz.ci.job-for-change.models +/ci/requirements-quantization.txt omz.ci.job-for-change.downloader /demos/** omz.ci.job-for-change.demos /demos/**/*.md -omz.ci.job-for-change.demos diff --git a/.yamllint b/.yamllint index 547528a7f82..d9df60cc771 100644 --- a/.yamllint +++ b/.yamllint @@ -11,14 +11,16 @@ yaml-files: ignore: | demos/thirdparty/ - tools/accuracy_checker/.yamllint + tools/accuracy_checker/dataset_definitions.yml tools/accuracy_checker/configs/ rules: line-length: disable braces: enable brackets: enable - colons: disable + colons: + max-spaces-before: 0 + max-spaces-after: -1 commas: enable comments: level: warning @@ -34,7 +36,7 @@ rules: key-ordering: disable new-line-at-end-of-file: enable new-lines: disable - octal-values: disable + octal-values: enable quoted-strings: disable trailing-spaces: enable truthy: disable diff --git a/README.md b/README.md index adb6bd23f42..0da12b74a61 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # [OpenVINO™ Toolkit](https://01.org/openvinotoolkit) - Open Model Zoo repository -[![Stable release](https://img.shields.io/badge/version-2021.2-green.svg)](https://github.com/openvinotoolkit/open_model_zoo/releases/tag/2021.2) +[![Stable release](https://img.shields.io/badge/version-2021.3-green.svg)](https://github.com/openvinotoolkit/open_model_zoo/releases/tag/2021.3) [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/open_model_zoo/community) [![Apache License Version 2.0](https://img.shields.io/badge/license-Apache_2.0-green.svg)](LICENSE) diff --git a/ci/check-basics.py b/ci/check-basics.py index bb8e21b4338..af6b3fb3526 100755 --- a/ci/check-basics.py +++ b/ci/check-basics.py @@ -49,6 +49,8 @@ def complain(message): cwd=OMZ_ROOT, ).stdout.strip() + print('running text checks...', flush=True) + if subprocess.run(['git', '--no-pager', 'diff', '--check', empty_tree_hash, '--'], cwd=OMZ_ROOT).returncode != 0: all_passed = False @@ -79,6 +81,28 @@ def complain(message): mode = raw_diff.split()[1] + absolute_path = OMZ_ROOT / path + + if path.startswith('tools/accuracy_checker/configs/') and path.endswith('.yml'): + if mode == '120000': + try: + if absolute_path.is_symlink(): + real_path = absolute_path.resolve(strict=True) + else: + with open(absolute_path, 'r', newline='') as file: + link_target = file.read() + real_path = (absolute_path.parent / link_target).resolve(strict=True) + except FileNotFoundError: + complain(f"{path}: should be a symbolic link to existing accuracy-check.yml from models directory") + else: + model_name = absolute_path.stem + if real_path.name != 'accuracy-check.yml' or real_path.parent.name != model_name: + complain(f"{path}: should be a symbolic link to accuracy-check.yml from {model_name} model " + "directory") + else: + complain(f"{path}: isn't a symbolic link but it should be a symbolic link to accuracy-check.yml " + "from models directory") + if mode not in {'100644', '100755'}: # not a regular or executable file continue @@ -88,7 +112,7 @@ def complain(message): if path.startswith('demos/thirdparty/'): continue - with open(OMZ_ROOT / path, encoding='UTF-8') as f: + with open(absolute_path, encoding='UTF-8') as f: lines = list(f) if lines and not lines[-1].endswith('\n'): @@ -113,9 +137,14 @@ def complain(message): shebang_program.endswith('/env') and shebang_args == 'python'): complain(f"{path}:1: use 'python3', not 'python'") + print('running yamllint...', flush=True) if subprocess.run([sys.executable, '-m', 'yamllint', '-s', '.'], cwd=OMZ_ROOT).returncode != 0: all_passed = False + print('running flake8...', flush=True) + if subprocess.run([sys.executable, '-m', 'flake8', '--config=.flake8'], cwd=OMZ_ROOT).returncode != 0: + all_passed = False + sys.exit(0 if all_passed else 1) diff --git a/ci/check-release-readiness.py b/ci/check-release-readiness.py index 1515c28d05b..1cf9a8cedd8 100755 --- a/ci/check-release-readiness.py +++ b/ci/check-release-readiness.py @@ -45,9 +45,10 @@ def complain(format, *args): for models_lst_path in OMZ_ROOT.glob('demos/**/models.lst'): with models_lst_path.open() as models_lst: - for line in models_lst: + for line_num, line in enumerate(models_lst): if RE_TODO_COMMENT.search(line): - complain('{} has a TODO comment', models_lst_path.relative_to(OMZ_ROOT)) + complain('{}:{}: line contains TODO comment', + models_lst_path.relative_to(OMZ_ROOT), line_num + 1) sys.exit(0 if all_passed else 1) diff --git a/ci/documentation_updater/documentation_updater.py b/ci/documentation_updater/documentation_updater.py index 154d7689280..7230c2b9491 100755 --- a/ci/documentation_updater/documentation_updater.py +++ b/ci/documentation_updater/documentation_updater.py @@ -20,7 +20,6 @@ import logging import re import ruamel.yaml -import shlex from pathlib import Path from ruamel.yaml.scalarstring import FoldedScalarString @@ -29,7 +28,7 @@ MODES = [ 'check', 'update' - ] +] LOG_LEVELS = [ 'CRITICAL', @@ -79,7 +78,7 @@ def convert(lines): result += ' ' result += line.rstrip('\n') result = re.sub(r"\[(.*?)\]\((.*?)\)", r"\1 <\2>", result) # Links transformation - result = result.replace("`", "\"").replace("\*", "*") + result = result.replace("`", "\"").replace("\\*", "*") return result.strip() diff --git a/ci/requirements-ac-test.txt b/ci/requirements-ac-test.txt index 621e363a347..eaa423b4a9b 100644 --- a/ci/requirements-ac-test.txt +++ b/ci/requirements-ac-test.txt @@ -1,48 +1,47 @@ # use update-requirements.py to update this file atomicwrites==1.4.0 # via -r tools/accuracy_checker/requirements-test.in -attrs==20.2.0 # via pytest -certifi==2020.6.20 # via matplotlib +attrs==20.3.0 # via pytest click==7.1.2 # via nltk cycler==0.10.0 # via matplotlib decorator==4.4.2 # via networkx editdistance==0.5.3 # via -r tools/accuracy_checker/requirements.in fast-ctc-decode==0.2.5 # via -r tools/accuracy_checker/requirements.in imageio==2.9.0 # via scikit-image -importlib-metadata==2.0.0 # via pluggy, pytest +importlib-metadata==3.3.0 # via pluggy, pytest joblib==0.17.0 # via nltk, scikit-learn -kiwisolver==1.2.0 # via matplotlib -matplotlib==3.3.2 # via scikit-image -more-itertools==8.5.0 # via pytest +kiwisolver==1.3.1 # via matplotlib +matplotlib==3.3.3 # via scikit-image +more-itertools==8.6.0 # via pytest networkx==2.5 # via scikit-image -nibabel==3.1.1 # via -r tools/accuracy_checker/requirements.in +nibabel==3.2.1 # via -r tools/accuracy_checker/requirements.in nltk==3.5 # via -r tools/accuracy_checker/requirements.in -numpy==1.17.5 # via -r tools/accuracy_checker/requirements-core.in, imageio, matplotlib, nibabel, parasail, pywavelets, scikit-image, scikit-learn, scipy, tifffile -packaging==20.4 # via nibabel, pytest +numpy==1.17.5 # via -r tools/accuracy_checker/requirements-core.in, -r tools/accuracy_checker/requirements.in, imageio, matplotlib, nibabel, parasail, pywavelets, scikit-image, scikit-learn, scipy, tifffile +packaging==20.8 # via nibabel, pytest parasail==1.2 # via -r tools/accuracy_checker/requirements.in -pillow==8.0.0 # via -r tools/accuracy_checker/requirements-core.in, imageio, matplotlib, scikit-image +pillow==8.1.0 # via -r tools/accuracy_checker/requirements-core.in, imageio, matplotlib, scikit-image pluggy==0.13.1 # via pytest py-cpuinfo==7.0.0 # via -r tools/accuracy_checker/requirements.in -py==1.9.0 # via pytest -pydicom==2.0.0 # via -r tools/accuracy_checker/requirements.in +py==1.10.0 # via pytest +pydicom==2.1.2 # via -r tools/accuracy_checker/requirements.in pyparsing==2.4.7 # via matplotlib, packaging -pypi-kenlm==0.1.20190403 # via -r tools/accuracy_checker/requirements.in pytest-mock==2.0.0 # via -r tools/accuracy_checker/requirements-test.in pytest==5.4.3 # via -r tools/accuracy_checker/requirements-test.in, pytest-mock python-dateutil==2.8.1 # via matplotlib pywavelets==1.1.1 # via scikit-image pyyaml==5.3.1 # via -r tools/accuracy_checker/requirements-core.in -regex==2020.10.15 # via nltk +regex==2020.11.13 # via nltk scikit-image==0.17.2 # via -r tools/accuracy_checker/requirements.in scikit-learn==0.23.2 # via -r tools/accuracy_checker/requirements.in -scipy==1.5.2 # via -r tools/accuracy_checker/requirements.in, scikit-image, scikit-learn -sentencepiece==0.1.91 # via -r tools/accuracy_checker/requirements.in +scipy==1.5.4 # via -r tools/accuracy_checker/requirements.in, scikit-image, scikit-learn +sentencepiece==0.1.94 # via -r tools/accuracy_checker/requirements.in shapely==1.7.1 # via -r tools/accuracy_checker/requirements.in -six==1.15.0 # via packaging, python-dateutil +six==1.15.0 # via python-dateutil threadpoolctl==2.1.0 # via scikit-learn tifffile==2020.9.3 # via scikit-image -tokenizers==0.9.1 # via -r tools/accuracy_checker/requirements.in -tqdm==4.50.2 # via -r tools/accuracy_checker/requirements.in, nltk +tokenizers==0.9.4 # via -r tools/accuracy_checker/requirements.in +tqdm==4.54.1 # via -r tools/accuracy_checker/requirements.in, nltk +typing-extensions==3.7.4.3 # via importlib-metadata wcwidth==0.2.5 # via pytest -wheel==0.35.1 # via parasail -zipp==3.3.0 # via importlib-metadata +wheel==0.36.2 # via parasail +zipp==3.4.0 # via importlib-metadata diff --git a/ci/requirements-ac.txt b/ci/requirements-ac.txt index d5c53b2625c..6b11560df23 100644 --- a/ci/requirements-ac.txt +++ b/ci/requirements-ac.txt @@ -1,6 +1,5 @@ # use update-requirements.py to update this file -certifi==2020.6.20 # via matplotlib click==7.1.2 # via nltk cycler==0.10.0 # via matplotlib decorator==4.4.2 # via networkx @@ -8,31 +7,30 @@ editdistance==0.5.3 # via -r tools/accuracy_checker/requirements.in fast-ctc-decode==0.2.5 # via -r tools/accuracy_checker/requirements.in imageio==2.9.0 # via scikit-image joblib==0.17.0 # via nltk, scikit-learn -kiwisolver==1.2.0 # via matplotlib -matplotlib==3.3.2 # via scikit-image +kiwisolver==1.3.1 # via matplotlib +matplotlib==3.3.3 # via scikit-image networkx==2.5 # via scikit-image -nibabel==3.1.1 # via -r tools/accuracy_checker/requirements.in +nibabel==3.2.1 # via -r tools/accuracy_checker/requirements.in nltk==3.5 # via -r tools/accuracy_checker/requirements.in -numpy==1.17.5 # via -r tools/accuracy_checker/requirements-core.in, imageio, matplotlib, nibabel, parasail, pywavelets, scikit-image, scikit-learn, scipy, tifffile -packaging==20.4 # via nibabel +numpy==1.17.5 # via -r tools/accuracy_checker/requirements-core.in, -r tools/accuracy_checker/requirements.in, imageio, matplotlib, nibabel, parasail, pywavelets, scikit-image, scikit-learn, scipy, tifffile +packaging==20.8 # via nibabel parasail==1.2 # via -r tools/accuracy_checker/requirements.in -pillow==8.0.0 # via -r tools/accuracy_checker/requirements-core.in, imageio, matplotlib, scikit-image +pillow==8.1.0 # via -r tools/accuracy_checker/requirements-core.in, imageio, matplotlib, scikit-image py-cpuinfo==7.0.0 # via -r tools/accuracy_checker/requirements.in -pydicom==2.0.0 # via -r tools/accuracy_checker/requirements.in +pydicom==2.1.2 # via -r tools/accuracy_checker/requirements.in pyparsing==2.4.7 # via matplotlib, packaging -pypi-kenlm==0.1.20190403 # via -r tools/accuracy_checker/requirements.in python-dateutil==2.8.1 # via matplotlib pywavelets==1.1.1 # via scikit-image pyyaml==5.3.1 # via -r tools/accuracy_checker/requirements-core.in -regex==2020.10.15 # via nltk +regex==2020.11.13 # via nltk scikit-image==0.17.2 # via -r tools/accuracy_checker/requirements.in scikit-learn==0.23.2 # via -r tools/accuracy_checker/requirements.in -scipy==1.5.2 # via -r tools/accuracy_checker/requirements.in, scikit-image, scikit-learn -sentencepiece==0.1.91 # via -r tools/accuracy_checker/requirements.in +scipy==1.5.4 # via -r tools/accuracy_checker/requirements.in, scikit-image, scikit-learn +sentencepiece==0.1.94 # via -r tools/accuracy_checker/requirements.in shapely==1.7.1 # via -r tools/accuracy_checker/requirements.in -six==1.15.0 # via packaging, python-dateutil +six==1.15.0 # via python-dateutil threadpoolctl==2.1.0 # via scikit-learn tifffile==2020.9.3 # via scikit-image -tokenizers==0.9.1 # via -r tools/accuracy_checker/requirements.in -tqdm==4.50.2 # via -r tools/accuracy_checker/requirements.in, nltk -wheel==0.35.1 # via parasail +tokenizers==0.9.4 # via -r tools/accuracy_checker/requirements.in +tqdm==4.54.1 # via -r tools/accuracy_checker/requirements.in, nltk +wheel==0.36.2 # via parasail diff --git a/ci/requirements-check-basics.in b/ci/requirements-check-basics.in index b2c729ca4de..049cd01e8e9 100644 --- a/ci/requirements-check-basics.in +++ b/ci/requirements-check-basics.in @@ -1 +1,2 @@ +flake8 yamllint diff --git a/ci/requirements-check-basics.txt b/ci/requirements-check-basics.txt index 95a6d7e6c37..a23acc47de9 100644 --- a/ci/requirements-check-basics.txt +++ b/ci/requirements-check-basics.txt @@ -1,8 +1,15 @@ # use update-requirements.py to update this file -pathspec==0.8.0 # via yamllint +flake8==3.8.4 # via -r ci/requirements-check-basics.in +importlib-metadata==3.3.0 # via flake8 +mccabe==0.6.1 # via flake8 +pathspec==0.8.1 # via yamllint +pycodestyle==2.6.0 # via flake8 +pyflakes==2.2.0 # via flake8 pyyaml==5.3.1 # via yamllint +typing-extensions==3.7.4.3 # via importlib-metadata yamllint==1.25.0 # via -r ci/requirements-check-basics.in +zipp==3.4.0 # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # setuptools diff --git a/ci/requirements-conversion.txt b/ci/requirements-conversion.txt index 50c2d1a2735..f6e7c181f9d 100644 --- a/ci/requirements-conversion.txt +++ b/ci/requirements-conversion.txt @@ -1,53 +1,55 @@ # use update-requirements.py to update this file -absl-py==0.10.0 # via tensorboard, tensorflow +absl-py==0.11.0 # via tensorboard, tensorflow astunparse==1.6.3 # via tensorflow -cachetools==4.1.1 # via google-auth -certifi==2020.6.20 # via requests +cachetools==4.2.0 # via google-auth +certifi==2020.12.5 # via requests chardet==3.0.4 # via requests decorator==4.4.2 # via networkx defusedxml==0.6.0 # via -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_caffe.txt, -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_mxnet.txt, -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_onnx.txt, -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_tf2.txt future==0.18.2 # via -r tools/downloader/requirements-caffe2.in, torch gast==0.3.3 # via tensorflow -google-auth-oauthlib==0.4.1 # via tensorboard -google-auth==1.22.1 # via google-auth-oauthlib, tensorboard +google-auth-oauthlib==0.4.2 # via tensorboard +google-auth==1.24.0 # via google-auth-oauthlib, tensorboard google-pasta==0.2.0 # via tensorflow graphviz==0.8.4 # via mxnet -grpcio==1.32.0 # via tensorboard, tensorflow -h5py==2.10.0 # via tensorflow +grpcio==1.34.0 # via tensorboard, tensorflow +h5py==2.10.0 # via -r tools/downloader/requirements-tensorflow.in, tensorflow idna==2.10 # via requests -importlib-metadata==2.0.0 # via markdown +importlib-metadata==3.3.0 # via markdown keras-preprocessing==1.1.2 # via tensorflow -markdown==3.3.1 # via tensorboard +markdown==3.3.3 # via tensorboard mxnet==1.5.1 # via -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_mxnet.txt networkx==2.5 # via -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_caffe.txt, -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_mxnet.txt, -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_onnx.txt, -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_tf2.txt numpy==1.18.5 # via -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_caffe.txt, -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_mxnet.txt, -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_onnx.txt, -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_tf2.txt, h5py, keras-preprocessing, mxnet, onnx, opt-einsum, scipy, tensorboard, tensorflow, torch, torchvision oauthlib==3.1.0 # via requests-oauthlib -onnx==1.7.0 # via -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_onnx.txt, -r tools/downloader/requirements-caffe2.in, -r tools/downloader/requirements-pytorch.in +onnx==1.8.0 # via -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_onnx.txt, -r tools/downloader/requirements-caffe2.in, -r tools/downloader/requirements-pytorch.in opt-einsum==3.3.0 # via tensorflow -pillow==8.0.0 # via torchvision -protobuf==3.13.0 # via -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_caffe.txt, onnx, tensorboard, tensorflow +pillow==8.1.0 # via torchvision +protobuf==3.14.0 # via -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_caffe.txt, onnx, tensorboard, tensorflow pyasn1-modules==0.2.8 # via google-auth pyasn1==0.4.8 # via pyasn1-modules, rsa +pyyaml==5.3.1 # via yacs requests-oauthlib==1.3.0 # via google-auth-oauthlib -requests==2.24.0 # via mxnet, requests-oauthlib, tensorboard +requests==2.25.0 # via mxnet, requests-oauthlib, tensorboard rsa==4.6 # via google-auth -scipy==1.5.2 # via -r tools/downloader/requirements-pytorch.in +scipy==1.5.4 # via -r tools/downloader/requirements-pytorch.in six==1.15.0 # via absl-py, astunparse, google-auth, google-pasta, grpcio, h5py, keras-preprocessing, onnx, protobuf, tensorboard, tensorflow, test-generator tensorboard-plugin-wit==1.7.0 # via tensorboard -tensorboard==2.3.0 # via tensorflow +tensorboard==2.4.0 # via tensorflow tensorflow-estimator==2.3.0 # via tensorflow -tensorflow==2.3.1 # via -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_tf2.txt +tensorflow==2.3.1 # via -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_tf2.txt, -r tools/downloader/requirements-tensorflow.in termcolor==1.1.0 # via tensorflow test-generator==0.1.1 # via -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_caffe.txt, -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_mxnet.txt, -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_onnx.txt, -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_tf2.txt torch==1.6.0 # via -r tools/downloader/requirements-caffe2.in, -r tools/downloader/requirements-pytorch.in, torchvision torchvision==0.7.0 # via -r tools/downloader/requirements-pytorch.in -typing-extensions==3.7.4.3 # via onnx -urllib3==1.25.10 # via requests +typing-extensions==3.7.4.3 # via importlib-metadata, onnx +urllib3==1.26.2 # via requests werkzeug==1.0.1 # via tensorboard -wheel==0.35.1 # via astunparse, tensorboard, tensorflow +wheel==0.36.2 # via astunparse, tensorboard, tensorflow wrapt==1.12.1 # via tensorflow -zipp==3.3.0 # via importlib-metadata +yacs==0.1.8 # via -r tools/downloader/requirements-pytorch.in +zipp==3.4.0 # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # setuptools diff --git a/ci/requirements-demos.txt b/ci/requirements-demos.txt index cd5e0e54e54..656a9e79bbd 100644 --- a/ci/requirements-demos.txt +++ b/ci/requirements-demos.txt @@ -1,61 +1,63 @@ # use update-requirements.py to update this file -absl-py==0.10.0 # via tensorboard -attrs==20.2.0 # via pytest -cachetools==4.1.1 # via google-auth -certifi==2020.6.20 # via matplotlib, requests +absl-py==0.11.0 # via tensorboard +attrs==20.3.0 # via pytest +cachetools==4.2.0 # via google-auth +certifi==2020.12.5 # via requests chardet==3.0.4 # via requests cycler==0.10.0 # via matplotlib flake8-import-order==0.18.1 # via motmetrics flake8==3.8.4 # via motmetrics -google-auth-oauthlib==0.4.1 # via tensorboard -google-auth==1.22.1 # via google-auth-oauthlib, tensorboard -grpcio==1.32.0 # via tensorboard +google-auth-oauthlib==0.4.2 # via tensorboard +google-auth==1.24.0 # via google-auth-oauthlib, tensorboard +grpcio==1.34.0 # via tensorboard idna==2.10 # via requests -importlib-metadata==2.0.0 # via flake8, markdown, pluggy, pytest +importlib-metadata==3.3.0 # via flake8, markdown, pluggy, pytest iniconfig==1.1.1 # via pytest joblib==0.17.0 # via scikit-learn -kiwisolver==1.2.0 # via matplotlib -markdown==3.3.1 # via tensorboard -matplotlib==3.3.2 # via -r demos/python_demos/requirements.txt +kiwisolver==1.3.1 # via matplotlib +markdown==3.3.3 # via tensorboard +matplotlib==3.3.3 # via -r demos/python_demos/requirements.txt mccabe==0.6.1 # via flake8 motmetrics==1.2.0 # via -r demos/python_demos/requirements.txt -nibabel==3.1.1 # via -r demos/python_demos/requirements.txt -numpy==1.19.2 ; python_version >= "3.4" # via -r ${INTEL_OPENVINO_DIR}/python/requirements.txt, -r demos/python_demos/requirements.txt, matplotlib, motmetrics, nibabel, pandas, scikit-learn, scipy, tensorboard, tensorboardx +nibabel==3.2.1 # via -r demos/python_demos/requirements.txt +numpy==1.19.3 ; python_version >= "3.4" # via -r ${INTEL_OPENVINO_DIR}/python/requirements.txt, -r demos/python_demos/requirements.txt, matplotlib, motmetrics, nibabel, pandas, scikit-learn, scipy, tensorboard, tensorboardx oauthlib==3.1.0 # via requests-oauthlib -packaging==20.4 # via nibabel, pytest -pandas==1.1.3 # via motmetrics -pillow==8.0.0 # via matplotlib +packaging==20.8 # via nibabel, pytest +pandas==1.1.5 # via motmetrics +pillow==8.1.0 # via matplotlib pluggy==0.13.1 # via pytest -protobuf==3.13.0 # via tensorboard, tensorboardx +protobuf==3.14.0 # via tensorboard, tensorboardx py-cpuinfo==7.0.0 # via pytest-benchmark -py==1.9.0 # via pytest +py==1.10.0 # via pytest pyasn1-modules==0.2.8 # via google-auth pyasn1==0.4.8 # via pyasn1-modules, rsa pycodestyle==2.6.0 # via flake8, flake8-import-order pyflakes==2.2.0 # via flake8 pyparsing==2.4.7 # via matplotlib, packaging pytest-benchmark==3.2.3 # via motmetrics -pytest==6.1.1 # via motmetrics, pytest-benchmark +pytest==6.2.0 # via motmetrics, pytest-benchmark python-dateutil==2.8.1 # via matplotlib, pandas -pytz==2020.1 # via pandas +pytz==2020.4 # via pandas requests-oauthlib==1.3.0 # via google-auth-oauthlib -requests==2.24.0 # via requests-oauthlib, tensorboard +requests==2.25.0 # via requests-oauthlib, tensorboard rsa==4.6 # via google-auth scikit-learn==0.23.2 # via -r demos/python_demos/requirements.txt -scipy==1.5.2 # via -r demos/python_demos/requirements.txt, motmetrics, scikit-learn -six==1.15.0 # via absl-py, google-auth, grpcio, packaging, protobuf, python-dateutil, tensorboard, tensorboardx +scipy==1.5.4 # via -r demos/python_demos/requirements.txt, motmetrics, scikit-learn +six==1.15.0 # via absl-py, google-auth, grpcio, protobuf, python-dateutil, tensorboard, tensorboardx tensorboard-plugin-wit==1.7.0 # via tensorboard -tensorboard==2.3.0 # via -r demos/python_demos/requirements.txt +tensorboard==2.4.0 # via -r demos/python_demos/requirements.txt tensorboardx==2.1 # via -r demos/python_demos/requirements.txt threadpoolctl==2.1.0 # via scikit-learn -toml==0.10.1 # via pytest -tqdm==4.50.2 # via -r demos/python_demos/requirements.txt -urllib3==1.25.10 # via requests +tokenizers==0.9.4 # via -r demos/python_demos/requirements.txt +toml==0.10.2 # via pytest +tqdm==4.54.1 # via -r demos/python_demos/requirements.txt +typing-extensions==3.7.4.3 # via importlib-metadata +urllib3==1.26.2 # via requests werkzeug==1.0.1 # via tensorboard -wheel==0.35.1 # via tensorboard +wheel==0.36.2 # via tensorboard xmltodict==0.12.0 # via motmetrics -zipp==3.3.0 # via importlib-metadata +zipp==3.4.0 # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # setuptools diff --git a/ci/requirements-downloader.txt b/ci/requirements-downloader.txt index f8c2503d31a..71466c454a9 100644 --- a/ci/requirements-downloader.txt +++ b/ci/requirements-downloader.txt @@ -1,8 +1,8 @@ # use update-requirements.py to update this file -certifi==2020.6.20 # via requests +certifi==2020.12.5 # via requests chardet==3.0.4 # via requests idna==2.10 # via requests pyyaml==5.3.1 # via -r tools/downloader/requirements.in -requests==2.24.0 # via -r tools/downloader/requirements.in -urllib3==1.25.10 # via requests +requests==2.25.0 # via -r tools/downloader/requirements.in +urllib3==1.26.2 # via requests diff --git a/ci/requirements-quantization.txt b/ci/requirements-quantization.txt new file mode 100644 index 00000000000..5c6c2e3efde --- /dev/null +++ b/ci/requirements-quantization.txt @@ -0,0 +1,54 @@ +# use update-requirements.py to update this file + +addict==2.2.1 # via pot (${INTEL_OPENVINO_DIR}/deployment_tools/tools/post_training_optimization_toolkit/setup.py) +chainer==7.7.0 # via pot (${INTEL_OPENVINO_DIR}/deployment_tools/tools/post_training_optimization_toolkit/setup.py) +click==7.1.2 # via nltk +cycler==0.10.0 # via matplotlib +decorator==4.4.2 # via networkx +defusedxml==0.6.0 # via -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_kaldi.txt +editdistance==0.5.3 # via -r tools/accuracy_checker/requirements.in +fast-ctc-decode==0.2.5 # via -r tools/accuracy_checker/requirements.in +filelock==3.0.12 # via chainer +future==0.18.2 # via hyperopt +hyperopt==0.1.2 # via pot (${INTEL_OPENVINO_DIR}/deployment_tools/tools/post_training_optimization_toolkit/setup.py) +ideep4py==2.0.0.post3 # via pot (${INTEL_OPENVINO_DIR}/deployment_tools/tools/post_training_optimization_toolkit/setup.py) +imageio==2.9.0 # via scikit-image +joblib==1.0.0 # via nltk, scikit-learn +jstyleson==0.0.2 # via pot (${INTEL_OPENVINO_DIR}/deployment_tools/tools/post_training_optimization_toolkit/setup.py) +kiwisolver==1.3.1 # via matplotlib +matplotlib==3.3.3 # via scikit-image +networkx==2.5 # via -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_kaldi.txt, hyperopt, scikit-image +nibabel==3.2.1 # via -r tools/accuracy_checker/requirements.in +nltk==3.5 # via -r tools/accuracy_checker/requirements.in +numpy==1.16.3 # via -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_kaldi.txt, -r tools/accuracy_checker/requirements-core.in, chainer, hyperopt, imageio, matplotlib, nibabel, pandas, parasail, pot (${INTEL_OPENVINO_DIR}/deployment_tools/tools/post_training_optimization_toolkit/setup.py), pywavelets, rawpy, scikit-image, scikit-learn, scipy, tifffile +packaging==20.8 # via nibabel +pandas==0.24.2 # via pot (${INTEL_OPENVINO_DIR}/deployment_tools/tools/post_training_optimization_toolkit/setup.py) +parasail==1.2 # via -r tools/accuracy_checker/requirements.in +pillow==8.1.0 # via -r tools/accuracy_checker/requirements-core.in, imageio, matplotlib, scikit-image +protobuf==3.14.0 # via chainer +py-cpuinfo==7.0.0 # via -r tools/accuracy_checker/requirements.in +pydicom==2.1.2 # via -r tools/accuracy_checker/requirements.in +pymongo==3.11.2 # via hyperopt +pyparsing==2.4.7 # via matplotlib, packaging +python-dateutil==2.8.1 # via matplotlib, pandas +pytz==2020.5 # via pandas +pywavelets==1.1.1 # via scikit-image +pyyaml==5.3.1 # via -r tools/accuracy_checker/requirements-core.in +rawpy==0.16.0 # via -r tools/accuracy_checker/requirements.in +regex==2020.11.13 # via nltk +scikit-image==0.17.2 # via -r tools/accuracy_checker/requirements.in +scikit-learn==0.24.0 # via -r tools/accuracy_checker/requirements.in +scipy==1.2.1 # via -r tools/accuracy_checker/requirements.in, hyperopt, pot (${INTEL_OPENVINO_DIR}/deployment_tools/tools/post_training_optimization_toolkit/setup.py), scikit-image, scikit-learn +sentencepiece==0.1.95 # via -r tools/accuracy_checker/requirements.in +shapely==1.7.1 # via -r tools/accuracy_checker/requirements.in +six==1.15.0 # via chainer, hyperopt, protobuf, python-dateutil, test-generator +test-generator==0.1.1 # via -r ${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/requirements_kaldi.txt +threadpoolctl==2.1.0 # via scikit-learn +tifffile==2020.9.3 # via scikit-image +tokenizers==0.10.0 # via -r tools/accuracy_checker/requirements.in +tqdm==4.56.0 # via -r tools/accuracy_checker/requirements.in, hyperopt, nltk +typing-extensions==3.7.4.3 # via chainer +wheel==0.36.2 # via parasail + +# The following packages are considered to be unsafe in a requirements file: +# setuptools diff --git a/ci/update-requirements.py b/ci/update-requirements.py index 0a790a376f9..15dbb8c6efe 100755 --- a/ci/update-requirements.py +++ b/ci/update-requirements.py @@ -69,13 +69,17 @@ def pc(target, *sources): 'tools/accuracy_checker/requirements-core.in') pc('ci/requirements-check-basics.txt', 'ci/requirements-check-basics.in') pc('ci/requirements-conversion.txt', - 'tools/downloader/requirements-pytorch.in', 'tools/downloader/requirements-caffe2.in', + *(f'tools/downloader/requirements-{suffix}.in' for suffix in ['caffe2', 'pytorch', 'tensorflow']), *(openvino_dir / f'deployment_tools/model_optimizer/requirements_{suffix}.txt' for suffix in ['caffe', 'mxnet', 'onnx', 'tf2'])) pc('ci/requirements-demos.txt', 'demos/python_demos/requirements.txt', openvino_dir / 'python/requirements.txt') pc('ci/requirements-downloader.txt', 'tools/downloader/requirements.in') + pc('ci/requirements-quantization.txt', + 'tools/accuracy_checker/requirements-core.in', 'tools/accuracy_checker/requirements.in', + openvino_dir / 'deployment_tools/tools/post_training_optimization_toolkit/setup.py', + openvino_dir / 'deployment_tools/model_optimizer/requirements_kaldi.txt') if __name__ == '__main__': main() diff --git a/data/dataset_classes/cityscapes19.txt b/data/dataset_classes/cityscapes19.txt new file mode 100644 index 00000000000..4075ba2557e --- /dev/null +++ b/data/dataset_classes/cityscapes19.txt @@ -0,0 +1,20 @@ +road +sidewalk +building +wall +fence +pole +traffic light +traffic sign +vegetation +terrain +sky +person +rider +car +truck +bus +train +motorcycle +bicycle +background diff --git a/demos/python_demos/instance_segmentation_demo/coco_labels.txt b/data/dataset_classes/coco.txt similarity index 100% rename from demos/python_demos/instance_segmentation_demo/coco_labels.txt rename to data/dataset_classes/coco.txt diff --git a/demos/classification_demo/imagenet_2012_classes.txt b/data/dataset_classes/imagenet_2012.txt similarity index 100% rename from demos/classification_demo/imagenet_2012_classes.txt rename to data/dataset_classes/imagenet_2012.txt diff --git a/demos/classification_demo/imagenet_2015_classes.txt b/data/dataset_classes/imagenet_2015.txt similarity index 100% rename from demos/classification_demo/imagenet_2015_classes.txt rename to data/dataset_classes/imagenet_2015.txt diff --git a/data/dataset_classes/jester27.json b/data/dataset_classes/jester27.json new file mode 100644 index 00000000000..025781a5848 --- /dev/null +++ b/data/dataset_classes/jester27.json @@ -0,0 +1,28 @@ +["Swiping Left", +"Swiping Right", +"Swiping Down", +"Swiping Up", +"Pushing Hand Away", +"Pulling Hand In", +"Sliding Two Fingers Left", +"Sliding Two Fingers Right", +"Sliding Two Fingers Down", +"Sliding Two Fingers Up", +"Pushing Two Fingers Away", +"Pulling Two Fingers In", +"Rolling Hand Forward", +"Rolling Hand Backward", +"Turning Hand Clockwise", +"Turning Hand Counterclockwise", +"Zooming In With Full Hand", +"Zooming Out With Full Hand", +"Zooming In With Two Fingers", +"Zooming Out With Two Fingers", +"Thumb Up", +"Thumb Down", +"Shaking Hand", +"Stop Sign", +"Drumming Fingers", +"No gesture", +"Doing other things" +] diff --git a/demos/python_demos/handwritten_text_recognition_demo/data/kondate_nakayosi_char_list.txt b/data/dataset_classes/kondate_nakayosi.txt similarity index 100% rename from demos/python_demos/handwritten_text_recognition_demo/data/kondate_nakayosi_char_list.txt rename to data/dataset_classes/kondate_nakayosi.txt diff --git a/demos/python_demos/asl_recognition_demo/classes.json b/data/dataset_classes/msasl100.json similarity index 100% rename from demos/python_demos/asl_recognition_demo/classes.json rename to data/dataset_classes/msasl100.json diff --git a/demos/python_demos/handwritten_text_recognition_demo/data/scut_ept_char_list.txt b/data/dataset_classes/scut_ept.txt similarity index 100% rename from demos/python_demos/handwritten_text_recognition_demo/data/scut_ept_char_list.txt rename to data/dataset_classes/scut_ept.txt diff --git a/demos/python_demos/voc_labels.txt b/data/dataset_classes/voc.txt similarity index 100% rename from demos/python_demos/voc_labels.txt rename to data/dataset_classes/voc.txt diff --git a/data/dataset_definitions.yml b/data/dataset_definitions.yml new file mode 100644 index 00000000000..faacd2d6f86 --- /dev/null +++ b/data/dataset_definitions.yml @@ -0,0 +1,1144 @@ +datasets: + - name: ms_coco_mask_rcnn + annotation_conversion: + converter: mscoco_mask_rcnn + annotation_file: instances_val2017.json + has_background: True + sort_annotations: True + annotation: mscoco_mask_rcnn.pickle + dataset_meta: mscoco_mask_rcnn.json + data_source: val2017 + + - name: ms_coco_mask_rcnn_short_80_classes + annotation_conversion: + converter: mscoco_mask_rcnn + annotation_file: instances_val2017_short.json + has_background: True + sort_annotations: True + annotation: mscoco_mask_rcnn_short_80.pickle + dataset_meta: mscoco_mask_rcnn_short_80.json + data_source: val2017 + + - name: ms_coco_mask_rcnn_short_80_classes_without_background + annotation_conversion: + converter: mscoco_mask_rcnn + annotation_file: instances_val2017.json + has_background: False + sort_annotations: True + annotation: mscoco_mask_rcnn_short_80_without_bkgr.pickle + dataset_meta: mscoco_mask_rcnn_short_80_without_bkgr.json + data_source: val2017 + + - name: ms_coco_mask_rcnn_short_91_classes + annotation_conversion: + converter: mscoco_mask_rcnn + annotation_file: instances_val2017_short.json + has_background: True + sort_annotations: True + use_full_label_map: True + annotation: mscoco_mask_rcnn_short_91.pickle + dataset_meta: mscoco_mask_rcnn_short_91.json + data_source: val2017 + preprocessing: + - type: resize + aspect_ratio_scale: fit_to_window + dst_height: 800 + dst_width: 1365 + - type: padding + dst_height: 800 + dst_width: 1365 + pad_type: right_bottom + + postprocessing: + - type: faster_rcnn_postprocessing_resize + dst_height: 800 + dst_width: 1365 + + - name: ms_coco_detection_91_classes + annotation_conversion: + converter: mscoco_detection + annotation_file: instances_val2017.json + has_background: True + sort_annotations: True + use_full_label_map: True + annotation: mscoco_det_91.pickle + dataset_meta: mscoco_det_91.json + data_source: val2017 + preprocessing: + - type: resize + aspect_ratio_scale: fit_to_window + dst_height: 600 + dst_width: 1024 + - type: padding + dst_height: 600 + dst_width: 1024 + pad_type: right_bottom + + postprocessing: + - type: faster_rcnn_postprocessing_resize + dst_height: 600 + dst_width: 1024 + + - name: ms_coco_detection_80_class_without_background + data_source: val2017 + annotation_conversion: + converter: mscoco_detection + annotation_file: instances_val2017.json + has_background: False + sort_annotations: True + use_full_label_map: False + annotation: mscoco_det_80.pickle + dataset_meta: mscoco_det_80.json + + - name: ms_coco_detection_80_class_with_background + data_source: val2017 + annotation_conversion: + converter: mscoco_detection + annotation_file: instances_val2017.json + has_background: True + sort_annotations: True + use_full_label_map: False + annotation: mscoco_det_80_bkgr.pickle + dataset_meta: mscoco_det_80_bkgr.json + + - name: ms_coco_detection_90_class_without_background + data_source: MSCOCO/val2017 + annotation_conversion: + converter: mscoco_detection + annotation_file: MSCOCO/annotations/instances_val2017.json + has_background: False + sort_annotations: True + use_full_label_map: True + annotation: mscoco_det_90.pickle + dataset_meta: mscoco_det_90.json + + - name: ms_coco_keypoints + data_source: val2017 + annotation_conversion: + converter: mscoco_keypoints + annotation_file: person_keypoints_val2017.json + sort_key: image_size + annotation: mscoco_keypoints.pickle + dataset_meta: mscoco_keypoints.json + metrics: + - name: AP + type: coco_precision + max_detections: 20 + + - name: ms_coco_val2017_keypoints + data_source: val2017 + annotation_conversion: + converter: mscoco_keypoints + annotation_file: person_keypoints_val2017.json + sort_key: image_size + images_dir: val2017 + annotation: mscoco_val2017_keypoints.pickle + dataset_meta: mscoco_val2017_keypoints.json + metrics: + - name: AP + type: coco_orig_keypoints_precision + + - name: imagenet_1000_classes + annotation_conversion: + converter: imagenet + annotation_file: val.txt + annotation: imagenet1000.pickle + data_source: ILSVRC2012_img_val + metrics: + - name: accuracy@top1 + type: accuracy + top_k: 1 + - name: accuracy@top5 + type: accuracy + top_k: 5 + + - name: imagenet_1000_classes_2015 + annotation_conversion: + converter: imagenet + annotation_file: val15.txt + annotation: imagenet1000_2015.pickle + data_source: ILSVRC2012_img_val + metrics: + - name: accuracy@top1 + type: accuracy + top_k: 1 + - name: accuracy@top5 + type: accuracy + top_k: 5 + + - name: imagenet_1001_classes + annotation_conversion: + converter: imagenet + annotation_file: val.txt + has_background: True + annotation: imagenet1001.pickle + data_source: ILSVRC2012_img_val + metrics: + - name: accuracy@top1 + type: accuracy + top_k: 1 + - name: accuracy@top5 + type: accuracy + top_k: 5 + + - name: VOC2012 + annotation_conversion: + converter: voc_detection + annotations_dir: VOCdevkit/VOC2012/Annotations + images_dir: VOCdevkit/VOC2012/JPEGImages + imageset_file: VOCdevkit/VOC2012/ImageSets/Main/val.txt + data_source: VOCdevkit/VOC2012/JPEGImages + annotation: voc12.pickle + dataset_meta: voc12.json + postprocessing: + - type: resize_prediction_boxes + metrics: + - type: map + integral: 11point + ignore_difficult: True + presenter: print_scalar + + - name: VOC2012_without_background + annotation_conversion: + converter: voc_detection + annotations_dir: VOCdevkit/VOC2012/Annotations + images_dir: VOCdevkit/VOC2012/JPEGImages + imageset_file: VOCdevkit/VOC2012/ImageSets/Main/val.txt + has_background: False + data_source: VOCdevkit/VOC2012/JPEGImages + annotation: voc12_without_background.pickle + dataset_meta: voc12_without_background.json + postprocessing: + - type: resize_prediction_boxes + metrics: + - type: map + integral: 11point + ignore_difficult: True + presenter: print_scalar + + - name: VOC2012_Segmentation + annotation_conversion: + converter: voc_segmentation + imageset_file: VOCdevkit/VOC2012/ImageSets/Segmentation/val.txt + images_dir: VOCdevkit/VOC2012/JPEGImages/ + mask_dir: VOCdevkit/VOC2012/SegmentationClass/ + data_source: VOCdevkit/VOC2012/JPEGImages/ + segmentation_masks_source: VOCdevkit/VOC2012/SegmentationClass/ + annotation: voc2012_segmentation.pickle + dataset_meta: voc2012_segmentation.json + + - name: mapillary_20 + annotation_conversion: + converter: mapillary_20 + data_dir: Mapillary_20 + annotation: mapillary_20.pickle + dataset_meta: mapillary_20.json + + - name: mapillary_vistas + data_source: mapillary_vistas/validation/images + segmentation_masks_source: mapillary_vistas/validation/labels + annotation_conversion: + converter: mapillary_vistas + data_dir: mapillary_vistas/validation + annotation: mapillary_vistas.pickle + dataset_meta: mapillary_vistas.json + + - name: wider + data_source: WIDER_val/images + annotation_conversion: + converter: wider + annotation_file: wider_face_split/wider_face_val_bbx_gt.txt + annotation: wider.pickle + dataset_meta: wider.json + + - name: wider_without_bkgr + data_source: WIDER_val/images + annotation_conversion: + converter: wider + annotation_file: wider_face_split/wider_face_val_bbx_gt.txt + label_start: 0 + annotation: wider_0.pickle + dataset_meta: wider_0.json + + - name: facial_landmarks_35 + data_source: VOCdevkit/VOC2012/JPEGImages + annotation_conversion: + converter: cvat_facial_landmarks + annotation_file: 3632_OMZ_task3_facial_landmarks_35_adas.xml + annotation: facial_landmarks_35.pickle + preprocessing: + - type: resize + size: 60 + postprocessing: + - type: normalize_landmarks_points + + - name: emotions_recognition + data_source: VOCdevkit/VOC2012/JPEGImages + annotation_conversion: + converter: cvat_attributes_recognition + annotation_file: 3631_OMZ_task2_emotions_recognition.xml + label: face + annotation: emotions_recognition.pickle + dataset_meta: emotions_recognition.json + preprocessing: + - type: extend_around_rect + augmentation_param: 0.3 + - type: crop_rect + - type: resize + size: 64 + + - name: age_gender + data_source: ILSVRC2012_img_val + annotation_conversion: + converter: cvat_age_gender + annotation_file: 3630_OMZ_task1_age_gender.xml + annotation: age_gender.pickle + dataset_meta: age_gender.json + + - name: vehicle_attributes + data_source: val2017 + annotation_conversion: + converter: cvat_attributes_recognition + annotation_file: 3634_OMZ_task8_vehicle_attributes_recognition_barrier_0039.xml + label: vehicle + annotation: vehicle_attributes.pickle + dataset_meta: vehicle_attributes.json + + - name: vehicle_attributes_0042 + data_source: val2017 + annotation_conversion: + converter: cvat_attributes_recognition + annotation_file: 3634_OMZ_task8_vehicle_attributes_recognition_barrier_0039.xml + label: vehicle + annotation: vehicle_attributes.pickle + dataset_meta: vehicle_attributes.json + + - name: person_8_attributes + data_source: ILSVRC2012_img_val + annotation_conversion: + converter: cvat_multilabel_binary_attributes_recognition + annotation_file: 3640_OMZ_task6_person_attributes_recognition_crossroad_0230.xml + label: person + annotation: person_8_attributes.pickle + dataset_meta: person_8_attributes.json + + - name: vehicle_license_plate_detection + data_source: ILSVRC2012_img_val + annotation_conversion: + converter: cvat_object_detection + annotation_file: 3638_OMZ_task13_vehicle_license_plate_detection_barrier_0106.xml + has_background: True + annotation: vlpd.pickle + dataset_meta: vlpd.json + + - name: action_detection_dataset_3_classes + data_source: WIDER_val/images/44--Aerobics + annotation_conversion: + converter: cvat_person_detection_action_recognition + use_case: common_3_actions + annotation_file: 3766_OMZ_task14_person-detection-raisinghand-recognition-0001.xml + annotation: action_detection_3classes.pickle + dataset_meta: action_detection_3classes.json + + - name: action_detection_dataset_6_classes + data_source: WIDER_val/images/44--Aerobics + annotation_conversion: + converter: cvat_person_detection_action_recognition + use_case: common_6_actions + annotation_file: 3766_OMZ_task14_person-detection-raisinghand-recognition-0001.xml + annotation: action_detection_6classes.pickle + dataset_meta: action_detection_6classes.json + + - name: action_detection_dataset_teacher + data_source: WIDER_val/images/44--Aerobics + annotation_conversion: + converter: cvat_person_detection_action_recognition + use_case: teacher + annotation_file: 3766_OMZ_task14_person-detection-raisinghand-recognition-0001.xml + annotation: action_detection_teacher.pickle + dataset_meta: action_detection_teacher.json + + - name: action_detection_dataset_raising_hand + data_source: WIDER_val/images/44--Aerobics + annotation_conversion: + converter: cvat_person_detection_action_recognition + use_case: raising_hand + annotation_file: 3766_OMZ_task14_person-detection-raisinghand-recognition-0001.xml + annotation: action_detection_raising_hand.pickle + dataset_meta: action_detection_raising_hand.json + + - name: person_detection + data_source: val2017 + annotation_conversion: + converter: mscoco_detection + annotation_file: person_keypoints_val2017.json + has_background: True + sort_annotations: True + use_full_label_map: True + annotation: mscoco_person_detection.pickle + dataset_meta: mscoco_person_detection.json + + - name: mscoco_person_detection + data_source: val2017 + annotation_conversion: + converter: mscoco_detection + annotation_file: person_keypoints_val2017.json + has_background: True + sort_annotations: True + use_full_label_map: True + annotation: mscoco_person_detection.pickle + dataset_meta: mscoco_person_detection.json + + - name: crossroad_dataset_1016 + data_source: val2017 + annotation_conversion: + converter: cvat_object_detection + annotation_file: 3637_OMZ_task12_person_vehicle_bike_detection_crossroad_0078.xml + labels_file: person-vehicle-bike-detection-crossroad-1016-labels.json + has_background: True + annotation: crossroad-1016.pickle + dataset_meta: crossroad-1016.json + + - name: crossroad_dataset_0078 + data_source: val2017 + annotation_conversion: + converter: cvat_object_detection + annotation_file: 3637_OMZ_task12_person_vehicle_bike_detection_crossroad_0078.xml + labels_file: person-vehicle-bike-detection-crossroad-0078-labels.json + has_background: True + annotation: crossroad-0078.pickle + dataset_meta: crossroad-0078.json + + - name: crossroad_extra_untagged + data_source: crossroad_extra_untagged/val_data + annotation_conversion: + converter: mscoco_detection + annotation_file: crossroad_extra_untagged/val_coco_no_bg.json + has_background: False + sort_annotations: True + use_full_label_map: False + annotation: crossroad_extra_untagged.pickle + dataset_meta: crossroad_extra_untagged.json + + - name: crossroad_extra_untagged_person + data_source: crossroad_extra_untagged/val_data + annotation_conversion: + converter: mscoco_detection + annotation_file: crossroad_extra_untagged/val_coco_no_bg_person.json + has_background: False + sort_annotations: True + use_full_label_map: False + annotation: crossroad_extra_untagged_person.pickle + dataset_meta: crossroad_extra_untagged_person.json + + - name: crossroad_extra_untagged_person_hb + data_source: crossroad_extra_untagged/val_data + annotation_conversion: + converter: mscoco_detection + annotation_file: crossroad_extra_untagged/val_coco_no_bg_person.json + has_background: True + sort_annotations: True + use_full_label_map: False + annotation: crossroad_extra_untagged_person_hb.pickle + dataset_meta: crossroad_extra_untagged_person_hb.json + + - name: crossroad_extra_untagged_vehicle + data_source: crossroad_extra_untagged/val_data + annotation_conversion: + converter: mscoco_detection + annotation_file: crossroad_extra_untagged/val_coco_no_bg_vehicle.json + has_background: False + sort_annotations: True + use_full_label_map: False + annotation: crossroad_extra_untagged_vehicle.pickle + dataset_meta: crossroad_extra_untagged_vehicle.json + + - name: crossroad_extra_untagged_vehicle_labels_from_1 + data_source: crossroad_extra_untagged/val_data + annotation_conversion: + converter: mscoco_detection + annotation_file: crossroad_extra_untagged/val_coco_no_bg_vehicle.json + has_background: True + annotation: crossroad_extra_untagged_vehicle_labels_from_1.pickle + dataset_meta: crossroad_extra_untagged_vehicle_labels_from_1.json + + - name: pedestrian_and_vehicle_dataset + data_source: val2017 + annotation_conversion: + converter: cvat_object_detection + annotation_file: 3636_OMZ_task11_pedestrian_and_vehicle_detector_adas_0001.xml + labels_file: pedestrian-and-vehicle-labels.json + has_background: True + annotation: pedestrian_and_vehicle.pickle + dataset_meta: pedestrian_and_vehicle.json + + - name: pedestrian_detection_dataset + data_source: val2017 + annotation_conversion: + converter: cvat_object_detection + annotation_file: 3636_OMZ_task11_pedestrian_and_vehicle_detector_adas_0001.xml + labels_file: pedestrian-detection-labels.json + has_background: True + annotation: pedestrian_detection.pickle + dataset_meta: pedestrian_detection.json + + - name: vehicle_detection_dataset + data_source: val2017 + annotation_conversion: + converter: cvat_object_detection + annotation_file: 3636_OMZ_task11_pedestrian_and_vehicle_detector_adas_0001.xml + labels_file: vehicle-detection-labels.json + has_background: True + annotation: vehicle_detection.pickle + dataset_meta: vehicle_detection.json + + - name: barrier_vehicle_detection_dataset_index_class_2 + data_source: val2017 + annotation_conversion: + converter: cvat_object_detection + annotation_file: 3636_OMZ_task11_pedestrian_and_vehicle_detector_adas_0001.xml + labels_file: vehicle-detection-labels.json + has_background: True + annotation: vehicle_detection.pickle + dataset_meta: vehicle_detection.json + + - name: synthetic_chinese_license_plates + data_source: Synthetic_Chinese_License_Plates + annotation_conversion: + converter: lpr_txt + annotation_file: Synthetic_Chinese_License_Plates/annotation + decoding_dictionary_file: dict + annotation: lpr.pickle + dataset_meta: lpr.json + + preprocessing: + - type: resize + dst_width: 94 + dst_height: 24 + + - name: image_retrieval + data_source: textile_crops + annotation_conversion: + converter: image_retrieval + data_dir: textile_crops + gallery_annotation_file: textile_crops/gallery/gallery.txt + queries_annotation_file: textile_crops/queries/quieries.txt + annotation: textile.pickle + dataset_meta: textile.json + preprocessing: + - type: resize + size: 224 + + - name: lfw + data_source: LFW/lfw + annotation_conversion: + converter: lfw + pairs_file: LFW/annotation/pairs.txt + landmarks_file: LFW/annotation/lfw_landmark.txt + annotation: lfw.pickle + + metrics: + - type: pairwise_accuracy_subsets + subset_number: 2 + + - name: lfw_mtcnn_align + # converted from LFW public dataset with using + # script https://github.com/davidsandberg/facenet/blob/master/src/align/align_dataset_mtcnn.py + data_source: lfw_mtcnnpy_160 + annotation_conversion: + converter: lfw + pairs_file: LFW/annotation/pairs.txt + extension: png + annotation: lfw_mtcnn_align.pickle + + - name: ICDAR2015 + data_source: ICDAR15_DET/ch4_test_images + annotation_conversion: + converter: icdar_detection + data_dir: ICDAR15_DET/gt + annotation: icdar15_detection.pickle + + - name: ICDAR2015_word_spotting + data_source: ICDAR15_DET/ch4_test_images + annotation_conversion: + converter: icdar_detection + word_spotting: True + data_dir: ICDAR15_DET/gt + annotation: icdar15_detection.pickle + + - name: ICDAR2013_detection + data_source: ICDAR13_DET + annotation_conversion: + converter: icdar_detection + data_dir: ICDAR13_DET/gt + annotation: icdar13_detection.pickle + + - name: ICDAR2013 + data_source: ICDAR13_REC/Challenge2_Test_Task3_Images + annotation_conversion: + converter: icdar13_recognition + annotation_file: ICDAR13_REC/gt/gt.txt.fixed.alfanumeric + annotation: icdar13_recognition.pickle + dataset_meta: icdar13_recognition.json + + - name: ICDAR2013_detection + data_source: ICDAR13_DET + annotation_conversion: + converter: icdar_detection + data_dir: ICDAR13_DET/gt + annotation: icdar13_detection.pickle + + - name: im2latex_medium_rendered + data_source: im2latex_medium_rendered/images_processed + annotation_conversion: + converter: im2latex_formula_recognition + data_dir: im2latex_medium_rendered + images_dir: im2latex_medium_rendered/images_processed + formula_file: im2latex_medium_rendered/formulas.norm.lst + split_file: im2latex_medium_rendered/validate_filter.lst + vocab_file: im2latex_medium_rendered/vocab.json + annotation: im2latex_medium_rendered.pickle + dataset_meta: im2latex_medium_rendered.json + + - name: im2latex_medium_photographed + data_source: im2latex_medium_photographed/images_processed + annotation_conversion: + converter: im2latex_formula_recognition + data_dir: im2latex_medium_photographed + images_dir: im2latex_medium_photographed/images_processed + formula_file: im2latex_medium_photographed/formulas.norm.lst + split_file: im2latex_medium_photographed/test_filter.lst + vocab_file: im2latex_medium_photographed/vocab.pkl + annotation: im2latex_medium_photographed.pickle + dataset_meta: im2latex_medium_photographed.json + + - name: im2latex_polynomials_handwritten + data_source: im2latex_polynomials_handwritten/images_processed + annotation_conversion: + converter: im2latex_formula_recognition + data_dir: im2latex_polynomials_handwritten + images_dir: im2latex_polynomials_handwritten/images_processed + formula_file: im2latex_polynomials_handwritten/formulas.norm.lst + split_file: im2latex_polynomials_handwritten/validate_filter.lst + vocab_file: im2latex_polynomials_handwritten/vocab.json + annotation: im2latex_polynomials_handwritten.pickle + dataset_meta: im2latex_polynomials_handwritten.json + + - name: market1501 + data_source: Market-1501-v15.09.15 + annotation_conversion: + converter: market1501_reid + data_dir: Market-1501-v15.09.15 + annotation: market1501_reid.pickle + + - name: veri776 + data_source: VeRi-776 + annotation_conversion: + converter: veri776_reid + data_dir: VeRi-776 + annotation: veri776_reid.pickle + + - name: reid_dataset + data_source: Market-1501-v15.09.15 + annotation_conversion: + converter: market1501_reid + data_dir: Market-1501-v15.09.15 + annotation: market1501_reid.pickle + + - name: vgg2face + data_source: VGGFaces2/test + annotation_conversion: + converter: vgg_face + landmarks_csv_file: VGGFaces2/bb_landmark/loose_landmark_test.csv + bbox_csv_file: VGGFaces2/bb_landmark/loose_bb_test.csv + annotation: vggfaces2.pickle + dataset_meta: vggfaces2.json + + - name: semantic_segmentation_adas + data_source: segmentation/images + segmentation_masks_source: segmentation/mask_segmentation_adas + annotation_conversion: + converter: common_semantic_segmentation + images_dir: segmentation/images + masks_dir: segmentation/mask_segmentation_adas + image_postfix: .JPEG + mask_postfix: .png + dataset_meta: segmentation/mask_segmentation_adas/dataset_meta.json + annotation: semantic_segmentation_adas.pickle + dataset_meta: semantic_segmentation_adas.json + + preprocessing: + - type: resize + dst_height: 1024 + dst_width: 2048 + + postprocessing: + - type: encode_segmentation_mask + apply_to: annotation + - type: resize_segmentation_mask + apply_to: annotation + dst_height: 1024 + dst_width: 2048 + + - name: road_segmentation + data_source: segmentation/images + segmentation_masks_source: segmentation/mask_road_segmentation + annotation_conversion: + converter: common_semantic_segmentation + images_dir: segmentation/images + masks_dir: segmentation/mask_road_segmentation + image_postfix: .JPEG + mask_postfix: .png + dataset_meta: segmentation/mask_road_segmentation/dataset_meta.json + annotation: road_segmentation.pickle + dataset_meta: road_segmentation.json + + preprocessing: + - type: resize + dst_height: 512 + dst_width: 896 + + postprocessing: + - type: encode_segmentation_mask + apply_to: annotation + - type: resize_segmentation_mask + apply_to: annotation + dst_height: 512 + dst_width: 896 + + metrics: + - type: mean_iou + presenter: print_vector + - type: mean_accuracy + presenter: print_vector + + - name: super_resolution_x3 + data_source: super_resolution + annotation_conversion: + converter: super_resolution + data_dir: super_resolution + lr_suffix: lr_x3 + upsample_suffix: upsample_x3 + hr_suffix: hr + two_streams: True + annotation: super_resolution_x3.pickle + + preprocessing: + - type: auto_resize + + postprocessing: + - type: resize + apply_to: prediction + + metrics: + - type: psnr + scale_border: 4 + presenter: print_vector + + - name: super_resolution_x4 + data_source: super_resolution + annotation_conversion: + converter: super_resolution + data_dir: super_resolution + lr_suffix: lr_x4 + upsample_suffix: upsample_x4 + hr_suffix: hr + two_streams: True + annotation: super_resolution_x4.pickle + + preprocessing: + - type: auto_resize + + postprocessing: + - type: resize + apply_to: prediction + + metrics: + - type: psnr + scale_border: 4 + presenter: print_vector + + - name: text_super_resolution_x3 + data_source: super_resolution + annotation_conversion: + converter: super_resolution + data_dir: super_resolution + lr_suffix: lr_x3 + hr_suffix: hr_gray + annotation: text_super_resolution_x3.pickle + + preprocessing: + - type: bgr_to_gray + - type: auto_resize + + postprocessing: + - type: resize + apply_to: prediction + + metrics: + - type: psnr + scale_border: 4 + presenter: print_vector + + - name: head_pose + data_source: WIDER_val/images/16--Award_Ceremony + annotation: head_pose.pickle + + preprocessing: + - type: crop_rect + - type: resize + size: 60 + + - name: gaze_estimation_dataset + data_source: gaze_estimation + annotation: gaze_estimation.pickle + + reader: + type: combine_reader + scheme: + ".*.png": opencv_imread + ".*.json": + type: json_reader + key: head_pose_angles + + - name: handwritten_score_recognition + data_source: ILSVRC2012_img_val + annotation: handwritten_score_recognition.pickle + dataset_meta: handwritten_score_recognition.json + + - name: cmu_panoptic_keypoints + data_source: cmu_panoptic_subset + annotation_conversion: + converter: cmu_panoptic_keypoints + data_dir: cmu_panoptic_subset + annotation: cmu_panoptic_keypoints.pickle + + - name: kinetics-400 + data_source: kinetics/frames_val + annotation_conversion: + converter: clip_action_recognition + annotation_file: kinetics/kinetics_400.json + data_dir: kinetics/frames_val + annotation: kinetics_action_recognition.pickle + dataset_meta: kinetics_action_recognition.json + + - name: kinetics-400-frames-79 + data_source: kinetics/frames_val + annotation_conversion: + converter: clip_action_recognition + annotation_file: kinetics/kinetics_400.json + data_dir: kinetics/frames_val + clip_duration: 79 + annotation: kinetics_action_recognition_79.pickle + dataset_meta: kinetics_action_recognition_79.json + + - name: kinetics-400-frames-79-400 + data_source: kinetics/frames_val + annotation_conversion: + converter: clip_action_recognition + annotation_file: kinetics/kinetics_400.json + data_dir: kinetics/frames_val + clip_duration: 79 + temporal_stride: 1 + num_samples: 400 + annotation: kinetics_action_recognition_79_400.pickle + dataset_meta: kinetics_action_recognition_79_400.json + + - name: driver_action_recognition_dataset + data_source: kinetics/frames_val + annotation_conversion: + converter: clip_action_recognition + annotation_file: kinetics/driver_action_recognition.json + data_dir: kinetics/frames_val + annotation: driver_action_recognition.pickle + dataset_meta: driver_action_recognition.json + + - name: BraTS + data_source: BraTS + reader: numpy_reader + annotation_conversion: + converter: brats_numpy + data_dir: BraTS + ids_file: BraTS/val_ids.p + labels_file: BraTS/labels + annotation: brats.pickle + dataset_meta: brats.json + + - name: BraTS_2017 + data_source: BraTS_2017 + reader: + type: nifti_reader + channels_first: True + annotation_conversion: + converter: brats + data_dir: BraTS_2017 + labels_file: BraTS_2017/labels + mask_channels_first: True + annotation: brats2017.pickle + dataset_meta: brats2017.json + + - name: product_detection + annotation: product_detection.pickle + dataset_meta: product_detection.json + data_source: product_detection + + metrics: + - type: coco_precision + + - name: ms_coco_single_keypoints + data_source: val2017 + annotation_conversion: + converter: mscoco_single_keypoints + annotation_file: person_keypoints_val2017.json + annotation: mscoco_single_keypoints.pickle + dataset_meta: mscoco_single_keypoints.json + metrics: + - name: AP + type: coco_orig_keypoints_precision + + - name: CamVid + data_source: CamVid + annotation_conversion: + converter: camvid + annotation_file: CamVid/val.txt + annotation: camvid.pickle + dataset_meta: camvid.json + + - name: msasl-100 + data_source: msasl/global_crops + annotation_conversion: + converter: continuous_clip_action_recognition + annotation_file: msasl/msasl_100.txt + data_dir: msasl/global_crops + out_fps: 15 + clip_length: 16 + annotation: msasl_action_recognition.pickle + + - name: jester + data_source: jester/global_crops + annotation_conversion: + converter: continuous_clip_action_recognition + annotation_file: jester/val.txt + data_dir: jester/global_crops + out_fps: 15 + clip_length: 8 + annotation: jester_action_recognition.pickle + + - name: ReDWeb_V1 + data_source: ReDWeb_V1 + annotation_conversion: + converter: redweb + data_dir: ReDWeb_V1 + annotation_file: ReDWeb_validation_360.txt + annotation: mono_depth.pickle + + - name: Kondate_nakayosi + data_source: Kondate/test_data + annotation_conversion: + converter: unicode_character_recognition + decoding_char_file: Kondate_nakayosi/kondate_nakayosi_char_list.txt + annotation_file: Kondate_nakayosi/test_img_id_gt.txt + annotation: kondate_nakayosi_recognition.pickle + dataset_meta: kondate_nakayosi_recognition.json + + - name: inpainting_free_form_masks + data_source: VOCdevkit/VOC2012/JPEGImages/ + annotation_conversion: + converter: inpainting + images_dir: VOCdevkit/VOC2012/JPEGImages/ + masks_dir: free_form_masks/masks_2k + annotation: inpainting_voc12_masks2k.pickle + + - name: inpainting_rect_masks + data_source: VOCdevkit/VOC2012/JPEGImages/ + annotation_conversion: + converter: inpainting + images_dir: VOCdevkit/VOC2012/JPEGImages/ + annotation: inpainting_voc12.pickle + + preprocessing: + - type: auto_resize + - type: rect_mask + postprocessing: + - type: resize + apply_to: prediction + + + - name: mrlEyes_2018_01 + annotation_conversion: + converter: mrlEyes_2018_01 + data_dir: mrlEyes_2018_01 + annotation: mrlEyes_2018_01.pickle + dataset_meta: mrlEyes_2018_01.json + data_source: mrlEyes_2018_01 + + - name: ms_coco_style_transfer + data_source: val2017 + annotation_conversion: + converter: style_transfer + images_dir: val2017 + metrics: + - type: psnr + scale_border: 0 + presenter: print_vector + - type: ssim + presenter: print_vector + annotation: style_transfer_val2017.pickle + + - name: squad_v1_1_msl384_mql64_ds128_lowercase + annotation_conversion: + converter: squad + testing_file: squad_v1.1/dev-v1.1.json + max_seq_length: 384 + max_query_length: 64 + doc_stride: 128 + lower_case: true + vocab_file: vocab.txt + + - name: squad_emb_v1_1_msl384_mql32_lowercase + annotation_conversion: + converter: squad_emb + testing_file: squad_v1.1/dev-v1.1.json + vocab_file: vocab.txt + max_seq_length: 384 + max_query_length: 32 + lower_case: true + + - name: librispeech-test-clean + data_source: librispeech/test/LibriSpeech/test-clean.wav + annotation_conversion: + converter: librispeech + data_dir: librispeech/test/LibriSpeech/test-clean.wav + annotation: librispeech-test-clean.pickle + metrics: + - name: wer + + - name: librispeech-dev-clean + data_source: librispeech/dev/LibriSpeech/dev-clean.wav + annotation_conversion: + converter: librispeech + data_dir: librispeech/dev/LibriSpeech/dev-clean.wav + annotation: librispeech-dev-clean.pickle + metrics: + - name: wer + + - name: WMT_en_ru + annotation_conversion: + converter: wmt + input_file: wmt19-ru-en.en.spbpe + reference_file: wmt19-ru-en.ru.spbpe + + reader: + type: annotation_features_extractor + features: + - source + + preprocessing: + - type: decode_by_sentence_piece_bpe_tokenizer + vocabulary_file: tokenizer_src/vocab.json + merges_file: tokenizer_src/merges.txt + + - type: pad_with_eos + eos_index: 1 + sequence_len: 192 + + - name: WMT_ru_en + annotation_conversion: + converter: wmt + input_file: wmt19-ru-en.ru.spbpe + reference_file: wmt19-ru-en.en.spbpe + + reader: + type: annotation_features_extractor + features: + - source + + preprocessing: + - type: decode_by_sentence_piece_bpe_tokenizer + vocabulary_file: tokenizer_src/vocab.json + merges_file: tokenizer_src/merges.txt + + - type: pad_with_eos + eos_index: 1 + sequence_len: 192 + + - name: NYU_Depth_V2 + data_source: nyudepthv2/val/converted/images + additional_data_source: nyudepthv2/val/converted/depth + annotation_conversion: + converter: nyu_depth_v2 + images_dir: nyudepthv2/val/converted/images + depth_map_dir: nyudepthv2/val/converted/depth + data_dir: nyudepthv2/val/official + + - name: SCUT_EPT + data_source: SCUT_EPT/test + annotation_conversion: + converter: unicode_character_recognition + decoding_char_file: SCUT_EPT/scut_ept_char_list.txt + annotation_file: SCUT_EPT/test_img_id_gt.txt + annotation: scut_ept_recognition.pickle + dataset_meta: scut_ept_recognition.json + + - name: ADEChallengeData2016 + annotation_conversion: + converter: ade20k + images_dir: ADEChallengeData2016/images/validation + annotations_dir: ADEChallengeData2016/annotations/validation + object_categories_file: ADEChallengeData2016/objectInfo150.txt + data_source: ADEChallengeData2016/images/validation + segmentation_masks_source: ADEChallengeData2016/annotations/validation + + - name: antispoof_test_data + data_source: antispoof_test_data + annotation_conversion: + converter: antispoofing + data_dir: antispoof_test_data + annotation_file: antispoof_test_data/metas/intra_test/items_test.json + label_id: 43 + annotation: antispoofing.pickle + dataset_meta: antispoofing.json + + - name: sound_classification + data_source: audio_dataset + annotation_conversion: + converter: sound_classification + annotation_file: audio_dataset/validation.csv + audio_dir: audio_dataset/data + annotation: sound_classification.pickle + reader: wav_reader + + - name: cocosnet_image_translation + annotation_conversion: + converter: ade20k_image_translation + annotations_dir: ADEChallengeData2016/annotations + reference_file: cocosnet_ade20k_ref_test.txt + data_source: ADEChallengeData2016 + additional_data_source: ADEChallengeData2016/images + + - name: lfw_bin + data_source: lfw_bin/images + annotation_conversion: + converter: face_recognition_bin + bin_file: lfw_bin/lfw.bin + images_dir: lfw_bin/images + convert_images: True + + - name: imagenet_colorization + data_source: ImageNet + annotation_conversion: + converter: image_processing + data_dir: ImageNet + input_suffix: .JPEG + target_suffix: .JPEG + annotation_loader: opencv + + - name: tacotron-io-duration-prediction + data_source: forward_tacotron_io + reader: numpy_dict_reader + annotation_conversion: + converter: multi_feature_regression + data_dir: forward_tacotron_io + prefix: duration_prediction + input_suffix: in + reference_suffix: out diff --git a/datasets.md b/data/datasets.md similarity index 75% rename from datasets.md rename to data/datasets.md index 17dba4c1897..8c3acf4c359 100644 --- a/datasets.md +++ b/data/datasets.md @@ -2,6 +2,13 @@ If you want to use prepared configs to run the Accuracy Checker tool and the Model Quantizer, you need to organize `` folder with validation datasets in a certain way. Instructions for preparing validation data are described in this document. +Each dataset description consists of the following sections: +* instruction for downloading the dataset +* structure of `` that matches the dataset definition in the existing global configuration file ([dataset_definitions.yml](./dataset_definitions.yml)) +* examples of using and presenting the dataset in the global configuration file + +More detailed information about using predefined configuration files you can find [here](../tools/accuracy_checker/configs/README.md). + ## [ImageNet](http://image-net.org) ### How download dataset @@ -32,9 +39,9 @@ To use this dataset with OMZ tools, make sure `` contains the follo * `val15.txt` - annotation file used for ILSVRC 2015 ### Datasets in dataset_definitions.yml -* `imagenet_1000_classes` used for evaluation models trained on ILSVRC 2012 dataset with 1000 classes. (model examples: [`alexnet`](models/public/alexnet/alexnet.md), [`vgg16`](models/public/vgg16/vgg16.md)) -* `imagenet_1000_classes_2015` used for evaluation models trained on ILSVRC 2015 dataset with 1000 classes. (model examples: [`se-resnet-152`](models/public/se-resnet-152/se-resnet-152.md), [`se-resnext-50`](models/public/se-resnext-50/se-resnext-50.md)) -* `imagenet_1001_classes` used for evaluation models trained on ILSVRC 2012 dataset with 1001 classes (background label + original labels). (model examples: [`googlenet-v2-tf`](models/public/googlenet-v2-tf/googlenet-v2-tf.md), [`resnet-50-tf`](models/public/resnet-50-tf/resnet-50-tf.md)) +* `imagenet_1000_classes` used for evaluation models trained on ILSVRC 2012 dataset with 1000 classes. (model examples: [`alexnet`](../models/public/alexnet/alexnet.md), [`vgg16`](../models/public/vgg16/vgg16.md)) +* `imagenet_1000_classes_2015` used for evaluation models trained on ILSVRC 2015 dataset with 1000 classes. (model examples: [`se-resnet-152`](../models/public/se-resnet-152/se-resnet-152.md), [`se-resnext-50`](../models/public/se-resnext-50/se-resnext-50.md)) +* `imagenet_1001_classes` used for evaluation models trained on ILSVRC 2012 dataset with 1001 classes (background label + original labels). (model examples: [`googlenet-v2-tf`](../models/public/googlenet-v2-tf/googlenet-v2-tf.md), [`resnet-50-tf`](../models/public/resnet-50-tf/resnet-50-tf.md)) ## [Common Objects in Context (COCO)](https://cocodataset.org/#home) @@ -54,11 +61,11 @@ To use this dataset with OMZ tools, make sure `` contains the follo ### Datasets in dataset_definitions.yml * `ms_coco_mask_rcnn` used for evaluation models trained on COCO dataset for object detection and instance segmentation tasks. Background label + label map with 80 public available object categories are used. Annotations are saved in order of ascending image ID. -* `ms_coco_detection_91_classes` used for evaluation models trained on COCO dataset for object detection tasks. Background label + label map with 80 public available object categories are used (original indexing to 91 categories is preserved. You can find more information about object categories labels [here](https://tech.amikelive.com/node-718/what-object-categories-labels-are-in-coco-dataset/)). Annotations are saved in order of ascending image ID. (model examples: [`faster_rcnn_resnet50_coco`](models/public/faster_rcnn_resnet50_coco/faster_rcnn_resnet50_coco.md), [`ssd_resnet50_v1_fpn_coco`](models/public/ssd_resnet50_v1_fpn_coco/ssd_resnet50_v1_fpn_coco.md)) -* `ms_coco_detection_80_class_with_background` used for evaluation models trained on COCO dataset for object detection tasks. Background label + label map with 80 public available object categories are used. Annotations are saved in order of ascending image ID. (model examples: [`faster-rcnn-resnet101-coco-sparse-60-0001`](models/intel/faster-rcnn-resnet101-coco-sparse-60-0001/description/faster-rcnn-resnet101-coco-sparse-60-0001.md), [`ssd-resnet34-1200-onnx`](models/public/ssd-resnet34-1200-onnx/ssd-resnet34-1200-onnx.md)) -* `ms_coco_detection_80_class_without_background` used for evaluation models trained on COCO dataset for object detection tasks. Label map with 80 public available object categories is used. Annotations are saved in order of ascending image ID. (model examples: [`ctdet_coco_dlav0_384`](models/public/ctdet_coco_dlav0_384/ctdet_coco_dlav0_384.md), [`yolo-v3-tf`](models/public/yolo-v3-tf/yolo-v3-tf.md)) -* `ms_coco_keypoints` used for evaluation models trained on COCO dataset for human pose estimation tasks. Each annotation stores multiple keypoints for one image. (model examples: [`human-pose-estimation-0001`](models/intel/human-pose-estimation-0001/description/human-pose-estimation-0001.md)) -* `ms_coco_single_keypoints` used for evaluation models trained on COCO dataset for human pose estimation tasks. Each annotation stores single keypoints for image, so several annotation can be associated to one image. (model examples: [`single-human-pose-estimation-0001`](models/public/single-human-pose-estimation-0001/description/single-human-pose-estimation-0001.md)) +* `ms_coco_detection_91_classes` used for evaluation models trained on COCO dataset for object detection tasks. Background label + label map with 80 public available object categories are used (original indexing to 91 categories is preserved. You can find more information about object categories labels [here](https://tech.amikelive.com/node-718/what-object-categories-labels-are-in-coco-dataset/)). Annotations are saved in order of ascending image ID. (model examples: [`faster_rcnn_resnet50_coco`](../models/public/faster_rcnn_resnet50_coco/faster_rcnn_resnet50_coco.md), [`ssd_resnet50_v1_fpn_coco`](../models/public/ssd_resnet50_v1_fpn_coco/ssd_resnet50_v1_fpn_coco.md)) +* `ms_coco_detection_80_class_with_background` used for evaluation models trained on COCO dataset for object detection tasks. Background label + label map with 80 public available object categories are used. Annotations are saved in order of ascending image ID. (model examples: [`faster-rcnn-resnet101-coco-sparse-60-0001`](../models/intel/faster-rcnn-resnet101-coco-sparse-60-0001/description/faster-rcnn-resnet101-coco-sparse-60-0001.md), [`ssd-resnet34-1200-onnx`](../models/public/ssd-resnet34-1200-onnx/ssd-resnet34-1200-onnx.md)) +* `ms_coco_detection_80_class_without_background` used for evaluation models trained on COCO dataset for object detection tasks. Label map with 80 public available object categories is used. Annotations are saved in order of ascending image ID. (model examples: [`ctdet_coco_dlav0_384`](../models/public/ctdet_coco_dlav0_384/ctdet_coco_dlav0_384.md), [`yolo-v3-tf`](../models/public/yolo-v3-tf/yolo-v3-tf.md)) +* `ms_coco_keypoints` used for evaluation models trained on COCO dataset for human pose estimation tasks. Each annotation stores multiple keypoints for one image. (model examples: [`human-pose-estimation-0001`](../models/intel/human-pose-estimation-0001/description/human-pose-estimation-0001.md)) +* `ms_coco_single_keypoints` used for evaluation models trained on COCO dataset for human pose estimation tasks. Each annotation stores single keypoints for image, so several annotation can be associated to one image. (model examples: [`single-human-pose-estimation-0001`](../models/public/single-human-pose-estimation-0001/description/single-human-pose-estimation-0001.md)) ## [WIDER FACE](http://shuoyang1213.me/WIDERFACE/) @@ -81,8 +88,8 @@ To use this dataset with OMZ tools, make sure `` contains the follo * `wider_face_val_bbx_gt.txt` - annotation file ### Datasets in dataset_definitions.yml -* `wider` used for evaluation models on WIDER Face dataset where the face is the first class. (model examples: [`mtcnn`](models/public/mtcnn/mtcnn.md), [`retinaface-resnet50`](models/public/retinaface-resnet50/retinaface-resnet50.md)) -* `wider_without_bkgr` used for evaluation models on WIDER Face dataset where the face is class zero. (model examples: [`mobilefacedet-v1-mxnet`](models/public/mobilefacedet-v1-mxnet/mobilefacedet-v1-mxnet.md)) +* `wider` used for evaluation models on WIDER Face dataset where the face is the first class. (model examples: [`mtcnn`](../models/public/mtcnn/mtcnn.md), [`retinaface-resnet50`](../models/public/retinaface-resnet50/retinaface-resnet50.md)) +* `wider_without_bkgr` used for evaluation models on WIDER Face dataset where the face is class zero. (model examples: [`mobilefacedet-v1-mxnet`](../models/public/mobilefacedet-v1-mxnet/mobilefacedet-v1-mxnet.md)) ## [Visual Object Classes Challenge 2012 (VOC2012)](http://host.robots.ox.ac.uk/pascal/VOC/voc2012/) @@ -107,6 +114,6 @@ To use this dataset with OMZ tools, make sure `` contains the follo * `SegmentationClass` - directory containing the VOC2012 segmentation masks ### Datasets in dataset_definitions.yml -* `VOC2012` used for evaluation models on VOC2012 dataset for object detection task. Background label + label map with 20 object categories are used. (model examples: [`mobilenet-ssd`](models/public/mobilenet-ssd/mobilenet-ssd.md), [`ssd300`](models/public/ssd300/ssd300.md)) -* `VOC2012_without_background` used for evaluation models on VOC2012 dataset for object detection tasks. Label map with 20 object categories is used.(model examples: [`yolo-v2-ava-0001`](models/intel/yolo-v2-ava-0001/description/yolo-v2-ava-0001.md), [`yolo-v2-tiny-ava-0001`](models/intel/yolo-v2-tiny-ava-0001/description/yolo-v2-tiny-ava-0001.md)) -* `VOC2012_Segmentation` used for evaluation models on VOC2012 dataset for segmentation tasks. Background label + label map with 20 object categories are used.(model examples: [`deeplabv3`](models/public/deeplabv3/deeplabv3.md)) +* `VOC2012` used for evaluation models on VOC2012 dataset for object detection task. Background label + label map with 20 object categories are used. (model examples: [`mobilenet-ssd`](../models/public/mobilenet-ssd/mobilenet-ssd.md), [`ssd300`](../models/public/ssd300/ssd300.md)) +* `VOC2012_without_background` used for evaluation models on VOC2012 dataset for object detection tasks. Label map with 20 object categories is used.(model examples: [`yolo-v2-ava-0001`](../models/intel/yolo-v2-ava-0001/description/yolo-v2-ava-0001.md), [`yolo-v2-tiny-ava-0001`](../models/intel/yolo-v2-tiny-ava-0001/description/yolo-v2-tiny-ava-0001.md)) +* `VOC2012_Segmentation` used for evaluation models on VOC2012 dataset for segmentation tasks. Background label + label map with 20 object categories are used.(model examples: [`deeplabv3`](../models/public/deeplabv3/deeplabv3.md)) diff --git a/demos/python_demos/3d_segmentation_demo/3d_segmentation_demo.py b/demos/3d_segmentation_demo/python/3d_segmentation_demo.py similarity index 98% rename from demos/python_demos/3d_segmentation_demo/3d_segmentation_demo.py rename to demos/3d_segmentation_demo/python/3d_segmentation_demo.py index bc56c5c21e1..fa3bbb405e1 100755 --- a/demos/python_demos/3d_segmentation_demo/3d_segmentation_demo.py +++ b/demos/3d_segmentation_demo/python/3d_segmentation_demo.py @@ -109,7 +109,7 @@ def parse_arguments(): args.add_argument('-c', '--path_to_cldnn_config', type=str, required=False, help="Required for GPU custom kernels. " "Absolute path to an .xml file with the kernels description.") - args.add_argument('-ms', '--mri_sequence', type=mri_sequence, metavar='N1,N2,N3,N4', default=(0,1,2,3), + args.add_argument('-ms', '--mri_sequence', type=mri_sequence, metavar='N1,N2,N3,N4', default=(0, 1, 2, 3), help='Optional. Transfer MRI-sequence from dataset order to the network order.') args.add_argument("--full_intensities_range", required=False, default=False, action="store_true", help="Take intensities of the input image in a full range.") @@ -185,8 +185,8 @@ def resample_np(data, output_shape, order): return interpolation.zoom(data, zoom=factor, order=order) -def read_image(test_data_path, data_name, sizes=(128, 128, 128), is_series=True, \ - mri_sequence_order=(0,1,2,3), full_intensities_range=False): +def read_image(test_data_path, data_name, sizes=(128, 128, 128), is_series=True, + mri_sequence_order=(0, 1, 2, 3), full_intensities_range=False): images_list = [] original_shape = () bboxes = np.zeros(shape=(len(DATA_SUFFIXES),) + (2, 3)) @@ -257,7 +257,7 @@ def main(): ie.set_config({'CPU_THREADS_NUM': str(args.number_threads)}, "CPU") elif 'GPU' in args.target_device: if args.path_to_cldnn_config: - ie.set_config({'CONFIG_FILE': args.path_to_cldnn_config}, "GPU") + ie.set_config({'CONFIG_FILE': args.path_to_cldnn_config}, "GPU") logger.info("GPU extensions is loaded {}".format(args.path_to_cldnn_config)) else: raise AttributeError("Device {} do not support of 3D convolution. " @@ -351,7 +351,7 @@ def main(): y = bbox[3] - bbox[2] z = bbox[5] - bbox[4] out_result = np.zeros(shape=((channels,) + original_size), dtype=float) - out_result[:,bbox[0]:bbox[1], bbox[2]:bbox[3], bbox[4]:bbox[5]] = \ + out_result[:, bbox[0]:bbox[1], bbox[2]:bbox[3], bbox[4]:bbox[5]] = \ resample_np(data, (channels, x, y, z), 1) else: out_result = data @@ -401,7 +401,7 @@ def main(): # --------------------------------------------- 7. Save output ----------------------------------------------- tiff_output_name = os.path.join(args.path_to_output, 'output.tiff') - Image.new('RGB', (original_data.shape[3], original_data.shape[2])).save(tiff_output_name, \ + Image.new('RGB', (original_data.shape[3], original_data.shape[2])).save(tiff_output_name, append_images=list_img, save_all=True) logger.info("Result tiff file was saved to {}".format(tiff_output_name)) diff --git a/demos/python_demos/3d_segmentation_demo/README.md b/demos/3d_segmentation_demo/python/README.md similarity index 97% rename from demos/python_demos/3d_segmentation_demo/README.md rename to demos/3d_segmentation_demo/python/README.md index 45a748a0030..9e707ff7ea1 100644 --- a/demos/python_demos/3d_segmentation_demo/README.md +++ b/demos/3d_segmentation_demo/python/README.md @@ -1,4 +1,4 @@ -# 3D Segmentation Python* Demo +# 3D Segmentation Python\* Demo This topic demonstrates how to run the 3D Segmentation Demo, which segments 3D images using 3D convolutional networks. @@ -56,7 +56,7 @@ Options: ``` Running the application with the empty list of options yields the usage message and an error message. -To run the demo, use public or pre-trained models that support 3D convolution, for example, UNet3D. You can download the pre-trained models using the OpenVINO [Model Downloader](../../../tools/downloader/README.md) or from [https://download.01.org/opencv/](https://download.01.org/opencv/). +To run the demo, use public or pre-trained models that support 3D convolution, for example, UNet3D. You can download the pre-trained models using the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). diff --git a/demos/python_demos/3d_segmentation_demo/models.lst b/demos/3d_segmentation_demo/python/models.lst similarity index 100% rename from demos/python_demos/3d_segmentation_demo/models.lst rename to demos/3d_segmentation_demo/python/models.lst diff --git a/demos/python_demos/3d_segmentation_demo/requirements.txt b/demos/3d_segmentation_demo/python/requirements.txt similarity index 82% rename from demos/python_demos/3d_segmentation_demo/requirements.txt rename to demos/3d_segmentation_demo/python/requirements.txt index 229190633a7..e0d40fcee45 100644 --- a/demos/python_demos/3d_segmentation_demo/requirements.txt +++ b/demos/3d_segmentation_demo/python/requirements.txt @@ -1,4 +1,4 @@ #3d segmentation demo specific requirements nibabel -pillow +pillow>=8.1 scipy diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt index 79152b8a6d1..c5e3b1ec320 100644 --- a/demos/CMakeLists.txt +++ b/demos/CMakeLists.txt @@ -2,18 +2,20 @@ # SPDX-License-Identifier: Apache-2.0 # -cmake_minimum_required (VERSION 3.10) +cmake_minimum_required(VERSION 3.10) project(Demos) option(ENABLE_PYTHON "Whether to build extension modules for Python demos" OFF) +option(MULTICHANNEL_DEMO_USE_TBB "Use TBB-based threading in multichannel demos" OFF) +option(MULTICHANNEL_DEMO_USE_NATIVE_CAM "Use native camera api in multichannel demos" OFF) -if (CMAKE_BUILD_TYPE STREQUAL "") +if(CMAKE_BUILD_TYPE STREQUAL "") message(STATUS "CMAKE_BUILD_TYPE not defined, 'Release' will be used") set(CMAKE_BUILD_TYPE "Release") endif() -if (NOT(BIN_FOLDER)) +if(NOT BIN_FOLDER) string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} ARCH) if(ARCH STREQUAL "x86_64" OR ARCH STREQUAL "amd64") # Windows detects Intel's 64-bit CPU as AMD64 set(ARCH intel64) @@ -21,104 +23,83 @@ if (NOT(BIN_FOLDER)) set(ARCH ia32) endif() - set (BIN_FOLDER ${ARCH}) + set(BIN_FOLDER ${ARCH}) endif() -if (NOT(IE_MAIN_SOURCE_DIR)) - # in case if samples are built out of IE repo - set (IE_MAIN_SAMPLES_DIR ${CMAKE_CURRENT_BINARY_DIR}) -else() - # in case if samples are built from IE repo - set (IE_MAIN_SAMPLES_DIR ${IE_MAIN_SOURCE_DIR}) -endif() +set(CMAKE_POSITION_INDEPENDENT_CODE ON) -set (CMAKE_POSITION_INDEPENDENT_CODE ON) -if(NOT(UNIX)) - set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER}) - set (CMAKE_LIBRARY_PATH ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER}) - set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER}) - set (CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER}) - set (CMAKE_PDB_OUTPUT_DIRECTORY ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER}) - set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER}) - set (LIBRARY_OUTPUT_DIRECTORY ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER}) - set (LIBRARY_OUTPUT_PATH ${LIBRARY_OUTPUT_DIRECTORY}) # compatibility issue: linux uses LIBRARY_OUTPUT_PATH, windows uses LIBRARY_OUTPUT_DIRECTORY -else () - set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE}/lib) - set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE}/lib) - set (CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE}) - set (CMAKE_PDB_OUTPUT_DIRECTORY ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE}) - set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE}) - set (LIBRARY_OUTPUT_DIRECTORY ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE}/lib) - set (LIBRARY_OUTPUT_PATH ${LIBRARY_OUTPUT_DIRECTORY}/lib) +foreach(artifact IN ITEMS ARCHIVE COMPILE_PDB LIBRARY PDB RUNTIME) + set("CMAKE_${artifact}_OUTPUT_DIRECTORY" "${CMAKE_CURRENT_BINARY_DIR}/${BIN_FOLDER}/$") +endforeach() + +if(UNIX) + string(APPEND CMAKE_LIBRARY_OUTPUT_DIRECTORY "/lib") + string(APPEND CMAKE_ARCHIVE_OUTPUT_DIRECTORY "/lib") endif() -if (WIN32) - if (NOT "${CMAKE_SIZEOF_VOID_P}" EQUAL "8") +if(WIN32) + if(NOT "${CMAKE_SIZEOF_VOID_P}" EQUAL "8") message(FATAL_ERROR "Only 64-bit supported on Windows") endif() - set_property (DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS _CRT_SECURE_NO_WARNINGS) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_SCL_SECURE_NO_WARNINGS -DNOMINMAX") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") #no asynchronous structured exception handling - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE") + add_definitions(-DNOMINMAX) +endif() - if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251 /wd4275 /wd4267") #disable some warnings - endif() -elseif(UNIX) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wuninitialized -Winit-self") - if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wmaybe-uninitialized") - endif() +if(MSVC) + add_definitions(-D_CRT_SECURE_NO_WARNINGS -DSCL_SECURE_NO_WARNINGS) + add_compile_options(/wd4251 /wd4275 /wd4267 # disable some warnings + /W3 # Specify the level of warnings to be generated by the compiler + /EHsc) # Enable standard C++ stack unwinding, assume functions with extern "C" never throw +endif() + +if(COMPILER_IS_GCC_LIKE) + add_compile_options(-Wall) endif() #################################### ## to use C++11 -set (CMAKE_CXX_STANDARD 11) -set (CMAKE_CXX_STANDARD_REQUIRED ON) -if (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU) - set (CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}") -endif() +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) #################################### -set (GFLAGS_IS_SUBPROJECT TRUE) -set (HAVE_SYS_STAT_H 1) -set (HAVE_INTTYPES_H 1) +set(GFLAGS_IS_SUBPROJECT TRUE) +set(HAVE_SYS_STAT_H 1) +set(HAVE_INTTYPES_H 1) add_subdirectory(thirdparty/gflags) -if (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") +if(CMAKE_CXX_COMPILER_ID MATCHES "^GNU|(Apple)?Clang$") + set(COMPILER_IS_GCC_LIKE TRUE) +else() + set(COMPILER_IS_GCC_LIKE FALSE) endif() -add_subdirectory(common) - -# samples build can be switched off during whole IE build -if (IE_MAIN_SOURCE_DIR AND NOT ENABLE_SAMPLES) - return() -endif() +add_subdirectory(common/cpp) +add_subdirectory(multi_channel_common/cpp) function(add_samples_to_build) # check each passed sample subdirectory - foreach (dir ${ARGN}) - if (IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${dir}) + foreach(dir ${ARGN}) + if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${dir}) # check if a subdirectory contains CMakeLists.txt. In this case we can build it. - file(GLOB is_sample_dir "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/CMakeLists.txt") - if(is_sample_dir) - # check if specified sample/demo is found. - if (BUILD_SAMPLE_NAME) - list(FIND BUILD_SAMPLE_NAME ${dir} index) - endif() - if (index EQUAL -1) - message(STATUS "${dir} SKIPPED") - else() - # Include subdirectory to the project. - add_subdirectory(${dir}) + file(GLOB sub_dirs ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/*) + foreach(sub_dir ${sub_dirs}) + if(EXISTS "${sub_dir}/CMakeLists.txt") + # check if specified sample/demo is found. + if(BUILD_SAMPLE_NAME) + list(FIND BUILD_SAMPLE_NAME ${dir} index) + endif() + if(index EQUAL -1) + message(STATUS "${dir} SKIPPED") + else() + # Include subdirectory to the project. + add_subdirectory(${sub_dir}) + endif() endif() - endif() + endforeach() endif() endforeach() -endfunction(add_samples_to_build) +endfunction() include(CMakeParseArguments) @@ -136,7 +117,7 @@ macro(ie_add_sample) set(oneValueArgs NAME) set(multiValueArgs SOURCES HEADERS DEPENDENCIES OPENCV_DEPENDENCIES INCLUDE_DIRECTORIES) cmake_parse_arguments(IE_SAMPLE "${options}" "${oneValueArgs}" - "${multiValueArgs}" ${ARGN} ) + "${multiValueArgs}" ${ARGN}) # Find OpenCV components if exist if(IE_SAMPLE_OPENCV_DEPENDENCIES) @@ -168,7 +149,7 @@ macro(ie_add_sample) endif() target_link_libraries(${IE_SAMPLE_NAME} PRIVATE ${OpenCV_LIBRARIES} ${InferenceEngine_LIBRARIES} - ${IE_SAMPLE_DEPENDENCIES} common gflags) + ${IE_SAMPLE_DEPENDENCIES} utils gflags) if(UNIX) target_link_libraries(${IE_SAMPLE_NAME} PRIVATE pthread) @@ -187,9 +168,9 @@ endmacro() # use this flag if you need to throw custom message in case if the IE package is not found. -if (IE_NOT_FOUND_MESSAGE) +if(IE_NOT_FOUND_MESSAGE) find_package(InferenceEngine 2.0 QUIET) - if (NOT(InferenceEngine_FOUND)) + if(NOT InferenceEngine_FOUND) message(FATAL_ERROR ${IE_NOT_FOUND_MESSAGE}) endif() else() @@ -201,7 +182,7 @@ find_package(ngraph REQUIRED) # collect all samples subdirectories file(GLOB samples_dirs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *) # skip building of unnecessary subdirectories -list(REMOVE_ITEM samples_dirs common thirdparty) +list(REMOVE_ITEM samples_dirs common thirdparty multi_channel_common) add_samples_to_build(${samples_dirs}) if(ENABLE_PYTHON) @@ -217,7 +198,7 @@ if(ENABLE_PYTHON) message(FATAL_ERROR "NumPy headers not found") endif() - add_subdirectory(python_demos/human_pose_estimation_3d_demo/pose_extractor) - add_subdirectory(python_demos/common/monitors_extension) - add_subdirectory(python_demos/speech_recognition_demo/ctcdecode-numpy) + add_subdirectory(human_pose_estimation_3d_demo/python/pose_extractor) + add_subdirectory(common/python/monitors_extension) + add_subdirectory(speech_recognition_demo/python/ctcdecode-numpy) endif() diff --git a/demos/README.md b/demos/README.md index 2df5498f38f..11fe1446255 100644 --- a/demos/README.md +++ b/demos/README.md @@ -1,46 +1,48 @@ # Open Model Zoo Demos -The Open Model Zoo demo applications are console applications that demonstrate how you can use the Inference Engine in your applications to solve specific use-cases. - +The Open Model Zoo demo applications are console applications that demonstrate how you can use the Inference Engine in your applications to solve specific use-cases The Open Model Zoo includes the following demos: -- [3D Human Pose Estimation Python* Demo](./python_demos/human_pose_estimation_3d_demo/README.md) - 3D human pose estimation demo. -- [Action Recognition Python* Demo](./python_demos/action_recognition/README.md) - Demo application for Action Recognition algorithm, which classifies actions that are being performed on input video. -- [BERT Question Answering Python* Demo](./python_demos/bert_question_answering_demo/README.md) -- [BERT Question Answering Embedding Python* Demo](./python_demos/bert_question_answering_embedding_demo/README.md) - The demo demonstrates how to run BERT based models for question answering task. -- [Classification C++ Demo](./classification_demo/README.md) - Shows an example of using neural networks for image classification. -- [Colorization Python* Demo](./python_demos/colorization_demo/README.md) - Colorization demo colorizes input frames. -- [Crossroad Camera C++ Demo](./crossroad_camera_demo/README.md) - Person Detection followed by the Person Attributes Recognition and Person Reidentification Retail, supports images/video and camera inputs. -- [Formula Recognition Python* Demo](./python_demos/formula_recognition_demo/README.md) - The demo demonstrates how to run Im2latex formula recognition models and recognize latex formulas. -- [Gaze Estimation C++ Demo](./gaze_estimation_demo/README.md) - Face detection followed by gaze estimation, head pose estimation and facial landmarks regression. -- [Human Pose Estimation C++ Demo](./human_pose_estimation_demo/README.md) - Human pose estimation demo. -- [Image Inpainting Python Demo](./python_demos/image_inpainting_demo/README.md) - Demo application for GMCNN inpainting network. -- [Image Retrieval Python* Demo](./python_demos/image_retrieval_demo/README.md) - The demo demonstrates how to run Image Retrieval models using OpenVINO™. -- [Image Segmentation C++ Demo](./segmentation_demo/README.md) - Inference of image segmentation networks like FCN8 (the demo supports only images as inputs). -- [Image Segmentation Asynchronous C++ Demo](./segmentation_demo_async/README.md) - Inference of image segmentation networks like FCN8, async API showcase, simple OpenCV interoperability (supports video and camera inputs). -- [Instance Segmentation Python* Demo](./python_demos/instance_segmentation_demo/README.md) - Inference of instance segmentation networks trained in `Detectron` or `maskrcnn-benchmark`. -- [Interactive Face Detection C++ Demo](./interactive_face_detection_demo/README.md) - Face Detection coupled with Age/Gender, Head-Pose, Emotion, and Facial Landmarks detectors. Supports video and camera inputs. -- [Machine Translation Python* Demo](./python_demos/machine_translation_demo/README.md) - The demo demonstrates how to run non-autoregressive machine translation models. -- [Mask R-CNN C++ Demo for TensorFlow* Object Detection API](./mask_rcnn_demo/README.md) - Inference of instance segmentation networks created with TensorFlow\* Object Detection API. -- [Monodepth Python* Demo](./python_demos/monodepth_demo/README.md) - The demo demonstrates how to run monocular depth estimation models. -- [Multi-Camera Multi-Target Tracking Python* Demo](./python_demos/multi_camera_multi_target_tracking/README.md) Demo application for multiple targets (persons or vehicles) tracking on multiple cameras. -- [Multi-Channel C++ Demos](./multi_channel/README.md) - Several demo applications for multi-channel scenarios. -- [Object Detection for CenterNet Python* Demo](./python_demos/object_detection_demo_centernet/README.md) - Demo application for CenterNet object detection network. -- [Object Detection for Faster R-CNN C++ Demo](./object_detection_demo_faster_rcnn/README.md) - Inference of object detection networks like Faster R-CNN (the demo supports only images as inputs). -- [Object Detection for RetinaFace Python\* Demo](./python_demos/object_detection_demo_retinaface/README.md) - Demo application for RetinaFace face detection model. -- [Object Detection C++ Demo](./object_detection_demo/README.md) - Demo application for Object Detection networks (different models architectures are supproted), async API showcase, simple OpenCV interoperability (supports video and camera inputs). -- [Object Detection for SSD C++ Demo](./object_detection_demo_ssd_async/README.md) - Demo application for SSD-based Object Detection networks, new Async API performance showcase, and simple OpenCV interoperability (supports video and camera inputs). -- [Object Detection for YOLO V3 C++ Demo](./object_detection_demo_yolov3_async/README.md) - Demo application for YOLOV3-based Object Detection networks, new Async API performance showcase, and simple OpenCV interoperability (supports video and camera inputs). -- [Pedestrian Tracker C++ Demo](./pedestrian_tracker_demo/README.md) - Demo application for pedestrian tracking scenario. -- [Security Barrier Camera C++ Demo](./security_barrier_camera_demo/README.md) - Vehicle Detection followed by the Vehicle Attributes and License-Plate Recognition, supports images/video and camera inputs. -- [Speech Recognition Python\* Demo](./python_demos/speech_recognition_demo/README.md) - Speech recognition demo: takes audio file with an English phrase on input, and converts it into text. -- [Single Human Pose Estimation Python* Demo](./python_demos/single_human_pose_estimation_demo/README.md) - 2D human pose estimation demo. -- [Smart Classroom C++ Demo](./smart_classroom_demo/README.md) - Face recognition and action detection demo for classroom environment. -- [Sound Classification Python* Demo](./python_demos/sound_classification_demo/README.md) - Demo application for sound classification algorithm. -- [Super Resolution C++ Demo](./super_resolution_demo/README.md) - Super Resolution demo (the demo supports only images as inputs). It enhances the resolution of the input image. -- [Text Detection C++ Demo](./text_detection_demo/README.md) - Text Detection demo. It detects and recognizes multi-oriented scene text on an input image and puts a bounding box around detected area. -- [Text Spotting Python* Demo](./python_demos/text_spotting_demo/README.md) - The demo demonstrates how to run Text Spotting models. -- [Handwritten Text Recognition Python* Demo](./python_demos/handwritten_text_recognition_demo/README.md) - The demo demonstrates how to run Handwritten Japanese Recognition models and Handwritten Simplified Chinese Recognition models. +- [3D Human Pose Estimation Python\* Demo](./human_pose_estimation_3d_demo/python/README.md) - 3D human pose estimation demo. +- [Action Recognition Python\* Demo](./action_recognition/python/README.md) - Demo application for Action Recognition algorithm, which classifies actions that are being performed on input video. +- [BERT Question Answering Python\* Demo](./bert_question_answering_demo/python/README.md) +- [BERT Question Answering Embedding Python\* Demo](./bert_question_answering_embedding_demo/python/README.md) - The demo demonstrates how to run BERT based models for question answering task. +- [Classification C++ Demo](./classification_demo/cpp/README.md) - Shows an example of using neural networks for image classification. +- [Colorization Python\* Demo](./colorization_demo/python/README.md) - Colorization demo colorizes input frames. +- [Crossroad Camera C++ Demo](./crossroad_camera_demo/cpp/README.md) - Person Detection followed by the Person Attributes Recognition and Person Reidentification Retail, supports images/video and camera inputs. +- [Formula Recognition Python\* Demo](./formula_recognition_demo/python/README.md) - The demo demonstrates how to run Im2latex formula recognition models and recognize latex formulas. +- [Gaze Estimation C++ Demo](./gaze_estimation_demo/cpp/README.md) - Face detection followed by gaze estimation, head pose estimation and facial landmarks regression. +- [Gesture Recognition Python\* Demo](./gesture_recognition_demo/python/README.md) - Demo application for Gesture Recognition algorithm (e.g. American Sign Language gestures), which classifies gesture actions that are being performed on input video. +- [Handwritten Text Recognition Python\* Demo](./handwritten_text_recognition_demo/python/README.md) - The demo demonstrates how to run Handwritten Japanese Recognition models and Handwritten Simplified Chinese Recognition models. +- [Human Pose Estimation C++ Demo](./human_pose_estimation_demo/cpp/README.md) - Human pose estimation demo. +- [Human Pose Estimation Python\* Demo](./human_pose_estimation_demo/python/README.md) - Human pose estimation demo. +- [Image Inpainting Python\* Demo](./image_inpainting_demo/python/README.md) - Demo application for GMCNN inpainting network. +- [Image Retrieval Python\* Demo](./image_retrieval_demo/python/README.md) - The demo demonstrates how to run Image Retrieval models using OpenVINO™. +- [Image Segmentation C++ Demo](./segmentation_demo/cpp/README.md) - Inference of semantic segmentation networks (supports video and camera inputs). +- [Image Segmentation Python\* Demo](./segmentation_demo/python/README.md) - Inference of semantic segmentation networks (supports video and camera inputs). +- [Image Translation Python\* Demo](./image_translation_demo/python/README.md) - Demo application to synthesize a photo-realistic image based on exemplar image. +- [Instance Segmentation Python\* Demo](./instance_segmentation_demo/python/README.md) - Inference of instance segmentation networks trained in `Detectron` or `maskrcnn-benchmark`. +- [Interactive Face Detection C++ Demo](./interactive_face_detection_demo/cpp/README.md) - Face Detection coupled with Age/Gender, Head-Pose, Emotion, and Facial Landmarks detectors. Supports video and camera inputs. +- [Interactive Face Detection G-API Demo](./interactive_face_detection_demo/cpp_gapi/README.md) - G-API based Face Detection coupled with Age/Gender, Head-Pose, Emotion, and Facial Landmarks detectors. Supports video and camera inputs. +- [Machine Translation Python\* Demo](./machine_translation_demo/python/README.md) - The demo demonstrates how to run non-autoregressive machine translation models. +- [Mask R-CNN C++ Demo for TensorFlow\* Object Detection API](./mask_rcnn_demo/cpp/README.md) - Inference of instance segmentation networks created with TensorFlow\* Object Detection API. +- [Monodepth Python\* Demo](./monodepth_demo/python/README.md) - The demo demonstrates how to run monocular depth estimation models. +- [Multi-Camera Multi-Target Tracking Python\* Demo](./multi_camera_multi_target_tracking/python/README.md) Demo application for multiple targets (persons or vehicles) tracking on multiple cameras. +- [Multi-Channel Face Detection C++ Demo](./multi_channel_face_detection_demo/cpp/README.md) - The demo demonstrates an inference pipeline for multi-channel face detection scenario. +- [Multi-Channel Human Pose Estimation C++ Demo](./multi_channel_human_pose_estimation_demo/cpp/README.md) - The demo demonstrates an inference pipeline for multi-channel human pose estimation scenario. +- [Multi-Channel Object Detection Yolov3 C++ Demo](./multi_channel_object_detection_demo_yolov3/cpp/README.md) - The demo demonstrates an inference pipeline for multi-channel common object detection scenario. +- [Object Detection Python\* Demo](./object_detection_demo/python/README.md) - Demo application for several object detection model types (like SSD, Yolo, etc). +- [Object Detection C++ Demo](./object_detection_demo/cpp/README.md) - Demo application for Object Detection networks (different models architectures are supproted), async API showcase, simple OpenCV interoperability (supports video and camera inputs). +- [Pedestrian Tracker C++ Demo](./pedestrian_tracker_demo/cpp/README.md) - Demo application for pedestrian tracking scenario. +- [Security Barrier Camera C++ Demo](./security_barrier_camera_demo/cpp/README.md) - Vehicle Detection followed by the Vehicle Attributes and License-Plate Recognition, supports images/video and camera inputs. +- [Speech Recognition Python\* Demo](./speech_recognition_demo/python/README.md) - Speech recognition demo: takes audio file with an English phrase on input, and converts it into text. +- [Single Human Pose Estimation Python\* Demo](./single_human_pose_estimation_demo/python/README.md) - 2D human pose estimation demo. +- [Smart Classroom C++ Demo](./smart_classroom_demo/cpp/README.md) - Face recognition and action detection demo for classroom environment. +- [Sound Classification Python\* Demo](./sound_classification_demo/python/README.md) - Demo application for sound classification algorithm. +- [Super Resolution C++ Demo](./super_resolution_demo/cpp/README.md) - Super Resolution demo (the demo supports only images as inputs). It enhances the resolution of the input image. +- [Text Detection C++ Demo](./text_detection_demo/cpp/README.md) - Text Detection demo. It detects and recognizes multi-oriented scene text on an input image and puts a bounding box around detected area. +- [Text Spotting Python\* Demo](./text_spotting_demo/python/README.md) - The demo demonstrates how to run Text Spotting models. +- [Text-to-speech Python\* Demo](./text_to_speech_demo/python/README.md) - Shows an example of using Forward Tacotron and WaveRNN neural networks for text to speech task. ## Media Files Available for Demos @@ -56,64 +58,65 @@ The table below shows the correlation between models, demos, and supported plugi > **NOTE:** **MYRIAD** below stands for Intel® Movidius™ Neural Compute Stick, Intel® Neural Compute Stick 2, and Intel® Vision Accelerator Design with Intel® Movidius™ Vision Processing Units. | Model | Demos supported on the model | CPU | GPU | MYRIAD/HDDL | HETERO:FPGA,CPU | -|--------------------------------------------------|----------------------------------------------------------------------------------------------------------------|-----------|-----------|-------------|-----------------| -| human-pose-estimation-3d-0001 | [3D Human Pose Estimation Python\* Demo](./python_demos/human_pose_estimation_3d_demo/README.md) | Supported | Supported | | | -| action-recognition-0001-decoder | [Action Recognition Demo](./python_demos/action_recognition/README.md) | Supported | Supported | | | -| action-recognition-0001-encoder | [Action Recognition Demo](./python_demos/action_recognition/README.md) | Supported | Supported | | | -| driver-action-recognition-adas-0002-decoder | [Action Recognition Demo](./python_demos/action_recognition/README.md) | Supported | Supported | | | -| driver-action-recognition-adas-0002-encoder | [Action Recognition Demo](./python_demos/action_recognition/README.md) | Supported | Supported | | Supported | -| person-attributes-recognition-crossroad-0230 | [Crossroad Camera Demo](./crossroad_camera_demo/README.md) | Supported | Supported | Supported | Supported | -| person-attributes-recognition-crossroad-0234 | [Crossroad Camera Demo](./crossroad_camera_demo/README.md) | Supported | | | | -| person-attributes-recognition-crossroad-0238 | [Crossroad Camera Demo](./crossroad_camera_demo/README.md) | Supported | | | | -| person-reidentification-retail-0031 | [Crossroad Camera Demo](./crossroad_camera_demo/README.md) | Supported | Supported | Supported | Supported | -| person-reidentification-retail-0076 | [Crossroad Camera Demo](./crossroad_camera_demo/README.md)
[Multi-Camera Multi-Target Tracking Demo](./python_demos/multi_camera_multi_target_tracking/README.md) | Supported | Supported | Supported | Supported | -| person-reidentification-retail-0079 | [Crossroad Camera Demo](./crossroad_camera_demo/README.md)
[Multi-Camera Multi-Target Tracking Demo](./python_demos/multi_camera_multi_target_tracking/README.md) | Supported | Supported | Supported | Supported | -| person-vehicle-bike-detection-crossroad-0078 | [Crossroad Camera Demo](./crossroad_camera_demo/README.md) | Supported | Supported | Supported | Supported | -| person-vehicle-bike-detection-crossroad-1016 | [Crossroad Camera Demo](./crossroad_camera_demo/README.md) | Supported | | | | -| person-vehicle-bike-detection-crossroad-yolov3-1020 | [Object Detection for YOLO V3 Python\* Demo](./python_demos/object_detection_demo_yolov3_async/README.md) | Supported | | | | -| human-pose-estimation-0001 | [Human Pose Estimation Demo](./human_pose_estimation_demo/README.md) | Supported | Supported | Supported | Supported | -| image-retrieval-0001 | [Image Retrieval Python\* Demo](./python_demos/image_retrieval_demo/README.md) | Supported | Supported | Supported | Supported | -| semantic-segmentation-adas-0001 | [Image Segmentation Demo](./segmentation_demo/README.md) | Supported | Supported | | Supported | -| instance-segmentation-security-0010 | [Instance Segmentation Demo](./python_demos/instance_segmentation_demo/README.md) | Supported | | | Supported | -| instance-segmentation-security-0050 | [Instance Segmentation Demo](./python_demos/instance_segmentation_demo/README.md) | Supported | | | Supported | -| instance-segmentation-security-0083 | [Instance Segmentation Demo](./python_demos/instance_segmentation_demo/README.md) | Supported | | | Supported | -| instance-segmentation-security-1025 | [Instance Segmentation Demo](./python_demos/instance_segmentation_demo/README.md) | Supported | | | Supported | -| age-gender-recognition-retail-0013 | [Interactive Face Detection Demo](./interactive_face_detection_demo/README.md) | Supported | Supported | Supported | Supported | -| emotions-recognition-retail-0003 | [Interactive Face Detection Demo](./interactive_face_detection_demo/README.md) | Supported | Supported | Supported | Supported | -| face-detection-adas-0001 | [Interactive Face Detection Demo](./interactive_face_detection_demo/README.md) | Supported | Supported | Supported | Supported | -| face-detection-adas-binary-0001 | [Interactive Face Detection Demo](./interactive_face_detection_demo/README.md) | Supported | Supported | | | -| face-detection-retail-0004 | [Interactive Face Detection Demo](./interactive_face_detection_demo/README.md) | Supported | Supported | Supported | Supported | -| facial-landmarks-35-adas-0002 | [Interactive Face Detection Demo](./interactive_face_detection_demo/README.md) | Supported | Supported | Supported | Supported | -| head-pose-estimation-adas-0001 | [Interactive Face Detection Demo](./interactive_face_detection_demo/README.md) | Supported | Supported | Supported | Supported | -| license-plate-recognition-barrier-0001 | [Security Barrier Camera Demo](./security_barrier_camera_demo/README.md) | Supported | Supported | Supported | Supported | -| vehicle-attributes-recognition-barrier-0039 | [Security Barrier Camera Demo](./security_barrier_camera_demo/README.md) | Supported | Supported | Supported | Supported | -| vehicle-attributes-recognition-barrier-0042 | [Security Barrier Camera Demo](./security_barrier_camera_demo/README.md) | Supported | | | | -| vehicle-license-plate-detection-barrier-0106 | [Security Barrier Camera Demo](./security_barrier_camera_demo/README.md) | Supported | Supported | Supported | Supported | -| vehicle-license-plate-detection-barrier-0123 | [Security Barrier Camera Demo](./security_barrier_camera_demo/README.md) | Supported | Supported | Supported | Supported | -| landmarks-regression-retail-0009 | [Smart Classroom Demo](./smart_classroom_demo/README.md) | Supported | Supported | Supported | Supported | -| person-detection-action-recognition-0005 | [Smart Classroom Demo](./smart_classroom_demo/README.md) | Supported | Supported | Supported | Supported | -| person-detection-action-recognition-teacher-0002 | [Smart Classroom Demo](./smart_classroom_demo/README.md) | Supported | Supported | | Supported | -| single-human-pose-estimation-0001 | [Single Human Pose Estimation Python\* Demo](./python_demos/single_human_pose_estimation_demo/README.md) | Supported | Supported | | | -| single-image-super-resolution-1032 | [Super Resolution Demo](./super_resolution_demo/README.md) | Supported | Supported | | Supported | -| single-image-super-resolution-1033 | [Super Resolution Demo](./super_resolution_demo/README.md) | Supported | Supported | | Supported | -| text-detection-0003 | [Text Detection Demo](./text_detection_demo/README.md) | Supported | Supported | | Supported | -| text-detection-0004 | [Text Detection Demo](./text_detection_demo/README.md) | Supported | Supported | | Supported | -| text-recognition-0012 | [Text Detection Demo](./text_detection_demo/README.md) | Supported | Supported | | | -| handwritten-japanese-recognition-0001 | [Handwritten Text Recognition Python\* Demo](./python_demos/handwritten_text_recognition_demo/README.md) | Supported | Supported | Supported | | -| handwritten-simplified-chinese-recognition-0001 | [Handwritten Text Recognition Python\* Demo](./python_demos/handwritten_text_recognition_demo/README.md) | Supported | Supported | Supported | | -| gaze-estimation-adas-0002 | [Gaze Estimation Demo](./gaze_estimation_demo/README.md) | Supported | Supported | Supported | Supported | -| head-pose-estimation-adas-0001 | [Gaze Estimation Demo](./gaze_estimation_demo/README.md) | Supported | Supported | Supported | Supported | -| facial-landmarks-35-adas-0002 | [Gaze Estimation Demo](./gaze_estimation_demo/README.md) | Supported | Supported | Supported | Supported | -| pedestrian-and-vehicle-detector-adas-0001 | any demo that supports SSD\*-based models, above | Supported | Supported | Supported | Supported | -| pedestrian-detection-adas-0002 | any demo that supports SSD\*-based models, above | Supported | Supported | Supported | Supported | -| pedestrian-detection-adas-binary-0001 | any demo that supports SSD\*-based models, above | Supported | Supported | | | -| person-detection-retail-0002 | any demo that supports SSD\*-based models, above | Supported | Supported | Supported | Supported | -| person-detection-retail-0013 | any demo that supports SSD\*-based models, above | Supported | Supported | Supported | Supported | -| road-segmentation-adas-0001 | any demo that supports SSD\*-based models, above | Supported | Supported | Supported | Supported | -| vehicle-detection-adas-binary-0001 | any demo that supports SSD\*-based models, above | Supported | Supported | | | -| vehicle-detection-adas-0002 | any demo that supports SSD\*-based models, above | Supported | Supported | Supported | Supported | -| yolo-v2-tiny-vehicle-detection-0001 | [Object Detection for YOLO V3 Python\* Demo](./python_demos/object_detection_demo_yolov3_async/README.md) | Supported | | | | - +|--------------------------------------------------|--------------------------------------------------------------------------------------------------------------|-----------|-----------|-------------|-----------------| +| action-recognition-0001-decoder | [Action Recognition Python\* Demo](./action_recognition/python/README.md) | Supported | Supported | Supported | | +| action-recognition-0001-encoder | [Action Recognition Python\* Demo](./action_recognition/python/README.md) | Supported | Supported | Supported | | +| age-gender-recognition-retail-0013 | [Interactive Face Detection Demo](./interactive_face_detection_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| asl-recognition-0004 | [Gesture Recognition Python\* Demo](./gesture_recognition_demo/python/README.md) | Supported | Supported | | | +| driver-action-recognition-adas-0002-decoder | [Action Recognition Python\* Demo](./action_recognition/python/README.md) | Supported | Supported | Supported | | +| driver-action-recognition-adas-0002-encoder | [Action Recognition Python\* Demo](./action_recognition/python/README.md) | Supported | Supported | Supported | Supported | +| emotions-recognition-retail-0003 | [Interactive Face Detection Demo](./interactive_face_detection_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| face-detection-adas-0001 | [Interactive Face Detection Demo](./interactive_face_detection_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| face-detection-retail-0004 | [Interactive Face Detection Demo](./interactive_face_detection_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| facial-landmarks-35-adas-0002 | [Interactive Face Detection Demo](./interactive_face_detection_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| facial-landmarks-35-adas-0002 | [Gaze Estimation Demo](./gaze_estimation_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| gaze-estimation-adas-0002 | [Gaze Estimation Demo](./gaze_estimation_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| handwritten-japanese-recognition-0001 | [Handwritten Text Recognition Python\* Demo](./handwritten_text_recognition_demo/python/README.md) | Supported | Supported | Supported | | +| handwritten-simplified-chinese-recognition-0001 | [Handwritten Text Recognition Python\* Demo](./handwritten_text_recognition_demo/python/README.md) | Supported | Supported | Supported | | +| head-pose-estimation-adas-0001 | [Interactive Face Detection Demo](./interactive_face_detection_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| head-pose-estimation-adas-0001 | [Gaze Estimation Demo](./gaze_estimation_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| human-pose-estimation-0001 | [Human Pose Estimation Demo](./human_pose_estimation_demo/cpp/README.md)
[Human Pose Estimation Python\* Demo](./human_pose_estimation_demo/python/README.md) | Supported | Supported | Supported | Supported | +| human-pose-estimation-0002 | [Human Pose Estimation Python\* Demo](./human_pose_estimation_demo/python/README.md) | Supported | Supported | | | +| human-pose-estimation-0003 | [Human Pose Estimation Python\* Demo](./human_pose_estimation_demo/python/README.md) | Supported | Supported | | | +| human-pose-estimation-0004 | [Human Pose Estimation Python\* Demo](./human_pose_estimation_demo/python/README.md) | Supported | Supported | | | +| human-pose-estimation-3d-0001 | [3D Human Pose Estimation Python\* Demo](./human_pose_estimation_3d_demo/python/README.md) | Supported | Supported | | | +| image-retrieval-0001 | [Image Retrieval Python\* Demo](./image_retrieval_demo/python/README.md) | Supported | Supported | Supported | Supported | +| instance-segmentation-security-0010 | [Instance Segmentation Python\* Demo](./instance_segmentation_demo/python/README.md) | Supported | | | Supported | +| instance-segmentation-security-0050 | [Instance Segmentation Python\* Demo](./instance_segmentation_demo/python/README.md) | Supported | | | Supported | +| instance-segmentation-security-0083 | [Instance Segmentation Python\* Demo](./instance_segmentation_demo/python/README.md) | Supported | | | Supported | +| instance-segmentation-security-1025 | [Instance Segmentation Python\* Demo](./instance_segmentation_demo/python/README.md) | Supported | | | Supported | +| landmarks-regression-retail-0009 | [Smart Classroom Demo](./smart_classroom_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| license-plate-recognition-barrier-0001 | [Security Barrier Camera Demo](./security_barrier_camera_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| pedestrian-and-vehicle-detector-adas-0001 | any demo that supports SSD\*-based models | Supported | Supported | Supported | Supported | +| pedestrian-detection-adas-0002 | any demo that supports SSD\*-based models | Supported | Supported | Supported | Supported | +| person-attributes-recognition-crossroad-0230 | [Crossroad Camera Demo](./crossroad_camera_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| person-attributes-recognition-crossroad-0234 | [Crossroad Camera Demo](./crossroad_camera_demo/cpp/README.md) | Supported | Supported | Supported | | +| person-attributes-recognition-crossroad-0238 | [Crossroad Camera Demo](./crossroad_camera_demo/cpp/README.md) | Supported | Supported | Supported | | +| person-detection-retail-0002 | [Pedestrian Tracker Demo](./pedestrian_tracker_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| person-detection-retail-0013 | [Object Detection Demo](./object_detection_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| person-reidentification-retail-0277 | [Crossroad Camera Demo](./crossroad_camera_demo/cpp/README.md) | Supported | Supported | | | +| person-reidentification-retail-0286 | [Crossroad Camera Demo](./crossroad_camera_demo/cpp/README.md)
[Multi-Camera Multi-Target Tracking Demo](./multi_camera_multi_target_tracking/python/README.md) | Supported | Supported | | | +| person-reidentification-retail-0287 | [Crossroad Camera Demo](./crossroad_camera_demo/cpp/README.md)
[Multi-Camera Multi-Target Tracking Demo](./multi_camera_multi_target_tracking/python/README.md) | Supported | Supported | | | +| person-reidentification-retail-0288 | [Crossroad Camera Demo](./crossroad_camera_demo/cpp/README.md)
[Multi-Camera Multi-Target Tracking Demo](./multi_camera_multi_target_tracking/python/README.md) | Supported | Supported | | | +| person-vehicle-bike-detection-crossroad-0078 | [Crossroad Camera Demo](./crossroad_camera_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| person-vehicle-bike-detection-crossroad-1016 | [Crossroad Camera Demo](./crossroad_camera_demo/cpp/README.md) | Supported | Supported | Supported | | +| person-vehicle-bike-detection-crossroad-yolov3-1020 | [Object Detection Python\* Demo](./object_detection_demo/python/README.md) | Supported | Supported | Supported | | +| person-detection-action-recognition-0005 | [Smart Classroom Demo](./smart_classroom_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| person-detection-action-recognition-teacher-0002 | [Smart Classroom Demo](./smart_classroom_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| road-segmentation-adas-0001 | [Segmentation Demo](./segmentation_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| semantic-segmentation-adas-0001 | [Image Segmentation Demo](./segmentation_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| single-human-pose-estimation-0001 | [Single Human Pose Estimation Python\* Demo](./single_human_pose_estimation_demo/python/README.md) | Supported | Supported | Supported | | +| single-image-super-resolution-1032 | [Super Resolution Demo](./super_resolution_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| single-image-super-resolution-1033 | [Super Resolution Demo](./super_resolution_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| text-detection-0003 | [Text Detection Demo](./text_detection_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| text-detection-0004 | [Text Detection Demo](./text_detection_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| text-recognition-0012 | [Text Detection Demo](./text_detection_demo/cpp/README.md) | Supported | Supported | Supported | | +| vehicle-attributes-recognition-barrier-0039 | [Security Barrier Camera Demo](./security_barrier_camera_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| vehicle-attributes-recognition-barrier-0042 | [Security Barrier Camera Demo](./security_barrier_camera_demo/cpp/README.md) | Supported | Supported | Supported | | +| vehicle-license-plate-detection-barrier-0106 | [Security Barrier Camera Demo](./security_barrier_camera_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| vehicle-license-plate-detection-barrier-0123 | [Security Barrier Camera Demo](./security_barrier_camera_demo/cpp/README.md) | Supported | Supported | Supported | Supported | +| vehicle-detection-adas-0002 | any demo that supports SSD\*-based models | Supported | Supported | Supported | Supported | +| yolo-v2-tiny-vehicle-detection-0001 | [Object Detection Python\* Demo](./object_detection_demo/python/README.md) | Supported | Supported | Supported | | Notice that the FPGA support comes through a [heterogeneous execution](https://docs.openvinotoolkit.org/latest/_docs_IE_DG_supported_plugins_HETERO.html), for example, when the post-processing is happening on the CPU. @@ -199,7 +202,7 @@ build binaries in Debug configuration. Run the appropriate version of the Microsoft Visual Studio and open the generated solution file from the `C:\Users\\Documents\Intel\OpenVINO\omz_demos_build\Demos.sln` directory. -### Build the Native Python* Extension Modules +### Build the Native Python\* Extension Modules Some of the Python demo applications require native Python extension modules to be built before they can be run. This requires you to have Python development files (headers and import libraries) installed. diff --git a/demos/python_demos/action_recognition/README.md b/demos/action_recognition/python/README.md similarity index 81% rename from demos/python_demos/action_recognition/README.md rename to demos/action_recognition/python/README.md index b5dd49dfb3d..54c0ab53db5 100644 --- a/demos/python_demos/action_recognition/README.md +++ b/demos/action_recognition/python/README.md @@ -1,4 +1,6 @@ -# Action Recognition Python* Demo +# Action Recognition Python\* Demo + +![](./action_recognition.gif) This is the demo application for Action Recognition algorithm, which classifies actions that are being performed on input video. The following pre-trained models are delivered with the product: @@ -33,8 +35,10 @@ You can change the value of `num_requests` in `action_recognition.py` to find an Running the application with the `-h` option yields the following usage message: ``` -usage: action_recognition.py [-h] -i INPUT -m_en M_ENCODER [-m_de M_DECODER] - [-l CPU_EXTENSION] [-d DEVICE] [--fps FPS] +usage: action_recognition.py [-h] -i INPUT [--loop] [-o OUTPUT] + [-limit OUTPUT_LIMIT] + -m_en M_ENCODER [-m_de M_DECODER] + [-l CPU_EXTENSION] [-d DEVICE] [-lb LABELS] [--no_show] [-s LABEL_SMOOTHING] [--seq DECODER_SEQ_SIZE] [-u UTILIZATION_MONITORS] @@ -42,16 +46,20 @@ usage: action_recognition.py [-h] -i INPUT -m_en M_ENCODER [-m_de M_DECODER] Options: -h, --help Show this help message and exit. -i INPUT, --input INPUT - Required. Id of the video capturing device to open (to - open default camera just pass 0), path to a video or a - .txt file with a list of ids or video files (one - object per line) + Required. An input to process. The input must be a single image, + a folder of images, video file or camera id. + --loop Optional. Enable reading the input in a loop. + -o OUTPUT, --output OUTPUT + Optional. Name of output to save. + -limit OUTPUT_LIMIT, --output_limit OUTPUT_LIMIT + Optional. Number of frames to store in output. + If -1 is set, all frames are stored. -m_en M_ENCODER, --m_encoder M_ENCODER - Required. Path to encoder model + Required. Path to encoder model. -m_de M_DECODER, --m_decoder M_DECODER Optional. Path to decoder model. If not specified, simple averaging of encoder's outputs over a time - window is applied + window is applied. -l CPU_EXTENSION, --cpu_extension CPU_EXTENSION Optional. For CPU custom layers, if any. Absolute path to a shared library with the kernels implementation. @@ -59,24 +67,23 @@ Options: Optional. Specify a target device to infer on. CPU, GPU, FPGA, HDDL or MYRIAD is acceptable. The demo will look for a suitable plugin for the device specified. - Default value is CPU - --fps FPS Optional. FPS for renderer + Default value is CPU. -lb LABELS, --labels LABELS - Optional. Path to file with label names - --no_show Optional. Don't show output + Optional. Path to file with label names. + --no_show Optional. Don't show output. -s LABEL_SMOOTHING, --smooth LABEL_SMOOTHING Optional. Number of frames used for output label - smoothing + smoothing. --seq DECODER_SEQ_SIZE Optional. Length of sequence that decoder takes as - input + input. -u UTILIZATION_MONITORS, --utilization-monitors UTILIZATION_MONITORS Optional. List of monitors to show initially. ``` Running the application with an empty list of options yields the usage message given above and an error message. -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). +To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). diff --git a/demos/action_recognition/python/action_recognition.gif b/demos/action_recognition/python/action_recognition.gif new file mode 100644 index 00000000000..60240faa9c5 Binary files /dev/null and b/demos/action_recognition/python/action_recognition.gif differ diff --git a/demos/python_demos/action_recognition/action_recognition.py b/demos/action_recognition/python/action_recognition.py similarity index 74% rename from demos/python_demos/action_recognition/action_recognition.py rename to demos/action_recognition/python/action_recognition.py index 993a0bbc63f..27b215f52cf 100755 --- a/demos/python_demos/action_recognition/action_recognition.py +++ b/demos/action_recognition/python/action_recognition.py @@ -19,47 +19,51 @@ from argparse import ArgumentParser, SUPPRESS from os import path -import numpy as np from openvino.inference_engine import IECore from action_recognition_demo.models import IEModel, DummyDecoder from action_recognition_demo.result_renderer import ResultRenderer from action_recognition_demo.steps import run_pipeline -sys.path.append(path.join(path.dirname(path.dirname(path.abspath(__file__))), 'common')) +sys.path.append(path.join(path.dirname(path.dirname(path.dirname(path.abspath(__file__)))), 'common/python')) import monitors +from images_capture import open_images_capture def build_argparser(): parser = ArgumentParser(add_help=False) args = parser.add_argument_group('Options') args.add_argument('-h', '--help', action='help', default=SUPPRESS, help='Show this help message and exit.') - args.add_argument('-i', '--input', - help='Required. Id of the video capturing device to open (to open default camera just pass 0), ' - 'path to a video or a .txt file with a list of ids or video files (one object per line)', - required=True, type=str) - args.add_argument('-m_en', '--m_encoder', help='Required. Path to encoder model', required=True, type=str) + args.add_argument('-i', '--input', required=True, + help='Required. An input to process. The input must be a single image, ' + 'a folder of images, video file or camera id.') + args.add_argument('--loop', default=False, action='store_true', + help='Optional. Enable reading the input in a loop.') + args.add_argument('-o', '--output', required=False, + help='Optional. Name of output to save.') + args.add_argument('-limit', '--output_limit', required=False, default=1000, type=int, + help='Optional. Number of frames to store in output. ' + 'If -1 is set, all frames are stored.') + args.add_argument('-m_en', '--m_encoder', help='Required. Path to encoder model.', required=True, type=str) decoder_args = args.add_mutually_exclusive_group() decoder_args.add_argument('-m_de', '--m_decoder', help="Optional. Path to decoder model. If not specified, " - "simple averaging of encoder's outputs over a time window is applied", + "simple averaging of encoder's outputs over a time window is applied.", default=None, type=str) decoder_args.add_argument('--seq', dest='decoder_seq_size', - help='Optional. Length of sequence that decoder takes as input', + help='Optional. Length of sequence that decoder takes as input.', default=16, type=int) - args.add_argument('-l', '--cpu_extension', help='Optional. For CPU custom layers, if any. Absolute path to a shared library with the ' 'kernels implementation.', type=str, default=None) args.add_argument('-d', '--device', help='Optional. Specify a target device to infer on. CPU, GPU, FPGA, HDDL or MYRIAD is ' 'acceptable. The demo will look for a suitable plugin for the device specified. ' - 'Default value is CPU', + 'Default value is CPU.', default='CPU', type=str) - args.add_argument('--fps', help='Optional. FPS for renderer', default=30, type=int) - args.add_argument('-lb', '--labels', help='Optional. Path to file with label names', type=str) - args.add_argument('--no_show', action='store_true', help="Optional. Don't show output") - args.add_argument('-s', '--smooth', dest='label_smoothing', help='Optional. Number of frames used for output label smoothing', + args.add_argument('-lb', '--labels', help='Optional. Path to file with label names.', type=str) + args.add_argument('--no_show', action='store_true', help="Optional. Don't show output.") + args.add_argument('-s', '--smooth', dest='label_smoothing', help='Optional. Number of frames used for output label smoothing.', default=30, type=int) args.add_argument('-u', '--utilization-monitors', default='', type=str, help='Optional. List of monitors to show initially.') @@ -70,21 +74,9 @@ def build_argparser(): def main(): args = build_argparser().parse_args() - full_name = path.basename(args.input) - extension = path.splitext(full_name)[1] - - if '.txt' in extension: - with open(args.input) as f: - videos = [line.strip() for line in f.read().split('\n')] - else: - videos = [args.input] - - if not args.input: - raise ValueError('--input option is expected') - if args.labels: with open(args.labels) as f: - labels = [l.strip() for l in f.read().strip().split('\n')] + labels = [line.strip() for line in f] else: labels = None @@ -118,9 +110,10 @@ def main(): decoder_seq_size = args.decoder_seq_size presenter = monitors.Presenter(args.utilization_monitors, 70) - result_presenter = ResultRenderer(no_show=args.no_show, presenter=presenter, labels=labels, + result_presenter = ResultRenderer(no_show=args.no_show, presenter=presenter, output=args.output, limit=args.output_limit, labels=labels, label_smoothing_window=args.label_smoothing) - run_pipeline(videos, encoder, decoder, result_presenter.render_frame, decoder_seq_size=decoder_seq_size, fps=args.fps) + cap = open_images_capture(args.input, args.loop) + run_pipeline(cap, encoder, decoder, result_presenter.render_frame, decoder_seq_size=decoder_seq_size, fps=cap.fps()) print(presenter.reportMeans()) diff --git a/demos/python_demos/action_recognition/action_recognition_demo/__init__.py b/demos/action_recognition/python/action_recognition_demo/__init__.py similarity index 100% rename from demos/python_demos/action_recognition/action_recognition_demo/__init__.py rename to demos/action_recognition/python/action_recognition_demo/__init__.py diff --git a/demos/python_demos/action_recognition/action_recognition_demo/meters.py b/demos/action_recognition/python/action_recognition_demo/meters.py similarity index 100% rename from demos/python_demos/action_recognition/action_recognition_demo/meters.py rename to demos/action_recognition/python/action_recognition_demo/meters.py diff --git a/demos/python_demos/action_recognition/action_recognition_demo/models.py b/demos/action_recognition/python/action_recognition_demo/models.py similarity index 100% rename from demos/python_demos/action_recognition/action_recognition_demo/models.py rename to demos/action_recognition/python/action_recognition_demo/models.py diff --git a/demos/python_demos/action_recognition/action_recognition_demo/pipeline.py b/demos/action_recognition/python/action_recognition_demo/pipeline.py similarity index 100% rename from demos/python_demos/action_recognition/action_recognition_demo/pipeline.py rename to demos/action_recognition/python/action_recognition_demo/pipeline.py diff --git a/demos/python_demos/action_recognition/action_recognition_demo/queue.py b/demos/action_recognition/python/action_recognition_demo/queue.py similarity index 100% rename from demos/python_demos/action_recognition/action_recognition_demo/queue.py rename to demos/action_recognition/python/action_recognition_demo/queue.py diff --git a/demos/python_demos/action_recognition/action_recognition_demo/result_renderer.py b/demos/action_recognition/python/action_recognition_demo/result_renderer.py similarity index 86% rename from demos/python_demos/action_recognition/action_recognition_demo/result_renderer.py rename to demos/action_recognition/python/action_recognition_demo/result_renderer.py index 80da3643039..c9d1c7703e9 100644 --- a/demos/python_demos/action_recognition/action_recognition_demo/result_renderer.py +++ b/demos/action_recognition/python/action_recognition_demo/result_renderer.py @@ -31,10 +31,13 @@ class ResultRenderer: - def __init__(self, no_show, presenter, display_fps=False, display_confidence=True, number_of_predictions=1, + def __init__(self, no_show, presenter, output, limit, display_fps=False, display_confidence=True, number_of_predictions=1, label_smoothing_window=30, labels=None, output_height=720): self.no_show = no_show self.presenter = presenter + self.output = output + self.limit = limit + self.video_writer = cv2.VideoWriter() self.number_of_predictions = number_of_predictions self.display_confidence = display_confidence self.display_fps = display_fps @@ -50,7 +53,7 @@ def update_timers(self, timers): self.meters['decoder'].update(timers['decoder']) return self.meters['encoder'].avg + self.meters['decoder'].avg - def render_frame(self, frame, logits, timers, frame_ind): + def render_frame(self, frame, logits, timers, frame_ind, fps): inference_time = self.update_timers(timers) if logits is not None: @@ -82,12 +85,22 @@ def render_frame(self, frame, logits, timers, frame_ind): cv2.putText(frame, display_text, text_loc, FONT_STYLE, FONT_SIZE, FONT_COLOR) + if self.output and not self.video_writer.isOpened(): + self.video_writer = cv2.VideoWriter(self.output, cv2.VideoWriter_fourcc(*'MJPG'), fps, + (frame.shape[1], frame.shape[0])) + if not self.video_writer.isOpened(): + print("Error: Can't open video writer") + return -1 + if self.display_fps: fps = 1000 / (inference_time + 1e-6) text_loc = (TEXT_LEFT_MARGIN, TEXT_VERTICAL_INTERVAL * (len(labels) + 1)) cv2.putText(frame, "Inference time: {:.2f}ms ({:.2f} FPS)".format(inference_time, fps), text_loc, FONT_STYLE, FONT_SIZE, FONT_COLOR) + if self.video_writer.isOpened() and (self.limit == -1 or frame_ind <= self.limit-1): + self.video_writer.write(frame) + if not self.no_show: cv2.imshow("Action Recognition", frame) diff --git a/demos/python_demos/action_recognition/action_recognition_demo/steps.py b/demos/action_recognition/python/action_recognition_demo/steps.py similarity index 80% rename from demos/python_demos/action_recognition/action_recognition_demo/steps.py rename to demos/action_recognition/python/action_recognition_demo/steps.py index 067599735cf..e0bf46a2063 100644 --- a/demos/python_demos/action_recognition/action_recognition_demo/steps.py +++ b/demos/action_recognition/python/action_recognition_demo/steps.py @@ -16,7 +16,6 @@ import time from collections import deque -from itertools import cycle import cv2 import numpy as np @@ -27,9 +26,9 @@ from .queue import Signal -def run_pipeline(video, encoder, decoder, render_fn, decoder_seq_size=16, fps=30): +def run_pipeline(capture, encoder, decoder, render_fn, decoder_seq_size=16, fps=30): pipeline = AsyncPipeline() - pipeline.add_step("Data", DataStep(video), parallel=False) + pipeline.add_step("Data", DataStep(capture), parallel=False) pipeline.add_step("Encoder", EncoderStep(encoder), parallel=False) pipeline.add_step("Decoder", DecoderStep(decoder, sequence_size=decoder_seq_size), parallel=False) pipeline.add_step("Render", RenderStep(render_fn, fps=fps), parallel=True) @@ -41,40 +40,21 @@ def run_pipeline(video, encoder, decoder, render_fn, decoder_seq_size=16, fps=30 class DataStep(PipelineStep): - def __init__(self, video_list, loop=True): + def __init__(self, capture): super().__init__() - self.video_list = video_list - self.cap = None - - if loop: - self._video_cycle = cycle(self.video_list) - else: - self._video_cycle = iter(self.video_list) + self.cap = capture def setup(self): - self._open_video() + pass def process(self, item): - if not self.cap.isOpened() and not self._open_video(): - return Signal.STOP - status, frame = self.cap.read() - if not status: + frame = self.cap.read() + if frame is None: return Signal.STOP return frame def end(self): - self.cap.release() - - def _open_video(self): - next_video = next(self._video_cycle) - try: - next_video = int(next_video) - except ValueError: - pass - self.cap = cv2.VideoCapture(next_video) - if not self.cap.isOpened(): - return False - return True + pass class EncoderStep(PipelineStep): @@ -150,7 +130,7 @@ def process(self, item): self._sync_time() # status = None render_start = time.time() - status = self.render(*item, self._frames_processed) + status = self.render(*item, self._frames_processed, self.fps) self._render_time.update(time.time() - render_start) self._frames_processed += 1 diff --git a/demos/python_demos/action_recognition/action_recognition_demo/timer.py b/demos/action_recognition/python/action_recognition_demo/timer.py similarity index 94% rename from demos/python_demos/action_recognition/action_recognition_demo/timer.py rename to demos/action_recognition/python/action_recognition_demo/timer.py index bec45207d11..92907a4ef4f 100644 --- a/demos/python_demos/action_recognition/action_recognition_demo/timer.py +++ b/demos/action_recognition/python/action_recognition_demo/timer.py @@ -60,6 +60,8 @@ def time_section(self): self.tock() def __repr__(self): + if not self._times: + return "{} ms (+/-: {}) {} fps".format(float("nan"), float("nan"), float("nan")) return "{:.2f}ms (+/-: {:.2f}) {:.2f}fps".format(self.avg, self.std, self.fps) diff --git a/demos/python_demos/action_recognition/driver_actions.txt b/demos/action_recognition/python/driver_actions.txt similarity index 100% rename from demos/python_demos/action_recognition/driver_actions.txt rename to demos/action_recognition/python/driver_actions.txt diff --git a/demos/python_demos/action_recognition/models.lst b/demos/action_recognition/python/models.lst similarity index 100% rename from demos/python_demos/action_recognition/models.lst rename to demos/action_recognition/python/models.lst diff --git a/demos/python_demos/action_recognition/weld_defects.txt b/demos/action_recognition/python/weld_defects.txt similarity index 100% rename from demos/python_demos/action_recognition/weld_defects.txt rename to demos/action_recognition/python/weld_defects.txt diff --git a/demos/python_demos/bert_question_answering_demo/README.md b/demos/bert_question_answering_demo/python/README.md similarity index 89% rename from demos/python_demos/bert_question_answering_demo/README.md rename to demos/bert_question_answering_demo/python/README.md index 38a283b0918..e3d9dd5bf9e 100644 --- a/demos/python_demos/bert_question_answering_demo/README.md +++ b/demos/bert_question_answering_demo/python/README.md @@ -1,4 +1,4 @@ -# BERT Question Answering Python* Demo +# BERT Question Answering Python\* Demo This README describes the Question Answering demo application that uses a Squad-tuned BERT model for inference. @@ -17,20 +17,25 @@ python3 question_answering_demo.py -h ``` The command yields the following usage message: ``` -usage: question_answering_demo.py [-h] -v VOCAB -m MODEL -i INPUT - [--input_names INPUT_NAMES] - [--output_names OUTPUT_NAMES] - [--model_squad_ver MODEL_SQUAD_VER] - [-a MAX_ANSWER_TOKEN_NUM] [-d DEVICE] +usage: bert_question_answering_demo.py [-h] -v VOCAB -m MODEL -i INPUT + [--questions QUESTION [QUESTION ...]] + [--input_names INPUT_NAMES] + [--output_names OUTPUT_NAMES] + [--model_squad_ver MODEL_SQUAD_VER] + [-q MAX_QUESTION_TOKEN_NUM] + [-a MAX_ANSWER_TOKEN_NUM] [-d DEVICE] + [-r] [-c] Options: -h, --help Show this help message and exit. -v VOCAB, --vocab VOCAB - Required. path to vocabulary file with tokens + Required. path to the vocabulary file with tokens -m MODEL, --model MODEL Required. Path to an .xml file with a trained model -i INPUT, --input INPUT - Required. Url to a page with context + Required. URL to a page with context + --questions QUESTION [QUESTION ...] + Optional. Prepared questions --input_names INPUT_NAMES Optional. Inputs names for the network. Default values are "input_ids,attention_mask,token_type_ids" diff --git a/demos/python_demos/bert_question_answering_demo/bert_question_answering_demo.py b/demos/bert_question_answering_demo/python/bert_question_answering_demo.py similarity index 93% rename from demos/python_demos/bert_question_answering_demo/bert_question_answering_demo.py rename to demos/bert_question_answering_demo/python/bert_question_answering_demo.py index ec4451334d8..c494f8e889b 100755 --- a/demos/python_demos/bert_question_answering_demo/bert_question_answering_demo.py +++ b/demos/bert_question_answering_demo/python/bert_question_answering_demo.py @@ -16,15 +16,15 @@ limitations under the License. """ import logging as log -import os import sys import time from argparse import ArgumentParser, SUPPRESS +from pathlib import Path import numpy as np from openvino.inference_engine import IECore -sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'common')) +sys.path.append(str(Path(__file__).resolve().parents[2] / 'common/python')) from tokens_bert import text_to_tokens, load_vocab_file from html_reader import get_paragraphs @@ -36,10 +36,11 @@ def build_argparser(): args.add_argument("-v", "--vocab", help="Required. path to the vocabulary file with tokens", required=True, type=str) args.add_argument("-m", "--model", help="Required. Path to an .xml file with a trained model", - required=True, type=str) + required=True, type=Path) args.add_argument("-i", "--input", help="Required. URL to a page with context", action='append', required=True, type=str) + args.add_argument("--questions", type=str, nargs='+', metavar='QUESTION', help="Optional. Prepared questions") args.add_argument("--input_names", help="Optional. Inputs names for the network. " "Default values are \"input_ids,attention_mask,token_type_ids\" ", @@ -70,13 +71,13 @@ def build_argparser(): def find_sentence_range(context, s, e): # find start of sentence for c_s in range(s, max(-1, s - 200), -1): - if context[c_s] in "\n\.": + if context[c_s] in "\n.": c_s += 1 break # find end of sentence for c_e in range(max(0, e - 1), min(len(context), e + 200), +1): - if context[c_e] in "\n\.": + if context[c_e] in "\n.": break return c_s, c_e @@ -113,7 +114,7 @@ def main(): # read IR model_xml = args.model - model_bin = os.path.splitext(model_xml)[0] + ".bin" + model_bin = model_xml.with_suffix(".bin") log.info("Loading network files:\n\t{}\n\t{}".format(model_xml, model_bin)) ie_encoder = ie.read_network(model=model_xml, weights=model_bin) @@ -157,10 +158,19 @@ def main(): log.info("Loading model to the {}".format(args.device)) ie_encoder_exec = ie.load_network(network=ie_encoder, device_name=args.device) - # loop on user's questions - while True: - question = input('Type question (empty string to exit):') - if not question: + if args.questions: + def questions(): + for question in args.questions: + log.info("Question: {}".format(question)) + yield question + else: + def questions(): + while True: + yield input('Type question (empty string to exit):') + + # loop on user's or prepared questions + for question in questions(): + if not question.strip(): break q_tokens_id, _ = text_to_tokens(question.lower(), vocab) @@ -208,7 +218,7 @@ def main(): input_names[2]: np.array([token_type_ids], dtype=np.int32), } if len(input_names)>3: - inputs[input_names[3]] = np.arange(len(input_ids), dtype=np.int32)[None,:] + inputs[input_names[3]] = np.arange(len(input_ids), dtype=np.int32)[None, :] t_start = time.perf_counter() # infer by IE diff --git a/demos/python_demos/bert_question_answering_demo/models.lst b/demos/bert_question_answering_demo/python/models.lst similarity index 100% rename from demos/python_demos/bert_question_answering_demo/models.lst rename to demos/bert_question_answering_demo/python/models.lst diff --git a/demos/python_demos/bert_question_answering_demo/requirements.txt b/demos/bert_question_answering_demo/python/requirements.txt similarity index 100% rename from demos/python_demos/bert_question_answering_demo/requirements.txt rename to demos/bert_question_answering_demo/python/requirements.txt diff --git a/demos/python_demos/bert_question_answering_embedding_demo/README.md b/demos/bert_question_answering_embedding_demo/python/README.md similarity index 95% rename from demos/python_demos/bert_question_answering_embedding_demo/README.md rename to demos/bert_question_answering_embedding_demo/python/README.md index d9c9953a44f..c1caaae87ec 100644 --- a/demos/python_demos/bert_question_answering_embedding_demo/README.md +++ b/demos/bert_question_answering_embedding_demo/python/README.md @@ -1,6 +1,6 @@ # BERT Question Answering Embedding Python\* Demo -This README describes the Question Answering Embedding demo application that uses a Squad-tuned BERT model to calculate embedding vectors for context and question to find right context for question. The primary difference from the [bert_question_answering_demo](../bert_question_answering_demo/README.md) is that this demo domonstrates how the inference can be accelerated via pre-computing the embeddings for the contexts. +This README describes the Question Answering Embedding demo application that uses a Squad-tuned BERT model to calculate embedding vectors for context and question to find right context for question. The primary difference from the [bert_question_answering_demo](../../bert_question_answering_demo/python/README.md) is that this demo demonstrates how the inference can be accelerated via pre-computing the embeddings for the contexts. ## How It Works @@ -22,6 +22,7 @@ If second (conventional SQuAD-tuned) Bert model is provided as well, it is used Running the application with the `-h` option yields the following usage message: ``` usage: bert_question_answering_embedding_demo.py [-h] -i INPUT + [--questions QUESTION [QUESTION ...]] [--best_n BEST_N] -v VOCAB -m_emb MODEL_EMB [--input_names_emb INPUT_NAMES_EMB] @@ -35,6 +36,8 @@ Options: -h, --help Show this help message and exit. -i INPUT, --input INPUT Required. Urls to a wiki pages with context + --questions QUESTION [QUESTION ...] + Optional. Prepared questions --best_n BEST_N Optional. Number of best (closest) contexts selected -v VOCAB, --vocab VOCAB Required. Path to vocabulary file with tokens diff --git a/demos/python_demos/bert_question_answering_embedding_demo/bert_question_answering_embedding_demo.py b/demos/bert_question_answering_embedding_demo/python/bert_question_answering_embedding_demo.py similarity index 90% rename from demos/python_demos/bert_question_answering_embedding_demo/bert_question_answering_embedding_demo.py rename to demos/bert_question_answering_embedding_demo/python/bert_question_answering_embedding_demo.py index ef484ed4d60..8546934bbdc 100755 --- a/demos/python_demos/bert_question_answering_embedding_demo/bert_question_answering_embedding_demo.py +++ b/demos/bert_question_answering_embedding_demo/python/bert_question_answering_embedding_demo.py @@ -16,19 +16,20 @@ limitations under the License. """ import sys -import os import time import logging as log from argparse import ArgumentParser, SUPPRESS +from pathlib import Path import numpy as np -from openvino.inference_engine import IENetwork, IECore +from openvino.inference_engine import IECore -sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'common')) +sys.path.append(str(Path(__file__).resolve().parents[2] / 'common/python')) from tokens_bert import text_to_tokens, load_vocab_file from html_reader import get_paragraphs + def build_argparser(): parser = ArgumentParser(add_help=False) args = parser.add_argument_group('Options') @@ -37,6 +38,7 @@ def build_argparser(): help="Required. Urls to a wiki pages with context", action='append', required=True, type=str) + args.add_argument("--questions", type=str, nargs='+', metavar='QUESTION', help="Optional. Prepared questions") args.add_argument("--best_n", help="Optional. Number of best (closest) contexts selected", default=10, @@ -44,19 +46,21 @@ def build_argparser(): args.add_argument("-v", "--vocab", help="Required. Path to vocabulary file with tokens", required=True, type=str) - args.add_argument("-m_emb","--model_emb", + args.add_argument("-m_emb", "--model_emb", help="Required. Path to an .xml file with a trained model to build embeddings", - required=True, type=str) + required=True, type=Path) args.add_argument("--input_names_emb", - help="Optional. Names for inputs in MODEL_EMB network. For example 'input_ids,attention_mask,token_type_ids','position_ids'", + help="Optional. Names for inputs in MODEL_EMB network. " + "For example 'input_ids,attention_mask,token_type_ids','position_ids'", default='input_ids,attention_mask,token_type_ids,position_ids', required=False, type=str) - args.add_argument("-m_qa","--model_qa", + args.add_argument("-m_qa", "--model_qa", help="Optional. Path to an .xml file with a trained model to give exact answer", default = None, - required=False,type=str) + required=False, type=Path) args.add_argument("--input_names_qa", - help="Optional. Names for inputs in MODEL_QA network. For example 'input_ids,attention_mask,token_type_ids','position_ids'", + help="Optional. Names for inputs in MODEL_QA network. " + "For example 'input_ids,attention_mask,token_type_ids','position_ids'", default='input_ids,attention_mask,token_type_ids,position_ids', required=False, type=str) args.add_argument("--output_names_qa", @@ -68,8 +72,8 @@ def build_argparser(): default=15, required=False, type=int) args.add_argument("-d", "--device", - help="Optional. Specify the target device to infer on; CPU is " - "acceptable. Sample will look for a suitable plugin for device specified. Default value is CPU", + help="Optional. Specify the target device to infer on; CPU is acceptable. " + "Sample will look for a suitable plugin for device specified. Default value is CPU", default="CPU", required=False, type=str) args.add_argument('-c', '--colors', action='store_true', @@ -77,6 +81,7 @@ def build_argparser(): "Might not work on some terminals (like Windows* cmd console)") return parser + def main(): log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout) args = build_argparser().parse_args() @@ -86,7 +91,7 @@ def main(): #read model to calculate embedding model_xml_emb = args.model_emb - model_bin_emb = os.path.splitext(model_xml_emb)[0] + ".bin" + model_bin_emb = model_xml_emb.with_suffix(".bin") log.info("Loading embedding network files:\n\t{}\n\t{}".format(model_xml_emb, model_bin_emb)) ie_encoder_emb = ie.read_network(model=model_xml_emb, weights=model_bin_emb) @@ -111,10 +116,10 @@ def main(): max_length_c = 384 max_length_q = 32 - for l in [max_length_q, max_length_c]: + for length in [max_length_q, max_length_c]: new_shapes = {} - for i,input_info in ie_encoder_emb.input_info.items(): - new_shapes[i] = [1, l] + for i, input_info in ie_encoder_emb.input_info.items(): + new_shapes[i] = [1, length] log.info("Reshaped input {} from {} to the {}".format( i, input_info.input_data.shape, @@ -130,12 +135,12 @@ def main(): # Loading model to the plugin log.info("Loading model to the plugin") - ie_encoder_exec_emb_dict[l] = ie.load_network(network=ie_encoder_emb, device_name=args.device) + ie_encoder_exec_emb_dict[length] = ie.load_network(network=ie_encoder_emb, device_name=args.device) # Read model for final exact qa if args.model_qa: model_xml = args.model_qa - model_bin = os.path.splitext(model_xml)[0] + ".bin" + model_bin = model_xml.with_suffix(".bin") log.info("Loading network files:\n\t{}\n\t{}".format(model_xml, model_bin)) ie_encoder_qa = ie.read_network(model=model_xml, weights=model_bin) @@ -224,7 +229,7 @@ def __init__(self, context, c_tokens_id, c_tokens_se): c_wnd_len = max_length_qc - (max_length_q + 3) else: #to make context be able to pass model_emb without question - c_wnd_len = max_length_c - 2 + c_wnd_len = max_length_c - 2 # token num between 2 neighbours context windows # 1/2 means that context windows are interleaved by half @@ -248,10 +253,19 @@ def __init__(self, context, c_tokens_id, c_tokens_se): c_s, c_e = c_s -shift_left, c_e-shift_left assert c_s >= 0, "start can be left of 0 only with window less than len but in this case we can not be here" - #loop to ask many questions - while True: - question = input('Type question (enter to exit):') - if not question: + if args.questions: + def questions(): + for question in args.questions: + log.info("Question: {}".format(question)) + yield question + else: + def questions(): + while True: + yield input('Type question (empty string to exit):') + + # loop on user's or prepared questions + for question in questions(): + if not question.strip(): break log.info("---Stage 1---Calc question embedding and compare with {} context embeddings".format(len(contexts_all))) @@ -285,7 +299,7 @@ def __init__(self, context, c_tokens_id, c_tokens_se): assert pad_len >= 0 input_ids = tok_cls + q_tokens_id + tok_sep + c_data.c_tokens_id + tok_sep + tok_pad*pad_len - token_type_ids = [0]*(len(q_tokens_id)+2) + [1] * (len(c_data.c_tokens_id)+1) + tok_pad * pad_len + token_type_ids = [0] * (len(q_tokens_id)+2) + [1] * (len(c_data.c_tokens_id)+1) + tok_pad * pad_len attention_mask = [1] * req_len + [0] * pad_len #create numpy inputs for IE diff --git a/demos/python_demos/bert_question_answering_embedding_demo/models.lst b/demos/bert_question_answering_embedding_demo/python/models.lst similarity index 100% rename from demos/python_demos/bert_question_answering_embedding_demo/models.lst rename to demos/bert_question_answering_embedding_demo/python/models.lst diff --git a/demos/python_demos/bert_question_answering_embedding_demo/requirements.txt b/demos/bert_question_answering_embedding_demo/python/requirements.txt similarity index 100% rename from demos/python_demos/bert_question_answering_embedding_demo/requirements.txt rename to demos/bert_question_answering_embedding_demo/python/requirements.txt diff --git a/demos/classification_demo/classification_demo.hpp b/demos/classification_demo/classification_demo.hpp deleted file mode 100644 index cd44c754a10..00000000000 --- a/demos/classification_demo/classification_demo.hpp +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (C) 2018-2019 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include -#include -#include -#include - -static const char help_message[] = "Print a usage message."; -static const char image_message[] = "Required. Path to a folder with images or path to an image file."; -static const char model_message[] = "Required. Path to an .xml file with a trained model."; -static const char labels_message[] = "Required. Path to .txt file with labels."; -static const char gt_message[] = "Optional. Path to ground truth .txt file."; -static const char target_device_message[] = "Optional. Specify the target device to infer on (the list of available " - "devices is shown below). Default value is CPU. " - "Sample will look for a suitable plugin for device specified."; -static const char batch_size_message[] = "Optional. Specify batch to infer. " - "Default value is 1. The following models: googlenet-v4-tf, " - "resnet18-xnor-binary-onnx-0001, resnet50-binary-0001, support only default " - "batch size."; -static const char num_threads_message[] = "Optional. Specify count of threads."; -static const char num_streams_message[] = "Optional. Specify count of streams."; -static const char num_inf_req_message[] = "Optional. Number of infer requests."; -static const char image_grid_resolution_message[] = "Optional. Set image grid resolution in format WxH. " - "Default value is 1280x720."; -static const char ntop_message[] = "Optional. Number of top results. Default value is 5. Must be >= 1."; -static const char custom_cldnn_message[] = "Required for GPU custom kernels. " - "Absolute path to the .xml file with kernels description."; -static const char custom_cpu_library_message[] = "Required for CPU custom layers." - "Absolute path to a shared library with the kernels implementation."; -static const char no_show_message[] = "Optional. Disable showing of processed images."; -static const char execution_time_message[] = "Optional. Time in seconds to execute program. " - "Default is -1 (infinite time)."; -static const char utilization_monitors_message[] = "Optional. List of monitors to show initially."; - -DEFINE_bool(h, false, help_message); -DEFINE_string(i, "", image_message); -DEFINE_string(m, "", model_message); -DEFINE_string(labels, "", labels_message); -DEFINE_string(gt, "", gt_message); -DEFINE_string(d, "CPU", target_device_message); -DEFINE_uint32(b, 1, batch_size_message); -DEFINE_uint32(nthreads, 0, num_threads_message); -DEFINE_string(nstreams, "", num_streams_message); -DEFINE_uint32(nireq, 0, num_inf_req_message); -DEFINE_uint32(nt, 5, ntop_message); -DEFINE_string(res, "1280x720", image_grid_resolution_message); -DEFINE_string(c, "", custom_cldnn_message); -DEFINE_string(l, "", custom_cpu_library_message); -DEFINE_bool(no_show, false, no_show_message); -DEFINE_int32(time, -1, execution_time_message); -DEFINE_string(u, "", utilization_monitors_message); - -static void showUsage() { - std::cout << std::endl; - std::cout << "classification_demo [OPTION]" << std::endl; - std::cout << "Options:" << std::endl; - std::cout << std::endl; - std::cout << " -h " << help_message << std::endl; - std::cout << " -i \"\" " << image_message << std::endl; - std::cout << " -m \"\" " << model_message << std::endl; - std::cout << " -l \"\" " << custom_cpu_library_message << std::endl; - std::cout << " Or" << std::endl; - std::cout << " -c \"\" " << custom_cldnn_message << std::endl; - std::cout << " -labels \"\" " << labels_message << std::endl; - std::cout << " -gt \"\" " << gt_message << std::endl; - std::cout << " -d \"\" " << target_device_message << std::endl; - std::cout << " -b \"\" " << batch_size_message << std::endl; - std::cout << " -nthreads \"\" " << num_threads_message << std::endl; - std::cout << " -nstreams \"\" " << num_streams_message << std::endl; - std::cout << " -nireq \"\" " << num_inf_req_message << std::endl; - std::cout << " -nt \"\" " << ntop_message << std::endl; - std::cout << " -res \"\" " << image_grid_resolution_message << std::endl; - std::cout << " -no_show " << no_show_message << std::endl; - std::cout << " -time \"\" " << execution_time_message << std::endl; - std::cout << " -u " << utilization_monitors_message << std::endl; -} diff --git a/demos/classification_demo/CMakeLists.txt b/demos/classification_demo/cpp/CMakeLists.txt similarity index 57% rename from demos/classification_demo/CMakeLists.txt rename to demos/classification_demo/cpp/CMakeLists.txt index af4b2250547..b523954b777 100644 --- a/demos/classification_demo/CMakeLists.txt +++ b/demos/classification_demo/cpp/CMakeLists.txt @@ -2,11 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 # -file (GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) -file (GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +file(GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) +file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) ie_add_sample(NAME classification_demo SOURCES ${SOURCES} HEADERS ${HEADERS} - DEPENDENCIES monitors + DEPENDENCIES monitors models pipelines OPENCV_DEPENDENCIES core highgui) diff --git a/demos/classification_demo/README.md b/demos/classification_demo/cpp/README.md similarity index 87% rename from demos/classification_demo/README.md rename to demos/classification_demo/cpp/README.md index 5a9291a4544..2f1621fdb31 100644 --- a/demos/classification_demo/README.md +++ b/demos/classification_demo/cpp/README.md @@ -9,7 +9,7 @@ You can use the following pre-trained models with the demo: * `vgg19` * all other classification models (please, check [models.lst](./models.lst) file) -For more information about the pre-trained models, refer to the [model documentation](../../models/public/index.md). +For more information about the pre-trained models, refer to the [model documentation](../../../models/public/index.md). ## How It Works @@ -25,10 +25,8 @@ You can stop the demo by pressing "Esc" or "Q" button. After that, the average m ## Running -Running the application with the -h option yields the following usage message: -```sh -./classification_demo -h - +Running the application with the `-h` option yields the following usage message: +``` classification_demo [OPTION] Options: @@ -38,10 +36,11 @@ Options: -l "" Required for CPU custom layers.Absolute path to a shared library with the kernels implementation. Or -c "" Required for GPU custom kernels. Absolute path to the .xml file with kernels description. + -pc Optional. Enables per-layer performance report. + -auto_resize Optional. Enables resizable input with support of ROI crop & auto resize. -labels "" Required. Path to .txt file with labels. -gt "" Optional. Path to ground truth .txt file. -d "" Optional. Specify the target device to infer on (the list of available devices is shown below). Default value is CPU. Sample will look for a suitable plugin for device specified. - -b "" Optional. Specify batch to infer. Default value is 1. The following models: googlenet-v4-tf, resnet18-xnor-binary-onnx-0001, resnet50-binary-0001, support only default batch size. -nthreads "" Optional. Specify count of threads. -nstreams "" Optional. Specify count of streams. -nireq "" Optional. Number of infer requests. @@ -58,7 +57,7 @@ For higher FPS, using `-nireq` which slightly exceeds `-nstreams` value summed o Running the application with the empty list of options yields an error message. -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). +To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). @@ -83,7 +82,7 @@ If you want to see classification results, you must use "-gt" and "-labels" flag It has the following format: -```sh +``` ./ILSVRC2012_val_00000001.JPEG 65 ./ILSVRC2012_val_00000002.JPEG 970 ./ILSVRC2012_val_00000003.JPEG 230 @@ -94,7 +93,7 @@ Class index values must be in range from 0 to 1000. If you want to use "other" c "Labels" file contains the list of human-readable labels, one line for each class. -Please note that you should use [imagenet_2015_classes.txt](./imagenet_2015_classes.txt) labels file with the following models: +Please note that you should use [imagenet_2015.txt](../../../data/dataset_classes/imagenet_2015.txt) labels file with the following models: - googlenet-v2 - se-inception - se-resnet-101 @@ -103,9 +102,9 @@ Please note that you should use [imagenet_2015_classes.txt](./imagenet_2015_clas - se-resnext-101 - se-resnext-50 -and [imagenet_2012_classes.txt](./imagenet_2012_classes.txt) labels file with all other models supported by the demo. +and [imagenet_2012.txt](../../../data/dataset_classes/imagenet_2012.txt) labels file with all other models supported by the demo. ## See Also -* [Using Open Model Zoo demos](../README.md) +* [Using Open Model Zoo demos](../../README.md) * [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) -* [Model Downloader](../../tools/downloader/README.md) +* [Model Downloader](../../../tools/downloader/README.md) diff --git a/demos/classification_demo/cpp/grid_mat.hpp b/demos/classification_demo/cpp/grid_mat.hpp new file mode 100644 index 00000000000..edf63a094df --- /dev/null +++ b/demos/classification_demo/cpp/grid_mat.hpp @@ -0,0 +1,135 @@ +// Copyright (C) 2018-2019 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include +#include +#include +#include +#include + +#include + +#include +#include + +enum class PredictionResult { Correct, + Incorrect, + Unknown }; + +class GridMat { +public: + cv::Mat outImg; + + explicit GridMat(Presenter& presenter, + const cv::Size maxDisp = cv::Size{1920, 1080}, + const cv::Size aspectRatio = cv::Size{16, 9}, + double targetFPS = 60 + ): + currSourceId{0} { + cv::Size size(static_cast(std::round(sqrt(1. * targetFPS * aspectRatio.width / aspectRatio.height))), + static_cast(std::round(sqrt(1. * targetFPS * aspectRatio.height / aspectRatio.width)))); + int minCellSize = std::min(maxDisp.width / size.width, maxDisp.height / size.height); + cellSize = cv::Size(minCellSize, minCellSize); + + for (int i = 0; i < size.height; i++) { + for (int j = 0; j < size.width; j++) { + points.emplace_back(cellSize.width * j, presenter.graphSize.height + cellSize.height * i); + } + } + + outImg.create((cellSize.height * size.height) + presenter.graphSize.height, + cellSize.width * size.width, CV_8UC3); + outImg.setTo(0); + + textSize = cv::getTextSize("", fontType, fontScale, thickness, &baseline); + accuracyMessageSize = cv::getTextSize("Accuracy (top 0): 0.000", fontType, fontScale, thickness, &baseline); + testMessageSize = cv::getTextSize(testMessage, fontType, fontScale, thickness, &baseline); + } + + void textUpdate(PerformanceMetrics& metrics, + PerformanceMetrics::TimePoint lastRequestStartTime, + double accuracy, + unsigned int nTop, + bool isFpsTest, + bool showAccuracy, + Presenter& presenter) { + rectangle(outImg, + {0, 0}, {outImg.cols, presenter.graphSize.height}, + cv::Scalar(0, 0, 0), cv::FILLED); + + presenter.drawGraphs(outImg); + + metrics.update(lastRequestStartTime, outImg, cv::Point(textPadding, textSize.height + textPadding), + fontType, fontScale, cv::Scalar(255, 100, 100), thickness); + + if (showAccuracy) { + cv::putText(outImg, + cv::format("Accuracy (top %d): %.3f", nTop, accuracy), + cv::Point(outImg.cols - accuracyMessageSize.width - textPadding, textSize.height + textPadding), + fontType, fontScale, cv::Scalar(255, 255, 255), thickness); + } + + if (isFpsTest) { + cv::putText(outImg, + testMessage, + cv::Point(outImg.cols - testMessageSize.width - textPadding, + (textSize.height + textPadding) * 2), + fontType, fontScale, cv::Scalar(50, 50, 255), thickness); + } + } + + void updateMat(const cv::Mat& mat, const std::string& label, PredictionResult predictionResul) { + if (!prevImg.empty()) { + size_t prevSourceId = currSourceId - 1; + prevSourceId = std::min(prevSourceId, points.size() - 1); + prevImg.copyTo(outImg(cv::Rect(points[prevSourceId], cellSize))); + } + cv::Scalar textColor; + switch (predictionResul) { + case PredictionResult::Correct: + textColor = cv::Scalar(75, 255, 75); break; // green + case PredictionResult::Incorrect: + textColor = cv::Scalar(50, 50, 255); break; // red + case PredictionResult::Unknown: + textColor = cv::Scalar(75, 255, 255); break; // yellow + default: + throw std::runtime_error("Undefined type of prediction result"); + } + int labelThickness = cellSize.width / 20; + cv::Size labelTextSize = cv::getTextSize(label, fontType, 1, 2, &baseline); + double labelFontScale = static_cast(cellSize.width - 2*labelThickness) / labelTextSize.width; + cv::resize(mat, prevImg, cellSize); + cv::putText(prevImg, label, + cv::Point(labelThickness, cellSize.height - labelThickness - labelTextSize.height), + fontType, labelFontScale, textColor, 2); + cv::Mat cell = outImg(cv::Rect(points[currSourceId], cellSize)); + prevImg.copyTo(cell); + cv::rectangle(cell, {0, 0}, {cell.cols, cell.rows}, {255, 50, 50}, labelThickness); // draw a border + + if (currSourceId == points.size() - 1) { + currSourceId = 0; + } else { + currSourceId++; + } + } + +private: + cv::Mat prevImg; + cv::Size cellSize; + size_t currSourceId; + std::vector points; + static const int fontType = cv::FONT_HERSHEY_PLAIN; + static constexpr double fontScale = 1.5; + static const int thickness = 2; + static const int textPadding = 10; + static const std::string testMessage; + int baseline; + cv::Size textSize; + cv::Size accuracyMessageSize; + cv::Size testMessageSize; +}; + +const std::string GridMat::testMessage = "Testing, please wait..."; diff --git a/demos/classification_demo/cpp/main.cpp b/demos/classification_demo/cpp/main.cpp new file mode 100644 index 00000000000..ebcc388b8df --- /dev/null +++ b/demos/classification_demo/cpp/main.cpp @@ -0,0 +1,343 @@ +// Copyright (C) 2018-2019 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "grid_mat.hpp" + +static const char help_message[] = "Print a usage message."; +static const char image_message[] = "Required. Path to a folder with images or path to an image file."; +static const char model_message[] = "Required. Path to an .xml file with a trained model."; +static const char labels_message[] = "Required. Path to .txt file with labels."; +static const char gt_message[] = "Optional. Path to ground truth .txt file."; +static const char target_device_message[] = "Optional. Specify the target device to infer on (the list of available " + "devices is shown below). Default value is CPU. " + "Sample will look for a suitable plugin for device specified."; +static const char num_threads_message[] = "Optional. Specify count of threads."; +static const char num_streams_message[] = "Optional. Specify count of streams."; +static const char num_inf_req_message[] = "Optional. Number of infer requests."; +static const char image_grid_resolution_message[] = "Optional. Set image grid resolution in format WxH. " + "Default value is 1280x720."; +static const char ntop_message[] = "Optional. Number of top results. Default value is 5. Must be >= 1."; +static const char custom_cldnn_message[] = "Required for GPU custom kernels. " + "Absolute path to the .xml file with kernels description."; +static const char custom_cpu_library_message[] = "Required for CPU custom layers." + "Absolute path to a shared library with the kernels implementation."; +static const char input_resizable_message[] = "Optional. Enables resizable input with support of ROI crop & auto resize."; +static const char performance_counter_message[] = "Optional. Enables per-layer performance report."; +static const char no_show_message[] = "Optional. Disable showing of processed images."; +static const char execution_time_message[] = "Optional. Time in seconds to execute program. " + "Default is -1 (infinite time)."; +static const char utilization_monitors_message[] = "Optional. List of monitors to show initially."; + +DEFINE_bool(h, false, help_message); +DEFINE_string(i, "", image_message); +DEFINE_string(m, "", model_message); +DEFINE_string(labels, "", labels_message); +DEFINE_string(gt, "", gt_message); +DEFINE_string(d, "CPU", target_device_message); +DEFINE_uint32(nthreads, 0, num_threads_message); +DEFINE_string(nstreams, "", num_streams_message); +DEFINE_uint32(nireq, 0, num_inf_req_message); +DEFINE_uint32(nt, 5, ntop_message); +DEFINE_string(res, "1280x720", image_grid_resolution_message); +DEFINE_string(c, "", custom_cldnn_message); +DEFINE_string(l, "", custom_cpu_library_message); +DEFINE_bool(auto_resize, false, input_resizable_message); +DEFINE_bool(pc, false, performance_counter_message); +DEFINE_bool(no_show, false, no_show_message); +DEFINE_uint32(time, std::numeric_limits::max(), execution_time_message); +DEFINE_string(u, "", utilization_monitors_message); + +static void showUsage() { + std::cout << std::endl; + std::cout << "classification_demo [OPTION]" << std::endl; + std::cout << "Options:" << std::endl; + std::cout << std::endl; + std::cout << " -h " << help_message << std::endl; + std::cout << " -i \"\" " << image_message << std::endl; + std::cout << " -m \"\" " << model_message << std::endl; + std::cout << " -l \"\" " << custom_cpu_library_message << std::endl; + std::cout << " Or" << std::endl; + std::cout << " -c \"\" " << custom_cldnn_message << std::endl; + std::cout << " -pc " << performance_counter_message << std::endl; + std::cout << " -auto_resize " << input_resizable_message << std::endl; + std::cout << " -labels \"\" " << labels_message << std::endl; + std::cout << " -gt \"\" " << gt_message << std::endl; + std::cout << " -d \"\" " << target_device_message << std::endl; + std::cout << " -nthreads \"\" " << num_threads_message << std::endl; + std::cout << " -nstreams \"\" " << num_streams_message << std::endl; + std::cout << " -nireq \"\" " << num_inf_req_message << std::endl; + std::cout << " -nt \"\" " << ntop_message << std::endl; + std::cout << " -res \"\" " << image_grid_resolution_message << std::endl; + std::cout << " -no_show " << no_show_message << std::endl; + std::cout << " -time \"\" " << execution_time_message << std::endl; + std::cout << " -u " << utilization_monitors_message << std::endl; +} + +bool ParseAndCheckCommandLine(int argc, char *argv[]) { + // ---------------------------Parsing and validation of input args-------------------------------------- + gflags::ParseCommandLineNonHelpFlags(&argc, &argv, true); + if (FLAGS_h) { + showUsage(); + showAvailableDevices(); + return false; + } + slog::info << "Parsing input parameters" << slog::endl; + + if (FLAGS_i.empty()) { + throw std::logic_error("Parameter -i is not set"); + } + + if (FLAGS_m.empty()) { + throw std::logic_error("Parameter -m is not set"); + } + + if (FLAGS_labels.empty()) { + throw std::logic_error("Parameter -labels is not set"); + } + + return true; +} + +cv::Mat centerSquareCrop(const cv::Mat& image) { + if (image.cols >= image.rows) { + return image(cv::Rect((image.cols - image.rows) / 2, 0, image.rows, image.rows)); + } + return image(cv::Rect(0, (image.rows - image.cols) / 2, image.cols, image.cols)); +} + +int main(int argc, char *argv[]) { + try { + PerformanceMetrics metrics; + + slog::info << "InferenceEngine: " << printable(*InferenceEngine::GetInferenceEngineVersion()) << slog::endl; + + // ------------------------------ Parsing and validation of input args --------------------------------- + if (!ParseAndCheckCommandLine(argc, argv)) { + return 0; + } + + //------------------------------- Preparing Input ------------------------------------------------------ + slog::info << "Reading input" << slog::endl; + std::vector imageNames; + std::vector inputImages; + parseInputFilesArguments(imageNames); + if (imageNames.empty()) throw std::runtime_error("No images provided"); + std::sort(imageNames.begin(), imageNames.end()); + for (size_t i = 0; i < imageNames.size(); i++) { + const std::string& name = imageNames[i]; + const cv::Mat& tmpImage = cv::imread(name); + if (tmpImage.data == nullptr) { + std::cerr << "Could not read image " << name << '\n'; + imageNames.erase(imageNames.begin() + i); + i--; + } else { + inputImages.push_back(tmpImage); + size_t lastSlashIdx = name.find_last_of("/\\"); + if (lastSlashIdx != std::string::npos) { + imageNames[i] = name.substr(lastSlashIdx + 1); + } else { + imageNames[i] = name; + } + } + } + + // ----------------------------------------Read image classes----------------------------------------- + std::vector classIndices; + if (!FLAGS_gt.empty()) { + std::map classIndicesMap; + std::ifstream inputGtFile(FLAGS_gt); + if (!inputGtFile.is_open()) throw std::runtime_error("Can't open the ground truth file."); + + std::string line; + while (std::getline(inputGtFile, line)) + { + size_t separatorIdx = line.find(' '); + if (separatorIdx == std::string::npos) { + throw std::runtime_error("The ground truth file has incorrect format."); + } + std::string imagePath = line.substr(0, separatorIdx); + size_t imagePathEndIdx = imagePath.rfind('/'); + unsigned classIndex = static_cast(std::stoul(line.substr(separatorIdx + 1))); + if ((imagePathEndIdx != 1 || imagePath[0] != '.') && imagePathEndIdx != std::string::npos) { + throw std::runtime_error("The ground truth file has incorrect format."); + } + classIndicesMap.insert({imagePath.substr(imagePathEndIdx + 1), classIndex}); + } + + for (size_t i = 0; i < imageNames.size(); i++) { + auto imageSearchResult = classIndicesMap.find(imageNames[i]); + if (imageSearchResult != classIndicesMap.end()) { + classIndices.push_back(imageSearchResult->second); + } else { + throw std::runtime_error("No class specified for image " + imageNames[i]); + } + } + } else { + classIndices.resize(inputImages.size()); + std::fill(classIndices.begin(), classIndices.end(), 0); + } + + //------------------------------ Running Detection routines ---------------------------------------------- + std::vector labels = ClassificationModel::loadLabels(FLAGS_labels); + for (const auto & classIndex : classIndices) { + if (classIndex >= labels.size()) { + throw std::runtime_error("Class index " + std::to_string(classIndex) + + " is outside the range supported by the model."); + } + } + + InferenceEngine::Core core; + AsyncPipeline pipeline(std::unique_ptr(new ClassificationModel(FLAGS_m, FLAGS_nt, FLAGS_auto_resize, labels)), + ConfigFactory::getUserConfig(FLAGS_d, FLAGS_l, FLAGS_c, FLAGS_pc, FLAGS_nireq, FLAGS_nstreams, FLAGS_nthreads), + core); + + Presenter presenter(FLAGS_u, 0); + int width; + int height; + std::vector gridMatRowsCols = split(FLAGS_res, 'x'); + if (gridMatRowsCols.size() != 2) { + throw std::runtime_error("The value of GridMat resolution flag is not valid."); + } else { + width = std::stoi(gridMatRowsCols[0]); + height = std::stoi(gridMatRowsCols[1]); + } + GridMat gridMat(presenter, cv::Size(width, height)); + + bool keepRunning = true; + std::unique_ptr result; + double accuracy = 0; + bool isTestMode = true; + std::chrono::steady_clock::duration elapsedSeconds = std::chrono::steady_clock::duration(0); + std::chrono::seconds testDuration = std::chrono::seconds(3); + std::chrono::seconds fpsCalculationDuration = std::chrono::seconds(1); + unsigned int framesNum = 0; + long long correctPredictionsCount = 0; + unsigned int framesNumOnCalculationStart = 0; + std::size_t nextImageIndex = 0; + std::chrono::steady_clock::time_point startTime = std::chrono::steady_clock::now(); + + while (keepRunning && elapsedSeconds < std::chrono::seconds(FLAGS_time)) { + if (elapsedSeconds >= testDuration - fpsCalculationDuration && framesNumOnCalculationStart == 0) { + framesNumOnCalculationStart = framesNum; + } + if (isTestMode && elapsedSeconds >= testDuration) { + isTestMode = false; + typedef std::chrono::duration Sec; + gridMat = GridMat(presenter, cv::Size(width, height), cv::Size(16, 9), + (framesNum - framesNumOnCalculationStart) / std::chrono::duration_cast( + fpsCalculationDuration).count()); + metrics = PerformanceMetrics(); + startTime = std::chrono::steady_clock::now(); + framesNum = 0; + correctPredictionsCount = 0; + accuracy = 0; + } + + if (pipeline.isReadyToProcess()) { + auto imageStartTime = std::chrono::steady_clock::now(); + cv::Mat curr_frame = centerSquareCrop(inputImages[nextImageIndex]); + + pipeline.submitData(ImageInputData(curr_frame), + std::make_shared(curr_frame, imageStartTime, classIndices[nextImageIndex])); + nextImageIndex++; + if (nextImageIndex == imageNames.size()) { + nextImageIndex = 0; + } + } + + //--- Waiting for free input slot or output data available. Function will return immediately if any of them are available. + pipeline.waitForData(false); + + //--- Checking for results and rendering data if it's ready + while ((result = pipeline.getResult(false)) && keepRunning) { + const ClassificationResult& classificationResult = result->asRef(); + if (!classificationResult.metaData) { + throw std::invalid_argument("Renderer: metadata is null"); + } + const ClassificationImageMetaData& classificationImageMetaData + = classificationResult.metaData->asRef(); + + auto outputImg = classificationImageMetaData.img; + + if (outputImg.empty()) { + throw std::invalid_argument("Renderer: image provided in metadata is empty"); + } + PredictionResult predictionResult = PredictionResult::Incorrect; + if (!FLAGS_gt.empty()) { + for (size_t i = 0; i < FLAGS_nt; i++) { + unsigned predictedClass = classificationResult.topLabels[i].first; + if (predictedClass == classificationImageMetaData.groundTruthId) { + predictionResult = PredictionResult::Correct; + correctPredictionsCount++; + break; + } + } + } else { + predictionResult = PredictionResult::Unknown; + } + framesNum++; + gridMat.updateMat(outputImg, classificationResult.topLabels.front().second, predictionResult); + accuracy = static_cast(correctPredictionsCount) / framesNum; + gridMat.textUpdate(metrics, classificationResult.metaData->asRef().timeStamp, accuracy, FLAGS_nt, isTestMode, + !FLAGS_gt.empty(), presenter); + elapsedSeconds = std::chrono::steady_clock::now() - startTime; + if (!FLAGS_no_show) { + cv::imshow("classification_demo", gridMat.outImg); + //--- Processing keyboard events + int key = cv::waitKey(1); + if (27 == key || 'q' == key || 'Q' == key) { // Esc + keepRunning = false; + } + else { + presenter.handleKey(key); + } + } + } + } + + //// --------------------------- Report metrics ------------------------------------------------------- + slog::info << slog::endl << "Metric reports:" << slog::endl; + metrics.printTotal(); + if (!FLAGS_gt.empty()) { + std::cout << "Accuracy (top " << FLAGS_nt << "): " << accuracy << std::endl; + } + std::cout << presenter.reportMeans() << std::endl; + + slog::info << presenter.reportMeans() << slog::endl; + } + catch (const std::exception& error) { + slog::err << error.what() << slog::endl; + return 1; + } + catch (...) { + slog::err << "Unknown/internal exception happened." << slog::endl; + return 1; + } + + slog::info << slog::endl << "The execution has completed successfully" << slog::endl; + return 0; +} diff --git a/demos/classification_demo/models.lst b/demos/classification_demo/cpp/models.lst similarity index 95% rename from demos/classification_demo/models.lst rename to demos/classification_demo/cpp/models.lst index 1a7012ab64b..7215347c750 100644 --- a/demos/classification_demo/models.lst +++ b/demos/classification_demo/cpp/models.lst @@ -9,6 +9,8 @@ densenet-161-tf densenet-169 densenet-169-tf densenet-201 +densenet-201-tf +dla-34 efficientnet-b0 efficientnet-b0_auto_aug efficientnet-b0-pytorch @@ -43,6 +45,7 @@ octave-resnet-50-0.125 octave-resnext-101-0.25 octave-resnext-50-0.25 octave-se-resnet-50-0.125 +regnetx-3.2gf resnest-50-pytorch resnet-18-pytorch resnet-50-caffe2 @@ -50,6 +53,7 @@ resnet-50-pytorch resnet-50-tf resnet18-xnor-binary-onnx-0001 resnet50-binary-0001 +rexnet-v1-x1.0 se-inception se-resnet-101 se-resnet-152 diff --git a/demos/classification_demo/grid_mat.hpp b/demos/classification_demo/grid_mat.hpp deleted file mode 100644 index ec652066a60..00000000000 --- a/demos/classification_demo/grid_mat.hpp +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (C) 2018-2019 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "classification_demo.hpp" - -enum class PredictionResult { Correct, - Incorrect, - Unknown }; - -struct LabeledImage { - cv::Mat mat; - std::string label; - PredictionResult predictionResult; -}; - -class GridMat { -public: - cv::Mat outImg; - - explicit GridMat(Presenter& presenter, - const cv::Size maxDisp = cv::Size{1920, 1080}, - const cv::Size aspectRatio = cv::Size{16, 9}, - double targetFPS = 60 - ): - currSourceId{0} { - targetFPS = std::max(targetFPS, static_cast(FLAGS_b)); - cv::Size size(static_cast(std::round(sqrt(1. * targetFPS * aspectRatio.width / aspectRatio.height))), - static_cast(std::round(sqrt(1. * targetFPS * aspectRatio.height / aspectRatio.width)))); - int minCellSize = std::min(maxDisp.width / size.width, maxDisp.height / size.height); - cellSize = cv::Size(minCellSize, minCellSize); - - for (int i = 0; i < size.height; i++) { - for (int j = 0; j < size.width; j++) { - points.emplace_back(cellSize.width * j, presenter.graphSize.height + cellSize.height * i); - } - } - - outImg.create((cellSize.height * size.height) + presenter.graphSize.height, - cellSize.width * size.width, CV_8UC3); - outImg.setTo(0); - - textSize = cv::getTextSize("", fontType, fontScale, thickness, &baseline); - accuracyMessageSize = cv::getTextSize("Accuracy (top 0): 0.000", fontType, fontScale, thickness, &baseline); - testMessageSize = cv::getTextSize(testMessage, fontType, fontScale, thickness, &baseline); - } - - void textUpdate(double avgFPS, double avgLatency, double accuracy, - bool isFpsTest, bool showAccuracy, - Presenter& presenter) { - rectangle(outImg, - {0, 0}, {outImg.cols, presenter.graphSize.height}, - cv::Scalar(0, 0, 0), cv::FILLED); - - presenter.drawGraphs(outImg); - - cv::Scalar textColor = cv::Scalar(255, 255, 255); - int textPadding = 10; - - cv::putText(outImg, - cv::format("FPS: %0.01f", avgFPS), - cv::Point(textPadding, textSize.height + textPadding), - fontType, fontScale, textColor, thickness); - cv::putText(outImg, - cv::format("Latency: %dms", static_cast(avgLatency * 1000)), - cv::Point(textPadding, (textSize.height + textPadding) * 2), - fontType, fontScale, textColor, thickness); - - if (showAccuracy) { - cv::putText(outImg, - cv::format("Accuracy (top %d): %.3f", FLAGS_nt, accuracy), - cv::Point(outImg.cols - accuracyMessageSize.width - textPadding, textSize.height + textPadding), - fontType, fontScale, textColor, thickness); - } - - if (isFpsTest) { - cv::putText(outImg, - testMessage, - cv::Point(outImg.cols - testMessageSize.width - textPadding, - (textSize.height + textPadding) * 2), - fontType, fontScale, cv::Scalar(50, 50, 255), thickness); - } - } - - void updateMat(const std::list& imageInfos) { - size_t prevSourceId = (currSourceId + points.size() - prevImgs.size() % points.size()) % points.size(); - - // redraw images from previous batch in order to remove borders - while (!prevImgs.empty()) { - prevImgs.front().copyTo(outImg(cv::Rect(points[prevSourceId], cellSize))); - prevImgs.pop(); - prevSourceId++; - - if (prevSourceId >= points.size()) { - prevSourceId -= points.size(); - } - } - - for (const auto & imageInfo : imageInfos) { - cv::Mat frame = imageInfo.mat; - - cv::Scalar textColor; - switch (imageInfo.predictionResult) { - case PredictionResult::Correct: - textColor = cv::Scalar(75, 255, 75); break; // green - case PredictionResult::Incorrect: - textColor = cv::Scalar(50, 50, 255); break; // red - case PredictionResult::Unknown: - textColor = cv::Scalar(75, 255, 255); break; // yellow - default: - throw std::runtime_error("Undefined type of prediction result"); - } - - int labelThickness = cellSize.width / 20; - cv::Size labelTextSize = cv::getTextSize(imageInfo.label, fontType, 1, 2, &baseline); - double labelFontScale = static_cast(cellSize.width - 2*labelThickness) / labelTextSize.width; - cv::resize(frame, frame, cellSize); - cv::putText(frame, - imageInfo.label, - cv::Point(labelThickness, cellSize.height - labelThickness - labelTextSize.height), - fontType, labelFontScale, textColor, 2); - - prevImgs.push(frame); - - cv::Mat cell = outImg(cv::Rect(points[currSourceId], cellSize)); - frame.copyTo(cell); - cv::rectangle(cell, {0, 0}, {frame.cols, frame.rows}, {255, 50, 50}, labelThickness); // draw a border - - if (currSourceId == points.size() - 1) { - currSourceId = 0; - } else { - currSourceId++; - } - } - } - -private: - std::queue prevImgs; - cv::Size cellSize; - size_t currSourceId; - std::vector points; - static const int fontType = cv::FONT_HERSHEY_PLAIN; - static constexpr double fontScale = 1.5; - static const int thickness = 2; - static const std::string testMessage; - int baseline; - cv::Size textSize; - cv::Size accuracyMessageSize; - cv::Size testMessageSize; -}; - -const std::string GridMat::testMessage = "Testing, please wait..."; diff --git a/demos/classification_demo/main.cpp b/demos/classification_demo/main.cpp deleted file mode 100644 index 6eb63716591..00000000000 --- a/demos/classification_demo/main.cpp +++ /dev/null @@ -1,534 +0,0 @@ -// Copyright (C) 2018-2019 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include - -#include - -#include "classification_demo.hpp" -#include "grid_mat.hpp" - -using namespace InferenceEngine; - -struct InferRequestInfo { - struct InferRequestImage { - cv::Mat mat; - unsigned correctClass; - std::chrono::time_point startTime; - }; - - InferRequest &inferRequest; - std::vector images; -}; - -bool ParseAndCheckCommandLine(int argc, char *argv[]) { - // ---------------------------------Parsing and validation of input args---------------------------------- - gflags::ParseCommandLineNonHelpFlags(&argc, &argv, true); - if (FLAGS_h) { - showUsage(); - showAvailableDevices(); - return false; - } - - slog::info << "Parsing input parameters" << slog::endl; - if (FLAGS_i.empty()) { - throw std::logic_error("Parameter -i is not set"); - } - if (FLAGS_m.empty()) { - throw std::logic_error("Parameter -m is not set"); - } - if (FLAGS_labels.empty()) { - throw std::logic_error("Parameter -labels is not set"); - } - if (FLAGS_nt < 1) { - throw std::runtime_error("Parameter -nt must be >= 1"); - } - - return true; -} - -cv::Mat resizeImage(const cv::Mat& image, int modelInputResolution) { - double scale = static_cast(modelInputResolution) / std::min(image.cols, image.rows); - - cv::Mat resizedImage; - cv::resize(image, resizedImage, cv::Size(), scale, scale); - - cv::Rect imgROI; - if (resizedImage.cols >= resizedImage.rows) { - int fromWidth = resizedImage.cols/2 - modelInputResolution/2; - imgROI = cv::Rect(fromWidth, 0, modelInputResolution, modelInputResolution); - } else { - int fromHeight = resizedImage.rows/2 - modelInputResolution/2; - imgROI = cv::Rect(0, fromHeight, modelInputResolution, modelInputResolution); - } - - return resizedImage(imgROI); -} - -std::vector> topResults(Blob& inputBlob, unsigned numTop) { - TBlob& tblob = dynamic_cast&>(inputBlob); - size_t batchSize = tblob.getTensorDesc().getDims()[0]; - numTop = static_cast(std::min(size_t(numTop), tblob.size())); - - std::vector> output(batchSize); - for (size_t i = 0; i < batchSize; i++) { - size_t offset = i * (tblob.size() / batchSize); - float *batchData = tblob.data() + offset; - std::vector indices(tblob.size() / batchSize); - std::iota(std::begin(indices), std::end(indices), 0); - std::partial_sort(std::begin(indices), std::begin(indices) + numTop, std::end(indices), - [&batchData](unsigned l, unsigned r) { - return batchData[l] > batchData[r]; - }); - - output[i].assign(indices.begin(), indices.begin() + numTop); - } - - return output; -} - -int main(int argc, char *argv[]) { - try { - std::cout << "InferenceEngine: " << printable(*GetInferenceEngineVersion()) << std::endl; - - if (!ParseAndCheckCommandLine(argc, argv)) { - return 0; - } - - // -----------------------------------------Read input images----------------------------------------- - std::vector imageNames; - std::vector inputImages; - parseInputFilesArguments(imageNames); - if (imageNames.empty()) throw std::runtime_error("No images provided"); - std::sort(imageNames.begin(), imageNames.end()); - for (size_t i = 0; i < imageNames.size(); i++) { - const std::string& name = imageNames[i]; - const cv::Mat& tmpImage = cv::imread(name); - if (tmpImage.data == nullptr) { - std::cerr << "Could not read image " << name << '\n'; - imageNames.erase(imageNames.begin() + i); - i--; - } else { - inputImages.push_back(tmpImage); - size_t lastSlashIdx = name.find_last_of("/\\"); - if (lastSlashIdx != std::string::npos) { - imageNames[i] = name.substr(lastSlashIdx + 1); - } else { - imageNames[i] = name; - } - } - } - // --------------------------------------------------------------------------------------------------- - - // ----------------------------------------Read image classes----------------------------------------- - std::vector classIndices; - if (!FLAGS_gt.empty()) { - std::map classIndicesMap; - std::ifstream inputGtFile(FLAGS_gt); - if (!inputGtFile.is_open()) throw std::runtime_error("Can't open the ground truth file."); - - std::string line; - while (std::getline(inputGtFile, line)) - { - size_t separatorIdx = line.find(' '); - if (separatorIdx == std::string::npos) { - throw std::runtime_error("The ground truth file has incorrect format."); - } - std::string imagePath = line.substr(0, separatorIdx); - size_t imagePathEndIdx = imagePath.rfind('/'); - unsigned classIndex = static_cast(std::stoul(line.substr(separatorIdx + 1))); - if ((imagePathEndIdx != 1 || imagePath[0] != '.') && imagePathEndIdx != std::string::npos) { - throw std::runtime_error("The ground truth file has incorrect format."); - } - classIndicesMap.insert({imagePath.substr(imagePathEndIdx + 1), classIndex}); - } - - for (size_t i = 0; i < imageNames.size(); i++) { - auto imageSearchResult = classIndicesMap.find(imageNames[i]); - if (imageSearchResult != classIndicesMap.end()) { - classIndices.push_back(imageSearchResult->second); - } else { - throw std::runtime_error("No class specified for image " + imageNames[i]); - } - } - } else { - classIndices.resize(inputImages.size()); - std::fill(classIndices.begin(), classIndices.end(), 0); - } - // --------------------------------------------------------------------------------------------------- - - // --------------------------------------------Read labels-------------------------------------------- - std::vector labels; - std::ifstream inputLabelsFile(FLAGS_labels); - if (!inputLabelsFile.is_open()) throw std::runtime_error("Can't open the labels file."); - std::string labelsLine; - while (std::getline(inputLabelsFile, labelsLine)) { - size_t labelBeginIdx = labelsLine.find(' '); - size_t labelEndIdx = labelsLine.find(','); // can be npos when class has only one label - if (labelBeginIdx == std::string::npos) { - throw std::runtime_error("The labels file has incorrect format."); - } - labels.push_back(labelsLine.substr(labelBeginIdx + 1, labelEndIdx - (labelBeginIdx + 1))); - } - - for (const auto & classIndex : classIndices) { - if (classIndex >= labels.size()) { - throw std::runtime_error("Class index " + std::to_string(classIndex) - + " is outside the range supported by the model."); - } - } - // --------------------------------------------------------------------------------------------------- - - // -------------------------------------------Read network-------------------------------------------- - Core ie; - CNNNetwork network = ie.ReadNetwork(FLAGS_m); - // --------------------------------------------------------------------------------------------------- - - // --------------------------------------Configure model input---------------------------------------- - auto inputShapes = network.getInputShapes(); - if (inputShapes.size() != 1) { - throw std::logic_error("The network should have only one input."); - } - - std::string inputBlobName = inputShapes.begin()->first; - SizeVector& inputShape = inputShapes.begin()->second; - if (inputShape.size() != 4) { - throw std::logic_error("Model input has incorrect number of dimensions. Must be 4."); - } - if (inputShape[1] != 3) { - throw std::logic_error("Model input has incorrect number of color channels." - " Expected 3, got " + std::to_string(inputShape[1]) + "."); - } - if (inputShape[2] != inputShape[3]) { - throw std::logic_error("Model input has incorrect image shape. Must be NxN square." - " Got " + std::to_string(inputShape[2]) + - "x" + std::to_string(inputShape[3]) + "."); - } - int modelInputResolution = inputShape[2]; - - inputShape[0] = FLAGS_b; - network.reshape(inputShapes); - - auto inputLayerData = network.getInputsInfo().begin()->second; - inputLayerData->setLayout(Layout::NCHW); - inputLayerData->setPrecision(Precision::U8); - // --------------------------------------------------------------------------------------------------- - - // --------------------------------------Configure model output--------------------------------------- - auto outputInfo = network.getOutputsInfo(); - if (outputInfo.size() != 1) { - throw std::logic_error("The network should have only one output."); - } - - auto outputName = outputInfo.begin()->first; - auto outputLayerData = outputInfo.begin()->second; - auto layerDataDims = outputLayerData->getTensorDesc().getDims(); - if (layerDataDims.size() != 2 && layerDataDims.size() != 4) { - throw std::logic_error("Incorrect number of dimensions in model output layer. Must be 2 or 4."); - } - if (layerDataDims[1] == labels.size() + 1) { - labels.insert(labels.begin(), "other"); - for (size_t i = 0; i < classIndices.size(); i++) { - classIndices[i]++; - } - } - if (layerDataDims[1] != labels.size() || layerDataDims[0] != FLAGS_b) { - throw std::logic_error("Incorrect size of model output layer. Must be BatchSize x NumberOfClasses."); - } - - outputLayerData->setPrecision(Precision::FP32); - // --------------------------------------------------------------------------------------------------- - - // ----------------------------------Set device and device settings----------------------------------- - std::set devices; - for (const std::string& device : parseDevices(FLAGS_d)) { - devices.insert(device); - } - std::map deviceNstreams = parseValuePerDevice(devices, FLAGS_nstreams); - for (auto & device : devices) { - if (device == "CPU") { // CPU supports a few special performance-oriented keys - // limit threading for CPU portion of inference - if (FLAGS_nthreads != 0) - ie.SetConfig({{ CONFIG_KEY(CPU_THREADS_NUM), std::to_string(FLAGS_nthreads) }}, device); - - if (FLAGS_d.find("MULTI") != std::string::npos - && devices.find("GPU") != devices.end()) { - ie.SetConfig({{ CONFIG_KEY(CPU_BIND_THREAD), CONFIG_VALUE(NO) }}, device); - } else { - // pin threads for CPU portion of inference - ie.SetConfig({{ CONFIG_KEY(CPU_BIND_THREAD), CONFIG_VALUE(YES) }}, device); - } - - // for CPU execution, more throughput-oriented execution via streams - ie.SetConfig({{ CONFIG_KEY(CPU_THROUGHPUT_STREAMS), - (deviceNstreams.count(device) > 0 ? std::to_string(deviceNstreams.at(device)) - : CONFIG_VALUE(CPU_THROUGHPUT_AUTO)) }}, device); - deviceNstreams[device] = std::stoi( - ie.GetConfig(device, CONFIG_KEY(CPU_THROUGHPUT_STREAMS)).as()); - } else if (device == "GPU") { - ie.SetConfig({{ CONFIG_KEY(GPU_THROUGHPUT_STREAMS), - (deviceNstreams.count(device) > 0 ? std::to_string(deviceNstreams.at(device)) - : CONFIG_VALUE(GPU_THROUGHPUT_AUTO)) }}, device); - deviceNstreams[device] = std::stoi( - ie.GetConfig(device, CONFIG_KEY(GPU_THROUGHPUT_STREAMS)).as()); - - if (FLAGS_d.find("MULTI") != std::string::npos - && devices.find("CPU") != devices.end()) { - // multi-device execution with the CPU + GPU performs best with GPU throttling hint, - // which releases another CPU thread (that is otherwise used by the GPU driver for active polling) - ie.SetConfig({{ CLDNN_CONFIG_KEY(PLUGIN_THROTTLE), "1" }}, "GPU"); - } - } - } - // --------------------------------------------------------------------------------------------------- - - // --------------------------------------Load network to device--------------------------------------- - ExecutableNetwork executableNetwork = ie.LoadNetwork(network, FLAGS_d); - // --------------------------------------------------------------------------------------------------- - - // ----------------------------Try to set optimal number of infer requests---------------------------- - unsigned nireq = FLAGS_nireq; - if (nireq == 0) { - std::string key = METRIC_KEY(OPTIMAL_NUMBER_OF_INFER_REQUESTS); - try { - nireq = executableNetwork.GetMetric(key).as(); - } catch (const details::InferenceEngineException& ex) { - THROW_IE_EXCEPTION - << "Every device used with the classification_demo should " - << "support OPTIMAL_NUMBER_OF_INFER_REQUESTS ExecutableNetwork metric. " - << "Failed to query the metric for the " << FLAGS_d << " with error:" << ex.what(); - } - } - // --------------------------------------------------------------------------------------------------- - - // ---------------------------------------Create infer request---------------------------------------- - std::vector inferRequests; - for (unsigned infReqId = 0; infReqId < nireq; ++infReqId) { - inferRequests.push_back(executableNetwork.CreateInferRequest()); - } - // --------------------------------------------------------------------------------------------------- - - // ----------------------------------------Create output info----------------------------------------- - Presenter presenter(FLAGS_u, 0); - int width; - int height; - std::vector gridMatRowsCols = split(FLAGS_res, 'x'); - if (gridMatRowsCols.size() != 2) { - throw std::runtime_error("The value of GridMat resolution flag is not valid."); - } else { - width = std::stoi(gridMatRowsCols[0]); - height = std::stoi(gridMatRowsCols[1]); - } - GridMat gridMat(presenter, cv::Size(width, height)); - // --------------------------------------------------------------------------------------------------- - - // -----------------------------Prepare variables and data for main loop------------------------------ - typedef std::chrono::duration Sec; - double avgFPS = 0; - double avgLatency = 0; - std::chrono::steady_clock::duration latencySum = std::chrono::steady_clock::duration::zero(); - unsigned framesNum = 0; - long long correctPredictionsCount = 0; - double accuracy = 0; - bool isTestMode = true; - char key = 0; - std::size_t nextImageIndex = 0; - std::condition_variable condVar; - std::mutex mutex; - std::exception_ptr irCallbackException; - - std::queue emptyInferRequests; - std::queue completedInferRequests; - for (std::size_t i = 0; i < inferRequests.size(); i++) { - emptyInferRequests.push({inferRequests[i], std::vector()}); - } - - auto startTime = std::chrono::steady_clock::now(); - auto elapsedSeconds = std::chrono::steady_clock::duration{0}; - // --------------------------------------------------------------------------------------------------- - - // -------------------------------------Processing infer requests------------------------------------- - int framesNumOnCalculationStart = 0; - auto testDuration = std::chrono::seconds{3}; - auto fpsCalculationDuration = std::chrono::seconds{1}; - do { - if (irCallbackException) std::rethrow_exception(irCallbackException); - - if (elapsedSeconds >= testDuration - fpsCalculationDuration && framesNumOnCalculationStart == 0) { - framesNumOnCalculationStart = framesNum; - } - if (isTestMode && elapsedSeconds >= testDuration) { - isTestMode = false; - gridMat = GridMat(presenter, cv::Size(width, height), cv::Size(16, 9), - (framesNum - framesNumOnCalculationStart) / std::chrono::duration_cast( - fpsCalculationDuration).count()); - startTime = std::chrono::steady_clock::now(); - framesNum = 0; - latencySum = std::chrono::steady_clock::duration::zero(); - correctPredictionsCount = 0; - accuracy = 0; - } - - std::unique_ptr completedInferRequestInfo; - { - std::lock_guard lock(mutex); - - if (!completedInferRequests.empty()) { - completedInferRequestInfo.reset(new InferRequestInfo(completedInferRequests.front())); - completedInferRequests.pop(); - } - } - if (completedInferRequestInfo) { - emptyInferRequests.push({completedInferRequestInfo->inferRequest, - std::vector()}); - - std::vector correctClasses = {}; - for (size_t i = 0; i < completedInferRequestInfo->images.size(); i++) { - correctClasses.push_back(completedInferRequestInfo->images[i].correctClass); - } - - std::vector> results = topResults( - *completedInferRequestInfo->inferRequest.GetBlob(outputName), FLAGS_nt); - std::vector predictedLabels = {}; - std::list shownImagesInfo; - for (size_t i = 0; i < FLAGS_b; i++) { - PredictionResult predictionResult = PredictionResult::Incorrect; - if (!FLAGS_gt.empty()) { - for (size_t j = 0; j < FLAGS_nt; j++) { - unsigned predictedClass = results[i][j]; - if (predictedClass == correctClasses[i]) { - predictionResult = PredictionResult::Correct; - predictedLabels.push_back(labels[predictedClass]); - correctPredictionsCount++; - break; - } - } - } else { - predictionResult = PredictionResult::Unknown; - } - - if (predictionResult != PredictionResult::Correct) { - predictedLabels.push_back(labels[results[i][0]]); - } - - shownImagesInfo.push_back( - LabeledImage{completedInferRequestInfo->images[i].mat, predictedLabels[i], predictionResult}); - } - - framesNum += FLAGS_b; - - avgFPS = framesNum / std::chrono::duration_cast( - std::chrono::steady_clock::now() - startTime).count(); - gridMat.updateMat(shownImagesInfo); - auto processingEndTime = std::chrono::steady_clock::now(); - for (const auto & image : completedInferRequestInfo->images) { - latencySum += processingEndTime - image.startTime; - } - avgLatency = std::chrono::duration_cast(latencySum).count() / framesNum; - accuracy = static_cast(correctPredictionsCount) / framesNum; - gridMat.textUpdate(avgFPS, avgLatency, accuracy, isTestMode, !FLAGS_gt.empty(), presenter); - - if (!FLAGS_no_show) { - cv::imshow("classification_demo", gridMat.outImg); - key = static_cast(cv::waitKey(1)); - presenter.handleKey(key); - } - - completedInferRequestInfo.reset(); - } else if (!emptyInferRequests.empty()) { - auto inferRequestStartTime = std::chrono::steady_clock::now(); - cv::Mat nextImage = resizeImage(inputImages[nextImageIndex], modelInputResolution); - emptyInferRequests.front().images.push_back( - {nextImage, - classIndices[nextImageIndex], - inferRequestStartTime}); - nextImageIndex++; - if (nextImageIndex == imageNames.size()) { - nextImageIndex = 0; - } - if (emptyInferRequests.front().images.size() == FLAGS_b) { - auto emptyInferRequest = emptyInferRequests.front(); - emptyInferRequests.pop(); - - emptyInferRequest.inferRequest.SetCompletionCallback([emptyInferRequest, - &completedInferRequests, - &mutex, - &condVar, - &irCallbackException] { - { - std::lock_guard callbackLock(mutex); - - try { - completedInferRequests.push(emptyInferRequest); - } - catch(...) { - if (!irCallbackException) { - irCallbackException = std::current_exception(); - } - } - } - condVar.notify_one(); - }); - - auto inputBlob = emptyInferRequest.inferRequest.GetBlob(inputBlobName); - for (unsigned i = 0; i < FLAGS_b; i++) { - matU8ToBlob(emptyInferRequest.images[i].mat, inputBlob, i); - } - emptyInferRequest.inferRequest.StartAsync(); - } - } - - { - std::unique_lock lock(mutex); - - while (!irCallbackException - && emptyInferRequests.empty() && completedInferRequests.empty()) { - condVar.wait(lock); - } - } - - elapsedSeconds = std::chrono::steady_clock::now() - startTime; - } while (key != 27 && key != 'q' && key != 'Q' - && (FLAGS_time == -1 || elapsedSeconds < std::chrono::seconds{FLAGS_time})); - - std::cout << "FPS: " << avgFPS << std::endl; - std::cout << "Latency: " << avgLatency << std::endl; - if (!FLAGS_gt.empty()) { - std::cout << "Accuracy (top " << FLAGS_nt << "): " << accuracy << std::endl; - } - std::cout << presenter.reportMeans() << std::endl; - // --------------------------------------------------------------------------------------------------- - - // ------------------------------------Wait for all infer requests------------------------------------ - for (InferRequest& inferRequest : inferRequests) - inferRequest.Wait(IInferRequest::WaitMode::RESULT_READY); - // --------------------------------------------------------------------------------------------------- - } - catch (const std::exception& error) { - slog::err << error.what() << slog::endl; - return 1; - } - catch (...) { - slog::err << "Unknown/internal exception happened." << slog::endl; - return 1; - } - - return 0; -} diff --git a/demos/python_demos/colorization_demo/README.md b/demos/colorization_demo/python/README.md similarity index 71% rename from demos/python_demos/colorization_demo/README.md rename to demos/colorization_demo/python/README.md index ee33c362372..32f2cd627cc 100644 --- a/demos/python_demos/colorization_demo/README.md +++ b/demos/colorization_demo/python/README.md @@ -23,8 +23,9 @@ Once the program receives an image, it performs the following steps: Running the application with the `-h` option yields the following usage message: ``` -usage: colorization_demo.py [-h] -m MODEL [-d DEVICE] -i "" [--no_show] - [-v] [-u UTILIZATION_MONITORS] +usage: colorization_demo.py [-h] -m MODEL [-d DEVICE] -i INPUT [--loop] + [-o OUTPUT] [-limit OUTPUT_LIMIT] + [--no_show] [-v] [-u UTILIZATION_MONITORS] Options: -h, --help Help with the script. @@ -33,8 +34,15 @@ Options: -d DEVICE, --device DEVICE Optional. Specify target device for infer: CPU, GPU, FPGA, HDDL or MYRIAD. Default: CPU - -i "", --input "" - Required. Input to process. + -i INPUT, --input INPUT + Required. An input to process. The input must be a single image, + a folder of images, video file or camera id. + --loop Optional. Enable reading the input in a loop. + -o OUTPUT, --output OUTPUT + Optional. Name of output to save. + -limit OUTPUT_LIMIT, --output_limit OUTPUT_LIMIT + Optional. Number of frames to store in output. + If -1 is set, all frames are stored. --no_show Optional. Disable display of results on screen. -v, --verbose Optional. Enable display of processing logs on screen. -u UTILIZATION_MONITORS, --utilization_monitors UTILIZATION_MONITORS @@ -43,7 +51,7 @@ Options: ``` -To run the demo, you can use public or Intel's pretrained models. To download pretrained models, use the OpenVINO™ [Model Downloader](../../../tools/downloader/README.md) or go to the [Intel® Open Source Technology Center](https://download.01.org/opencv/). +To run the demo, you can use public or Intel's pretrained models. To download pretrained models, use the OpenVINO™ [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). diff --git a/demos/python_demos/colorization_demo/colorization_demo.py b/demos/colorization_demo/python/colorization_demo.py similarity index 70% rename from demos/python_demos/colorization_demo/colorization_demo.py rename to demos/colorization_demo/python/colorization_demo.py index 61ae54690a6..11ffe5d38ca 100755 --- a/demos/python_demos/colorization_demo/colorization_demo.py +++ b/demos/colorization_demo/python/colorization_demo.py @@ -18,13 +18,14 @@ from openvino.inference_engine import IECore import cv2 as cv import numpy as np -import os -from argparse import ArgumentParser, SUPPRESS import logging as log import sys +from argparse import ArgumentParser, SUPPRESS +from pathlib import Path -sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'common')) +sys.path.append(str(Path(__file__).resolve().parents[2] / 'common/python')) import monitors +from images_capture import open_images_capture def build_arg(): @@ -32,20 +33,27 @@ def build_arg(): in_args = parser.add_argument_group('Options') in_args.add_argument('-h', '--help', action='help', default=SUPPRESS, help='Help with the script.') in_args.add_argument("-m", "--model", help="Required. Path to .xml file with pre-trained model.", - required=True, type=str) + required=True, type=Path) in_args.add_argument("-d", "--device", help="Optional. Specify target device for infer: CPU, GPU, FPGA, HDDL or MYRIAD. " "Default: CPU", default="CPU", type=str) - in_args.add_argument('-i', "--input", - help='Required. Input to process.', - required=True, type=str, metavar='""') + in_args.add_argument('-i', "--input", required=True, + help='Required. An input to process. The input must be a single image, ' + 'a folder of images, video file or camera id.') + in_args.add_argument('--loop', default=False, action='store_true', + help='Optional. Enable reading the input in a loop.') + in_args.add_argument('-o', '--output', required=False, + help='Optional. Name of output to save.') + in_args.add_argument('-limit', '--output_limit', required=False, default=1000, type=int, + help='Optional. Number of frames to store in output. ' + 'If -1 is set, all frames are stored.') in_args.add_argument("--no_show", help="Optional. Disable display of results on screen.", action='store_true', default=False) in_args.add_argument("-v", "--verbose", help="Optional. Enable display of processing logs on screen.", action='store_true', default=False) in_args.add_argument("-u", "--utilization_monitors", default="", type=str, - help="Optional. List of monitors to show initially.") + help="Optional. List of monitors to show initially.") return parser @@ -57,7 +65,7 @@ def build_arg(): log.debug("Load network") ie = IECore() - load_net = ie.read_network(args.model, os.path.splitext(args.model)[0] + ".bin") + load_net = ie.read_network(args.model, args.model.with_suffix(".bin")) load_net.batch_size = 1 exec_net = ie.load_network(network=load_net, device_name=args.device) @@ -65,30 +73,35 @@ def build_arg(): input_shape = load_net.input_info[input_blob].input_data.shape assert input_shape[1] == 1, "Expected model input shape with 1 channel" + inputs = {} + for input_name in load_net.input_info: + inputs[input_name] = np.zeros(load_net.input_info[input_name].input_data.shape) + assert len(load_net.outputs) == 1, "Expected number of outputs is equal 1" output_blob = next(iter(load_net.outputs)) output_shape = load_net.outputs[output_blob].shape _, _, h_in, w_in = input_shape - try: - input_source = int(args.input) - except ValueError: - input_source = args.input - - cap = cv.VideoCapture(input_source) - if not cap.isOpened(): - assert "{} not exist".format(input_source) + cap = open_images_capture(args.input, args.loop) + original_frame = cap.read() + if original_frame is None: + raise RuntimeError("Can't read an image from the input") + frames_processed = 0 imshow_size = (640, 480) graph_size = (imshow_size[0] // 2, imshow_size[1] // 4) presenter = monitors.Presenter(args.utilization_monitors, imshow_size[1] * 2 - graph_size[1], graph_size) - while True: + video_writer = cv.VideoWriter() + if args.output: + video_writer = cv.VideoWriter(args.output, cv.VideoWriter_fourcc(*'MJPG'), cap.fps(), + (imshow_size[0] * 2, imshow_size[1] * 2)) + if not video_writer.isOpened(): + raise RuntimeError("Can't open video writer") + + while original_frame is not None: log.debug("#############################") - hasFrame, original_frame = cap.read() - if not hasFrame: - break (h_orig, w_orig) = original_frame.shape[:2] log.debug("Preprocessing frame") @@ -100,9 +113,11 @@ def build_arg(): img_rgb = frame.astype(np.float32) / 255 img_lab = cv.cvtColor(img_rgb, cv.COLOR_RGB2Lab) img_l_rs = cv.resize(img_lab.copy(), (w_in, h_in))[:, :, 0] + inputs[input_blob] = img_l_rs log.debug("Network inference") - res = exec_net.infer(inputs={input_blob: [img_l_rs]}) + + res = exec_net.infer(inputs=inputs) update_res = np.squeeze(res[output_blob]) @@ -129,6 +144,11 @@ def build_arg(): ir_image = [cv.hconcat([original_image, grayscale_image]), cv.hconcat([lab_image, colorize_image])] final_image = cv.vconcat(ir_image) + + frames_processed += 1 + if video_writer.isOpened() and (args.output_limit == -1 or frames_processed <= args.output_limit): + video_writer.write(final_image) + presenter.drawGraphs(final_image) if not args.no_show: log.debug("Show results") @@ -137,4 +157,5 @@ def build_arg(): if key in {ord("q"), ord("Q"), 27}: break presenter.handleKey(key) + original_frame = cap.read() print(presenter.reportMeans()) diff --git a/demos/python_demos/colorization_demo/models.lst b/demos/colorization_demo/python/models.lst similarity index 100% rename from demos/python_demos/colorization_demo/models.lst rename to demos/colorization_demo/python/models.lst diff --git a/demos/common/cpp/CMakeLists.txt b/demos/common/cpp/CMakeLists.txt new file mode 100644 index 00000000000..29b34d9e445 --- /dev/null +++ b/demos/common/cpp/CMakeLists.txt @@ -0,0 +1,8 @@ +# Copyright (C) 2018-2020 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +# + +add_subdirectory(utils) +add_subdirectory(monitors) +add_subdirectory(models) +add_subdirectory(pipelines) diff --git a/demos/common/models/CMakeLists.txt b/demos/common/cpp/models/CMakeLists.txt similarity index 76% rename from demos/common/models/CMakeLists.txt rename to demos/common/cpp/models/CMakeLists.txt index 1643faf9f99..d91ea83ea1e 100644 --- a/demos/common/models/CMakeLists.txt +++ b/demos/common/cpp/models/CMakeLists.txt @@ -2,11 +2,12 @@ # SPDX-License-Identifier: Apache-2.0 # +find_package(InferenceEngine 2.0 REQUIRED) find_package(OpenCV REQUIRED COMPONENTS core imgproc) find_package(ngraph REQUIRED) -FILE(GLOB SOURCES ./src/*.cpp) -FILE(GLOB HEADERS ./include/models/*.h) +file(GLOB SOURCES ./src/*.cpp) +file(GLOB HEADERS ./include/models/*.h) # Create named folders for the sources within the .vcproj # Empty name lists them directly under the .vcproj @@ -15,4 +16,4 @@ source_group("include" FILES ${HEADERS}) add_library(models STATIC ${SOURCES} ${HEADERS}) target_include_directories(models PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") -target_link_libraries(models PRIVATE ngraph::ngraph gflags ${InferenceEngine_LIBRARIES} common opencv_core opencv_imgproc) +target_link_libraries(models PRIVATE ngraph::ngraph gflags ${InferenceEngine_LIBRARIES} utils opencv_core opencv_imgproc) diff --git a/demos/common/cpp/models/include/models/classification_model.h b/demos/common/cpp/models/include/models/classification_model.h new file mode 100644 index 00000000000..54ee58a3ba9 --- /dev/null +++ b/demos/common/cpp/models/include/models/classification_model.h @@ -0,0 +1,43 @@ +/* +// Copyright (C) 2018-2020 Intel Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +*/ +#pragma once + +#include "models/model_base.h" + +class ClassificationModel : public ModelBase { +public: + /// Constructor + /// @param modelFileName name of model to load. + /// @param nTop - number of top results. + /// Any detected object with confidence lower than this threshold will be ignored. + /// @param useAutoResize - if true, image will be resized by IE. + /// Otherwise, image will be preprocessed and resized using OpenCV routines. + /// @param labels - array of labels for every class. + ClassificationModel(const std::string& modelFileName, size_t nTop, bool useAutoResize, const std::vector& labels); + + std::shared_ptr preprocess( + const InputData& inputData, InferenceEngine::InferRequest::Ptr& request) override; + std::unique_ptr postprocess(InferenceResult& infResult) override; + + static std::vector loadLabels(const std::string& labelFilename); + +protected: + size_t nTop; + bool useAutoResize; + std::vector labels; + + void prepareInputsOutputs(InferenceEngine::CNNNetwork& cnnNetwork) override; +}; diff --git a/demos/common/models/include/models/detection_model.h b/demos/common/cpp/models/include/models/detection_model.h similarity index 100% rename from demos/common/models/include/models/detection_model.h rename to demos/common/cpp/models/include/models/detection_model.h index 1522f2bb64a..36e4d9cc6f6 100644 --- a/demos/common/models/include/models/detection_model.h +++ b/demos/common/cpp/models/include/models/detection_model.h @@ -34,13 +34,13 @@ class DetectionModel : public ModelBase { static std::vector loadLabels(const std::string& labelFilename); protected: + float confidenceThreshold; + bool useAutoResize; + std::vector labels; size_t netInputHeight = 0; size_t netInputWidth = 0; - bool useAutoResize; - float confidenceThreshold; - std::string getLabelName(int labelID) { return (size_t)labelID < labels.size() ? labels[labelID] : std::string("Label #") + std::to_string(labelID); } }; diff --git a/demos/common/cpp/models/include/models/detection_model_centernet.h b/demos/common/cpp/models/include/models/detection_model_centernet.h new file mode 100644 index 00000000000..b4c262a3e2a --- /dev/null +++ b/demos/common/cpp/models/include/models/detection_model_centernet.h @@ -0,0 +1,41 @@ +/* +// Copyright (C) 2020-2021 Intel Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +*/ + +#pragma once +#include "detection_model.h" + +class ModelCenterNet : public DetectionModel { +public: + struct BBox { + float left; + float top; + float right; + float bottom; + + float getWidth() const { return (right - left) + 1.0f; } + float getHeight() const { return (bottom - top) + 1.0f; } + }; + static const int INIT_VECTOR_SIZE = 200; + + ModelCenterNet(const std::string& modelFileName, float confidenceThreshold, + const std::vector& labels = std::vector()); + std::shared_ptr preprocess( + const InputData& inputData, InferenceEngine::InferRequest::Ptr& request) override; + std::unique_ptr postprocess(InferenceResult& infResult) override; + +protected: + void prepareInputsOutputs(InferenceEngine::CNNNetwork& cnnNetwork) override; +}; diff --git a/demos/common/cpp/models/include/models/detection_model_faceboxes.h b/demos/common/cpp/models/include/models/detection_model_faceboxes.h new file mode 100644 index 00000000000..2912c0f1e48 --- /dev/null +++ b/demos/common/cpp/models/include/models/detection_model_faceboxes.h @@ -0,0 +1,48 @@ +/* +// Copyright (C) 2018-2020 Intel Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +*/ + +#pragma once +#include "detection_model.h" + +class ModelFaceBoxes : public DetectionModel { +public: + struct Anchor { + int left; + int top; + int right; + int bottom; + + int getWidth() const { return (right - left) + 1; } + int getHeight() const { return (bottom - top) + 1; } + int getXCenter() const { return left + (getWidth() - 1) / 2; } + int getYCenter() const { return top + (getHeight() - 1) / 2; } + }; + static const int INIT_VECTOR_SIZE = 200; + + ModelFaceBoxes(const std::string& modelFileName, float confidenceThreshold, bool useAutoResize, float boxIOUThreshold); + std::unique_ptr postprocess(InferenceResult& infResult) override; + +protected: + int maxProposalsCount; + const float boxIOUThreshold; + const std::vector steps; + const std::vector variance; + const std::vector> minSizes; + std::vector anchors; + virtual void prepareInputsOutputs(InferenceEngine::CNNNetwork& cnnNetwork) override; + void priorBoxes(const std::vector>& featureMaps); + +}; diff --git a/demos/common/cpp/models/include/models/detection_model_retinaface.h b/demos/common/cpp/models/include/models/detection_model_retinaface.h new file mode 100644 index 00000000000..b7c8784bb17 --- /dev/null +++ b/demos/common/cpp/models/include/models/detection_model_retinaface.h @@ -0,0 +1,76 @@ +/* +// Copyright (C) 2020-2021 Intel Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +*/ + +#pragma once +#include +#include "detection_model.h" + +class ModelRetinaFace + : public DetectionModel { +public: + struct Anchor { + float left; + float top; + float right; + float bottom; + + float getWidth() const { return (right - left) + 1.0f; } + float getHeight() const { return (bottom - top) + 1.0f; } + float getXCenter() const { return left + (getWidth() - 1.0f) / 2.0f; } + float getYCenter() const { return top + (getHeight() - 1.0f) / 2.0f; } + }; + + static const int LANDMARKS_NUM = 5; + static const int INIT_VECTOR_SIZE = 200; + /// Loads model and performs required initialization + /// @param model_name name of model to load + /// @param confidenceThreshold - threshold to eleminate low-confidence detections. + /// Any detected object with confidence lower than this threshold will be ignored. + /// @param useAutoResize - if true, image will be resized by IE. + /// @param labels - array of labels for every class. If this array is empty or contains less elements + /// than actual classes number, default "Label #N" will be shown for missing items. + ModelRetinaFace(const std::string& model_name, float confidenceThreshold, bool useAutoResize, float boxIOUThreshold); + std::unique_ptr postprocess(InferenceResult& infResult) override; + +protected: + struct AnchorCfgLine { + int stride; + std::vector scales; + int baseSize; + std::vector ratios; + }; + + bool shouldDetectMasks; + float landmarkStd; + const float boxIOUThreshold; + const float maskThreshold; + + enum EOutputType { + OT_BBOX, + OT_SCORES, + OT_LANDMARK, + OT_MASKSCORES, + OT_MAX + }; + + std::vector separateOutputsNames[OT_MAX]; + const std::vector anchorCfg; + std::map> anchorsFpn; + std::vector> anchors; + + void generateAnchorsFpn(); + void prepareInputsOutputs(InferenceEngine::CNNNetwork& cnnNetwork) override; +}; diff --git a/demos/common/models/include/models/detection_model_ssd.h b/demos/common/cpp/models/include/models/detection_model_ssd.h similarity index 82% rename from demos/common/models/include/models/detection_model_ssd.h rename to demos/common/cpp/models/include/models/detection_model_ssd.h index 040ecb54004..32e0cbaf7ef 100644 --- a/demos/common/models/include/models/detection_model_ssd.h +++ b/demos/common/cpp/models/include/models/detection_model_ssd.h @@ -30,11 +30,12 @@ class ModelSSD : public DetectionModel { float confidenceThreshold, bool useAutoResize, const std::vector& labels = std::vector()); - virtual void onLoadCompleted(InferenceEngine::ExecutableNetwork* execNetwork, const std::vector& requests) override; - virtual std::unique_ptr postprocess(InferenceResult& infResult) override; + std::shared_ptr preprocess( + const InputData& inputData, InferenceEngine::InferRequest::Ptr& request) override; + std::unique_ptr postprocess(InferenceResult& infResult) override; protected: - virtual void prepareInputsOutputs(InferenceEngine::CNNNetwork& cnnNetwork) override; + void prepareInputsOutputs(InferenceEngine::CNNNetwork& cnnNetwork) override; size_t maxProposalCount = 0; size_t objectSize = 0; }; diff --git a/demos/common/models/include/models/detection_model_yolo.h b/demos/common/cpp/models/include/models/detection_model_yolo.h similarity index 97% rename from demos/common/models/include/models/detection_model_yolo.h rename to demos/common/cpp/models/include/models/detection_model_yolo.h index e754f819cfa..2761278d564 100644 --- a/demos/common/models/include/models/detection_model_yolo.h +++ b/demos/common/cpp/models/include/models/detection_model_yolo.h @@ -57,7 +57,7 @@ class ModelYolo3 : public DetectionModel { std::unique_ptr postprocess(InferenceResult& infResult) override; protected: - virtual void prepareInputsOutputs(InferenceEngine::CNNNetwork& cnnNetwork) override; + void prepareInputsOutputs(InferenceEngine::CNNNetwork& cnnNetwork) override; void parseYOLOV3Output(const std::string& output_name, const InferenceEngine::Blob::Ptr& blob, const unsigned long resized_im_h, const unsigned long resized_im_w, const unsigned long original_im_h, diff --git a/demos/common/cpp/models/include/models/hpe_model_openpose.h b/demos/common/cpp/models/include/models/hpe_model_openpose.h new file mode 100644 index 00000000000..45ddaf37342 --- /dev/null +++ b/demos/common/cpp/models/include/models/hpe_model_openpose.h @@ -0,0 +1,55 @@ +/* +// Copyright (C) 2018-2021 Intel Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +*/ +#pragma once +#include "model_base.h" + +class HPEOpenPose : public ModelBase { +public: + /// Constructor + /// @param modelFileName name of model to load + /// @param confidenceThreshold - threshold to eleminate low-confidence keypoints. + /// Any keypoint with confidence lower than this threshold will be ignored. + HPEOpenPose(const std::string& modelFileName, double aspectRatio, int targetSize, float confidenceThreshold); + + std::unique_ptr postprocess(InferenceResult& infResult) override; + + std::shared_ptr preprocess( + const InputData& inputData, InferenceEngine::InferRequest::Ptr& request) override; + + static const size_t keypointsNumber = 18; + +protected: + void prepareInputsOutputs(InferenceEngine::CNNNetwork & cnnNetwork) override; + + static const int minJointsNumber = 3; + static const int stride = 8; + static const int upsampleRatio = 4; + static const cv::Vec3f meanPixel; + static const float minPeaksDistance; + static const float midPointsScoreThreshold; + static const float foundMidPointsRatioThreshold; + static const float minSubsetScore; + cv::Size inputLayerSize; + double aspectRatio; + float confidenceThreshold; + int targetSize; + + std::vector extractPoses(const std::vector& heatMaps, + const std::vector& pafs) const; + void resizeFeatureMaps(std::vector& featureMaps) const; + + void reshape(InferenceEngine::CNNNetwork & cnnNetwork) override; +}; diff --git a/demos/common/models/include/models/input_data.h b/demos/common/cpp/models/include/models/input_data.h similarity index 100% rename from demos/common/models/include/models/input_data.h rename to demos/common/cpp/models/include/models/input_data.h diff --git a/demos/common/models/include/models/internal_model_data.h b/demos/common/cpp/models/include/models/internal_model_data.h similarity index 85% rename from demos/common/models/include/models/internal_model_data.h rename to demos/common/cpp/models/include/models/internal_model_data.h index 56bbfcd2bb3..5ed5034dfbc 100644 --- a/demos/common/models/include/models/internal_model_data.h +++ b/demos/common/cpp/models/include/models/internal_model_data.h @@ -36,3 +36,13 @@ struct InternalImageModelData : public InternalModelData { int inputImgWidth; int inputImgHeight; }; + +struct InternalScaleData : public InternalModelData { + InternalScaleData(float scaleX, float scaleY) { + x = scaleX; + y = scaleY; + } + + float x; + float y; +}; diff --git a/demos/common/models/include/models/model_base.h b/demos/common/cpp/models/include/models/model_base.h similarity index 80% rename from demos/common/models/include/models/model_base.h rename to demos/common/cpp/models/include/models/model_base.h index 0d4691c7a76..9edef67a1b7 100644 --- a/demos/common/models/include/models/model_base.h +++ b/demos/common/cpp/models/include/models/model_base.h @@ -1,5 +1,5 @@ /* -// Copyright (C) 2018-2020 Intel Corporation +// Copyright (C) 2018-2021 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,7 +20,10 @@ class ModelBase { public: - ModelBase(const std::string& modelFileName) { this->modelFileName = modelFileName; } + ModelBase(const std::string& modelFileName) + : execNetwork(nullptr), modelFileName(modelFileName) + {} + virtual ~ModelBase() {} virtual void prepareInputsOutputs(InferenceEngine::CNNNetwork& cnnNetwork) = 0; @@ -33,6 +36,13 @@ class ModelBase { std::string getModelFileName() { return modelFileName; } + virtual void reshape(InferenceEngine::CNNNetwork & cnnNetwork) { + auto shapes = cnnNetwork.getInputShapes(); + for (auto& shape : shapes) + shape.second[0] = 1; + cnnNetwork.reshape(shapes); + } + protected: std::vector inputsNames; std::vector outputsNames; diff --git a/demos/human_pose_estimation_demo/include/peak.hpp b/demos/common/cpp/models/include/models/openpose_decoder.h similarity index 60% rename from demos/human_pose_estimation_demo/include/peak.hpp rename to demos/common/cpp/models/include/models/openpose_decoder.h index 4b0dba0e1cc..708aa298518 100644 --- a/demos/human_pose_estimation_demo/include/peak.hpp +++ b/demos/common/cpp/models/include/models/openpose_decoder.h @@ -1,16 +1,22 @@ -// Copyright (C) 2018-2019 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 +/* +// Copyright (C) 2018-2021 Intel Corporation // - +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +*/ #pragma once +#include "opencv2/core.hpp" +#include "results.h" -#include - -#include - -#include "human_pose.hpp" - -namespace human_pose_estimation { struct Peak { Peak(const int id = -1, const cv::Point2f& pos = cv::Point2f(), @@ -42,7 +48,7 @@ struct TwoJointsConnection { void findPeaks(const std::vector& heatMaps, const float minPeaksDistance, std::vector >& allPeaks, - int heatMapId); + int heatMapId, float confidenceThreshold); std::vector groupPeaksToPoses( const std::vector >& allPeaks, @@ -52,4 +58,3 @@ std::vector groupPeaksToPoses( const float foundMidPointsRatioThreshold, const int minJointsNumber, const float minSubsetScore); -} // namespace human_pose_estimation diff --git a/demos/common/models/include/models/results.h b/demos/common/cpp/models/include/models/results.h similarity index 82% rename from demos/common/models/include/models/results.h rename to demos/common/cpp/models/include/models/results.h index e2965941ed9..32801cadace 100644 --- a/demos/common/models/include/models/results.h +++ b/demos/common/cpp/models/include/models/results.h @@ -1,5 +1,5 @@ /* -// Copyright (C) 2018-2020 Intel Corporation +// Copyright (C) 2018-2021 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ #include #include #include -//#include "metadata.h" #include "internal_model_data.h" struct MetaData; @@ -57,6 +56,10 @@ struct InferenceResult : public ResultBase { bool IsEmpty() { return outputsData.empty(); } }; +struct ClassificationResult : public ResultBase { + std::vector> topLabels; +}; + struct DetectedObject : public cv::Rect2f { unsigned int labelID; std::string label; @@ -67,6 +70,19 @@ struct DetectionResult : public ResultBase { std::vector objects; }; +struct RetinaFaceDetectionResult : public DetectionResult { + std::vector landmarks; +}; + struct SegmentationResult : public ResultBase { cv::Mat mask; }; + +struct HumanPose { + std::vector keypoints; + float score; +}; + +struct HumanPoseResult : public ResultBase { + std::vector poses; +}; diff --git a/demos/common/models/include/models/segmentation_model.h b/demos/common/cpp/models/include/models/segmentation_model.h similarity index 57% rename from demos/common/models/include/models/segmentation_model.h rename to demos/common/cpp/models/include/models/segmentation_model.h index 06f2da7d743..2ed6d11593d 100644 --- a/demos/common/models/include/models/segmentation_model.h +++ b/demos/common/cpp/models/include/models/segmentation_model.h @@ -21,16 +21,21 @@ class SegmentationModel : public ModelBase { public: /// Constructor - /// @param model_nameFileName of model to load - SegmentationModel(const std::string& modelFileName) : ModelBase(modelFileName) {} + /// @param modelFileName name of model to load + /// @param useAutoResize - if true, image will be resized by IE. + /// Otherwise, image will be preprocessed and resized using OpenCV routines. + SegmentationModel(const std::string& modelFileName, bool useAutoResize); - virtual std::shared_ptr preprocess(const InputData& inputData, InferenceEngine::InferRequest::Ptr& request) override; - virtual std::unique_ptr postprocess(InferenceResult& infResult); + std::shared_ptr preprocess( + const InputData& inputData, InferenceEngine::InferRequest::Ptr& request) override; + std::unique_ptr postprocess(InferenceResult& infResult) override; protected: - virtual void prepareInputsOutputs(InferenceEngine::CNNNetwork & cnnNetwork) override; + void prepareInputsOutputs(InferenceEngine::CNNNetwork & cnnNetwork) override; int outHeight = 0; int outWidth = 0; int outChannels = 0; + + bool useAutoResize; }; diff --git a/demos/common/cpp/models/src/classification_model.cpp b/demos/common/cpp/models/src/classification_model.cpp new file mode 100644 index 00000000000..8b38d1b612b --- /dev/null +++ b/demos/common/cpp/models/src/classification_model.cpp @@ -0,0 +1,135 @@ +/* +// Copyright (C) 2018-2020 Intel Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +*/ + +#include "models/classification_model.h" +#include +#include + +using namespace InferenceEngine; + +ClassificationModel::ClassificationModel(const std::string& modelFileName, size_t nTop, bool useAutoResize, const std::vector& labels) : + ModelBase(modelFileName), + nTop(nTop), + useAutoResize(useAutoResize), + labels(labels) { +} + +std::shared_ptr ClassificationModel::preprocess(const InputData& inputData, InferRequest::Ptr& request) { + auto& img = inputData.asRef().inputImage; + + if (useAutoResize) { + /* Just set input blob containing read image. Resize and layout conversionx will be done automatically */ + request->SetBlob(inputsNames[0], wrapMat2Blob(img)); + } + else { + /* Resize and copy data from the image to the input blob */ + Blob::Ptr frameBlob = request->GetBlob(inputsNames[0]); + matU8ToBlob(img, frameBlob); + } + + return nullptr; +} + +std::unique_ptr ClassificationModel::postprocess(InferenceResult& infResult) { + InferenceEngine::LockedMemory outputMapped = infResult.getFirstOutputBlob()->rmap(); + const float *classificationData = outputMapped.as(); + + ClassificationResult* result = new ClassificationResult; + auto retVal = std::unique_ptr(result); + + *static_cast(result) = static_cast(infResult); + + std::vector indices(infResult.getFirstOutputBlob()->size()); + std::iota(std::begin(indices), std::end(indices), 0); + std::partial_sort(std::begin(indices), std::begin(indices) + nTop, std::end(indices), + [&classificationData](unsigned l, unsigned r) { + return classificationData[l] > classificationData[r]; + }); + result->topLabels.reserve(nTop); + for (size_t i = 0; i < nTop; ++i) { + result->topLabels.emplace_back(indices[i], labels[indices[i]]); + } + return retVal; +} + +std::vector ClassificationModel::loadLabels(const std::string& labelFilename) { + std::vector labels; + + /* Read labels */ + std::ifstream inputFile(labelFilename); + if (!inputFile.is_open()) + throw std::runtime_error("Can't open the labels file: " + labelFilename); + std::string labelsLine; + while (std::getline(inputFile, labelsLine)) { + size_t labelBeginIdx = labelsLine.find(' '); + size_t labelEndIdx = labelsLine.find(','); // can be npos when class has only one label + if (labelBeginIdx == std::string::npos) { + throw std::runtime_error("The labels file has incorrect format."); + } + labels.push_back(labelsLine.substr(labelBeginIdx + 1, labelEndIdx - (labelBeginIdx + 1))); + } + if (labels.empty()) + throw std::logic_error("File is empty: " + labelFilename); + + return labels; +} + +void ClassificationModel::prepareInputsOutputs(InferenceEngine::CNNNetwork& cnnNetwork) { + // --------------------------- Configure input & output ------------------------------------------------- + // --------------------------- Prepare input blobs ------------------------------------------------------ + InferenceEngine::ICNNNetwork::InputShapes inputShapes = cnnNetwork.getInputShapes(); + if (inputShapes.size() != 1) + throw std::runtime_error("Demo supports topologies only with 1 input"); + inputsNames.push_back(inputShapes.begin()->first); + SizeVector& inSizeVector = inputShapes.begin()->second; + if (inSizeVector.size() != 4 || inSizeVector[1] != 3) + throw std::runtime_error("3-channel 4-dimensional model's input is expected"); + if (inSizeVector[2] != inSizeVector[3]) + throw std::logic_error("Model input has incorrect image shape. Must be NxN square." + " Got " + std::to_string(inSizeVector[2]) + + "x" + std::to_string(inSizeVector[3]) + "."); + + InputInfo& inputInfo = *cnnNetwork.getInputsInfo().begin()->second; + inputInfo.setPrecision(Precision::U8); + if (useAutoResize) { + inputInfo.getPreProcess().setResizeAlgorithm(ResizeAlgorithm::RESIZE_BILINEAR); + inputInfo.getInputData()->setLayout(Layout::NHWC); + } + else + inputInfo.getInputData()->setLayout(Layout::NCHW); + + // --------------------------- Prepare output blobs ----------------------------------------------------- + const OutputsDataMap& outputsDataMap = cnnNetwork.getOutputsInfo(); + if (outputsDataMap.size() != 1) throw std::runtime_error("Demo supports topologies only with 1 output"); + + outputsNames.push_back(outputsDataMap.begin()->first); + Data& data = *outputsDataMap.begin()->second; + const SizeVector& outSizeVector = data.getTensorDesc().getDims(); + if (outSizeVector.size() != 2 && outSizeVector.size() != 4) + throw std::runtime_error("Demo supports topologies only with 2-dimensional or 4-dimensional ouput"); + if (outSizeVector.size() == 4 && outSizeVector[2] != 1 && outSizeVector[3] != 1) + throw std::runtime_error("Demo supports topologies only with 4-dimensional ouput which has last two dimensions of size 1"); + if (nTop > outSizeVector[1]) + throw std::runtime_error("The model provides " + std::to_string(outSizeVector[1]) + " classes, but " + std::to_string(nTop) + " labels are requested to be predicted"); + if (outSizeVector[1] == labels.size() + 1) { + labels.insert(labels.begin(), "other"); + slog::warn << "Inserted 'other' label as first.\n"; + } + else if (outSizeVector[1] != labels.size()) + throw std::logic_error("Model's number of classes and parsed labels must match (" + std::to_string(outSizeVector[1]) + " and " + std::to_string(labels.size()) + ')'); + + data.setPrecision(Precision::FP32); +} diff --git a/demos/common/models/src/detection_model.cpp b/demos/common/cpp/models/src/detection_model.cpp similarity index 85% rename from demos/common/models/src/detection_model.cpp rename to demos/common/cpp/models/src/detection_model.cpp index fc3c1000270..f249615fe8f 100644 --- a/demos/common/models/src/detection_model.cpp +++ b/demos/common/cpp/models/src/detection_model.cpp @@ -15,16 +15,16 @@ */ #include "models/detection_model.h" -#include -#include +#include +#include using namespace InferenceEngine; DetectionModel::DetectionModel(const std::string& modelFileName, float confidenceThreshold, bool useAutoResize, const std::vector& labels) : ModelBase(modelFileName), - labels(labels), + confidenceThreshold(confidenceThreshold), useAutoResize(useAutoResize), - confidenceThreshold(confidenceThreshold) { + labels(labels) { } std::shared_ptr DetectionModel::preprocess(const InputData& inputData, InferenceEngine::InferRequest::Ptr& request) { @@ -46,15 +46,17 @@ std::shared_ptr DetectionModel::preprocess(const InputData& i std::vector DetectionModel::loadLabels(const std::string& labelFilename) { std::vector labelsList; - /** Read labels (if any)**/ + /* Read labels (if any) */ if (!labelFilename.empty()) { std::ifstream inputFile(labelFilename); + if (!inputFile.is_open()) + throw std::runtime_error("Can't open the labels file: " + labelFilename); std::string label; while (std::getline(inputFile, label)) { labelsList.push_back(label); } if (labelsList.empty()) - throw std::logic_error("File empty or not found: " + labelFilename); + throw std::logic_error("File is empty: " + labelFilename); } return labelsList; diff --git a/demos/common/cpp/models/src/detection_model_centernet.cpp b/demos/common/cpp/models/src/detection_model_centernet.cpp new file mode 100644 index 00000000000..787335c5f4e --- /dev/null +++ b/demos/common/cpp/models/src/detection_model_centernet.cpp @@ -0,0 +1,289 @@ +/* +// Copyright (C) 2020-2021 Intel Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include "models/detection_model_centernet.h" + + +ModelCenterNet::ModelCenterNet(const std::string& modelFileName, + float confidenceThreshold, const std::vector& labels) + : DetectionModel(modelFileName, confidenceThreshold, false , labels) { +} + +void ModelCenterNet::prepareInputsOutputs(InferenceEngine::CNNNetwork& cnnNetwork) { + // --------------------------- Configure input & output ------------------------------------------------- + // --------------------------- Prepare input blobs ------------------------------------------------------ + slog::info << "Checking that the inputs are as the demo expects" << slog::endl; + InferenceEngine::InputsDataMap inputInfo(cnnNetwork.getInputsInfo()); + if (inputInfo.size() != 1) { + throw std::logic_error("This demo accepts networks that have only one input"); + } + + InferenceEngine::InputInfo::Ptr& input = inputInfo.begin()->second; + const InferenceEngine::TensorDesc& inputDesc = input->getTensorDesc(); + input->setPrecision(InferenceEngine::Precision::U8); + + if (inputDesc.getDims()[1] != 3) { + throw std::logic_error("Expected 3-channel input"); + } + input->getInputData()->setLayout(InferenceEngine::Layout::NHWC); + + // --------------------------- Reading image input parameters ------------------------------------------- + std::string imageInputName = inputInfo.begin()->first; + inputsNames.push_back(imageInputName); + netInputHeight = getTensorHeight(inputDesc); + netInputWidth = getTensorWidth(inputDesc); + + // --------------------------- Prepare output blobs ----------------------------------------------------- + slog::info << "Checking that the outputs are as the demo expects" << slog::endl; + + InferenceEngine::OutputsDataMap outputInfo(cnnNetwork.getOutputsInfo()); + if (outputInfo.size() != 3) { + throw std::logic_error("This demo expect networks that have 3 outputs blobs"); + } + + const InferenceEngine::TensorDesc& outputDesc = outputInfo.begin()->second->getTensorDesc(); + for (auto& output : outputInfo) { + output.second->setPrecision(InferenceEngine::Precision::FP32); + output.second->setLayout(InferenceEngine::Layout::NCHW); + outputsNames.push_back(output.first); + } + +} + +cv::Point2f getDir(const cv::Point2f& srcPoint, float rotRadius) { + float sn = sinf(rotRadius); + float cs = cosf(rotRadius); + + cv::Point2f srcResult(0.0f, 0.0f); + srcResult.x = srcPoint.x * cs - srcPoint.y * sn; + srcResult.y = srcPoint.x * sn + srcPoint.y * cs; + + return srcResult; +} + +cv::Point2f get3rdPoint(const cv::Point2f& a, const cv::Point2f& b) { + cv::Point2f direct = a - b; + return b + cv::Point2f(-direct.y, direct.x); +} + +cv::Mat getAffineTransform(float centerX, float centerY, int srcW, float rot, size_t outputWidth, size_t outputHeight, bool inv = false) { + float rotRad = static_cast(CV_PI) * rot / 180.0f; + auto srcDir = getDir({ 0.0f, -0.5f * srcW }, rotRad); + cv::Point2f dstDir(0.0f, -0.5f * outputWidth); + std::vector src(3, { 0.0f, 0.0f }); + std::vector dst(3, { 0.0f, 0.0f }); + + src[0] = { centerX, centerY }; + src[1] = srcDir + src[0]; + src[2] = get3rdPoint(src[0], src[1]); + + dst[0] = { outputWidth * 0.5f, outputHeight * 0.5f }; + dst[1] = dst[0] + dstDir; + dst[2] = get3rdPoint(dst[0], dst[1]); + + cv::Mat trans; + if (inv) { + trans = cv::getAffineTransform(dst, src); + } + else { + trans = cv::getAffineTransform(src, dst); + } + + return trans; +} + +std::shared_ptr ModelCenterNet::preprocess(const InputData& inputData, InferenceEngine::InferRequest::Ptr& request) { + auto& img = inputData.asRef().inputImage; + + int imgWidth = img.cols; + int imgHeight = img.rows; + float centerX = imgWidth / 2.0f; + float centerY = imgHeight / 2.0f; + int scale = std::max(imgWidth, imgHeight); + + auto transInput = getAffineTransform(centerX, centerY, scale, 0, netInputWidth, netInputHeight); + cv::Mat resizedImg; + cv::warpAffine(img, resizedImg, transInput, cv::Size(netInputWidth, netInputHeight), cv::INTER_LINEAR); + request->SetBlob(inputsNames[0], wrapMat2Blob(resizedImg)); + + return std::shared_ptr(new InternalImageModelData(img.cols, img.rows)); +} + +std::vector> nms(float* scoresPtr, InferenceEngine::SizeVector sz, float threshold, int kernel = 3) { + std::vector> scores; + scores.reserve(ModelCenterNet::INIT_VECTOR_SIZE); + auto chSize = sz[2] * sz[3]; + + for (int i = 0; i < sz[1] * sz[2] * sz[3]; ++i) { + scoresPtr[i] = expf(scoresPtr[i]) / (1 + expf(scoresPtr[i])); + } + + for (int ch = 0; ch < sz[1]; ++ch) { + for (int w = 0; w < sz[2]; ++w) { + for (int h = 0; h < sz[3]; ++h) { + float max = scoresPtr[chSize * ch + sz[2] * w + h]; + + // --------------------- filter on threshold-------------------------------------- + if (max < threshold) { + continue; + } + + // --------------------- store index and score------------------------------------ + scores.push_back({ chSize * ch + sz[2] * w + h, max }); + + bool next = true; + // ---------------------- maxpool2d ----------------------------------------------- + for (int i = -kernel / 2; i < kernel / 2 + 1 && next; ++i) { + for (int j = -kernel / 2; j < kernel / 2 + 1; ++j) { + if (w + i >= 0 && w + i < sz[2] && h + j >= 0 && h + j < sz[3]) { + if (scoresPtr[chSize * ch + sz[2] * (w + i) + h + j] > max) { + scores.pop_back(); + next = false; + break; + } + } + else { + if (max < 0) { + scores.pop_back(); + next = false; + break; + } + } + } + } + } + } + } + + return scores; +} + + +static std::vector> filterScores(const InferenceEngine::MemoryBlob::Ptr& scoresInfRes, float threshold) { + InferenceEngine::LockedMemory scoresOutputMapped = scoresInfRes->rmap(); + auto desc = scoresInfRes->getTensorDesc(); + auto sz = desc.getDims(); + float *scoresPtr = scoresOutputMapped.as(); + + return nms(scoresPtr, sz, threshold); +} + +std::vector> filterReg(const InferenceEngine::MemoryBlob::Ptr& regInfRes, const std::vector>& scores, size_t chSize) { + InferenceEngine::LockedMemory bboxesOutputMapped = regInfRes->rmap(); + const float *regPtr = bboxesOutputMapped.as(); + std::vector> reg; + + for (auto s : scores) { + reg.push_back({ regPtr[s.first % chSize], regPtr[chSize + s.first % chSize] }); + } + + return reg; +} + +std::vector> filterWH(const InferenceEngine::MemoryBlob::Ptr& whInfRes, const std::vector>& scores, size_t chSize) { + InferenceEngine::LockedMemory bboxesOutputMapped = whInfRes->rmap(); + const float *whPtr = bboxesOutputMapped.as(); + std::vector> wh; + + for (auto s : scores) { + wh.push_back({ whPtr[s.first % chSize], whPtr[chSize + s.first % chSize] }); + } + + return wh; +} + +std::vector calcBBoxes(const std::vector>& scores, const std::vector>& reg, + const std::vector>& wh, const InferenceEngine::SizeVector& sz) { + std::vector bboxes(scores.size()); + + for (int i = 0; i < bboxes.size(); ++i) { + size_t chIdx = scores[i].first % (sz[2] * sz[3]); + auto xCenter = chIdx % sz[3]; + auto yCenter = chIdx / sz[3]; + + bboxes[i].left = xCenter + reg[i].first - wh[i].first / 2.0f; + bboxes[i].top = yCenter + reg[i].second - wh[i].second / 2.0f; + bboxes[i].right = xCenter + reg[i].first + wh[i].first / 2.0f; + bboxes[i].bottom = yCenter + reg[i].second + wh[i].second / 2.0f; + } + + return bboxes; +} + +void transform(std::vector& bboxes, const InferenceEngine::SizeVector& sz, int scale, float centerX, float centerY) { + cv::Mat1f trans = getAffineTransform(centerX, centerY, scale, 0, sz[2], sz[3], true); + + for (auto& b : bboxes) { + ModelCenterNet::BBox newbb; + + newbb.left = trans.at(0, 0) * b.left + trans.at(0, 1) * b.top + trans.at(0, 2); + newbb.top = trans.at(1, 0) * b.left + trans.at(1, 1) * b.top + trans.at(1, 2); + newbb.right = trans.at(0, 0) * b.right + trans.at(0, 1) * b.bottom + trans.at(0, 2); + newbb.bottom = trans.at(1, 0) * b.right + trans.at(1, 1) * b.bottom + trans.at(1, 2); + + b = newbb; + } +} + +std::unique_ptr ModelCenterNet::postprocess(InferenceResult& infResult) { + // --------------------------- Filter data and get valid indices --------------------------------- + auto heatInfRes = infResult.outputsData[outputsNames[0]]; + auto sz = heatInfRes->getTensorDesc().getDims();; + auto chSize = sz[2] * sz[3]; + auto scores = filterScores(heatInfRes, confidenceThreshold); + + auto regInfRes = infResult.outputsData[outputsNames[1]]; + auto reg = filterReg(regInfRes, scores, chSize); + + auto whInfRes = infResult.outputsData[outputsNames[2]]; + auto wh = filterWH(whInfRes, scores, chSize); + + // --------------------------- Calculate bounding boxes & apply inverse affine transform ---------- + auto bboxes = calcBBoxes(scores, reg, wh, sz); + + auto imgWidth = infResult.internalModelData->asRef().inputImgWidth; + auto imgHeight = infResult.internalModelData->asRef().inputImgHeight; + auto scale = std::max(imgWidth, imgHeight); + float centerX = imgWidth / 2.0f; + float centerY = imgHeight / 2.0f; + + transform(bboxes, sz, scale, centerX, centerY); + + // --------------------------- Create detection result objects ------------------------------------ + DetectionResult* result = new DetectionResult; + *static_cast(result) = static_cast(infResult); + + result->objects.reserve(scores.size()); + for (int i = 0; i < scores.size(); ++i) { + DetectedObject desc; + desc.confidence = scores[i].second; + desc.labelID = scores[i].first / chSize; + desc.label = getLabelName(desc.labelID); + desc.x = bboxes[i].left; + desc.y = bboxes[i].top; + desc.width = bboxes[i].getWidth(); + desc.height = bboxes[i].getHeight(); + + result->objects.push_back(desc); + } + + return std::unique_ptr(result); +} diff --git a/demos/common/cpp/models/src/detection_model_faceboxes.cpp b/demos/common/cpp/models/src/detection_model_faceboxes.cpp new file mode 100644 index 00000000000..06222ff465c --- /dev/null +++ b/demos/common/cpp/models/src/detection_model_faceboxes.cpp @@ -0,0 +1,292 @@ +/* +// Copyright (C) 2018-2020 Intel Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +*/ + +#include +#include "models/detection_model_faceboxes.h" +#include +#include +#include + +using namespace InferenceEngine; + +ModelFaceBoxes::ModelFaceBoxes(const std::string& modelFileName, + float confidenceThreshold, bool useAutoResize, float boxIOUThreshold) + : DetectionModel(modelFileName, confidenceThreshold, useAutoResize, {"Face"}), + boxIOUThreshold(boxIOUThreshold), variance({0.1f, 0.2f}), steps({32, 64, 128}), + minSizes({ {32, 64, 128}, {256}, {512} }) { +} + +void ModelFaceBoxes::prepareInputsOutputs(InferenceEngine::CNNNetwork& cnnNetwork) { +// --------------------------- Configure input & output ------------------------------------------------- +// --------------------------- Prepare input blobs ------------------------------------------------------ + slog::info << "Checking that the inputs are as the demo expects" << slog::endl; + InputsDataMap inputInfo(cnnNetwork.getInputsInfo()); + + if (inputInfo.size() != 1) { + throw std::logic_error("This demo accepts networks that have only one input"); + } + + InputInfo::Ptr& input = inputInfo.begin()->second; + const TensorDesc& inputDesc = input->getTensorDesc(); + input->setPrecision(Precision::U8); + + if (inputDesc.getDims()[1] != 3) { + throw std::logic_error("Expected 3-channel input"); + } + + if (useAutoResize) { + input->getPreProcess().setResizeAlgorithm(ResizeAlgorithm::RESIZE_BILINEAR); + input->getInputData()->setLayout(Layout::NHWC); + } + else { + input->getInputData()->setLayout(Layout::NCHW); + } + +// --------------------------- Reading image input parameters ------------------------------------------- + std::string imageInputName = inputInfo.begin()->first; + inputsNames.push_back(imageInputName); + netInputHeight = getTensorHeight(inputDesc); + netInputWidth = getTensorWidth(inputDesc); + +// --------------------------- Prepare output blobs ----------------------------------------------------- + slog::info << "Checking that the outputs are as the demo expects" << slog::endl; + + InferenceEngine::OutputsDataMap outputInfo(cnnNetwork.getOutputsInfo()); + + if (outputInfo.size() != 2) { + throw std::logic_error("This demo expect networks that have 2 outputs blobs"); + } + + const TensorDesc& outputDesc = outputInfo.begin()->second->getTensorDesc(); + maxProposalsCount = outputDesc.getDims()[1]; + + for (auto& output : outputInfo) { + output.second->setPrecision(InferenceEngine::Precision::FP32); + output.second->setLayout(InferenceEngine::Layout::CHW); + outputsNames.push_back(output.first); + } + +} + +void calculateAnchors(std::vector* anchors, const std::vector& vx, const std::vector& vy, + const int minSize, const int step) { + float skx = static_cast(minSize); + float sky = static_cast(minSize); + + std::vector dense_cx, dense_cy; + + for (auto x : vx) { + dense_cx.push_back(x * step); + } + + for (auto y : vy) { + dense_cy.push_back(y * step); + } + + for (auto cy : dense_cy) { + for (auto cx : dense_cx) { + anchors->push_back({ static_cast(cx - 0.5f * skx), static_cast(cy - 0.5f * sky), + static_cast( cx + 0.5f * skx), static_cast(cy + 0.5f * sky) }); // left top right bottom + } + } + +} + +void calculateAnchorsZeroLevel(std::vector* anchors, const int fx, const int fy, + const std::vector& minSizes, const int step) { + for (auto s : minSizes) { + std::vector vx, vy; + if (s == 32) { + vx.push_back(static_cast(fx)); + vx.push_back(fx + 0.25f); + vx.push_back(fx + 0.5f); + vx.push_back(fx + 0.75f); + + vy.push_back(static_cast(fy)); + vy.push_back(fy + 0.25f); + vy.push_back(fy + 0.5f); + vy.push_back(fy + 0.75f); + } + else if (s == 64) { + vx.push_back(static_cast(fx)); + vx.push_back(fx + 0.5f); + + vy.push_back(static_cast(fy)); + vy.push_back(fy + 0.5f); + } + else { + vx.push_back(fx + 0.5f); + vy.push_back(fy + 0.5f); + } + calculateAnchors(anchors, vx, vy, s, step); + } +} + +void ModelFaceBoxes::priorBoxes(const std::vector>& featureMaps) { + anchors.reserve(maxProposalsCount); + + for (size_t k = 0; k < featureMaps.size(); ++k) { + std::vector a; + for (int i = 0; i < featureMaps[k].first; ++i) { + for (int j = 0; j < featureMaps[k].second; ++j) { + if (k == 0) { + calculateAnchorsZeroLevel(&anchors, j, i, minSizes[k], steps[k]);; + } + else { + calculateAnchors(&anchors, { j + 0.5f }, { i + 0.5f }, minSizes[k][0], steps[k]); + } + } + } + } +} + +std::vector nms(const std::vector& boxes, const std::vector& scores, const float thresh) { + + std::vector areas(boxes.size()); + + for (int i = 0; i < boxes.size(); ++i) { + areas[i] = (boxes[i].right - boxes[i].left) * (boxes[i].bottom - boxes[i].top); + } + + std::vector order(scores.size()); + std::iota(order.begin(), order.end(), 0); + std::sort(order.begin(), order.end(), [&scores](int o1, int o2) { return scores[o1] > scores[o2]; }); + + int ordersNum = 0; + for (; ordersNum < order.size() && scores[order[ordersNum]] >= 0; ordersNum++); + std::vector keep; + bool shouldContinue = true; + for (int i = 0; shouldContinue && i < ordersNum; ++i) { + auto idx1 = order[i]; + if (idx1 >= 0) { + keep.push_back(idx1); + shouldContinue = false; + for (int j = i + 1; j < ordersNum; ++j) { + auto idx2 = order[j]; + if (idx2 >= 0) { + shouldContinue = true; + auto overlappingWidth = std::min(boxes[idx1].right, boxes[idx2].right) - std::max(boxes[idx1].left, boxes[idx2].left); + auto overlappingHeight = std::min(boxes[idx1].bottom, boxes[idx2].bottom) - std::max(boxes[idx1].top, boxes[idx2].top); + auto intersection = overlappingWidth > 0 && overlappingHeight > 0 ? overlappingWidth * overlappingHeight : 0; + auto overlap = static_cast(intersection) / (areas[idx1] + areas[idx2] - intersection); + + if (overlap >= thresh) { + order[j] = -1; + } + } + } + } + } + return keep; +} + + +std::pair, std::vector> filterScores(InferenceEngine::MemoryBlob::Ptr scoreInfRes, const float confidenceThreshold) { + auto desc = scoreInfRes->getTensorDesc(); + auto sz = desc.getDims(); + LockedMemory outputMapped = scoreInfRes->rmap(); + const float* scoresPtr = outputMapped.as(); + + std::vector indices; + std::vector scores; + scores.reserve(ModelFaceBoxes::INIT_VECTOR_SIZE); + indices.reserve(ModelFaceBoxes::INIT_VECTOR_SIZE); + for (size_t i = 1; i < sz[1] * sz[2]; i = i + 2) { + if (scoresPtr[i] > confidenceThreshold) { + indices.push_back(i / 2); + scores.push_back(scoresPtr[i]); + } + } + + return { indices, scores }; +} + +std::vector filterBBoxes(InferenceEngine::MemoryBlob::Ptr bboxesInfRes, const std::vector& anchors, + const std::vector& validIndices, const std::vector& variance) { + LockedMemory bboxesOutputMapped = bboxesInfRes->rmap(); + auto desc = bboxesInfRes->getTensorDesc(); + auto sz = desc.getDims(); + const float *bboxesPtr = bboxesOutputMapped.as(); + + std::vector bboxes; + bboxes.reserve(ModelFaceBoxes::INIT_VECTOR_SIZE); + for (auto i : validIndices) { + auto objStart = sz[2] * i; + + auto dx = bboxesPtr[objStart]; + auto dy = bboxesPtr[objStart + 1]; + auto dw = bboxesPtr[objStart + 2]; + auto dh = bboxesPtr[objStart + 3]; + + auto predCtrX = dx * variance[0] * anchors[i].getWidth() + anchors[i].getXCenter(); + auto predCtrY = dy * variance[0] * anchors[i].getHeight() + anchors[i].getYCenter(); + auto predW = exp(dw * variance[1]) * anchors[i].getWidth(); + auto predH = exp(dh * variance[1]) * anchors[i].getHeight(); + + bboxes.push_back({ static_cast(predCtrX - 0.5f * predW), static_cast(predCtrY - 0.5f * predH), + static_cast(predCtrX + 0.5f * predW), static_cast(predCtrY + 0.5f * predH) }); + + } + + return bboxes; +} + +std::unique_ptr ModelFaceBoxes::postprocess(InferenceResult& infResult) { +// --------------------------- Calculating anchors at first start ---------------------------------------------------- + if (anchors.size() == 0) { + std::vector> featureMaps; + for (auto s : steps) { + featureMaps.push_back({ netInputHeight / s, netInputWidth / s }); + } + + priorBoxes(featureMaps); + } + +// --------------------------- Filter scores and get valid indices for bounding boxes---------------------------------- + const auto scoresInfRes = infResult.outputsData[outputsNames[1]]; + auto scores = filterScores(scoresInfRes, confidenceThreshold); + +// --------------------------- Filter bounding boxes on indices ------------------------------------------------------- + auto bboxesInfRes = infResult.outputsData[outputsNames[0]]; + std::vector bboxes = filterBBoxes(bboxesInfRes, anchors, scores.first, variance); + +// --------------------------- Apply Non-maximum Suppression ---------------------------------------------------------- + std::vector keep = nms(bboxes, scores.second, boxIOUThreshold); + +// --------------------------- Create detection result objects -------------------------------------------------------- + DetectionResult* result = new DetectionResult; + *static_cast(result) = static_cast(infResult); + auto imgWidth = infResult.internalModelData->asRef().inputImgWidth; + auto imgHeight = infResult.internalModelData->asRef().inputImgHeight; + float scaleX = static_cast(netInputWidth) / imgWidth; + float scaleY = static_cast(netInputHeight) / imgHeight; + + result->objects.reserve(keep.size()); + for (auto i : keep) { + DetectedObject desc; + desc.confidence = static_cast(scores.second[i]); + desc.x = static_cast(bboxes[i].left / scaleX); + desc.y = static_cast(bboxes[i].top / scaleY); + desc.width = static_cast(bboxes[i].getWidth() / scaleX); + desc.height = static_cast(bboxes[i].getHeight() / scaleY); + desc.labelID = 0; + desc.label = labels[0]; + + result->objects.push_back(desc); + } + + return std::unique_ptr(result); +} diff --git a/demos/common/cpp/models/src/detection_model_retinaface.cpp b/demos/common/cpp/models/src/detection_model_retinaface.cpp new file mode 100644 index 00000000000..24766ff4ec0 --- /dev/null +++ b/demos/common/cpp/models/src/detection_model_retinaface.cpp @@ -0,0 +1,394 @@ +/* +// Copyright (C) 2020-2021 Intel Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +*/ + +#include +#include +#include +#include "models/detection_model_retinaface.h" + +ModelRetinaFace::ModelRetinaFace(const std::string& modelFileName, float confidenceThreshold, bool useAutoResize, float boxIOUThreshold) + : DetectionModel(modelFileName, confidenceThreshold, useAutoResize, {"Face"}), // Default label is "Face" + boxIOUThreshold(boxIOUThreshold), maskThreshold(0.8f), shouldDetectMasks(false), landmarkStd(1.0f), + anchorCfg({ {32, { 32, 16 }, 16, { 1 }}, + { 16, { 8, 4 }, 16, { 1 }}, + { 8, { 2, 1 }, 16, { 1 }} }) { + generateAnchorsFpn(); +} + +void ModelRetinaFace::prepareInputsOutputs(InferenceEngine::CNNNetwork& cnnNetwork) { + // --------------------------- Configure input & output ------------------------------------------------- + // --------------------------- Prepare input blobs ------------------------------------------------------ + slog::info << "Checking that the inputs are as the demo expects" << slog::endl; + InferenceEngine::InputsDataMap inputInfo(cnnNetwork.getInputsInfo()); + if (inputInfo.size() != 1) { + throw std::logic_error("This demo accepts networks that have only one input"); + } + InferenceEngine::InputInfo::Ptr& input = inputInfo.begin()->second; + std::string imageInputName = inputInfo.begin()->first; + inputsNames.push_back(imageInputName); + input->setPrecision(InferenceEngine::Precision::U8); + if (useAutoResize) { + input->getPreProcess().setResizeAlgorithm(InferenceEngine::ResizeAlgorithm::RESIZE_BILINEAR); + input->getInputData()->setLayout(InferenceEngine::Layout::NHWC); + } + else { + input->getInputData()->setLayout(InferenceEngine::Layout::NCHW); + } + + //--- Reading image input parameters + imageInputName = inputInfo.begin()->first; + const InferenceEngine::TensorDesc& inputDesc = inputInfo.begin()->second->getTensorDesc(); + netInputHeight = getTensorHeight(inputDesc); + netInputWidth = getTensorWidth(inputDesc); + + // --------------------------- Prepare output blobs ----------------------------------------------------- + slog::info << "Checking that the outputs are as the demo expects" << slog::endl; + + InferenceEngine::OutputsDataMap outputInfo(cnnNetwork.getOutputsInfo()); + + std::vector outputsSizes[OT_MAX]; + for (auto& output : outputInfo) { + output.second->setPrecision(InferenceEngine::Precision::FP32); + output.second->setLayout(InferenceEngine::Layout::NCHW); + outputsNames.push_back(output.first); + + EOutputType type = OT_MAX; + if (output.first.find("bbox") != -1) { + type = OT_BBOX; + } + else if (output.first.find("cls") != -1) { + type = OT_SCORES; + } + else if (output.first.find("landmark") != -1) { + type = OT_LANDMARK; + } + else if (output.first.find("type") != -1) { + type = OT_MASKSCORES; + labels.clear(); + labels.push_back("No Mask"); + labels.push_back("Mask"); + shouldDetectMasks = true; + landmarkStd = 0.2f; + } + else { + continue; + } + + size_t num = output.second->getDims()[2]; + size_t i = 0; + for (; i < outputsSizes[type].size(); ++i) { + if (num < outputsSizes[type][i]) { + break; + } + } + separateOutputsNames[type].insert(separateOutputsNames[type].begin() + i, output.first); + outputsSizes[type].insert(outputsSizes[type].begin() + i, num); + } + + if (outputsNames.size() != 9 && outputsNames.size() != 12) { + throw std::logic_error("Expected 12 or 9 output blobs"); + } + + for (int idx = 0; idx < outputsSizes[OT_BBOX].size(); ++idx) { + int width = outputsSizes[OT_BBOX][idx]; + int height = outputsSizes[OT_BBOX][idx]; + auto s = anchorCfg[idx].stride; + auto anchorNum = anchorsFpn[s].size(); + + anchors.push_back(std::vector(height * width * anchorNum)); + for (int iw = 0; iw < width; ++iw) { + auto sw = iw * s; + for (int ih = 0; ih < height; ++ih) { + auto sh = ih * s; + for (int k = 0; k < anchorNum; ++k) { + Anchor& anc = anchors[idx][(ih * width + iw) * anchorNum + k]; + anc.left = anchorsFpn[s][k].left + sw; + anc.top = anchorsFpn[s][k].top + sh; + anc.right = anchorsFpn[s][k].right + sw; + anc.bottom = anchorsFpn[s][k].bottom + sh; + } + } + } + } +} + +std::vector ratioEnum(const ModelRetinaFace::Anchor& anchor, const std::vector& ratios) { + std::vector retVal; + auto w = anchor.getWidth(); + auto h = anchor.getHeight(); + auto xCtr = anchor.getXCenter(); + auto yCtr = anchor.getYCenter(); + + for (auto ratio : ratios) { + auto size = w * h; + auto sizeRatio = static_cast(size) / ratio; + auto ws = sqrt(sizeRatio); + auto hs = ws * ratio; + retVal.push_back({ static_cast(xCtr - 0.5f * (ws - 1.0f)), static_cast(yCtr - 0.5f * (hs - 1.0f)), + static_cast(xCtr + 0.5f * (ws - 1.0f)), static_cast(yCtr + 0.5f * (hs - 1.0f)) }); + } + return retVal; +} + +std::vector scaleEnum(const ModelRetinaFace::Anchor& anchor, const std::vector& scales) { + std::vector retVal; + auto w = anchor.getWidth(); + auto h = anchor.getHeight(); + auto xCtr = anchor.getXCenter(); + auto yCtr = anchor.getYCenter(); + + for (auto scale : scales) { + auto ws = w * scale; + auto hs = h * scale; + retVal.push_back({ static_cast(xCtr - 0.5f * (ws - 1.0f)), static_cast(yCtr - 0.5f * (hs - 1.0f)), + static_cast(xCtr + 0.5f * (ws - 1.0f)), static_cast(yCtr + 0.5f * (hs - 1.0f)) }); + } + return retVal; +} + +std::vector generateAnchors(const int baseSize, const std::vector& ratios, const std::vector& scales) { + ModelRetinaFace::Anchor baseAnchor{ 0.0f, 0.0f, baseSize - 1.0f, baseSize - 1.0f }; + auto ratioAnchors = ratioEnum(baseAnchor, ratios); + std::vector retVal; + + for (const auto& ra : ratioAnchors) { + auto addon = scaleEnum(ra, scales); + retVal.insert(retVal.end(), addon.begin(), addon.end()); + } + return retVal; +} + +void ModelRetinaFace::generateAnchorsFpn() { + auto cfg = anchorCfg; + std::sort(cfg.begin(), cfg.end(), [](const AnchorCfgLine& x, const AnchorCfgLine& y) { return x.stride > y.stride; }); + + for (const auto& cfgLine : cfg) { + anchorsFpn.emplace(cfgLine.stride, generateAnchors(cfgLine.baseSize, cfgLine.ratios, cfgLine.scales)); + } +} + + +std::vector thresholding(const InferenceEngine::MemoryBlob::Ptr& rawData, const int anchorNum, const float confidenceThreshold) { + std::vector indices; + indices.reserve(ModelRetinaFace::INIT_VECTOR_SIZE); + auto desc = rawData->getTensorDesc(); + auto sz = desc.getDims(); + size_t restAnchors = sz[1] - anchorNum; + InferenceEngine::LockedMemory outputMapped = rawData->rmap(); + const float *memPtr = outputMapped.as(); + + for (size_t x = anchorNum; x < sz[1]; ++x) { + for (size_t y = 0; y < sz[2]; ++y) { + for (size_t z = 0; z < sz[3]; ++z) { + auto idx = (x * sz[2] + y) * sz[3] + z; + auto score = memPtr[idx]; + if (score >= confidenceThreshold) { + indices.push_back((y * sz[3] + z) * restAnchors + (x - anchorNum)); + } + } + } + } + + return indices; +} + +void filterScores(std::vector& scores, const std::vector& indices, const InferenceEngine::MemoryBlob::Ptr& rawData, const int anchorNum) { + InferenceEngine::LockedMemory outputMapped = rawData->rmap(); + const float *memPtr = outputMapped.as(); + auto desc = rawData->getTensorDesc(); + auto sz = desc.getDims(); + auto start = sz[2] * sz[3] * anchorNum; + + for (auto i : indices) { + auto offset = (i % anchorNum) * sz[2] * sz[3] + i / anchorNum;; + scores.push_back(memPtr[start + offset]); + } +} + +void filterBBoxes(std::vector& bboxes, const std::vector& indices, const InferenceEngine::MemoryBlob::Ptr& rawData, + int anchorNum, const std::vector& anchors) { + auto desc = rawData->getTensorDesc(); + auto sz = desc.getDims(); + auto bboxPredLen = sz[1] / anchorNum; + auto blockWidth = sz[2] * sz[3]; + InferenceEngine::LockedMemory outputMapped = rawData->rmap(); + const float *memPtr = outputMapped.as(); + + for (auto i : indices) { + auto offset = blockWidth * bboxPredLen * (i % anchorNum) + (i / anchorNum); + + auto dx = memPtr[offset]; + auto dy = memPtr[offset + blockWidth]; + auto dw = memPtr[offset + blockWidth * 2]; + auto dh = memPtr[offset + blockWidth * 3]; + + auto predCtrX = dx * anchors[i].getWidth() + anchors[i].getXCenter(); + auto predCtrY = dy * anchors[i].getHeight() + anchors[i].getYCenter(); + auto predW = exp(dw) * anchors[i].getWidth(); + auto predH = exp(dh) * anchors[i].getHeight(); + + bboxes.push_back({ static_cast(predCtrX - 0.5f * (predW - 1.0f)), static_cast(predCtrY - 0.5f * (predH - 1.0f)), + static_cast(predCtrX + 0.5f * (predW - 1.0f)), static_cast(predCtrY + 0.5f * (predH - 1.0f)) }); + } +} + + +void filterLandmarks(std::vector& landmarks, const std::vector& indices, const InferenceEngine::MemoryBlob::Ptr& rawData, + int anchorNum, const std::vector& anchors, const float landmarkStd) { + auto desc = rawData->getTensorDesc(); + auto sz = desc.getDims(); + auto landmarkPredLen = sz[1] / anchorNum; + auto blockWidth = sz[2] * sz[3]; + InferenceEngine::LockedMemory outputMapped = rawData->rmap(); + const float *memPtr = outputMapped.as(); + + for (auto i : indices) { + auto ctrX = anchors[i].getXCenter(); + auto ctrY = anchors[i].getYCenter(); + for (int j = 0; j < ModelRetinaFace::LANDMARKS_NUM; ++j) { + auto offset = (i % anchorNum) * landmarkPredLen * sz[2] * sz[3] + i / anchorNum; + auto deltaX = memPtr[offset + j * 2 * blockWidth] * landmarkStd; + auto deltaY = memPtr[offset + (j * 2 + 1) * blockWidth] * landmarkStd; + landmarks.push_back({deltaX * anchors[i].getWidth() + anchors[i].getXCenter(), + deltaY * anchors[i].getHeight() + anchors[i].getYCenter() }); + } + } +} + +void filterMasksScores(std::vector& masks, const std::vector& indices, const InferenceEngine::MemoryBlob::Ptr& rawData, const int anchorNum) { + auto desc = rawData->getTensorDesc(); + auto sz = desc.getDims(); + auto start = sz[2] * sz[3] * anchorNum * 2; + InferenceEngine::LockedMemory outputMapped = rawData->rmap(); + const float *memPtr = outputMapped.as(); + + for (auto i : indices) { + auto offset = (i % anchorNum) * sz[2] * sz[3] + i / anchorNum; + masks.push_back(memPtr[start + offset]); + } +} + +std::vector nms(const std::vector& boxes, const std::vector& scores, const float thresh) { + std::vector areas(boxes.size()); + for (int i = 0; i < boxes.size(); ++i) { + areas[i] = (boxes[i].right - boxes[i].left) * (boxes[i].bottom - boxes[i].top); + } + std::vector order(scores.size()); + std::iota(order.begin(), order.end(), 0); + std::sort(order.begin(), order.end(), [&scores](int o1, int o2) { return scores[o1] > scores[o2]; }); + + int ordersNum = 0; + for (; ordersNum < order.size() && scores[order[ordersNum]] >= 0; ordersNum++); + + std::vector keep; + bool shouldContinue = true; + for (int i = 0; shouldContinue && i < ordersNum; ++i) { + auto idx1 = order[i]; + if (idx1 >= 0) { + keep.push_back(idx1); + shouldContinue = false; + for (int j = i + 1; j < ordersNum; ++j) { + auto idx2 = order[j]; + if (idx2 >= 0) { + shouldContinue = true; + auto overlappingWidth = std::fminf(boxes[idx1].right, boxes[idx2].right) - std::fmaxf(boxes[idx1].left, boxes[idx2].left); + auto overlappingHeight = std::fminf(boxes[idx1].bottom, boxes[idx2].bottom) - std::fmaxf(boxes[idx1].top, boxes[idx2].top); + auto intersection = overlappingWidth > 0 && overlappingHeight > 0 ? overlappingWidth * overlappingHeight : 0; + auto overlap = intersection / (areas[idx1] + areas[idx2] - intersection); + + if (overlap >= thresh) { + order[j] = -1; + } + } + } + } + } + return keep; +} + +std::unique_ptr ModelRetinaFace::postprocess(InferenceResult& infResult) { + std::vector scores; + scores.reserve(INIT_VECTOR_SIZE); + std::vector bboxes; + bboxes.reserve(INIT_VECTOR_SIZE); + std::vector landmarks; + landmarks.reserve(INIT_VECTOR_SIZE); + std::vector masks; + + if (shouldDetectMasks) { + masks.reserve(INIT_VECTOR_SIZE); + } + + // --------------------------- Gather & Filter output from all levels ---------------------------------------------------------- + for (int idx = 0; idx < anchorCfg.size(); ++idx) { + const auto bboxRaw = infResult.outputsData[separateOutputsNames[OT_BBOX][idx]]; + const auto scoresRaw = infResult.outputsData[separateOutputsNames[OT_SCORES][idx]]; + const auto landmarksRaw = infResult.outputsData[separateOutputsNames[OT_LANDMARK][idx]]; + auto s = anchorCfg[idx].stride; + auto anchorNum = anchorsFpn[s].size(); + + auto validIndices = thresholding(scoresRaw, anchorNum, confidenceThreshold); + filterScores(scores, validIndices, scoresRaw, anchorNum); + filterBBoxes(bboxes, validIndices, bboxRaw, anchorNum, anchors[idx]); + filterLandmarks(landmarks, validIndices, landmarksRaw, anchorNum, anchors[idx], landmarkStd); + + if (shouldDetectMasks) { + const auto masksRaw = infResult.outputsData[separateOutputsNames[OT_MASKSCORES][idx]]; + filterMasksScores(masks, validIndices, masksRaw, anchorNum); + } + } + // --------------------------- Apply Non-maximum Suppression ---------------------------------------------------------- + auto keep = nms(bboxes, scores, boxIOUThreshold); + + // --------------------------- Create detection result objects -------------------------------------------------------- + RetinaFaceDetectionResult* result = new RetinaFaceDetectionResult; + *static_cast(result) = static_cast(infResult); + + auto imgWidth = infResult.internalModelData->asRef().inputImgWidth; + auto imgHeight = infResult.internalModelData->asRef().inputImgHeight; + auto scaleX = static_cast(netInputWidth) / imgWidth; + auto scaleY = static_cast(netInputHeight) / imgHeight; + + result->objects.reserve(keep.size()); + result->landmarks.reserve(keep.size() * ModelRetinaFace::LANDMARKS_NUM); + for (auto i : keep) { + DetectedObject desc; + desc.confidence = scores[i]; + //--- Scaling coordinates + bboxes[i].left /= scaleX; + bboxes[i].top /= scaleY; + bboxes[i].right /= scaleX; + bboxes[i].bottom /= scaleY; + + desc.x = bboxes[i].left; + desc.y = bboxes[i].top; + desc.width = bboxes[i].getWidth(); + desc.height = bboxes[i].getHeight(); + //--- Default label 0 - Face. If detecting masks then labels would be 0 - No Mask, 1 - Mask + desc.labelID = shouldDetectMasks ? (masks[i] > maskThreshold) : 0; + desc.label = labels[desc.labelID]; + result->objects.push_back(desc); + + //--- Scaling landmarks coordinates + for (size_t l = 0; l < ModelRetinaFace::LANDMARKS_NUM; ++l) { + landmarks[i * ModelRetinaFace::LANDMARKS_NUM + l].x /= scaleX; + landmarks[i * ModelRetinaFace::LANDMARKS_NUM + l].y /= scaleY; + result->landmarks.push_back(landmarks[i * ModelRetinaFace::LANDMARKS_NUM + l]); + } + } + + return std::unique_ptr(result);; +} diff --git a/demos/common/models/src/detection_model_ssd.cpp b/demos/common/cpp/models/src/detection_model_ssd.cpp similarity index 73% rename from demos/common/models/src/detection_model_ssd.cpp rename to demos/common/cpp/models/src/detection_model_ssd.cpp index 0e7e0ece7ad..685b101d867 100644 --- a/demos/common/models/src/detection_model_ssd.cpp +++ b/demos/common/cpp/models/src/detection_model_ssd.cpp @@ -15,8 +15,8 @@ */ #include "models/detection_model_ssd.h" -#include -#include +#include +#include #include using namespace InferenceEngine; @@ -27,20 +27,17 @@ ModelSSD::ModelSSD(const std::string& modelFileName, DetectionModel(modelFileName, confidenceThreshold, useAutoResize, labels) { } -void ModelSSD::onLoadCompleted(InferenceEngine::ExecutableNetwork* execNetwork, const std::vector& requests) { - DetectionModel::onLoadCompleted(execNetwork, requests); - - // --- Setting image info for every request in a pool. We can do it once and reuse this info at every submit ------- +std::shared_ptr ModelSSD::preprocess(const InputData& inputData, InferenceEngine::InferRequest::Ptr& request) { if (inputsNames.size() > 1) { - for (auto &request : requests) { - auto blob = request->GetBlob(inputsNames[1]); - LockedMemory blobMapped = as(blob)->wmap(); - auto data = blobMapped.as(); - data[0] = static_cast(netInputHeight); - data[1] = static_cast(netInputWidth); - data[2] = 1; - } + auto blob = request->GetBlob(inputsNames[1]); + LockedMemory blobMapped = as(blob)->wmap(); + auto data = blobMapped.as(); + data[0] = static_cast(netInputHeight); + data[1] = static_cast(netInputWidth); + data[2] = 1; } + + return DetectionModel::preprocess(inputData, request); } std::unique_ptr ModelSSD::postprocess(InferenceResult& infResult) { @@ -129,35 +126,6 @@ void ModelSSD::prepareInputsOutputs(InferenceEngine::CNNNetwork& cnnNetwork) { DataPtr& output = outputInfo.begin()->second; outputsNames.push_back(outputInfo.begin()->first); - int num_classes = 0; - - if (auto ngraphFunction = cnnNetwork.getFunction()) { - for (const auto op : ngraphFunction->get_ops()) { - if (op->get_friendly_name() == outputsNames[0]) { - auto detOutput = std::dynamic_pointer_cast(op); - if (!detOutput) { - THROW_IE_EXCEPTION << "Object Detection network output layer(" + op->get_friendly_name() + - ") should be DetectionOutput, but was " + op->get_type_info().name; - } - - num_classes = detOutput->get_attrs().num_classes; - break; - } - } - } - else { - throw std::logic_error("This demo requires IR version no older than 10"); - } - - if (labels.size()) { - if (static_cast(labels.size()) == (num_classes - 1)) { // if network assumes default "background" class, having no label - labels.insert(labels.begin(), "fake"); - } - else if (static_cast(labels.size()) != num_classes) { - throw std::logic_error("The number of labels is different from numbers of model classes"); - } - } - const SizeVector outputDims = output->getTensorDesc().getDims(); if (outputDims.size() != 4) { diff --git a/demos/common/models/src/detection_model_yolo.cpp b/demos/common/cpp/models/src/detection_model_yolo.cpp similarity index 96% rename from demos/common/models/src/detection_model_yolo.cpp rename to demos/common/cpp/models/src/detection_model_yolo.cpp index 331d83b9001..73c51f4b5b5 100644 --- a/demos/common/models/src/detection_model_yolo.cpp +++ b/demos/common/cpp/models/src/detection_model_yolo.cpp @@ -15,8 +15,8 @@ */ #include "models/detection_model_yolo.h" -#include -#include +#include +#include #include using namespace InferenceEngine; @@ -79,11 +79,6 @@ void ModelYolo3::prepareInputsOutputs(InferenceEngine::CNNNetwork& cnnNetwork) { else { throw std::runtime_error("Can't get ngraph::Function. Make sure the provided model is in IR version 10 or greater."); } - - if (!this->labels.empty() && static_cast(labels.size()) != regions.begin()->second.classes) { - throw std::runtime_error(std::string("The number of labels (") + std::to_string(labels.size()) + - ") is different from numbers of model classes (" + std::to_string(regions.begin()->second.classes) + ")"); - } } std::unique_ptr ModelYolo3::postprocess(InferenceResult & infResult) { diff --git a/demos/common/cpp/models/src/hpe_model_openpose.cpp b/demos/common/cpp/models/src/hpe_model_openpose.cpp new file mode 100644 index 00000000000..1c3c2b2f82b --- /dev/null +++ b/demos/common/cpp/models/src/hpe_model_openpose.cpp @@ -0,0 +1,212 @@ +/* +// Copyright (C) 2018-2021 Intel Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +*/ + +#include +#include +#include + +#include + +#include "models/hpe_model_openpose.h" +#include "models/openpose_decoder.h" + +#include +#include +#include + +using namespace InferenceEngine; + +const cv::Vec3f HPEOpenPose::meanPixel = cv::Vec3f::all(128); +const float HPEOpenPose::minPeaksDistance = 3.0f; +const float HPEOpenPose::midPointsScoreThreshold = 0.05f; +const float HPEOpenPose::foundMidPointsRatioThreshold = 0.8f; +const float HPEOpenPose::minSubsetScore = 0.2f; + +HPEOpenPose::HPEOpenPose(const std::string& modelFileName, double aspectRatio, int targetSize, float confidenceThreshold) : + ModelBase(modelFileName), + aspectRatio(aspectRatio), + targetSize(targetSize), + confidenceThreshold(confidenceThreshold) { +} + +void HPEOpenPose::prepareInputsOutputs(CNNNetwork& cnnNetwork) { + // --------------------------- Configure input & output ------------------------------------------------- + // --------------------------- Prepare input blobs ------------------------------------------------------ + ICNNNetwork::InputShapes inputShapes = cnnNetwork.getInputShapes(); + if (inputShapes.size() != 1) + throw std::runtime_error("Demo supports topologies only with 1 input"); + inputsNames.push_back(inputShapes.begin()->first); + SizeVector& inSizeVector = inputShapes.begin()->second; + if (inSizeVector.size() != 4 || inSizeVector[0] != 1 || inSizeVector[1] != 3) + throw std::runtime_error("3-channel 4-dimensional model's input is expected"); + + InputInfo& inputInfo = *cnnNetwork.getInputsInfo().begin()->second; + inputInfo.setPrecision(Precision::U8); + inputInfo.getInputData()->setLayout(Layout::NCHW); + + // --------------------------- Prepare output blobs ----------------------------------------------------- + const OutputsDataMap& outputInfo = cnnNetwork.getOutputsInfo(); + if (outputInfo.size() != 2) + throw std::runtime_error("Demo supports topologies only with 2 outputs"); + + for (const auto& outputLayer: outputInfo) { + outputLayer.second->setPrecision(Precision::FP32); + outputLayer.second->setLayout(Layout::NCHW); + outputsNames.push_back(outputLayer.first); + } + + auto outputIt = outputInfo.begin(); + const SizeVector& pafsOutputDims = (*outputIt++).second->getTensorDesc().getDims(); + if (pafsOutputDims.size() != 4 || pafsOutputDims[0] != 1 || pafsOutputDims[1] != 2 * (keypointsNumber + 1)) + throw std::runtime_error("1x" + std::to_string(2 * (keypointsNumber + 1)) + "xHFMxWFM dimension of model's output is expected"); + const SizeVector& heatmapsOutputDims = (*outputIt++).second->getTensorDesc().getDims(); + if (heatmapsOutputDims.size() != 4 || heatmapsOutputDims[0] != 1 || heatmapsOutputDims[1] != keypointsNumber + 1) + throw std::runtime_error("1x" + std::to_string(keypointsNumber + 1) + "xHFMxWFM dimension of model's heatmap is expected"); + if (pafsOutputDims[2] != heatmapsOutputDims[2] || pafsOutputDims[3] != heatmapsOutputDims[3]) + throw std::runtime_error("output and heatmap are expected to have matching last two dimensions"); +} + +void HPEOpenPose::reshape(CNNNetwork& cnnNetwork) { + ICNNNetwork::InputShapes inputShapes = cnnNetwork.getInputShapes(); + SizeVector& InputLayerDims = inputShapes.begin()->second; + if (!targetSize) { + targetSize = InputLayerDims[2]; + } + int height = static_cast((targetSize + stride - 1) / stride) * stride; + int inputWidth = static_cast(std::round(targetSize * aspectRatio)); + int width = static_cast((inputWidth + stride - 1) / stride) * stride; + InputLayerDims[0] = 1; + InputLayerDims[2] = height; + InputLayerDims[3] = width; + inputLayerSize = cv::Size(InputLayerDims[3], InputLayerDims[2]); + cnnNetwork.reshape(inputShapes); +} + +std::shared_ptr HPEOpenPose::preprocess(const InputData& inputData, InferRequest::Ptr& request) { + auto& image = inputData.asRef().inputImage; + Blob::Ptr frameBlob = request->GetBlob(inputsNames[0]); + cv::Mat resizedImage; + double scale = inputLayerSize.height / static_cast(image.rows); + cv::resize(image, resizedImage, cv::Size(), scale, scale, cv::INTER_CUBIC); + int h = resizedImage.rows; + int w = resizedImage.cols; + if (inputLayerSize.width < w) + throw std::runtime_error("The image aspect ratio doesn't fit current model shape"); + cv::Mat paddedImage; + int bottom = inputLayerSize.height - h; + int right = inputLayerSize.width - w; + cv::copyMakeBorder(resizedImage, paddedImage, 0, bottom, 0, right, + cv::BORDER_CONSTANT, meanPixel); + matU8ToBlob(paddedImage, frameBlob); + return std::shared_ptr(new InternalScaleData(image.cols / static_cast(w), + image.rows / static_cast(h))); +} + +std::unique_ptr HPEOpenPose::postprocess(InferenceResult& infResult) { + HumanPoseResult* result = new HumanPoseResult; + *static_cast(result) = static_cast(infResult); + + auto outputMapped = infResult.outputsData[outputsNames[0]]; + auto heatMapsMapped = infResult.outputsData[outputsNames[1]]; + + const SizeVector& outputDims = outputMapped->getTensorDesc().getDims(); + const SizeVector& heatMapDims = heatMapsMapped->getTensorDesc().getDims(); + + float* predictions = outputMapped->rmap().as(); + float* heats = heatMapsMapped->rmap().as(); + + std::vector heatMaps(keypointsNumber); + for (size_t i = 0; i < heatMaps.size(); i++) { + heatMaps[i] = cv::Mat(heatMapDims[2], heatMapDims[3], CV_32FC1, + heats + i * heatMapDims[2] * heatMapDims[3]); + } + resizeFeatureMaps(heatMaps); + + std::vector pafs(outputDims[1]); + for (size_t i = 0; i < pafs.size(); i++) { + pafs[i] = cv::Mat(heatMapDims[2], heatMapDims[3], CV_32FC1, + predictions + i * heatMapDims[2] * heatMapDims[3]); + } + resizeFeatureMaps(pafs); + + std::vector poses = extractPoses(heatMaps, pafs); + + const auto& scale = infResult.internalModelData->asRef(); + float scaleX = stride / upsampleRatio * scale.x; + float scaleY = stride / upsampleRatio * scale.y; + for (auto& pose : poses) { + for (auto& keypoint : pose.keypoints) { + if (keypoint != cv::Point2f(-1, -1)) { + keypoint.x *= scaleX; + keypoint.y *= scaleY; + } + } + } + for (size_t i = 0; i < poses.size(); ++i) { + result->poses.push_back(poses[i]); + } + + return std::unique_ptr(result); +} + +void HPEOpenPose::resizeFeatureMaps(std::vector& featureMaps) const { + for (auto& featureMap : featureMaps) { + cv::resize(featureMap, featureMap, cv::Size(), + upsampleRatio, upsampleRatio, cv::INTER_CUBIC); + } +} + +class FindPeaksBody: public cv::ParallelLoopBody { +public: + FindPeaksBody(const std::vector& heatMaps, float minPeaksDistance, + std::vector >& peaksFromHeatMap, float confidenceThreshold) + : heatMaps(heatMaps), + minPeaksDistance(minPeaksDistance), + peaksFromHeatMap(peaksFromHeatMap), + confidenceThreshold(confidenceThreshold) {} + + void operator()(const cv::Range& range) const override { + for (int i = range.start; i < range.end; i++) { + findPeaks(heatMaps, minPeaksDistance, peaksFromHeatMap, i, confidenceThreshold); + } + } + +private: + const std::vector& heatMaps; + float minPeaksDistance; + float confidenceThreshold; + std::vector >& peaksFromHeatMap; +}; + +std::vector HPEOpenPose::extractPoses( + const std::vector& heatMaps, + const std::vector& pafs) const { + std::vector> peaksFromHeatMap(heatMaps.size()); + FindPeaksBody findPeaksBody(heatMaps, minPeaksDistance, peaksFromHeatMap, confidenceThreshold); + cv::parallel_for_(cv::Range(0, static_cast(heatMaps.size())), + findPeaksBody); + int peaksBefore = 0; + for (size_t heatmapId = 1; heatmapId < heatMaps.size(); heatmapId++) { + peaksBefore += static_cast(peaksFromHeatMap[heatmapId - 1].size()); + for (auto& peak : peaksFromHeatMap[heatmapId]) { + peak.id += peaksBefore; + } + } + std::vector poses = groupPeaksToPoses( + peaksFromHeatMap, pafs, keypointsNumber, midPointsScoreThreshold, + foundMidPointsRatioThreshold, minJointsNumber, minSubsetScore); + return poses; +} diff --git a/demos/human_pose_estimation_demo/src/peak.cpp b/demos/common/cpp/models/src/openpose_decoder.cpp similarity index 92% rename from demos/human_pose_estimation_demo/src/peak.cpp rename to demos/common/cpp/models/src/openpose_decoder.cpp index 26602293ff2..6538445a436 100644 --- a/demos/human_pose_estimation_demo/src/peak.cpp +++ b/demos/common/cpp/models/src/openpose_decoder.cpp @@ -1,16 +1,27 @@ -// Copyright (C) 2018-2019 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 +/* +// Copyright (C) 2018-2021 Intel Corporation // +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +*/ #include #include #include -#include +#include +#include "models/openpose_decoder.h" -#include "peak.hpp" -namespace human_pose_estimation { Peak::Peak(const int id, const cv::Point2f& pos, const float score) : id(id), pos(pos), @@ -31,8 +42,7 @@ TwoJointsConnection::TwoJointsConnection(const int firstJointIdx, void findPeaks(const std::vector& heatMaps, const float minPeaksDistance, std::vector >& allPeaks, - int heatMapId) { - const float threshold = 0.1f; + int heatMapId, float confidenceThreshold) { std::vector peaks; const cv::Mat& heatMap = heatMaps[heatMapId]; const float* heatMapData = heatMap.ptr(); @@ -45,7 +55,7 @@ void findPeaks(const std::vector& heatMaps, && x < heatMap.cols && y < heatMap.rows) { val = heatMapData[y * heatMapStep + x]; - val = val >= threshold ? val : 0; + val = val >= confidenceThreshold ? val : 0; } float left_val = 0; @@ -53,7 +63,7 @@ void findPeaks(const std::vector& heatMaps, && x < (heatMap.cols - 1) && y < heatMap.rows) { left_val = heatMapData[y * heatMapStep + x + 1]; - left_val = left_val >= threshold ? left_val : 0; + left_val = left_val >= confidenceThreshold ? left_val : 0; } float right_val = 0; @@ -61,7 +71,7 @@ void findPeaks(const std::vector& heatMaps, && y >= 0 && y < heatMap.rows) { right_val = heatMapData[y * heatMapStep + x - 1]; - right_val = right_val >= threshold ? right_val : 0; + right_val = right_val >= confidenceThreshold ? right_val : 0; } float top_val = 0; @@ -69,7 +79,7 @@ void findPeaks(const std::vector& heatMaps, && x < heatMap.cols && y < (heatMap.rows - 1)) { top_val = heatMapData[(y + 1) * heatMapStep + x]; - top_val = top_val >= threshold ? top_val : 0; + top_val = top_val >= confidenceThreshold ? top_val : 0; } float bottom_val = 0; @@ -77,7 +87,7 @@ void findPeaks(const std::vector& heatMaps, && y > 0 && x < heatMap.cols) { bottom_val = heatMapData[(y - 1) * heatMapStep + x]; - bottom_val = bottom_val >= threshold ? bottom_val : 0; + bottom_val = bottom_val >= confidenceThreshold ? bottom_val : 0; } if ((val > left_val) @@ -311,8 +321,8 @@ std::vector groupPeaksToPoses(const std::vector >& continue; } int position = -1; - HumanPose pose(std::vector(keypointsNumber, cv::Point2f(-1.0f, -1.0f)), - subsetI.score * std::max(0, subsetI.nJoints - 1)); + HumanPose pose{std::vector(keypointsNumber, cv::Point2f(-1.0f, -1.0f)), + subsetI.score * std::max(0, subsetI.nJoints - 1)}; for (const auto& peakIdx : subsetI.peaksIndices) { position++; if (peakIdx >= 0) { @@ -325,4 +335,3 @@ std::vector groupPeaksToPoses(const std::vector >& } return poses; } -} // namespace human_pose_estimation diff --git a/demos/common/models/src/segmentation_model.cpp b/demos/common/cpp/models/src/segmentation_model.cpp similarity index 85% rename from demos/common/models/src/segmentation_model.cpp rename to demos/common/cpp/models/src/segmentation_model.cpp index 20f7477e68b..fe78f64ff5c 100644 --- a/demos/common/models/src/segmentation_model.cpp +++ b/demos/common/cpp/models/src/segmentation_model.cpp @@ -15,10 +15,15 @@ */ #include "models/segmentation_model.h" -#include "samples/ocv_common.hpp" +#include "utils/ocv_common.hpp" using namespace InferenceEngine; +SegmentationModel::SegmentationModel(const std::string& modelFileName, bool useAutoResize) : + ModelBase(modelFileName), + useAutoResize(useAutoResize) { +} + void SegmentationModel::prepareInputsOutputs(InferenceEngine::CNNNetwork& cnnNetwork) { // --------------------------- Configure input & output --------------------------------------------- // --------------------------- Prepare input blobs ----------------------------------------------------- @@ -29,14 +34,16 @@ void SegmentationModel::prepareInputsOutputs(InferenceEngine::CNNNetwork& cnnNet SizeVector& inSizeVector = inputShapes.begin()->second; if (inSizeVector.size() != 4 || inSizeVector[1] != 3) throw std::runtime_error("3-channel 4-dimensional model's input is expected"); - inSizeVector[0] = 1; // set batch size to 1 - cnnNetwork.reshape(inputShapes); InputInfo& inputInfo = *cnnNetwork.getInputsInfo().begin()->second; - inputInfo.getPreProcess().setResizeAlgorithm(ResizeAlgorithm::RESIZE_BILINEAR); - inputInfo.setLayout(Layout::NHWC); inputInfo.setPrecision(Precision::U8); - + if (useAutoResize) { + inputInfo.getPreProcess().setResizeAlgorithm(ResizeAlgorithm::RESIZE_BILINEAR); + inputInfo.setLayout(Layout::NHWC); + } + else { + inputInfo.setLayout(Layout::NCHW); + } // --------------------------- Prepare output blobs ----------------------------------------------------- const OutputsDataMap& outputsDataMap = cnnNetwork.getOutputsInfo(); if (outputsDataMap.size() != 1) throw std::runtime_error("Demo supports topologies only with 1 output"); @@ -69,7 +76,16 @@ std::shared_ptr SegmentationModel::preprocess(const InputData auto imgData = inputData.asRef(); auto& img = imgData.inputImage; - request->SetBlob(inputsNames[0], wrapMat2Blob(img)); + if (useAutoResize) { + /* Just set input blob containing read image. Resize and layout conversionx will be done automatically */ + request->SetBlob(inputsNames[0], wrapMat2Blob(img)); + } + else { + /* Resize and copy data from the image to the input blob */ + Blob::Ptr frameBlob = request->GetBlob(inputsNames[0]); + matU8ToBlob(img, frameBlob); + } + return std::shared_ptr(new InternalImageModelData(img.cols, img.rows)); } diff --git a/demos/common/monitors/CMakeLists.txt b/demos/common/cpp/monitors/CMakeLists.txt similarity index 100% rename from demos/common/monitors/CMakeLists.txt rename to demos/common/cpp/monitors/CMakeLists.txt diff --git a/demos/common/monitors/include/monitors/cpu_monitor.h b/demos/common/cpp/monitors/include/monitors/cpu_monitor.h similarity index 100% rename from demos/common/monitors/include/monitors/cpu_monitor.h rename to demos/common/cpp/monitors/include/monitors/cpu_monitor.h diff --git a/demos/common/monitors/include/monitors/memory_monitor.h b/demos/common/cpp/monitors/include/monitors/memory_monitor.h similarity index 100% rename from demos/common/monitors/include/monitors/memory_monitor.h rename to demos/common/cpp/monitors/include/monitors/memory_monitor.h diff --git a/demos/common/monitors/include/monitors/presenter.h b/demos/common/cpp/monitors/include/monitors/presenter.h similarity index 100% rename from demos/common/monitors/include/monitors/presenter.h rename to demos/common/cpp/monitors/include/monitors/presenter.h diff --git a/demos/common/monitors/src/cpu_monitor.cpp b/demos/common/cpp/monitors/src/cpu_monitor.cpp similarity index 100% rename from demos/common/monitors/src/cpu_monitor.cpp rename to demos/common/cpp/monitors/src/cpu_monitor.cpp diff --git a/demos/common/monitors/src/memory_monitor.cpp b/demos/common/cpp/monitors/src/memory_monitor.cpp similarity index 100% rename from demos/common/monitors/src/memory_monitor.cpp rename to demos/common/cpp/monitors/src/memory_monitor.cpp diff --git a/demos/common/monitors/src/presenter.cpp b/demos/common/cpp/monitors/src/presenter.cpp similarity index 100% rename from demos/common/monitors/src/presenter.cpp rename to demos/common/cpp/monitors/src/presenter.cpp diff --git a/demos/common/monitors/src/query_wrapper.cpp b/demos/common/cpp/monitors/src/query_wrapper.cpp similarity index 100% rename from demos/common/monitors/src/query_wrapper.cpp rename to demos/common/cpp/monitors/src/query_wrapper.cpp diff --git a/demos/common/monitors/src/query_wrapper.h b/demos/common/cpp/monitors/src/query_wrapper.h similarity index 100% rename from demos/common/monitors/src/query_wrapper.h rename to demos/common/cpp/monitors/src/query_wrapper.h diff --git a/demos/common/pipelines/CMakeLists.txt b/demos/common/cpp/pipelines/CMakeLists.txt similarity index 75% rename from demos/common/pipelines/CMakeLists.txt rename to demos/common/cpp/pipelines/CMakeLists.txt index ade14eeaa9d..38846db61be 100644 --- a/demos/common/pipelines/CMakeLists.txt +++ b/demos/common/cpp/pipelines/CMakeLists.txt @@ -2,10 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 # +find_package(InferenceEngine 2.0 REQUIRED) find_package(OpenCV REQUIRED COMPONENTS core imgproc) -FILE(GLOB SOURCES ./src/*.cpp) -FILE(GLOB HEADERS ./include/pipelines/*.h) +file(GLOB SOURCES ./src/*.cpp) +file(GLOB HEADERS ./include/pipelines/*.h) # Create named folders for the sources within the .vcproj # Empty name lists them directly under the .vcproj @@ -14,4 +15,4 @@ source_group("include" FILES ${HEADERS}) add_library(pipelines STATIC ${SOURCES} ${HEADERS}) target_include_directories(pipelines PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") -target_link_libraries(pipelines PRIVATE gflags ${InferenceEngine_LIBRARIES} models common opencv_core opencv_imgproc) +target_link_libraries(pipelines PRIVATE gflags ${InferenceEngine_LIBRARIES} models utils opencv_core opencv_imgproc) diff --git a/demos/common/pipelines/include/pipelines/async_pipeline.h b/demos/common/cpp/pipelines/include/pipelines/async_pipeline.h similarity index 76% rename from demos/common/pipelines/include/pipelines/async_pipeline.h rename to demos/common/cpp/pipelines/include/pipelines/async_pipeline.h index 66dc81e8a80..339f9b2bcab 100644 --- a/demos/common/pipelines/include/pipelines/async_pipeline.h +++ b/demos/common/cpp/pipelines/include/pipelines/async_pipeline.h @@ -37,11 +37,10 @@ class AsyncPipeline { virtual ~AsyncPipeline(); /// Waits until either output data becomes available or pipeline allows to submit more input data. - /// Function will treat results as ready only if next sequential result (frame) is ready. - void waitForData(); + /// @param shouldKeepOrder if true, function will treat results as ready only if next sequential result (frame) is + /// ready (so results can be extracted in the same order as they were submitted). Otherwise, function will return if any result is ready. + void waitForData(bool shouldKeepOrder = true); - /// Returns true if there's available infer requests in the pool - /// and next frame can be submitted for processing. /// @returns true if there's available infer requests in the pool /// and next frame can be submitted for processing, false otherwise. bool isReadyToProcess() { return requestsPool->isIdleRequestAvailable(); } @@ -55,18 +54,20 @@ class AsyncPipeline { /// @param metaData - shared pointer to metadata container. /// Might be null. This pointer will be passed through pipeline and put to the final result structure. /// @returns -1 if image cannot be scheduled for processing (there's no free InferRequest available). - /// Otherwise returns unique sequential frame ID for this particular request. Same frame ID will be written in the response structure. + /// Otherwise returns unique sequential frame ID for this particular request. Same frame ID will be written in the result structure. virtual int64_t submitData(const InputData& inputData, const std::shared_ptr& metaData); /// Gets available data from the queue - /// Function will treat results as ready only if next sequential result (frame) is ready. - virtual std::unique_ptr getResult(); + /// @param shouldKeepOrder if true, function will treat results as ready only if next sequential result (frame) is + /// ready (so results can be extracted in the same order as they were submitted). Otherwise, function will return if any result is ready. + virtual std::unique_ptr getResult(bool shouldKeepOrder = true); protected: /// Returns processed result, if available - /// Function will treat results as ready only if next sequential result (frame) is ready. + /// @param shouldKeepOrder if true, function will return processed data sequentially, + /// keeping original frames order (as they were submitted). Otherwise, function will return processed data in random order. /// @returns InferenceResult with processed information or empty InferenceResult (with negative frameID) if there's no any results yet. - virtual InferenceResult getInferenceResult(); + virtual InferenceResult getInferenceResult(bool shouldKeepOrder); std::unique_ptr requestsPool; std::unordered_map completedInferenceResults; diff --git a/demos/common/pipelines/include/pipelines/config_factory.h b/demos/common/cpp/pipelines/include/pipelines/config_factory.h similarity index 100% rename from demos/common/pipelines/include/pipelines/config_factory.h rename to demos/common/cpp/pipelines/include/pipelines/config_factory.h diff --git a/demos/common/pipelines/include/pipelines/metadata.h b/demos/common/cpp/pipelines/include/pipelines/metadata.h similarity index 75% rename from demos/common/pipelines/include/pipelines/metadata.h rename to demos/common/cpp/pipelines/include/pipelines/metadata.h index 389265476b4..ae22964ebde 100644 --- a/demos/common/pipelines/include/pipelines/metadata.h +++ b/demos/common/cpp/pipelines/include/pipelines/metadata.h @@ -15,7 +15,7 @@ */ #pragma once -#include +#include struct MetaData { virtual ~MetaData() {} @@ -36,8 +36,17 @@ struct ImageMetaData : public MetaData { ImageMetaData() { } - ImageMetaData(cv::Mat img, std::chrono::steady_clock::time_point timeStamp): + ImageMetaData(cv::Mat img, std::chrono::steady_clock::time_point timeStamp) : img(img), timeStamp(timeStamp) { } }; + +struct ClassificationImageMetaData : public ImageMetaData { + unsigned int groundTruthId; + + ClassificationImageMetaData(cv::Mat img, std::chrono::steady_clock::time_point timeStamp, unsigned int groundTruthId) : + ImageMetaData(img, timeStamp), + groundTruthId(groundTruthId) { + } +}; diff --git a/demos/common/pipelines/include/pipelines/requests_pool.h b/demos/common/cpp/pipelines/include/pipelines/requests_pool.h similarity index 100% rename from demos/common/pipelines/include/pipelines/requests_pool.h rename to demos/common/cpp/pipelines/include/pipelines/requests_pool.h diff --git a/demos/common/pipelines/src/async_pipeline.cpp b/demos/common/cpp/pipelines/src/async_pipeline.cpp similarity index 79% rename from demos/common/pipelines/src/async_pipeline.cpp rename to demos/common/cpp/pipelines/src/async_pipeline.cpp index 58c77cfef4f..6ebad86bfec 100644 --- a/demos/common/pipelines/src/async_pipeline.cpp +++ b/demos/common/cpp/pipelines/src/async_pipeline.cpp @@ -16,8 +16,8 @@ #include "pipelines/async_pipeline.h" #include -#include -#include +#include +#include using namespace InferenceEngine; @@ -47,12 +47,7 @@ AsyncPipeline::AsyncPipeline(std::unique_ptr&& modelInstance, const C InferenceEngine::CNNNetwork cnnNetwork = engine.ReadNetwork(model->getModelFileName()); /** Set batch size to 1 **/ slog::info << "Batch size is forced to 1." << slog::endl; - - auto shapes = cnnNetwork.getInputShapes(); - for (auto& shape : shapes) { - shape.second[0] = 1; - } - cnnNetwork.reshape(shapes); + model->reshape(cnnNetwork); // -------------------------- Reading all outputs names and customizing I/O blobs (in inherited classes) model->prepareInputsOutputs(cnnNetwork); @@ -62,7 +57,17 @@ AsyncPipeline::AsyncPipeline(std::unique_ptr&& modelInstance, const C execNetwork = engine.LoadNetwork(cnnNetwork, cnnConfig.devices, cnnConfig.execNetworkConfig); // --------------------------- 5. Create infer requests ------------------------------------------------ - requestsPool.reset(new RequestsPool(execNetwork, cnnConfig.maxAsyncRequests)); + unsigned int nireq = cnnConfig.maxAsyncRequests; + if (nireq == 0) { + try { + // +1 to use it as a buffer of the pipeline + nireq = execNetwork.GetMetric(METRIC_KEY(OPTIMAL_NUMBER_OF_INFER_REQUESTS)).as() + 1; + } catch (const details::InferenceEngineException& ex) { + throw std::runtime_error(std::string("Every device used with the demo should support " + "OPTIMAL_NUMBER_OF_INFER_REQUESTS ExecutableNetwork metric. Failed to query the metric with error: ") + ex.what()); + } + } + requestsPool.reset(new RequestsPool(execNetwork, nireq)); // --------------------------- 6. Call onLoadCompleted to complete initialization of model ------------- model->onLoadCompleted(&execNetwork, requestsPool->getInferRequestsList()); @@ -72,12 +77,14 @@ AsyncPipeline::~AsyncPipeline() { waitForTotalCompletion(); } -void AsyncPipeline::waitForData() { +void AsyncPipeline::waitForData(bool shouldKeepOrder) { std::unique_lock lock(mtx); condVar.wait(lock, [&] {return callbackException != nullptr || requestsPool->isIdleRequestAvailable() || - completedInferenceResults.find(outputFrameId) != completedInferenceResults.end(); + (shouldKeepOrder ? + completedInferenceResults.find(outputFrameId) != completedInferenceResults.end() : + !completedInferenceResults.empty()); }); if (callbackException) @@ -116,7 +123,7 @@ int64_t AsyncPipeline::submitData(const InputData& inputData, const std::shared_ } catch (...) { if (!this->callbackException) { - this->callbackException = std::move(std::current_exception()); + this->callbackException = std::current_exception(); } } } @@ -131,24 +138,25 @@ int64_t AsyncPipeline::submitData(const InputData& inputData, const std::shared_ return frameID; } -std::unique_ptr AsyncPipeline::getResult() { - auto infResult = AsyncPipeline::getInferenceResult(); +std::unique_ptr AsyncPipeline::getResult(bool shouldKeepOrder) { + auto infResult = AsyncPipeline::getInferenceResult(shouldKeepOrder); if (infResult.IsEmpty()) { return std::unique_ptr(); } - auto result = model->postprocess(infResult); *result = static_cast(infResult); return result; } -InferenceResult AsyncPipeline::getInferenceResult() { +InferenceResult AsyncPipeline::getInferenceResult(bool shouldKeepOrder) { InferenceResult retVal; { std::lock_guard lock(mtx); - const auto& it = completedInferenceResults.find(outputFrameId); + const auto& it = shouldKeepOrder ? + completedInferenceResults.find(outputFrameId) : + completedInferenceResults.begin(); if (it != completedInferenceResults.end()) { retVal = std::move(it->second); diff --git a/demos/common/pipelines/src/config_factory.cpp b/demos/common/cpp/pipelines/src/config_factory.cpp similarity index 96% rename from demos/common/pipelines/src/config_factory.cpp rename to demos/common/cpp/pipelines/src/config_factory.cpp index a8cead5b561..93c42856744 100644 --- a/demos/common/pipelines/src/config_factory.cpp +++ b/demos/common/cpp/pipelines/src/config_factory.cpp @@ -18,8 +18,8 @@ #include -#include -#include +#include +#include #include using namespace InferenceEngine; @@ -106,9 +106,7 @@ CnnConfig ConfigFactory::getCommonConfig(const std::string& flags_d, const std:: config.clKernelsConfigPath = flags_c; } - if (flags_nireq) { - config.maxAsyncRequests = flags_nireq; - } + config.maxAsyncRequests = flags_nireq; /** Per layer metrics **/ if (flags_pc) { diff --git a/demos/common/pipelines/src/requests_pool.cpp b/demos/common/cpp/pipelines/src/requests_pool.cpp similarity index 100% rename from demos/common/pipelines/src/requests_pool.cpp rename to demos/common/cpp/pipelines/src/requests_pool.cpp diff --git a/demos/common/CMakeLists.txt b/demos/common/cpp/utils/CMakeLists.txt similarity index 55% rename from demos/common/CMakeLists.txt rename to demos/common/cpp/utils/CMakeLists.txt index 8671bbc9038..0fc709d9560 100644 --- a/demos/common/CMakeLists.txt +++ b/demos/common/cpp/utils/CMakeLists.txt @@ -5,16 +5,12 @@ find_package(InferenceEngine 2.0 REQUIRED) find_package(OpenCV REQUIRED COMPONENTS core imgcodecs videoio) -add_subdirectory(monitors) -add_subdirectory(models) -add_subdirectory(pipelines) - file(GLOB_RECURSE HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/include/*") file(GLOB_RECURSE SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/*") source_group("src" FILES ${SOURCES}) source_group("include" FILES ${HEADERS}) -add_library(common STATIC ${HEADERS} ${SOURCES}) -target_include_directories(common PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") -target_link_libraries(common PRIVATE gflags ${InferenceEngine_LIBRARIES} opencv_core opencv_imgcodecs opencv_videoio) +add_library(utils STATIC ${HEADERS} ${SOURCES}) +target_include_directories(utils PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") +target_link_libraries(utils PRIVATE gflags ${InferenceEngine_LIBRARIES} opencv_core opencv_imgcodecs opencv_videoio) diff --git a/demos/common/include/samples/args_helper.hpp b/demos/common/cpp/utils/include/utils/args_helper.hpp similarity index 100% rename from demos/common/include/samples/args_helper.hpp rename to demos/common/cpp/utils/include/utils/args_helper.hpp diff --git a/demos/common/include/samples/common.hpp b/demos/common/cpp/utils/include/utils/common.hpp similarity index 97% rename from demos/common/include/samples/common.hpp rename to demos/common/cpp/utils/include/utils/common.hpp index 9ac0e7a7268..8ab212ab8d5 100644 --- a/demos/common/include/samples/common.hpp +++ b/demos/common/cpp/utils/include/utils/common.hpp @@ -24,7 +24,7 @@ #include #ifndef UNUSED - #ifdef WIN32 + #ifdef _WIN32 #define UNUSED #else #define UNUSED __attribute__((unused)) @@ -36,17 +36,6 @@ constexpr std::size_t arraySize(const T (&)[N]) noexcept { return N; } -/** - * @brief Gets filename without extension - * @param filepath - full file name - * @return filename without extension - */ -static UNUSED std::string fileNameNoExt(const std::string &filepath) { - auto pos = filepath.rfind('.'); - if (pos == std::string::npos) return filepath; - return filepath.substr(0, pos); -} - // Helpers to print IE version information. // We don't directly define operator<< for InferenceEngine::Version // and such, because that won't get picked up by argument-dependent lookup diff --git a/demos/common/include/samples/default_flags.hpp b/demos/common/cpp/utils/include/utils/default_flags.hpp similarity index 100% rename from demos/common/include/samples/default_flags.hpp rename to demos/common/cpp/utils/include/utils/default_flags.hpp diff --git a/demos/common/include/samples/images_capture.h b/demos/common/cpp/utils/include/utils/images_capture.h similarity index 100% rename from demos/common/include/samples/images_capture.h rename to demos/common/cpp/utils/include/utils/images_capture.h diff --git a/demos/common/include/samples/ocv_common.hpp b/demos/common/cpp/utils/include/utils/ocv_common.hpp similarity index 99% rename from demos/common/include/samples/ocv_common.hpp rename to demos/common/cpp/utils/include/utils/ocv_common.hpp index 701b9c9c76d..352864d3aec 100644 --- a/demos/common/include/samples/ocv_common.hpp +++ b/demos/common/cpp/utils/include/utils/ocv_common.hpp @@ -11,7 +11,7 @@ #include -#include "samples/common.hpp" +#include "utils/common.hpp" /** * @brief Sets image data stored in cv::Mat object to a given Blob object. diff --git a/demos/common/include/samples/performance_metrics.hpp b/demos/common/cpp/utils/include/utils/performance_metrics.hpp similarity index 94% rename from demos/common/include/samples/performance_metrics.hpp rename to demos/common/cpp/utils/include/utils/performance_metrics.hpp index c573018338c..c39fa1053df 100644 --- a/demos/common/include/samples/performance_metrics.hpp +++ b/demos/common/cpp/utils/include/utils/performance_metrics.hpp @@ -14,7 +14,7 @@ #include #include -#include "samples/ocv_common.hpp" +#include "utils/ocv_common.hpp" class PerformanceMetrics { public: @@ -33,6 +33,7 @@ class PerformanceMetrics { void update(TimePoint lastRequestStartTime, cv::Mat& frame, cv::Point position = {15, 30}, + int fontFace = cv::FONT_HERSHEY_COMPLEX, double fontScale = 0.75, cv::Scalar color = {200, 10, 10}, int thickness = 2); @@ -46,6 +47,7 @@ class PerformanceMetrics { /// @param thickness font thickness void paintMetrics(cv::Mat& frame, cv::Point position = { 15, 30 }, + int fontFace = cv::FONT_HERSHEY_COMPLEX, double fontScale = 0.75, cv::Scalar color = { 200, 10, 10 }, int thickness = 2) const; diff --git a/demos/common/include/samples/slog.hpp b/demos/common/cpp/utils/include/utils/slog.hpp similarity index 100% rename from demos/common/include/samples/slog.hpp rename to demos/common/cpp/utils/include/utils/slog.hpp diff --git a/demos/common/src/args_helper.cpp b/demos/common/cpp/utils/src/args_helper.cpp similarity index 98% rename from demos/common/src/args_helper.cpp rename to demos/common/cpp/utils/src/args_helper.cpp index 6a14c0d322e..94c654261d5 100644 --- a/demos/common/src/args_helper.cpp +++ b/demos/common/cpp/utils/src/args_helper.cpp @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "samples/args_helper.hpp" -#include "samples/slog.hpp" +#include "utils/args_helper.hpp" +#include "utils/slog.hpp" #ifdef _WIN32 #include "w_dirent.hpp" diff --git a/demos/common/src/images_capture.cpp b/demos/common/cpp/utils/src/images_capture.cpp similarity index 99% rename from demos/common/src/images_capture.cpp rename to demos/common/cpp/utils/src/images_capture.cpp index f5317c43946..6848a77a823 100644 --- a/demos/common/src/images_capture.cpp +++ b/demos/common/cpp/utils/src/images_capture.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "samples/images_capture.h" +#include "utils/images_capture.h" #ifdef _WIN32 #include "w_dirent.hpp" diff --git a/demos/common/src/performance_metrics.cpp b/demos/common/cpp/utils/src/performance_metrics.cpp similarity index 89% rename from demos/common/src/performance_metrics.cpp rename to demos/common/cpp/utils/src/performance_metrics.cpp index e5a735040f6..8fe001c55d9 100644 --- a/demos/common/src/performance_metrics.cpp +++ b/demos/common/cpp/utils/src/performance_metrics.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "samples/performance_metrics.hpp" +#include "utils/performance_metrics.hpp" #include @@ -15,11 +15,12 @@ PerformanceMetrics::PerformanceMetrics(Duration timeWindow) void PerformanceMetrics::update(TimePoint lastRequestStartTime, cv::Mat& frame, cv::Point position, + int fontFace, double fontScale, cv::Scalar color, int thickness) { update(lastRequestStartTime); - paintMetrics(frame, position, fontScale, color, thickness); + paintMetrics(frame, position, fontFace, fontScale, color, thickness); } void PerformanceMetrics::update(TimePoint lastRequestStartTime) { @@ -44,20 +45,19 @@ void PerformanceMetrics::update(TimePoint lastRequestStartTime) { } } -void PerformanceMetrics::paintMetrics(cv::Mat & frame, cv::Point position, double fontScale, cv::Scalar color, int thickness) const{ +void PerformanceMetrics::paintMetrics(cv::Mat & frame, cv::Point position, int fontFace, double fontScale, cv::Scalar color, int thickness) const { // Draw performance stats over frame Metrics metrics = getLast(); std::ostringstream out; if (!std::isnan(metrics.latency)) { out << "Latency: " << std::fixed << std::setprecision(1) << metrics.latency << " ms"; - putHighlightedText(frame, out.str(), position, cv::FONT_HERSHEY_COMPLEX, fontScale, color, thickness); + putHighlightedText(frame, out.str(), position, fontFace, fontScale, color, thickness); } if (!std::isnan(metrics.fps)) { out.str(""); out << "FPS: " << std::fixed << std::setprecision(1) << metrics.fps; - putHighlightedText(frame, out.str(), {position.x, position.y + 30}, cv::FONT_HERSHEY_COMPLEX, fontScale, color, - thickness); + putHighlightedText(frame, out.str(), {position.x, position.y + 30}, fontFace, fontScale, color, thickness); } } diff --git a/demos/common/src/w_dirent.hpp b/demos/common/cpp/utils/src/w_dirent.hpp similarity index 100% rename from demos/common/src/w_dirent.hpp rename to demos/common/cpp/utils/src/w_dirent.hpp diff --git a/demos/python_demos/common/helpers.py b/demos/common/python/helpers.py similarity index 100% rename from demos/python_demos/common/helpers.py rename to demos/common/python/helpers.py diff --git a/demos/python_demos/common/html_reader.py b/demos/common/python/html_reader.py similarity index 88% rename from demos/python_demos/common/html_reader.py rename to demos/common/python/html_reader.py index f03d9eb25dd..726ee0325bb 100644 --- a/demos/python_demos/common/html_reader.py +++ b/demos/common/python/html_reader.py @@ -6,8 +6,8 @@ class HTMLDataExtractor(HTMLParser): def __init__(self, tags): super(HTMLDataExtractor, self).__init__() - self.started_tags = {k:[] for k in tags} - self.ended_tags = {k:[] for k in tags} + self.started_tags = {k: [] for k in tags} + self.ended_tags = {k: [] for k in tags} def handle_starttag(self, tag, attrs): if tag in self.started_tags: @@ -32,7 +32,7 @@ def get_paragraphs(url_list): parser = HTMLDataExtractor(['title', 'p']) charset='utf-8' if 'Content-type' in response.headers: - m = re.match('.*charset=(\S+).*', response.headers['Content-type']) + m = re.match(r'.*charset=(\S+).*', response.headers['Content-type']) if m: charset = m.group(1) data = response.read() diff --git a/demos/common/python/images_capture.py b/demos/common/python/images_capture.py new file mode 100644 index 00000000000..24713af2c2d --- /dev/null +++ b/demos/common/python/images_capture.py @@ -0,0 +1,172 @@ +import os +import sys +import copy + +import cv2 + + +class InvalidInput(Exception): + + def __init__(self, message): + self.message = message + + +class OpenError(Exception): + + def __init__(self, message): + self.message = message + + +class ImagesCapture: + + def read(): + raise NotImplementedError + + def fps(): + raise NotImplementedError + + def get_type(): + raise NotImplementedError + + +class ImreadWrapper(ImagesCapture): + + def __init__(self, input, loop): + self.loop = loop + if not os.path.isfile(input): + raise InvalidInput("Can't find the image by {}".format(input)) + self.image = cv2.imread(input, cv2.IMREAD_COLOR) + if self.image is None: + raise OpenError("Can't open the image from {}".format(input)) + self.can_read = True + + def read(self): + if self.loop: + return copy.deepcopy(self.image) + if self.can_read: + self.can_read = False + return copy.deepcopy(self.image) + return None + + def fps(self): + return 1.0 + + def get_type(self): + return 'IMAGE' + + +class DirReader(ImagesCapture): + + def __init__(self, input, loop): + self.loop = loop + self.dir = input + if not os.path.isdir(self.dir): + raise InvalidInput("Can't find the dir by {}".format(input)) + self.names = sorted(os.listdir(self.dir)) + if not self.names: + raise OpenError("The dir {} is empty".format(input)) + self.file_id = 0 + for name in self.names: + filename = os.path.join(self.dir, name) + image = cv2.imread(filename, cv2.IMREAD_COLOR) + if image is not None: + return + raise OpenError("Can't read the first image from {}".format(input)) + + def read(self): + while self.file_id < len(self.names): + filename = os.path.join(self.dir, self.names[self.file_id]) + image = cv2.imread(filename, cv2.IMREAD_COLOR) + self.file_id += 1 + if image is not None: + return image + if self.loop: + self.file_id = 0 + while self.file_id < len(self.names): + filename = os.path.join(self.dir, self.names[self.file_id]) + image = cv2.imread(filename, cv2.IMREAD_COLOR) + self.file_id += 1 + if image is not None: + return image + return None + + def fps(self): + return 1.0 + + def get_type(self): + return 'DIR' + + +class VideoCapWrapper(ImagesCapture): + + def __init__(self, input, loop): + self.loop = loop + self.cap = cv2.VideoCapture() + status = self.cap.open(input) + if not status: + raise InvalidInput("Can't open the video from {}".format(input)) + + def read(self): + status, image = self.cap.read() + if not status: + if not self.loop: + return None + self.cap.set(cv2.CAP_PROP_POS_FRAMES, 0) + status, image = self.cap.read() + if not status: + return None + return image + + def fps(self): + return self.cap.get(cv2.CAP_PROP_FPS) + + def get_type(self): + return 'VIDEO' + + +class CameraCapWrapper(ImagesCapture): + + def __init__(self, input, camera_resolution): + self.cap = cv2.VideoCapture() + try: + status = self.cap.open(int(input)) + self.cap.set(cv2.CAP_PROP_BUFFERSIZE, 1) + self.cap.set(cv2.CAP_PROP_FRAME_WIDTH, camera_resolution[0]) + self.cap.set(cv2.CAP_PROP_FRAME_HEIGHT, camera_resolution[1]) + self.cap.set(cv2.CAP_PROP_FPS, 30) + self.cap.set(cv2.CAP_PROP_AUTOFOCUS, 1) + self.cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc(*'MJPG')) + if not status: + raise OpenError("Can't open the camera from {}".format(input)) + except ValueError: + raise InvalidInput("Can't find the camera {}".format(input)) + + def read(self): + status, image = self.cap.read() + if not status: + return None + return image + + def fps(self): + return self.cap.get(cv2.CAP_PROP_FPS) + + def get_type(self): + return 'CAMERA' + + +def open_images_capture(input, loop, camera_resolution=(1280, 720)): + errors = {InvalidInput: [], OpenError: []} + for reader in (ImreadWrapper, DirReader, VideoCapWrapper): + try: + return reader(input, loop) + except (InvalidInput, OpenError) as e: + errors[type(e)].append(e.message) + try: + return CameraCapWrapper(input, camera_resolution) + except (InvalidInput, OpenError) as e: + errors[type(e)].append(e.message) + if not errors[OpenError]: + print(*errors[InvalidInput], file=sys.stderr, sep='\n') + else: + print(*errors[OpenError], file=sys.stderr, sep='\n') + sys.exit(1) diff --git a/demos/common/python/models/__init__.py b/demos/common/python/models/__init__.py new file mode 100644 index 00000000000..d7cc9260b9e --- /dev/null +++ b/demos/common/python/models/__init__.py @@ -0,0 +1,34 @@ +""" + Copyright (C) 2020 Intel Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + + +from .centernet import CenterNet +from .faceboxes import FaceBoxes +from .retinaface import RetinaFace +from .segmentation import SegmentationModel +from .ssd import SSD +from .utils import DetectionWithLandmarks +from .yolo import YOLO + +__all__ = [ + 'CenterNet', + 'DetectionWithLandmarks', + 'FaceBoxes', + 'RetinaFace', + 'SegmentationModel', + 'SSD', + 'YOLO', +] diff --git a/demos/python_demos/object_detection_demo_centernet/detector.py b/demos/common/python/models/centernet.py similarity index 72% rename from demos/python_demos/object_detection_demo_centernet/detector.py rename to demos/common/python/models/centernet.py index f6ddfd1aa79..e0fcbb5df83 100644 --- a/demos/python_demos/object_detection_demo_centernet/detector.py +++ b/demos/common/python/models/centernet.py @@ -1,5 +1,5 @@ """ - Copyright (c) 2019 Intel Corporation + Copyright (c) 2019-2020 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,28 +14,80 @@ limitations under the License. """ -import os import cv2 import numpy as np from numpy.lib.stride_tricks import as_strided +from .model import Model +from .utils import Detection, load_labels -class Detector(object): - def __init__(self, ie, model_path, threshold=0.3, device='CPU'): - model = ie.read_network(model_path, os.path.splitext(model_path)[0] + '.bin') - assert len(model.input_info) == 1, "Expected 1 input blob" - assert len(model.outputs) == 3, "Expected 3 output blobs" +class CenterNet(Model): + def __init__(self, ie, model_path, labels=None, threshold=0.3): + super().__init__(ie, model_path) - self._input_layer_name = next(iter(model.input_info)) - self._output_layer_names = sorted(model.outputs) + assert len(self.net.input_info) == 1, "Expected 1 input blob" + assert len(self.net.outputs) == 3, "Expected 3 output blobs" + + if isinstance(labels, (list, tuple)): + self.labels = labels + else: + self.labels = load_labels(labels) if labels else None + + self.image_blob_name = next(iter(self.net.input_info)) + self._output_layer_names = sorted(self.net.outputs) - self._ie = ie - self._exec_model = self._ie.load_network(model, device) self._threshold = threshold - self.infer_time = -1 - _, channels, self.input_height, self.input_width = model.input_info[self._input_layer_name].input_data.shape - assert channels == 3, "Expected 3-channel input" + + self.n, self.c, self.h, self.w = self.net.input_info[self.image_blob_name].input_data.shape + assert self.c == 3, "Expected 3-channel input" + + def preprocess(self, inputs): + image = inputs + meta = {'original_shape': image.shape} + + height, width = image.shape[0:2] + center = np.array([width / 2., height / 2.], dtype=np.float32) + scale = max(height, width) + trans_input = self.get_affine_transform(center, scale, 0, [self.w, self.h]) + resized_image = cv2.warpAffine(image, trans_input, (self.w, self.h), flags=cv2.INTER_LINEAR) + resized_image = np.transpose(resized_image, (2, 0, 1)) + + dict_inputs = {self.image_blob_name: resized_image} + return dict_inputs, meta + + def postprocess(self, outputs, meta): + heat = outputs[self._output_layer_names[0]][0] + reg = outputs[self._output_layer_names[1]][0] + wh = outputs[self._output_layer_names[2]][0] + heat = np.exp(heat)/(1 + np.exp(heat)) + height, width = heat.shape[1:3] + num_predictions = 100 + + heat = self._nms(heat) + scores, inds, clses, ys, xs = self._topk(heat, K=num_predictions) + reg = self._tranpose_and_gather_feat(reg, inds) + + reg = reg.reshape((num_predictions, 2)) + xs = xs.reshape((num_predictions, 1)) + reg[:, 0:1] + ys = ys.reshape((num_predictions, 1)) + reg[:, 1:2] + + wh = self._tranpose_and_gather_feat(wh, inds) + wh = wh.reshape((num_predictions, 2)) + clses = clses.reshape((num_predictions, 1)) + scores = scores.reshape((num_predictions, 1)) + bboxes = np.concatenate((xs - wh[..., 0:1] / 2, + ys - wh[..., 1:2] / 2, + xs + wh[..., 0:1] / 2, + ys + wh[..., 1:2] / 2), axis=1) + detections = np.concatenate((bboxes, scores, clses), axis=1) + mask = detections[..., 4] >= self._threshold + filtered_detections = detections[mask] + scale = max(meta['original_shape']) + center = np.array(meta['original_shape'][:2])/2.0 + dets = self._transform(filtered_detections, np.flip(center, 0), scale, height, width) + dets = [Detection(x[0], x[1], x[2], x[3], score=x[4], id=x[5]) for x in dets] + return dets @staticmethod def get_affine_transform(center, scale, rot, output_size, inv=False): @@ -89,7 +141,7 @@ def _gather_feat(feat, ind): def _tranpose_and_gather_feat(feat, ind): feat = np.transpose(feat, (1, 2, 0)) feat = feat.reshape((-1, feat.shape[2])) - feat = Detector._gather_feat(feat, ind) + feat = CenterNet._gather_feat(feat, ind) return feat @staticmethod @@ -107,10 +159,10 @@ def _topk(scores, K=40): topk_ind = np.argpartition(topk_scores, -K)[-K:] topk_score = topk_scores[topk_ind] topk_clses = topk_ind / K - topk_inds = Detector._gather_feat( + topk_inds = CenterNet._gather_feat( topk_inds.reshape((-1, 1)), topk_ind).reshape((K)) - topk_ys = Detector._gather_feat(topk_ys.reshape((-1, 1)), topk_ind).reshape((K)) - topk_xs = Detector._gather_feat(topk_xs.reshape((-1, 1)), topk_ind).reshape((K)) + topk_ys = CenterNet._gather_feat(topk_ys.reshape((-1, 1)), topk_ind).reshape((K)) + topk_xs = CenterNet._gather_feat(topk_xs.reshape((-1, 1)), topk_ind).reshape((K)) return topk_score, topk_inds, topk_clses, topk_ys, topk_xs @@ -142,72 +194,15 @@ def affine_transform(pt, t): return new_pt[:2] target_coords = np.zeros(coords.shape) - trans = Detector.get_affine_transform(center, scale, 0, output_size, inv=True) + trans = CenterNet.get_affine_transform(center, scale, 0, output_size, inv=True) for p in range(coords.shape[0]): target_coords[p, 0:2] = affine_transform(coords[p, 0:2], trans) return target_coords @staticmethod def _transform(dets, center, scale, height, width): - dets[:, :2] = Detector._transform_preds( + dets[:, :2] = CenterNet._transform_preds( dets[:, 0:2], center, scale, (width, height)) - dets[:, 2:4] = Detector._transform_preds( + dets[:, 2:4] = CenterNet._transform_preds( dets[:, 2:4], center, scale, (width, height)) return dets - - def preprocess(self, image): - height, width = image.shape[0:2] - center = np.array([width / 2., height / 2.], dtype=np.float32) - scale = max(height, width) - - trans_input = self.get_affine_transform(center, scale, 0, [self.input_width, self.input_height]) - resized_image = cv2.resize(image, (width, height)) - inp_image = cv2.warpAffine( - resized_image, trans_input, (self.input_width, self.input_height), - flags=cv2.INTER_LINEAR) - - return inp_image - - def postprocess(self, raw_output, image_sizes): - heat, reg, wh = raw_output - heat = heat = np.exp(heat)/(1 + np.exp(heat)) - height, width = heat.shape[1:3] - num_predictions = 100 - - heat = self._nms(heat) - scores, inds, clses, ys, xs = self._topk(heat, K=num_predictions) - reg = self._tranpose_and_gather_feat(reg, inds) - - reg = reg.reshape((num_predictions, 2)) - xs = xs.reshape((num_predictions, 1)) + reg[:, 0:1] - ys = ys.reshape((num_predictions, 1)) + reg[:, 1:2] - - wh = self._tranpose_and_gather_feat(wh, inds) - wh = wh.reshape((num_predictions, 2)) - clses = clses.reshape((num_predictions, 1)) - scores = scores.reshape((num_predictions, 1)) - bboxes = np.concatenate((xs - wh[..., 0:1] / 2, - ys - wh[..., 1:2] / 2, - xs + wh[..., 0:1] / 2, - ys + wh[..., 1:2] / 2), axis=1) - detections = np.concatenate((bboxes, scores, clses), axis=1) - mask = detections[..., 4] >= self._threshold - filtered_detections = detections[mask] - scale = max(image_sizes) - center = np.array(image_sizes[:2])/2.0 - dets = self._transform(filtered_detections, np.flip(center, 0), scale, height, width) - return dets - - def infer(self, image): - t0 = cv2.getTickCount() - output = self._exec_model.infer(inputs={self._input_layer_name: image}) - self.infer_time = (cv2.getTickCount() - t0) / cv2.getTickFrequency() - return output - - def detect(self, image): - image_sizes = image.shape[:2] - image = self.preprocess(image) - image = np.transpose(image, (2, 0, 1)) - output = self.infer(image) - detections = self.postprocess([output[name][0] for name in self._output_layer_names], image_sizes) - return detections diff --git a/demos/python_demos/object_detection_demo_faceboxes/detector.py b/demos/common/python/models/faceboxes.py similarity index 63% rename from demos/python_demos/object_detection_demo_faceboxes/detector.py rename to demos/common/python/models/faceboxes.py index a975043d95c..821d488c62f 100644 --- a/demos/python_demos/object_detection_demo_faceboxes/detector.py +++ b/demos/common/python/models/faceboxes.py @@ -16,30 +16,26 @@ import itertools import math import numpy as np -import os -import cv2 -from collections import namedtuple -class Detector(object): - def __init__(self, ie, model_path, device='CPU', threshold=0.5): - model = ie.read_network(model=model_path, weights=os.path.splitext(model_path)[0] + '.bin') +from .model import Model +from .utils import Detection, resize_image - assert len(model.input_info) == 1, "Expected 1 input blob" - assert len(model.outputs) == 2, "Expected 2 output blobs" - self._input_layer_name = next(iter(model.input_info)) - self._output_layer_names = sorted(model.outputs) +class FaceBoxes(Model): + def __init__(self, ie, model_path, threshold=0.5): + super().__init__(ie, model_path) - assert model.outputs[self._output_layer_names[0]].shape[1] == \ - model.outputs[self._output_layer_names[1]].shape[1], "Expected the same dimension for boxes and scores" - assert model.outputs[self._output_layer_names[0]].shape[2] == 4, "Expected 4-coordinate boxes" - assert model.outputs[self._output_layer_names[1]].shape[2] == 2, "Expected 2-class scores(background, face)" + assert len(self.net.input_info) == 1, "Expected 1 input blob" + self.image_blob_name = next(iter(self.net.input_info)) - self._ie = ie - self._exec_model = self._ie.load_network(model, device) - self.infer_time = -1 - _, channels, self.input_height, self.input_width = model.input_info[self._input_layer_name].input_data.shape - assert channels == 3, "Expected 3-channel input" + self._output_layer_names = sorted(self.net.outputs) + assert len(self.net.outputs) == 2, "Expected 2 output blobs" + self.bboxes_blob_name, self.scores_blob_name = self._parse_outputs() + + self.labels = ['Face'] + + self.n, self.c, self.h, self.w = self.net.input_info[self.image_blob_name].input_data.shape + assert self.c == 3, "Expected 3-channel input" self.min_sizes = [[32, 64, 128], [256], [512]] self.steps = [32, 64, 128] @@ -48,6 +44,79 @@ def __init__(self, ie, model_path, device='CPU', threshold=0.5): self.nms_threshold = 0.3 self.keep_top_k = 750 + def _parse_outputs(self): + bboxes_blob_name = None + scores_blob_name = None + for name, layer in self.net.outputs.items(): + if layer.shape[2] == 4: + bboxes_blob_name = name + elif layer.shape[2] == 2: + scores_blob_name = name + else: + raise RuntimeError("Expected shapes [:,:,4] and [:,:2] for outputs, but got {} and {}" + .format(*[output.shape for output in self.net.outputs])) + assert self.net.outputs[bboxes_blob_name].shape[1] == self.net.outputs[scores_blob_name].shape[1], \ + "Expected the same dimension for boxes and scores" + return bboxes_blob_name, scores_blob_name + + def preprocess(self, inputs): + image = inputs + + resized_image = resize_image(image, (self.w, self.h)) + meta = {'original_shape': image.shape, + 'resized_shape': resized_image.shape} + resized_image = resized_image.transpose((2, 0, 1)) # Change data layout from HWC to CHW + resized_image = resized_image.reshape((self.n, self.c, self.h, self.w)) + + dict_inputs = {self.image_blob_name: resized_image} + return dict_inputs, meta + + def postprocess(self, outputs, meta): + boxes = outputs[self.bboxes_blob_name][0] + scores = outputs[self.scores_blob_name][0] + + detections = [] + + feature_maps = [[math.ceil(self.h / step), math.ceil(self.w / step)] for step in + self.steps] + prior_data = self.prior_boxes(feature_maps, [self.h, self.w]) + + boxes[:, :2] = self.variance[0] * boxes[:, :2] + boxes[:, 2:] = self.variance[1] * boxes[:, 2:] + boxes[:, :2] = boxes[:, :2] * prior_data[:, 2:] + prior_data[:, :2] + boxes[:, 2:] = np.exp(boxes[:, 2:]) * prior_data[:, 2:] + + score = np.transpose(scores)[1] + + mask = score > self.confidence_threshold + filtered_boxes, filtered_score = boxes[mask, :], score[mask] + if filtered_score.size != 0: + x_mins = (filtered_boxes[:, 0] - 0.5 * filtered_boxes[:, 2]) + y_mins = (filtered_boxes[:, 1] - 0.5 * filtered_boxes[:, 3]) + x_maxs = (filtered_boxes[:, 0] + 0.5 * filtered_boxes[:, 2]) + y_maxs = (filtered_boxes[:, 1] + 0.5 * filtered_boxes[:, 3]) + + keep = self.nms(x_mins, y_mins, x_maxs, y_maxs, filtered_score, self.nms_threshold, + include_boundaries=False, keep_top_k=self.keep_top_k) + + filtered_score = filtered_score[keep] + x_mins = x_mins[keep] + y_mins = y_mins[keep] + x_maxs = x_maxs[keep] + y_maxs = y_maxs[keep] + + if filtered_score.size > self.keep_top_k: + filtered_score = filtered_score[:self.keep_top_k] + x_mins = x_mins[:self.keep_top_k] + y_mins = y_mins[:self.keep_top_k] + x_maxs = x_maxs[:self.keep_top_k] + y_maxs = y_maxs[:self.keep_top_k] + + detections = [Detection(*det, 0) for det in zip(x_mins, y_mins, x_maxs, y_maxs, filtered_score)] + + detections = self.resize_boxes(detections, meta['original_shape'][:2]) + return detections + @staticmethod def calculate_anchors(list_x, list_y, min_size, image_size, step): anchors = [] @@ -122,75 +191,9 @@ def nms(x1, y1, x2, y2, scores, thresh, include_boundaries=True, keep_top_k=None @staticmethod def resize_boxes(detections, image_size): h, w = image_size - for i, detection in enumerate(detections): - detections[i] = detection._replace(x_min=detection.x_min * w, - y_min=detection.y_min * h, - x_max=detection.x_max * w, - y_max=detection.y_max * h) - return detections - - def preprocess(self, image): - return cv2.resize(image, (self.input_width, self.input_height)) - - def infer(self, image): - t0 = cv2.getTickCount() - inputs = {self._input_layer_name: image} - output = self._exec_model.infer(inputs=inputs) - self.infer_time = (cv2.getTickCount() - t0) / cv2.getTickFrequency() - return output - - def postprocess(self, raw_output, image_sizes): - boxes, scores = raw_output - - detection = namedtuple('detection', 'score, x_min, y_min, x_max, y_max') - detections = [] - image_info = [self.input_height, self.input_width] - - feature_maps = [[math.ceil(image_info[0] / step), math.ceil(image_info[1] / step)] for step in - self.steps] - prior_data = self.prior_boxes(feature_maps, image_info) - - boxes[:, :2] = self.variance[0] * boxes[:, :2] - boxes[:, 2:] = self.variance[1] * boxes[:, 2:] - boxes[:, :2] = boxes[:, :2] * prior_data[:, 2:] + prior_data[:, :2] - boxes[:, 2:] = np.exp(boxes[:, 2:]) * prior_data[:, 2:] - - score = np.transpose(scores)[1] - - mask = score > self.confidence_threshold - filtered_boxes, filtered_score = boxes[mask, :], score[mask] - if filtered_score.size != 0: - x_mins = (filtered_boxes[:, 0] - 0.5 * filtered_boxes[:, 2]) - y_mins = (filtered_boxes[:, 1] - 0.5 * filtered_boxes[:, 3]) - x_maxs = (filtered_boxes[:, 0] + 0.5 * filtered_boxes[:, 2]) - y_maxs = (filtered_boxes[:, 1] + 0.5 * filtered_boxes[:, 3]) - - keep = self.nms(x_mins, y_mins, x_maxs, y_maxs, filtered_score, self.nms_threshold, - include_boundaries=False, keep_top_k=self.keep_top_k) - - filtered_score = filtered_score[keep] - x_mins = x_mins[keep] - y_mins = y_mins[keep] - x_maxs = x_maxs[keep] - y_maxs = y_maxs[keep] - - if filtered_score.size > self.keep_top_k: - filtered_score = filtered_score[:self.keep_top_k] - x_mins = x_mins[:self.keep_top_k] - y_mins = y_mins[:self.keep_top_k] - x_maxs = x_maxs[:self.keep_top_k] - y_maxs = y_maxs[:self.keep_top_k] - - for score, x_min, y_min, x_max, y_max in zip(filtered_score, x_mins, y_mins, x_maxs, y_maxs): - detections.append(detection(score=score, x_min=x_min, y_min=y_min, x_max=x_max, y_max=y_max)) - - detections = self.resize_boxes(detections, image_sizes) - return detections - - def detect(self, image): - image_sizes = image.shape[:2] - image = self.preprocess(image) - image = np.transpose(image, (2, 0, 1)) - output = self.infer(image) - detections = self.postprocess([output[name][0] for name in self._output_layer_names], image_sizes) + for detection in detections: + detection.xmin *= w + detection.xmax *= w + detection.ymin *= h + detection.ymax *= h return detections diff --git a/demos/common/python/models/model.py b/demos/common/python/models/model.py new file mode 100644 index 00000000000..b7dcaff2a47 --- /dev/null +++ b/demos/common/python/models/model.py @@ -0,0 +1,39 @@ +""" + Copyright (C) 2020 Intel Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + +import logging + + +class Model: + def __init__(self, ie, model_path): + self.logger = logging.getLogger() + self.logger.info('Reading network from IR...') + self.net = ie.read_network(model_path, model_path.with_suffix('.bin')) + self.set_batch_size(1) + + def preprocess(self, inputs): + meta = {} + return inputs, meta + + def postprocess(self, outputs, meta): + return outputs + + def set_batch_size(self, batch): + shapes = {} + for input_layer in self.net.input_info: + new_shape = [batch] + self.net.input_info[input_layer].input_data.shape[1:] + shapes.update({input_layer: new_shape}) + self.net.reshape(shapes) diff --git a/demos/python_demos/object_detection_demo_retinaface/postprocessor.py b/demos/common/python/models/retinaface.py similarity index 63% rename from demos/python_demos/object_detection_demo_retinaface/postprocessor.py rename to demos/common/python/models/retinaface.py index cab88b197bb..a0d93773eab 100644 --- a/demos/python_demos/object_detection_demo_retinaface/postprocessor.py +++ b/demos/common/python/models/retinaface.py @@ -1,5 +1,5 @@ """ - Copyright (c) 2020 Intel Corporation + Copyright (C) 2020 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,15 +14,60 @@ limitations under the License. """ -from collections import namedtuple -import numpy as np import re -Detection = namedtuple('Detection', 'face_detection, landmarks_regression, mask_detection') +import numpy as np + +from .model import Model +from .utils import DetectionWithLandmarks, Detection, resize_image + + +class RetinaFace(Model): + def __init__(self, ie, model_path, threshold=0.5, mask_threshold=0.5): + super().__init__(ie, model_path) + + assert len(self.net.input_info) == 1, "Expected 1 input blob" + expected_outputs_count = (6, 9, 12) + assert len(self.net.outputs) in expected_outputs_count, "Expected {} or {} output blobs".format( + ', '.join(str(count) for count in expected_outputs_count[:-1]), int(expected_outputs_count[-1])) + + self.threshold = threshold + self.detect_masks = len(self.net.outputs) == 12 + self.process_landmarks = len(self.net.outputs) > 6 + self.mask_threshold = mask_threshold + self.postprocessor = RetinaFacePostprocessor(detect_attributes=self.detect_masks, + process_landmarks=self.process_landmarks) + + self.labels = ['Face'] if not self.detect_masks else ['Mask', 'No mask'] + + self.image_blob_name = next(iter(self.net.input_info)) + self._output_layer_names = self.net.outputs + self.n, self.c, self.h, self.w = self.net.input_info[self.image_blob_name].input_data.shape + + def preprocess(self, inputs): + image = inputs -class RetinaFacePostprocessor(object): - def __init__(self, detect_masks=False): - self._detect_masks = detect_masks + resized_image = resize_image(image, (self.w, self.h)) + meta = {'original_shape': image.shape, + 'resized_shape': resized_image.shape} + resized_image = resized_image.transpose((2, 0, 1)) # Change data layout from HWC to CHW + resized_image = resized_image.reshape((self.n, self.c, self.h, self.w)) + + dict_inputs = {self.image_blob_name: resized_image} + return dict_inputs, meta + + def postprocess(self, outputs, meta): + scale_x = meta['resized_shape'][1] / meta['original_shape'][1] + scale_y = meta['resized_shape'][0] / meta['original_shape'][0] + + outputs = self.postprocessor.process_output(outputs, scale_x, scale_y, self.threshold, self.mask_threshold) + return outputs + + +class RetinaFacePostprocessor: + def __init__(self, detect_attributes=False, process_landmarks=True): + self._detect_masks = detect_attributes + self._process_landmarks = process_landmarks _ratio = (1.,) self._anchor_cfg = { 32: {'SCALES': (32, 16), 'BASE_SIZE': 16, 'RATIOS': _ratio}, @@ -34,7 +79,8 @@ def __init__(self, detect_masks=False): self._num_anchors = dict(zip( self._features_stride_fpn, [anchors.shape[0] for anchors in self._anchors_fpn.values()] )) - self.landmark_std = 0.2 if detect_masks else 1.0 + self.landmark_std = 0.2 if detect_attributes else 1.0 + self.nms_threshold = 0.5 if process_landmarks else 0.3 @staticmethod def generate_anchors_fpn(cfg): @@ -88,8 +134,9 @@ def _make_anchors(ws, hs, x_ctr, y_ctr): return anchors @staticmethod - def nms(x1, y1, x2, y2, scores, thresh): - areas = (x2 - x1) * (y2 - y1) + def nms(x1, y1, x2, y2, scores, thresh, include_boundaries=True): + b = 1 if include_boundaries else 0 + areas = (x2 - x1 + b) * (y2 - y1 + b) order = scores.argsort()[::-1] keep = [] @@ -113,15 +160,17 @@ def nms(x1, y1, x2, y2, scores, thresh): return keep - def process_output(self, raw_output, scale_x, scale_y, face_prob_threshold): + def process_output(self, raw_output, scale_x, scale_y, face_prob_threshold, mask_prob_threshold): bboxes_outputs = [raw_output[name][0] for name in raw_output if re.search('.bbox.', name)] bboxes_outputs.sort(key=lambda x: x.shape[1]) scores_outputs = [raw_output[name][0] for name in raw_output if re.search('.cls.', name)] scores_outputs.sort(key=lambda x: x.shape[1]) - landmarks_outputs = [raw_output[name][0] for name in raw_output if re.search('.landmark.', name)] - landmarks_outputs.sort(key=lambda x: x.shape[1]) + if self._process_landmarks: + landmarks_outputs = [raw_output[name][0] for name in raw_output if re.search('.landmark.', name)] + landmarks_outputs.sort(key=lambda x: x.shape[1]) + if self._detect_masks: type_scores_outputs = [raw_output[name][0] for name in raw_output if re.search('.type.', name)] type_scores_outputs.sort(key=lambda x: x.shape[1]) @@ -140,29 +189,59 @@ def process_output(self, raw_output, scale_x, scale_y, face_prob_threshold): anchors = anchors.reshape((height * width * anchor_num, 4)) proposals = self._get_proposals(bbox_deltas, anchor_num, anchors) threshold_mask = scores >= face_prob_threshold - proposals, scores = proposals[threshold_mask, :], scores[threshold_mask] - if scores.size != 0: - x_mins, y_mins, x_maxs, y_maxs = proposals.T - keep = self.nms(x_mins, y_mins, x_maxs, y_maxs, scores, 0.5) - proposals_list.extend(proposals[keep]) - scores_list.extend(scores[keep]) - landmarks = self._get_landmarks(landmarks_outputs[idx], anchor_num, anchors)[threshold_mask, :] - landmarks_list.extend(landmarks[keep, :]) - if self._detect_masks: - mask_scores_list.extend(self._get_mask_scores(type_scores_outputs[idx], - anchor_num)[threshold_mask][keep]) - detections = [] - landmarks_regression = [] + + proposals_list.extend(proposals[threshold_mask, :]) + scores_list.extend(scores[threshold_mask]) + if self._process_landmarks: + landmarks = self._get_landmarks(landmarks_outputs[idx], anchor_num, anchors) + landmarks_list.extend(landmarks[threshold_mask, :]) + if self._detect_masks: + masks = self._get_mask_scores(type_scores_outputs[idx], anchor_num) + mask_scores_list.extend(masks[threshold_mask]) + + if len(scores_list) > 0: + proposals_list = np.array(proposals_list) + scores_list = np.array(scores_list) + landmarks_list = np.array(landmarks_list) + mask_scores_list = np.array(mask_scores_list) + x_mins, y_mins, x_maxs, y_maxs = proposals_list.T + keep = self.nms(x_mins, y_mins, x_maxs, y_maxs, scores_list, self.nms_threshold, + include_boundaries=not self._process_landmarks) + proposals_list = proposals_list[keep] + scores_list = scores_list[keep] + if self._process_landmarks: + landmarks_list = landmarks_list[keep] + if self._detect_masks: + mask_scores_list = mask_scores_list[keep] + + result = [] if len(scores_list) != 0: scores = np.reshape(scores_list, -1) mask_scores_list = np.reshape(mask_scores_list, -1) x_mins, y_mins, x_maxs, y_maxs = np.array(proposals_list).T # pylint: disable=E0633 - detections = [scores, x_mins / scale_x, y_mins / scale_y, x_maxs / scale_x, y_maxs / scale_y] - - landmarks_x_coords = np.array(landmarks_list)[:, :, ::2].reshape(len(landmarks_list), -1) / scale_x - landmarks_y_coords = np.array(landmarks_list)[:, :, 1::2].reshape(len(landmarks_list), -1) / scale_y - landmarks_regression = [landmarks_x_coords, landmarks_y_coords] - return Detection(detections, landmarks_regression, mask_scores_list) + x_mins /= scale_x + x_maxs /= scale_x + y_mins /= scale_y + y_maxs /= scale_y + + result = [] + if self._process_landmarks: + landmarks_x_coords = np.array(landmarks_list)[:, :, ::2].reshape(len(landmarks_list), -1) / scale_x + landmarks_y_coords = np.array(landmarks_list)[:, :, 1::2].reshape(len(landmarks_list), -1) / scale_y + if self._detect_masks: + for i in range(len(scores_list)): + result.append(DetectionWithLandmarks(x_mins[i], y_mins[i], x_maxs[i], y_maxs[i], scores[i], + 0 if mask_scores_list[i] > mask_prob_threshold else 1, + landmarks_x_coords[i], landmarks_y_coords[i])) + else: + for i in range(len(scores_list)): + result.append(DetectionWithLandmarks(x_mins[i], y_mins[i], x_maxs[i], y_maxs[i], scores[i], 0, + landmarks_x_coords[i], landmarks_y_coords[i])) + else: + for i in range(len(scores_list)): + result.append(Detection(x_mins[i], y_mins[i], x_maxs[i], y_maxs[i], scores[i], 0)) + + return result def _get_proposals(self, bbox_deltas, anchor_num, anchors): bbox_deltas = bbox_deltas.transpose((1, 2, 0)) diff --git a/demos/common/python/models/segmentation.py b/demos/common/python/models/segmentation.py new file mode 100644 index 00000000000..8c75381de88 --- /dev/null +++ b/demos/common/python/models/segmentation.py @@ -0,0 +1,92 @@ +""" + Copyright (c) 2020 Intel Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + +import cv2 +import numpy as np + +from .model import Model + + +class SegmentationModel(Model): + def __init__(self, ie, model_path): + super().__init__(ie, model_path) + + self.input_blob_name = self.prepare_inputs() + self.out_blob_name = self.prepare_outputs() + + def prepare_inputs(self): + input_num = len(self.net.input_info) + if input_num != 1: + raise RuntimeError("Demo supports topologies only with 1 input") + + blob_name = next(iter(self.net.input_info)) + blob = self.net.input_info[blob_name] + blob.precision = "U8" + blob.layout = "NCHW" + + input_size = blob.input_data.shape + if len(input_size) == 4 and input_size[1] == 3: + self.n, self.c, self.h, self.w = input_size + else: + raise RuntimeError("3-channel 4-dimensional model's input is expected") + + return blob_name + + def prepare_outputs(self): + output_num = len(self.net.outputs) + if output_num != 1: + raise RuntimeError("Demo supports topologies only with 1 output") + + blob_name = next(iter(self.net.outputs)) + blob = self.net.outputs[blob_name] + blob.precision = "FP32" + + out_size = blob.shape + if len(out_size) == 3: + self.out_channels = 0 + self.out_height = out_size[1] + self.out_width = out_size[2] + elif len(out_size) == 4: + self.out_channels = out_size[1] + self.out_height = out_size[2] + self.out_width = out_size[3] + else: + raise Exception("Unexpected output blob shape {}. Only 4D and 3D output blobs are supported".format(out_size)) + + return blob_name + + def preprocess(self, inputs): + image = inputs + resized_image = cv2.resize(image, (self.w, self.h)) + meta = {'original_shape': image.shape, + 'resized_shape': resized_image.shape} + resized_image = resized_image.transpose((2, 0, 1)) + resized_image = resized_image.reshape((self.n, self.c, self.h, self.w)) + dict_inputs = {self.input_blob_name: resized_image} + return dict_inputs, meta + + def postprocess(self, outputs, meta): + predictions = outputs[self.out_blob_name].squeeze() + input_image_height = meta['original_shape'][0] + input_image_width = meta['original_shape'][1] + + if self.out_channels < 2: # assume the output is already ArgMax'ed + result = predictions.astype(np.uint8) + else: + result = np.argmax(predictions, axis=0).astype(np.uint8) + + result = cv2.resize(result, (input_image_width, input_image_height), 0, 0, interpolation=cv2.INTER_NEAREST) + return result diff --git a/demos/common/python/models/ssd.py b/demos/common/python/models/ssd.py new file mode 100644 index 00000000000..cc1d901772c --- /dev/null +++ b/demos/common/python/models/ssd.py @@ -0,0 +1,180 @@ +""" + Copyright (C) 2020 Intel Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + +import numpy as np + +from .model import Model +from .utils import Detection, resize_image, load_labels + + +class SSD(Model): + def __init__(self, ie, model_path, labels=None, keep_aspect_ratio_resize=False): + super().__init__(ie, model_path) + + self.keep_aspect_ratio_resize = keep_aspect_ratio_resize + if isinstance(labels, (list, tuple)): + self.labels = labels + else: + self.labels = load_labels(labels) if labels else None + + self.image_blob_name, self.image_info_blob_name = self._get_inputs() + self.n, self.c, self.h, self.w = self.net.input_info[self.image_blob_name].input_data.shape + + self.output_parser = self._get_output_parser(self.net, self.image_blob_name) + + def _get_inputs(self): + image_blob_name = None + image_info_blob_name = None + for blob_name, blob in self.net.input_info.items(): + if len(blob.input_data.shape) == 4: + image_blob_name = blob_name + elif len(blob.input_data.shape) == 2: + image_info_blob_name = blob_name + else: + raise RuntimeError('Unsupported {}D input layer "{}". Only 2D and 4D input layers are supported' + .format(len(blob.shape), blob_name)) + if image_blob_name is None: + raise RuntimeError('Failed to identify the input for the image.') + return image_blob_name, image_info_blob_name + + def _get_output_parser(self, net, image_blob_name, bboxes='bboxes', labels='labels', scores='scores'): + try: + parser = SingleOutputParser(net.outputs) + self.logger.info('Use SingleOutputParser') + return parser + except ValueError: + pass + + try: + parser = MultipleOutputParser(net.outputs, bboxes, scores, labels) + self.logger.info('Use MultipleOutputParser') + return parser + except ValueError: + pass + + try: + parser = BoxesLabelsParser(net.outputs, net.input_info[image_blob_name].input_data.shape[2:]) + self.logger.info('Use BoxesLabelsParser') + return parser + except ValueError: + pass + raise RuntimeError('Unsupported model outputs') + + def preprocess(self, inputs): + image = inputs + + resized_image = resize_image(image, (self.w, self.h), self.keep_aspect_ratio_resize) + meta = {'original_shape': image.shape, + 'resized_shape': resized_image.shape} + + h, w = resized_image.shape[:2] + if h != self.h or w != self.w: + resized_image = np.pad(resized_image, ((0, self.h - h), (0, self.w - w), (0, 0)), + mode='constant', constant_values=0) + resized_image = resized_image.transpose((2, 0, 1)) # Change data layout from HWC to CHW + resized_image = resized_image.reshape((self.n, self.c, self.h, self.w)) + + dict_inputs = {self.image_blob_name: resized_image} + if self.image_info_blob_name: + dict_inputs[self.image_info_blob_name] = [self.h, self.w, 1] + return dict_inputs, meta + + def postprocess(self, outputs, meta): + detections = self.output_parser(outputs) + orginal_image_shape = meta['original_shape'] + resized_image_shape = meta['resized_shape'] + scale_x = self.w / resized_image_shape[1] * orginal_image_shape[1] + scale_y = self.h / resized_image_shape[0] * orginal_image_shape[0] + for detection in detections: + detection.xmin *= scale_x + detection.xmax *= scale_x + detection.ymin *= scale_y + detection.ymax *= scale_y + return detections + + +def find_layer_by_name(name, layers): + suitable_layers = [layer_name for layer_name in layers if name in layer_name] + if not suitable_layers: + raise ValueError('Suitable layer for "{}" output is not found'.format(name)) + + if len(suitable_layers) > 1: + raise ValueError('More than 1 layer matched to "{}" output'.format(name)) + + return suitable_layers[0] + + +class SingleOutputParser: + def __init__(self, all_outputs): + if len(all_outputs) != 1: + raise ValueError('Network must have only one output.') + self.output_name, output_data = next(iter(all_outputs.items())) + last_dim = np.shape(output_data)[-1] + if last_dim != 7: + raise ValueError('The last dimension of the output blob must be equal to 7, ' + 'got {} instead.'.format(last_dim)) + + def __call__(self, outputs): + return [Detection(xmin, ymin, xmax, ymax, score, label) + for _, label, score, xmin, ymin, xmax, ymax in outputs[self.output_name][0][0]] + + +class MultipleOutputParser: + def __init__(self, layers, bboxes_layer='bboxes', scores_layer='scores', labels_layer='labels'): + self.labels_layer = find_layer_by_name(labels_layer, layers) + self.scores_layer = find_layer_by_name(scores_layer, layers) + self.bboxes_layer = find_layer_by_name(bboxes_layer, layers) + + def __call__(self, outputs): + bboxes = outputs[self.bboxes_layer][0] + scores = outputs[self.scores_layer][0] + labels = outputs[self.labels_layer][0] + return [Detection(*bbox, score, label) for label, score, bbox in zip(labels, scores, bboxes)] + + +class BoxesLabelsParser: + def __init__(self, layers, input_size, labels_layer='labels', default_label=0): + try: + self.labels_layer = find_layer_by_name(labels_layer, layers) + except ValueError: + self.labels_layer = None + self.default_label = default_label + + self.bboxes_layer = self.find_layer_bboxes_output(layers) + self.input_size = input_size + + @staticmethod + def find_layer_bboxes_output(layers): + filter_outputs = [name for name, data in layers.items() if len(np.shape(data)) == 2 and np.shape(data)[-1] == 5] + if not filter_outputs: + raise ValueError('Suitable output with bounding boxes is not found') + if len(filter_outputs) > 1: + raise ValueError('More than 1 candidate for output with bounding boxes.') + return filter_outputs[0] + + def __call__(self, outputs): + bboxes = outputs[self.bboxes_layer] + scores = bboxes[:, 4] + bboxes = bboxes[:, :4] + bboxes[:, 0::2] /= self.input_size[0] + bboxes[:, 1::2] /= self.input_size[1] + if self.labels_layer: + labels = outputs[self.labels_layer] + else: + labels = np.full(len(bboxes), self.default_label, dtype=bboxes.dtype) + + detections = [Detection(*bbox, score, label) for label, score, bbox in zip(labels, scores, bboxes)] + return detections diff --git a/demos/common/python/models/utils.py b/demos/common/python/models/utils.py new file mode 100644 index 00000000000..25a54f13b35 --- /dev/null +++ b/demos/common/python/models/utils.py @@ -0,0 +1,72 @@ +""" + Copyright (C) 2020 Intel Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + +import cv2 +import numpy as np + + +class Detection: + def __init__(self, xmin, ymin, xmax, ymax, score, id): + self.xmin = xmin + self.ymin = ymin + self.xmax = xmax + self.ymax = ymax + self.score = score + self.id = id + + def bottom_left_point(self): + return self.xmin, self.ymin + + def top_right_point(self): + return self.xmax, self.ymax + + +class DetectionWithLandmarks(Detection): + def __init__(self, xmin, ymin, xmax, ymax, score, id, landmarks_x, landmarks_y): + super().__init__(xmin, ymin, xmax, ymax, score, id) + self.landmarks = [] + for x, y in zip(landmarks_x, landmarks_y): + self.landmarks.append((x, y)) + + +def load_labels(label_file): + with open(label_file, 'r') as f: + labels_map = [x.strip() for x in f] + return labels_map + + +def resize_image(image, size, keep_aspect_ratio=False): + if not keep_aspect_ratio: + resized_frame = cv2.resize(image, size) + else: + h, w = image.shape[:2] + scale = min(size[1] / h, size[0] / w) + resized_frame = cv2.resize(image, None, fx=scale, fy=scale) + return resized_frame + + +def resize_image_letterbox(image, size): + ih, iw = image.shape[0:2] + w, h = size + scale = min(w / iw, h / ih) + nw = int(iw * scale) + nh = int(ih * scale) + image = cv2.resize(image, (nw, nh)) + dx = (w - nw) // 2 + dy = (h - nh) // 2 + resized_image = np.pad(image, ((dy, dy + (h - nh) % 2), (dx, dx + (w - nw) % 2), (0, 0)), + mode='constant', constant_values=128) + return resized_image diff --git a/demos/common/python/models/yolo.py b/demos/common/python/models/yolo.py new file mode 100644 index 00000000000..6bdb7aa9b69 --- /dev/null +++ b/demos/common/python/models/yolo.py @@ -0,0 +1,213 @@ +""" + Copyright (C) 2020 Intel Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + +import numpy as np +import ngraph + +from .model import Model +from .utils import Detection, resize_image, resize_image_letterbox, load_labels + +class YOLO(Model): + class Params: + # Magic numbers are copied from yolo samples + def __init__(self, param, sides): + self.num = param.get('num', 3) + self.coords = param.get('coord', 4) + self.classes = param.get('classes', 80) + self.sides = sides + self.anchors = param.get('anchors', + [10.0, 13.0, 16.0, 30.0, 33.0, 23.0, + 30.0, 61.0, 62.0, 45.0, 59.0, 119.0, + 116.0, 90.0, 156.0, 198.0, 373.0, 326.0]) + + self.isYoloV3 = False + + mask = param.get('mask', None) + if mask: + self.num = len(mask) + + masked_anchors = [] + for idx in mask: + masked_anchors += [self.anchors[idx * 2], self.anchors[idx * 2 + 1]] + self.anchors = masked_anchors + + self.isYoloV3 = True # Weak way to determine but the only one. + + def __init__(self, ie, model_path, labels=None, keep_aspect_ratio=False, threshold=0.5, iou_threshold=0.5): + super().__init__(ie, model_path) + + if isinstance(labels, (list, tuple)): + self.labels = labels + else: + self.labels = load_labels(labels) if labels else None + + self.threshold = threshold + self.iou_threshold = iou_threshold + + self.keep_aspect_ratio = keep_aspect_ratio + self.resize_image = resize_image_letterbox if self.keep_aspect_ratio else resize_image + + assert len(self.net.input_info) == 1, "Sample supports only YOLO V* based single input topologies" + self.image_blob_name = next(iter(self.net.input_info)) + if self.net.input_info[self.image_blob_name].input_data.shape[1] == 3: + self.n, self.c, self.h, self.w = self.net.input_info[self.image_blob_name].input_data.shape + self.nchw_shape = True + else: + self.n, self.h, self.w, self.c = self.net.input_info[self.image_blob_name].input_data.shape + self.nchw_shape = False + + self.yolo_layer_params = self._get_output_info() + + def _get_output_info(self): + def get_parent(node): + return node.inputs()[0].get_source_output().get_node() + ng_func = ngraph.function_from_cnn(self.net) + output_info = {} + for node in ng_func.get_ordered_ops(): + layer_name = node.get_friendly_name() + if layer_name not in self.net.outputs: + continue + shape = list(get_parent(node).shape) + yolo_params = self.Params(node._get_attributes(), shape[2:4]) + output_info[layer_name] = (shape, yolo_params) + return output_info + + def preprocess(self, inputs): + image = inputs + + resized_image = self.resize_image(image, (self.w, self.h)) + meta = {'original_shape': image.shape, + 'resized_shape': resized_image.shape} + if self.nchw_shape: + resized_image = resized_image.transpose((2, 0, 1)) # Change data layout from HWC to CHW + resized_image = resized_image.reshape((self.n, self.c, self.h, self.w)) + + else: + resized_image = resized_image.reshape((self.n, self.h, self.w, self.c)) + + dict_inputs = {self.image_blob_name: resized_image} + return dict_inputs, meta + + @staticmethod + def _parse_yolo_region(predictions, input_size, params, threshold, multiple_labels=True): + # ------------------------------------------ Extracting layer parameters --------------------------------------- + objects = list() + size_normalizer = input_size if params.isYoloV3 else params.sides + bbox_size = params.coords + 1 + params.classes + # ------------------------------------------- Parsing YOLO Region output --------------------------------------- + for row, col, n in np.ndindex(params.sides[0], params.sides[1], params.num): + # Getting raw values for each detection bounding bFox + bbox = predictions[0, n * bbox_size:(n + 1) * bbox_size, row, col] + x, y, width, height, object_probability = bbox[:5] + class_probabilities = bbox[5:] + if object_probability < threshold: + continue + # Process raw value + x = (col + x) / params.sides[1] + y = (row + y) / params.sides[0] + # Value for exp is very big number in some cases so following construction is using here + try: + width = np.exp(width) + height = np.exp(height) + except OverflowError: + continue + # Depends on topology we need to normalize sizes by feature maps (up to YOLOv3) or by input shape (YOLOv3) + width = width * params.anchors[2 * n] / size_normalizer[0] + height = height * params.anchors[2 * n + 1] / size_normalizer[1] + + if multiple_labels: + for class_id, class_probability in enumerate(class_probabilities): + confidence = object_probability * class_probability + if confidence > threshold: + objects.append(Detection(x - width / 2, y - height / 2, x + width / 2, y + height / 2, + confidence, class_id)) + else: + class_id = np.argmax(class_probabilities) + confidence = class_probabilities[class_id] * object_probability + if confidence < threshold: + continue + objects.append(Detection(x - width / 2, y - height / 2, x + width / 2, y + height / 2, + confidence.item(), class_id.item())) + return objects + + @staticmethod + def _filter(detections, iou_threshold): + def iou(box_1, box_2): + width_of_overlap_area = min(box_1.xmax, box_2.xmax) - max(box_1.xmin, box_2.xmin) + height_of_overlap_area = min(box_1.ymax, box_2.ymax) - max(box_1.ymin, box_2.ymin) + if width_of_overlap_area < 0 or height_of_overlap_area < 0: + area_of_overlap = 0 + else: + area_of_overlap = width_of_overlap_area * height_of_overlap_area + box_1_area = (box_1.ymax - box_1.ymin) * (box_1.xmax - box_1.xmin) + box_2_area = (box_2.ymax - box_2.ymin) * (box_2.xmax - box_2.xmin) + area_of_union = box_1_area + box_2_area - area_of_overlap + if area_of_union == 0: + return 0 + return area_of_overlap / area_of_union + + detections = sorted(detections, key=lambda obj: obj.score, reverse=True) + for i in range(len(detections)): + if detections[i].score == 0: + continue + for j in range(i + 1, len(detections)): + # We perform IOU only on objects of same class + if detections[i].id != detections[j].id: + continue + + if iou(detections[i], detections[j]) > iou_threshold: + detections[j].score = 0 + + return [det for det in detections if det.score > 0] + + @staticmethod + def _resize_detections(detections, original_shape): + for detection in detections: + detection.xmin *= original_shape[0] + detection.xmax *= original_shape[0] + detection.ymin *= original_shape[1] + detection.ymax *= original_shape[1] + return detections + + @staticmethod + def _resize_detections_letterbox(detections, original_shape, resized_shape): + scales = [x / y for x, y in zip(resized_shape, original_shape)] + scale = min(scales) + scales = (scale / scales[0], scale / scales[1]) + offset = [0.5 * (1 - x) for x in scales] + for detection in detections: + detection.xmin = ((detection.xmin - offset[0]) / scales[0]) * original_shape[0] + detection.xmax = ((detection.xmax - offset[0]) / scales[0]) * original_shape[0] + detection.ymin = ((detection.ymin - offset[1]) / scales[1]) * original_shape[1] + detection.ymax = ((detection.ymax - offset[1]) / scales[1]) * original_shape[1] + return detections + + def postprocess(self, outputs, meta): + detections = list() + + for layer_name, out_blob in outputs.items(): + layer_params = self.yolo_layer_params[layer_name] + out_blob.shape = layer_params[0] + detections += self._parse_yolo_region(out_blob, meta['resized_shape'], layer_params[1], self.threshold) + + detections = self._filter(detections, self.iou_threshold) + if self.keep_aspect_ratio: + detections = self._resize_detections_letterbox(detections, meta['original_shape'][1::-1], + meta['resized_shape'][1::-1]) + else: + detections = self._resize_detections(detections, meta['original_shape'][1::-1]) + + return detections diff --git a/demos/python_demos/common/monitors.py b/demos/common/python/monitors.py similarity index 100% rename from demos/python_demos/common/monitors.py rename to demos/common/python/monitors.py diff --git a/demos/python_demos/common/monitors_extension/CMakeLists.txt b/demos/common/python/monitors_extension/CMakeLists.txt similarity index 93% rename from demos/python_demos/common/monitors_extension/CMakeLists.txt rename to demos/common/python/monitors_extension/CMakeLists.txt index ca49fbc9a17..4f915d2f465 100644 --- a/demos/python_demos/common/monitors_extension/CMakeLists.txt +++ b/demos/common/python/monitors_extension/CMakeLists.txt @@ -6,7 +6,7 @@ find_package(OpenCV 4 REQUIRED COMPONENTS core) add_library(monitors_extension MODULE monitors_extension.cpp) target_include_directories(monitors_extension PRIVATE ${PYTHON_INCLUDE_DIRS} ${NUMPY_INCLUDE_DIR}) -target_link_libraries(monitors_extension PRIVATE ${PYTHON_LIBRARIES} opencv_core monitors common) +target_link_libraries(monitors_extension PRIVATE ${PYTHON_LIBRARIES} opencv_core monitors utils) set_target_properties(monitors_extension PROPERTIES PREFIX "") if(WIN32) set_target_properties(monitors_extension PROPERTIES SUFFIX ".pyd") diff --git a/demos/python_demos/common/monitors_extension/monitors_extension.cpp b/demos/common/python/monitors_extension/monitors_extension.cpp similarity index 100% rename from demos/python_demos/common/monitors_extension/monitors_extension.cpp rename to demos/common/python/monitors_extension/monitors_extension.cpp diff --git a/demos/python_demos/common/performance_metrics.py b/demos/common/python/performance_metrics.py similarity index 100% rename from demos/python_demos/common/performance_metrics.py rename to demos/common/python/performance_metrics.py diff --git a/demos/common/python/pipelines/__init__.py b/demos/common/python/pipelines/__init__.py new file mode 100644 index 00000000000..363c71b5bfe --- /dev/null +++ b/demos/common/python/pipelines/__init__.py @@ -0,0 +1,5 @@ +from .async_pipeline import AsyncPipeline + +__all__ = [ + 'AsyncPipeline', +] diff --git a/demos/common/python/pipelines/async_pipeline.py b/demos/common/python/pipelines/async_pipeline.py new file mode 100644 index 00000000000..124a5b35314 --- /dev/null +++ b/demos/common/python/pipelines/async_pipeline.py @@ -0,0 +1,81 @@ +""" + Copyright (C) 2020 Intel Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + +import logging +import threading +from collections import deque + + +class AsyncPipeline: + def __init__(self, ie, model, plugin_config, device='CPU', max_num_requests=1): + self.model = model + self.logger = logging.getLogger() + + self.logger.info('Loading network to {} plugin...'.format(device)) + self.exec_net = ie.load_network(network=self.model.net, device_name=device, + config=plugin_config, num_requests=max_num_requests) + + self.empty_requests = deque(self.exec_net.requests) + self.completed_request_results = {} + self.callback_exceptions = {} + self.event = threading.Event() + + def inference_completion_callback(self, status, callback_args): + request, id, meta, preprocessing_meta = callback_args + try: + if status != 0: + raise RuntimeError('Infer Request has returned status code {}'.format(status)) + raw_outputs = {key: blob.buffer for key, blob in request.output_blobs.items()} + self.completed_request_results[id] = (raw_outputs, meta, preprocessing_meta) + self.empty_requests.append(request) + except Exception as e: + self.callback_exceptions.append(e) + self.event.set() + + def submit_data(self, inputs, id, meta): + request = self.empty_requests.popleft() + if len(self.empty_requests) == 0: + self.event.clear() + inputs, preprocessing_meta = self.model.preprocess(inputs) + request.set_completion_callback(py_callback=self.inference_completion_callback, + py_data=(request, id, meta, preprocessing_meta)) + request.async_infer(inputs=inputs) + + def get_raw_result(self, id): + if id in self.completed_request_results: + return self.completed_request_results.pop(id) + return None + + def get_result(self, id): + result = self.get_raw_result(id) + if result: + raw_result, meta, preprocess_meta = result + return self.model.postprocess(raw_result, preprocess_meta), meta + return None + + def is_ready(self): + return len(self.empty_requests) != 0 + + def has_completed_request(self): + return len(self.completed_request_results) != 0 + + def await_all(self): + for request in self.exec_net.requests: + request.wait() + + def await_any(self): + if len(self.empty_requests) == 0: + self.event.wait() diff --git a/demos/python_demos/common/tokens_bert.py b/demos/common/python/tokens_bert.py similarity index 100% rename from demos/python_demos/common/tokens_bert.py rename to demos/common/python/tokens_bert.py diff --git a/demos/crossroad_camera_demo/CMakeLists.txt b/demos/crossroad_camera_demo/cpp/CMakeLists.txt similarity index 100% rename from demos/crossroad_camera_demo/CMakeLists.txt rename to demos/crossroad_camera_demo/cpp/CMakeLists.txt diff --git a/demos/crossroad_camera_demo/README.md b/demos/crossroad_camera_demo/cpp/README.md similarity index 96% rename from demos/crossroad_camera_demo/README.md rename to demos/crossroad_camera_demo/cpp/README.md index 613e66a8049..1e75af97349 100644 --- a/demos/crossroad_camera_demo/README.md +++ b/demos/crossroad_camera_demo/cpp/README.md @@ -1,5 +1,7 @@ # Crossroad Camera C++ Demo +![](./crossroad_camera.gif) + This demo provides an inference pipeline for persons' detection, recognition and reidentification. The demo uses Person Detection network followed by the Person Attributes Recognition and Person Reidentification Retail networks applied on top of the detection results. You can use a set of the following pre-trained models with the demo: * `person-vehicle-bike-detection-crossroad-0078`, which is a primary detection network for finding the persons (and other objects if needed) @@ -8,7 +10,7 @@ reports person attributes like gender, has hat, has long-sleeved clothes * `person-reidentification-retail-0031`, which is executed on top of the results from the first network and prints a vector of features for each detected person. This vector is used to conclude if it is already detected person or not. -For more information about the pre-trained models, refer to the [model documentation](../../models/intel/index.md). +For more information about the pre-trained models, refer to the [model documentation](../../../models/intel/index.md). Other demo objectives are: * Images/Video/Camera as inputs, via OpenCV\* @@ -64,7 +66,7 @@ Options: Running the application with an empty list of options yields the usage message given above and an error message. -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). +To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). @@ -96,6 +98,6 @@ If Person Attributes Recognition or Person Reidentification Retail are enabled, > Other models may produce unexpected results on these devices. ## See Also -* [Using Open Model Zoo demos](../README.md) +* [Using Open Model Zoo demos](../../README.md) * [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) -* [Model Downloader](../../tools/downloader/README.md) +* [Model Downloader](../../../tools/downloader/README.md) diff --git a/demos/crossroad_camera_demo/cpp/crossroad_camera.gif b/demos/crossroad_camera_demo/cpp/crossroad_camera.gif new file mode 100644 index 00000000000..7b82123177d Binary files /dev/null and b/demos/crossroad_camera_demo/cpp/crossroad_camera.gif differ diff --git a/demos/crossroad_camera_demo/crossroad_camera_demo.hpp b/demos/crossroad_camera_demo/cpp/crossroad_camera_demo.hpp similarity index 99% rename from demos/crossroad_camera_demo/crossroad_camera_demo.hpp rename to demos/crossroad_camera_demo/cpp/crossroad_camera_demo.hpp index 86a19ae7214..05ade38a49d 100644 --- a/demos/crossroad_camera_demo/crossroad_camera_demo.hpp +++ b/demos/crossroad_camera_demo/cpp/crossroad_camera_demo.hpp @@ -9,7 +9,7 @@ #include #include -#include +#include DEFINE_INPUT_FLAGS diff --git a/demos/crossroad_camera_demo/main.cpp b/demos/crossroad_camera_demo/cpp/main.cpp similarity index 99% rename from demos/crossroad_camera_demo/main.cpp rename to demos/crossroad_camera_demo/cpp/main.cpp index b0f92908f07..3815899670c 100644 --- a/demos/crossroad_camera_demo/main.cpp +++ b/demos/crossroad_camera_demo/cpp/main.cpp @@ -24,9 +24,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "crossroad_camera_demo.hpp" using namespace InferenceEngine; diff --git a/demos/crossroad_camera_demo/models.lst b/demos/crossroad_camera_demo/cpp/models.lst similarity index 100% rename from demos/crossroad_camera_demo/models.lst rename to demos/crossroad_camera_demo/cpp/models.lst diff --git a/demos/python_demos/formula_recognition_demo/README.md b/demos/formula_recognition_demo/python/README.md similarity index 98% rename from demos/python_demos/formula_recognition_demo/README.md rename to demos/formula_recognition_demo/python/README.md index 93c45662f31..dc23a40b01d 100644 --- a/demos/python_demos/formula_recognition_demo/README.md +++ b/demos/formula_recognition_demo/python/README.md @@ -130,7 +130,7 @@ Options: Running the application with an empty list of options yields the short version of the usage message and an error message. -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). +To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (`*.xml` + `*.bin`) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). diff --git a/demos/python_demos/formula_recognition_demo/formula_recognition_demo.py b/demos/formula_recognition_demo/python/formula_recognition_demo.py similarity index 99% rename from demos/python_demos/formula_recognition_demo/formula_recognition_demo.py rename to demos/formula_recognition_demo/python/formula_recognition_demo.py index 9f92d69f98a..9c9196b8ca3 100755 --- a/demos/python_demos/formula_recognition_demo/formula_recognition_demo.py +++ b/demos/formula_recognition_demo/python/formula_recognition_demo.py @@ -217,7 +217,7 @@ def main(): targets = np.argmax(logits, axis=1) if args.output_file: with open(args.output_file, 'a') as output_file: - output_file.write(rec['img_name'] + '\t' + vocab.construct_phrase(targets) + '\n') + output_file.write(rec['img_name'] + '\t' + vocab.construct_phrase(targets) + '\n') else: print("Image name: {}\nFormula: {}\n".format(rec['img_name'], vocab.construct_phrase(targets))) diff --git a/demos/formula_recognition_demo/python/models.lst b/demos/formula_recognition_demo/python/models.lst new file mode 100644 index 00000000000..ca9cac4c817 --- /dev/null +++ b/demos/formula_recognition_demo/python/models.lst @@ -0,0 +1,5 @@ +# This file can be used with the --list option of the model downloader. +formula-recognition-medium-scan-????-im2latex-decoder +formula-recognition-medium-scan-????-im2latex-encoder +formula-recognition-polynomials-handwritten-????-decoder +formula-recognition-polynomials-handwritten-????-encoder diff --git a/demos/python_demos/formula_recognition_demo/sample.png b/demos/formula_recognition_demo/python/sample.png similarity index 100% rename from demos/python_demos/formula_recognition_demo/sample.png rename to demos/formula_recognition_demo/python/sample.png diff --git a/demos/python_demos/formula_recognition_demo/utils.py b/demos/formula_recognition_demo/python/utils.py similarity index 97% rename from demos/python_demos/formula_recognition_demo/utils.py rename to demos/formula_recognition_demo/python/utils.py index ebd77317b84..9c671dd27e5 100644 --- a/demos/python_demos/formula_recognition_demo/utils.py +++ b/demos/formula_recognition_demo/python/utils.py @@ -1,4 +1,3 @@ -import pickle as pkl import json START_TOKEN = 0 diff --git a/demos/gaze_estimation_demo/CMakeLists.txt b/demos/gaze_estimation_demo/cpp/CMakeLists.txt similarity index 73% rename from demos/gaze_estimation_demo/CMakeLists.txt rename to demos/gaze_estimation_demo/cpp/CMakeLists.txt index e273ea580cd..4f57300cc14 100644 --- a/demos/gaze_estimation_demo/CMakeLists.txt +++ b/demos/gaze_estimation_demo/cpp/CMakeLists.txt @@ -2,8 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 # -file (GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) -file (GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) +file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +file(GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) ie_add_sample(NAME gaze_estimation_demo SOURCES ${SOURCES} diff --git a/demos/gaze_estimation_demo/README.md b/demos/gaze_estimation_demo/cpp/README.md similarity index 95% rename from demos/gaze_estimation_demo/README.md rename to demos/gaze_estimation_demo/cpp/README.md index 14990d73f84..be872b3ebe2 100644 --- a/demos/gaze_estimation_demo/README.md +++ b/demos/gaze_estimation_demo/cpp/README.md @@ -1,5 +1,7 @@ # Gaze Estimation Demo +![](./gaze_estimation.gif) + This demo showcases the work of gaze estimation model. The corresponding pre-trained model `gaze-estimation-adas-0002` is delivered with the product. @@ -9,7 +11,7 @@ The demo also relies on the following auxiliary networks: * `facial-landmarks-35-adas-0002`, which estimates coordinates of facial landmarks for detected faces. The keypoints at the corners of eyes are used to locate eyes regions required for the gaze estimation model * `open-closed-eye-0001`, which estimates eyes state of detected faces. -For more information about the pre-trained models, refer to the [model documentation](../../models/intel/index.md). +For more information about the pre-trained models, refer to the [model documentation](../../../models/intel/index.md). Other demo objectives are: * Video/Camera as inputs, via OpenCV* @@ -60,7 +62,7 @@ Options: Running the application with an empty list of options yields an error message. -To run the demo, you can use public or pre-trained and optimized `gaze-estimation-adas-0002` model, and the auxiliary models. To download the pre-trained models, use the OpenVINO Model Downloader or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). +To run the demo, you can use public or pre-trained and optimized `gaze-estimation-adas-0002` model, and the auxiliary models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with another trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). @@ -99,6 +101,6 @@ The following keys are supported: > Other models may produce unexpected results on these devices. ## See Also -* [Using Open Model Zoo demos](../README.md) +* [Using Open Model Zoo demos](../../README.md) * [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) -* [Model Downloader](../../tools/downloader/README.md) +* [Model Downloader](../../../tools/downloader/README.md) diff --git a/demos/gaze_estimation_demo/cpp/gaze_estimation.gif b/demos/gaze_estimation_demo/cpp/gaze_estimation.gif new file mode 100644 index 00000000000..f35726545ee Binary files /dev/null and b/demos/gaze_estimation_demo/cpp/gaze_estimation.gif differ diff --git a/demos/gaze_estimation_demo/gaze_estimation_demo.hpp b/demos/gaze_estimation_demo/cpp/gaze_estimation_demo.hpp similarity index 99% rename from demos/gaze_estimation_demo/gaze_estimation_demo.hpp rename to demos/gaze_estimation_demo/cpp/gaze_estimation_demo.hpp index 7ae361792f8..aa22bb7ab9e 100644 --- a/demos/gaze_estimation_demo/gaze_estimation_demo.hpp +++ b/demos/gaze_estimation_demo/cpp/gaze_estimation_demo.hpp @@ -10,7 +10,7 @@ #include #include -#include +#include DEFINE_INPUT_FLAGS diff --git a/demos/gaze_estimation_demo/include/base_estimator.hpp b/demos/gaze_estimation_demo/cpp/include/base_estimator.hpp similarity index 100% rename from demos/gaze_estimation_demo/include/base_estimator.hpp rename to demos/gaze_estimation_demo/cpp/include/base_estimator.hpp diff --git a/demos/gaze_estimation_demo/include/exponential_averager.hpp b/demos/gaze_estimation_demo/cpp/include/exponential_averager.hpp similarity index 100% rename from demos/gaze_estimation_demo/include/exponential_averager.hpp rename to demos/gaze_estimation_demo/cpp/include/exponential_averager.hpp diff --git a/demos/gaze_estimation_demo/include/eye_state_estimator.hpp b/demos/gaze_estimation_demo/cpp/include/eye_state_estimator.hpp similarity index 100% rename from demos/gaze_estimation_demo/include/eye_state_estimator.hpp rename to demos/gaze_estimation_demo/cpp/include/eye_state_estimator.hpp diff --git a/demos/gaze_estimation_demo/include/face_detector.hpp b/demos/gaze_estimation_demo/cpp/include/face_detector.hpp similarity index 100% rename from demos/gaze_estimation_demo/include/face_detector.hpp rename to demos/gaze_estimation_demo/cpp/include/face_detector.hpp diff --git a/demos/gaze_estimation_demo/include/face_inference_results.hpp b/demos/gaze_estimation_demo/cpp/include/face_inference_results.hpp similarity index 100% rename from demos/gaze_estimation_demo/include/face_inference_results.hpp rename to demos/gaze_estimation_demo/cpp/include/face_inference_results.hpp diff --git a/demos/gaze_estimation_demo/include/gaze_estimator.hpp b/demos/gaze_estimation_demo/cpp/include/gaze_estimator.hpp similarity index 100% rename from demos/gaze_estimation_demo/include/gaze_estimator.hpp rename to demos/gaze_estimation_demo/cpp/include/gaze_estimator.hpp diff --git a/demos/gaze_estimation_demo/include/head_pose_estimator.hpp b/demos/gaze_estimation_demo/cpp/include/head_pose_estimator.hpp similarity index 100% rename from demos/gaze_estimation_demo/include/head_pose_estimator.hpp rename to demos/gaze_estimation_demo/cpp/include/head_pose_estimator.hpp diff --git a/demos/gaze_estimation_demo/include/ie_wrapper.hpp b/demos/gaze_estimation_demo/cpp/include/ie_wrapper.hpp similarity index 94% rename from demos/gaze_estimation_demo/include/ie_wrapper.hpp rename to demos/gaze_estimation_demo/cpp/include/ie_wrapper.hpp index 1b8414436b8..efee26d191f 100644 --- a/demos/gaze_estimation_demo/include/ie_wrapper.hpp +++ b/demos/gaze_estimation_demo/cpp/include/ie_wrapper.hpp @@ -10,9 +10,9 @@ #include #include -#include -#include -#include +#include +#include +#include namespace gaze_estimation { class IEWrapper { diff --git a/demos/gaze_estimation_demo/include/landmarks_estimator.hpp b/demos/gaze_estimation_demo/cpp/include/landmarks_estimator.hpp similarity index 100% rename from demos/gaze_estimation_demo/include/landmarks_estimator.hpp rename to demos/gaze_estimation_demo/cpp/include/landmarks_estimator.hpp diff --git a/demos/gaze_estimation_demo/include/results_marker.hpp b/demos/gaze_estimation_demo/cpp/include/results_marker.hpp similarity index 100% rename from demos/gaze_estimation_demo/include/results_marker.hpp rename to demos/gaze_estimation_demo/cpp/include/results_marker.hpp diff --git a/demos/gaze_estimation_demo/include/utils.hpp b/demos/gaze_estimation_demo/cpp/include/utils.hpp similarity index 90% rename from demos/gaze_estimation_demo/include/utils.hpp rename to demos/gaze_estimation_demo/cpp/include/utils.hpp index ee404d501b8..f74c56f56c4 100644 --- a/demos/gaze_estimation_demo/include/utils.hpp +++ b/demos/gaze_estimation_demo/cpp/include/utils.hpp @@ -13,8 +13,8 @@ #include -#include -#include +#include +#include namespace gaze_estimation { void initializeIEObject(InferenceEngine::Core& ie, diff --git a/demos/gaze_estimation_demo/main.cpp b/demos/gaze_estimation_demo/cpp/main.cpp similarity index 98% rename from demos/gaze_estimation_demo/main.cpp rename to demos/gaze_estimation_demo/cpp/main.cpp index b46401857f7..f5a8dd1fee5 100644 --- a/demos/gaze_estimation_demo/main.cpp +++ b/demos/gaze_estimation_demo/cpp/main.cpp @@ -28,10 +28,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "gaze_estimation_demo.hpp" diff --git a/demos/gaze_estimation_demo/models.lst b/demos/gaze_estimation_demo/cpp/models.lst similarity index 100% rename from demos/gaze_estimation_demo/models.lst rename to demos/gaze_estimation_demo/cpp/models.lst diff --git a/demos/gaze_estimation_demo/src/exponential_averager.cpp b/demos/gaze_estimation_demo/cpp/src/exponential_averager.cpp similarity index 100% rename from demos/gaze_estimation_demo/src/exponential_averager.cpp rename to demos/gaze_estimation_demo/cpp/src/exponential_averager.cpp diff --git a/demos/gaze_estimation_demo/src/eye_state_estimator.cpp b/demos/gaze_estimation_demo/cpp/src/eye_state_estimator.cpp similarity index 100% rename from demos/gaze_estimation_demo/src/eye_state_estimator.cpp rename to demos/gaze_estimation_demo/cpp/src/eye_state_estimator.cpp diff --git a/demos/gaze_estimation_demo/src/face_detector.cpp b/demos/gaze_estimation_demo/cpp/src/face_detector.cpp similarity index 100% rename from demos/gaze_estimation_demo/src/face_detector.cpp rename to demos/gaze_estimation_demo/cpp/src/face_detector.cpp diff --git a/demos/gaze_estimation_demo/src/face_inference_results.cpp b/demos/gaze_estimation_demo/cpp/src/face_inference_results.cpp similarity index 100% rename from demos/gaze_estimation_demo/src/face_inference_results.cpp rename to demos/gaze_estimation_demo/cpp/src/face_inference_results.cpp diff --git a/demos/gaze_estimation_demo/src/gaze_estimator.cpp b/demos/gaze_estimation_demo/cpp/src/gaze_estimator.cpp similarity index 100% rename from demos/gaze_estimation_demo/src/gaze_estimator.cpp rename to demos/gaze_estimation_demo/cpp/src/gaze_estimator.cpp diff --git a/demos/gaze_estimation_demo/src/head_pose_estimator.cpp b/demos/gaze_estimation_demo/cpp/src/head_pose_estimator.cpp similarity index 100% rename from demos/gaze_estimation_demo/src/head_pose_estimator.cpp rename to demos/gaze_estimation_demo/cpp/src/head_pose_estimator.cpp diff --git a/demos/gaze_estimation_demo/src/ie_wrapper.cpp b/demos/gaze_estimation_demo/cpp/src/ie_wrapper.cpp similarity index 100% rename from demos/gaze_estimation_demo/src/ie_wrapper.cpp rename to demos/gaze_estimation_demo/cpp/src/ie_wrapper.cpp diff --git a/demos/gaze_estimation_demo/src/landmarks_estimator.cpp b/demos/gaze_estimation_demo/cpp/src/landmarks_estimator.cpp similarity index 100% rename from demos/gaze_estimation_demo/src/landmarks_estimator.cpp rename to demos/gaze_estimation_demo/cpp/src/landmarks_estimator.cpp diff --git a/demos/gaze_estimation_demo/src/results_marker.cpp b/demos/gaze_estimation_demo/cpp/src/results_marker.cpp similarity index 100% rename from demos/gaze_estimation_demo/src/results_marker.cpp rename to demos/gaze_estimation_demo/cpp/src/results_marker.cpp diff --git a/demos/gaze_estimation_demo/src/utils.cpp b/demos/gaze_estimation_demo/cpp/src/utils.cpp similarity index 100% rename from demos/gaze_estimation_demo/src/utils.cpp rename to demos/gaze_estimation_demo/cpp/src/utils.cpp diff --git a/demos/python_demos/asl_recognition_demo/README.md b/demos/gesture_recognition_demo/python/README.md similarity index 62% rename from demos/python_demos/asl_recognition_demo/README.md rename to demos/gesture_recognition_demo/python/README.md index df7bd64a4d7..2394adef4b4 100644 --- a/demos/python_demos/asl_recognition_demo/README.md +++ b/demos/gesture_recognition_demo/python/README.md @@ -1,22 +1,22 @@ -# ASL Recognition Python* Demo +# Gesture Recognition Python\* Demo -This demo demonstrates how to run ASL (American Sign Language) Recognition models using OpenVINO™ toolkit. +This demo demonstrates how to run Gesture (e.g. American Sign Language (ASL) gestures) Recognition models using OpenVINO™ toolkit. ## How It Works -The demo application expects an ASL recognition model in the Intermediate Representation (IR) format. +The demo application expects an gesture recognition model in the Intermediate Representation (IR) format. As input, the demo application takes: * a path to a video file or a device node of a web-camera specified with a command line argument `--input` -* a path to a file in JSON format with ASL class names `--class_map` +* a path to a file in JSON format with gesture class names `--class_map` The demo workflow is the following: 1. The demo application reads video frames one by one, runs person detector that extracts ROI, tracks the ROI of very first person. Additional process is used to prepare the batch of frames with constant framerate. -2. Batch of frames and extracted ROI are passed to artificial neural network that predicts the ASL gesture. +2. Batch of frames and extracted ROI are passed to artificial neural network that predicts the gesture. 3. The app visualizes results of its work as graphical window where following objects are shown: - Input frame with detected ROI. - - Last recognized ASL gesture. + - Last recognized gesture. - Performance characteristics. > **NOTE**: By default, Open Model Zoo demos expect input with BGR channels order. If you trained your model to work with RGB order, you need to manually rearrange the default channels order in the demo application or reconvert your model using the Model Optimizer tool with `--reverse_input_channels` argument specified. For more information about the argument, refer to **When to Reverse Input Channels** section of [Converting a Model Using General Conversion Parameters](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_convert_model_Converting_Model_General.html). @@ -26,15 +26,16 @@ The demo workflow is the following: Run the application with the `-h` option to see the following usage message: ``` -usage: asl_recognition_demo.py [-h] -m_a ACTION_MODEL -m_d DETECTION_MODEL -i - INPUT -c CLASS_MAP [-s SAMPLES_DIR] [-d DEVICE] - [-l CPU_EXTENSION] [--no_show] - [-u UTILIZATION_MONITORS] +usage: gesture_recognition_demo.py [-h] -m_a ACTION_MODEL -m_d DETECTION_MODEL + -i INPUT -c CLASS_MAP [-s SAMPLES_DIR] + [-t ACTION_THRESHOLD] [-d DEVICE] + [-l CPU_EXTENSION] [--no_show] + [-u UTILIZATION_MONITORS] Options: -h, --help Show this help message and exit. -m_a ACTION_MODEL, --action_model ACTION_MODEL - Required. Path to an .xml file with a trained asl + Required. Path to an .xml file with a trained gesture recognition model. -m_d DETECTION_MODEL, --detection_model DETECTION_MODEL Required. Path to an .xml file with a trained person @@ -43,10 +44,13 @@ Options: Required. Path to a video file or a device node of a web-camera. -c CLASS_MAP, --class_map CLASS_MAP - Required. Path to a file with ASL classes. + Required. Path to a file with gesture classes. -s SAMPLES_DIR, --samples_dir SAMPLES_DIR Optional. Path to a directory with video samples of gestures. + -t ACTION_THRESHOLD, --action_threshold ACTION_THRESHOLD + Optional. Threshold for the predicted score of an + action. -d DEVICE, --device DEVICE Optional. Specify the target device to infer on: CPU, GPU, FPGA, HDDL or MYRIAD. The demo will look for a @@ -63,30 +67,30 @@ Options: Running the application with an empty list of options yields the short version of the usage message and an error message. -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). +To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (`*.xml` + `*.bin`) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). -To run the demo, please provide paths to the ASL recognition and person detection models in the IR format, to a file with class names, and to an input video: +To run the demo, please provide paths to the gesture recognition and person detection models in the IR format, to a file with class names, and to an input video: ```bash -python asl_recognition_demo.py \ --m_a /home/user/asl-recognition-0003.xml \ +python gesture_recognition_demo.py \ +-m_a /home/user/asl-recognition-0004.xml \ -m_d /home/user/person-detection-asl-0001.xml \ -i 0 \ --c ./classes.json +-c /data/dataset_classes/msasl100.json ``` -The demo starts in person tracking mode and to switch it in the action recognition mode you should press `0-9` button with appropriate detection ID (the number in top-left of each bounding box). After that you can switch back to tracking mode by pressing space button. +The demo starts in person tracking mode and to switch it in the action recognition mode you should press `0-9` button with appropriate detection ID (the number in top-left of each bounding box). If frame contains only one person, they will be chosen automatically. After that you can switch back to tracking mode by pressing space button. -An example of file with class names can be found [here](./classes.json). +An example of file with class names can be found [here](../../../data/dataset_classes/msasl100.json). -> **NOTE**: To run the demo application with video examples of ASL gestures specify the `-s` key with valid path to the directory with video samples (you can find some ASL gesture video samples [here](https://github.com/intel-iot-devkit/sample-videos)). The name of each video sample should be the valid name of gesture from the `./classes.json` file. To navigate between samples use 'f' and 'b' keys for iterating next and previous respectively video sample. +> **NOTE**: To run the demo application with video examples of gestures specify the `-s` key with valid path to the directory with video samples (you can find some ASL gesture video samples [here](https://github.com/intel-iot-devkit/sample-videos)). The name of each video sample should be the valid name of gesture from the [`msasl100.json`](../../../data/dataset_classes/msasl100.json) file. To navigate between samples use 'f' and 'b' keys for iterating next and previous respectively video sample. ## Demo Output -The application uses OpenCV to display ASL gesture recognition result and current inference performance. +The application uses OpenCV to display gesture recognition result and current inference performance. -![](./asl_recognition_demo.jpg) +![](./gesture_recognition_demo.jpg) ## See Also * [Using Open Model Zoo demos](../../README.md) diff --git a/demos/python_demos/asl_recognition_demo/asl_recognition_demo.jpg b/demos/gesture_recognition_demo/python/gesture_recognition_demo.jpg similarity index 100% rename from demos/python_demos/asl_recognition_demo/asl_recognition_demo.jpg rename to demos/gesture_recognition_demo/python/gesture_recognition_demo.jpg diff --git a/demos/python_demos/asl_recognition_demo/asl_recognition_demo.py b/demos/gesture_recognition_demo/python/gesture_recognition_demo.py similarity index 89% rename from demos/python_demos/asl_recognition_demo/asl_recognition_demo.py rename to demos/gesture_recognition_demo/python/gesture_recognition_demo.py index 141b7bf1336..8ff3e62777e 100755 --- a/demos/python_demos/asl_recognition_demo/asl_recognition_demo.py +++ b/demos/gesture_recognition_demo/python/gesture_recognition_demo.py @@ -25,24 +25,23 @@ import cv2 import numpy as np -from asl_recognition_demo.common import load_ie_core -from asl_recognition_demo.video_stream import VideoStream -from asl_recognition_demo.video_library import VideoLibrary -from asl_recognition_demo.person_detector import PersonDetector -from asl_recognition_demo.tracker import Tracker -from asl_recognition_demo.action_recognizer import ActionRecognizer -from asl_recognition_demo.visualizer import Visualizer - -sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'common')) +from gesture_recognition_demo.common import load_ie_core +from gesture_recognition_demo.video_stream import VideoStream +from gesture_recognition_demo.video_library import VideoLibrary +from gesture_recognition_demo.person_detector import PersonDetector +from gesture_recognition_demo.tracker import Tracker +from gesture_recognition_demo.action_recognizer import ActionRecognizer +from gesture_recognition_demo.visualizer import Visualizer + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), + 'common/python')) import monitors DETECTOR_OUTPUT_SHAPE = -1, 5 TRACKER_SCORE_THRESHOLD = 0.4 TRACKER_IOU_THRESHOLD = 0.3 ACTION_NET_INPUT_FPS = 15 -ACTION_NUM_CLASSES = 100 ACTION_IMAGE_SCALE = 256 -ACTION_SCORE_THRESHOLD = 0.8 SAMPLES_MAX_WINDOW_SIZE = 1000 SAMPLES_TRG_FPS = 20 VISUALIZER_TRG_FPS = 60 @@ -57,7 +56,7 @@ def build_argparser(): args.add_argument('-h', '--help', action='help', default=SUPPRESS, help='Show this help message and exit.') args.add_argument('-m_a', '--action_model', - help='Required. Path to an .xml file with a trained asl recognition model.', + help='Required. Path to an .xml file with a trained gesture recognition model.', required=True, type=str) args.add_argument('-m_d', '--detection_model', help='Required. Path to an .xml file with a trained person detector model.', @@ -66,11 +65,14 @@ def build_argparser(): help='Required. Path to a video file or a device node of a web-camera.', required=True, type=str) args.add_argument('-c', '--class_map', - help='Required. Path to a file with ASL classes.', + help='Required. Path to a file with gesture classes.', required=True, type=str) args.add_argument('-s', '--samples_dir', help='Optional. Path to a directory with video samples of gestures.', default=None, type=str) + args.add_argument('-t', '--action_threshold', + help='Optional. Threshold for the predicted score of an action.', + default=0.8, type=float) args.add_argument('-d', '--device', help='Optional. Specify the target device to infer on: CPU, GPU, FPGA, HDDL ' 'or MYRIAD. The demo will look for a suitable plugin for device ' @@ -116,7 +118,7 @@ def main(): num_requests=2, output_shape=DETECTOR_OUTPUT_SHAPE) action_recognizer = ActionRecognizer(args.action_model, args.device, ie_core, num_requests=2, img_scale=ACTION_IMAGE_SCALE, - num_classes=ACTION_NUM_CLASSES) + num_classes=len(class_map)) person_tracker = Tracker(person_detector, TRACKER_SCORE_THRESHOLD, TRACKER_IOU_THRESHOLD) video_stream = VideoStream(args.input, ACTION_NET_INPUT_FPS, action_recognizer.input_length) @@ -156,6 +158,9 @@ def main(): active_object_id = -1 last_caption = None + if len(detections) == 1: + active_object_id = 0 + if active_object_id >= 0: cur_det = [det for det in detections if det.id == active_object_id] if len(cur_det) != 1: @@ -170,7 +175,7 @@ def main(): class_map[action_class_id] if class_map is not None else action_class_id action_class_score = np.max(recognizer_result) - if action_class_score > ACTION_SCORE_THRESHOLD: + if action_class_score > args.action_threshold: last_caption = 'Last gesture: {} '.format(action_class_label) end_time = time.perf_counter() diff --git a/demos/python_demos/asl_recognition_demo/asl_recognition_demo/__init__.py b/demos/gesture_recognition_demo/python/gesture_recognition_demo/__init__.py similarity index 100% rename from demos/python_demos/asl_recognition_demo/asl_recognition_demo/__init__.py rename to demos/gesture_recognition_demo/python/gesture_recognition_demo/__init__.py diff --git a/demos/python_demos/asl_recognition_demo/asl_recognition_demo/action_recognizer.py b/demos/gesture_recognition_demo/python/gesture_recognition_demo/action_recognizer.py similarity index 98% rename from demos/python_demos/asl_recognition_demo/asl_recognition_demo/action_recognizer.py rename to demos/gesture_recognition_demo/python/gesture_recognition_demo/action_recognizer.py index 167ad5a02ef..7bee11c3ec4 100644 --- a/demos/python_demos/asl_recognition_demo/asl_recognition_demo/action_recognizer.py +++ b/demos/gesture_recognition_demo/python/gesture_recognition_demo/action_recognizer.py @@ -17,7 +17,7 @@ import cv2 import numpy as np -from asl_recognition_demo.common import IEModel +from gesture_recognition_demo.common import IEModel class ActionRecognizer(IEModel): diff --git a/demos/python_demos/asl_recognition_demo/asl_recognition_demo/common.py b/demos/gesture_recognition_demo/python/gesture_recognition_demo/common.py similarity index 100% rename from demos/python_demos/asl_recognition_demo/asl_recognition_demo/common.py rename to demos/gesture_recognition_demo/python/gesture_recognition_demo/common.py diff --git a/demos/python_demos/asl_recognition_demo/asl_recognition_demo/person_detector.py b/demos/gesture_recognition_demo/python/gesture_recognition_demo/person_detector.py similarity index 98% rename from demos/python_demos/asl_recognition_demo/asl_recognition_demo/person_detector.py rename to demos/gesture_recognition_demo/python/gesture_recognition_demo/person_detector.py index 4f87b81bf98..d6697eda1e2 100644 --- a/demos/python_demos/asl_recognition_demo/asl_recognition_demo/person_detector.py +++ b/demos/gesture_recognition_demo/python/gesture_recognition_demo/person_detector.py @@ -17,7 +17,7 @@ import cv2 import numpy as np -from asl_recognition_demo.common import IEModel +from gesture_recognition_demo.common import IEModel class PersonDetector(IEModel): diff --git a/demos/python_demos/asl_recognition_demo/asl_recognition_demo/tracker.py b/demos/gesture_recognition_demo/python/gesture_recognition_demo/tracker.py similarity index 100% rename from demos/python_demos/asl_recognition_demo/asl_recognition_demo/tracker.py rename to demos/gesture_recognition_demo/python/gesture_recognition_demo/tracker.py diff --git a/demos/python_demos/asl_recognition_demo/asl_recognition_demo/video_library.py b/demos/gesture_recognition_demo/python/gesture_recognition_demo/video_library.py similarity index 100% rename from demos/python_demos/asl_recognition_demo/asl_recognition_demo/video_library.py rename to demos/gesture_recognition_demo/python/gesture_recognition_demo/video_library.py diff --git a/demos/python_demos/asl_recognition_demo/asl_recognition_demo/video_stream.py b/demos/gesture_recognition_demo/python/gesture_recognition_demo/video_stream.py similarity index 99% rename from demos/python_demos/asl_recognition_demo/asl_recognition_demo/video_stream.py rename to demos/gesture_recognition_demo/python/gesture_recognition_demo/video_stream.py index eba35276c12..b60f8cdb16c 100644 --- a/demos/python_demos/asl_recognition_demo/asl_recognition_demo/video_stream.py +++ b/demos/gesture_recognition_demo/python/gesture_recognition_demo/video_stream.py @@ -16,7 +16,6 @@ import logging as log import time -from os.path import exists from multiprocessing import Process, Value, Array import cv2 diff --git a/demos/python_demos/asl_recognition_demo/asl_recognition_demo/visualizer.py b/demos/gesture_recognition_demo/python/gesture_recognition_demo/visualizer.py similarity index 100% rename from demos/python_demos/asl_recognition_demo/asl_recognition_demo/visualizer.py rename to demos/gesture_recognition_demo/python/gesture_recognition_demo/visualizer.py diff --git a/demos/python_demos/asl_recognition_demo/models.lst b/demos/gesture_recognition_demo/python/models.lst similarity index 82% rename from demos/python_demos/asl_recognition_demo/models.lst rename to demos/gesture_recognition_demo/python/models.lst index 76c3c505099..6d0c12136d6 100644 --- a/demos/python_demos/asl_recognition_demo/models.lst +++ b/demos/gesture_recognition_demo/python/models.lst @@ -1,3 +1,4 @@ # This file can be used with the --list option of the model downloader. asl-recognition-???? +common-sign-language-???? person-detection-asl-???? diff --git a/demos/python_demos/handwritten_text_recognition_demo/README.md b/demos/handwritten_text_recognition_demo/python/README.md similarity index 100% rename from demos/python_demos/handwritten_text_recognition_demo/README.md rename to demos/handwritten_text_recognition_demo/python/README.md diff --git a/demos/python_demos/handwritten_text_recognition_demo/data/digit_hyphen.txt b/demos/handwritten_text_recognition_demo/python/data/digit_hyphen.txt similarity index 100% rename from demos/python_demos/handwritten_text_recognition_demo/data/digit_hyphen.txt rename to demos/handwritten_text_recognition_demo/python/data/digit_hyphen.txt diff --git a/demos/python_demos/handwritten_text_recognition_demo/data/handwritten_japanese_test.png b/demos/handwritten_text_recognition_demo/python/data/handwritten_japanese_test.png similarity index 100% rename from demos/python_demos/handwritten_text_recognition_demo/data/handwritten_japanese_test.png rename to demos/handwritten_text_recognition_demo/python/data/handwritten_japanese_test.png diff --git a/demos/python_demos/handwritten_text_recognition_demo/data/handwritten_simplified_chinese_test.png b/demos/handwritten_text_recognition_demo/python/data/handwritten_simplified_chinese_test.png similarity index 100% rename from demos/python_demos/handwritten_text_recognition_demo/data/handwritten_simplified_chinese_test.png rename to demos/handwritten_text_recognition_demo/python/data/handwritten_simplified_chinese_test.png diff --git a/demos/python_demos/handwritten_text_recognition_demo/handwritten_text_recognition_demo.py b/demos/handwritten_text_recognition_demo/python/handwritten_text_recognition_demo.py similarity index 95% rename from demos/python_demos/handwritten_text_recognition_demo/handwritten_text_recognition_demo.py rename to demos/handwritten_text_recognition_demo/python/handwritten_text_recognition_demo.py index 6f73092d3b4..850aebe2c70 100755 --- a/demos/python_demos/handwritten_text_recognition_demo/handwritten_text_recognition_demo.py +++ b/demos/handwritten_text_recognition_demo/python/handwritten_text_recognition_demo.py @@ -18,6 +18,7 @@ import time import logging as log from argparse import ArgumentParser, SUPPRESS +from pathlib import Path import cv2 import numpy as np @@ -41,7 +42,7 @@ def build_argparser(): "value is CPU") args.add_argument("-ni", "--number_iter", type=int, default=1, help="Optional. Number of inference iterations") - args.add_argument("-cl", "--charlist", type=str, default=os.path.join(os.path.dirname(__file__), "data/kondate_nakayosi_char_list.txt"), + args.add_argument("-cl", "--charlist", type=str, default=str(Path(__file__).resolve().parents[3] / "data/dataset_classes/kondate_nakayosi.txt"), help="Path to the decoding char list file. Default is for Japanese") args.add_argument("-dc", "--designated_characters", type=str, default=None, help="Optional. Path to the designated character file") args.add_argument("-tk", "--top_k", type=int, default=20, help="Optional. Top k steps in looking up the decoded character, until a designated one is found") @@ -63,7 +64,7 @@ def preprocess_input(image_name, height, width): img = rsz[None, :, :] _, h, w = img.shape # right edge padding - pad_img = np.pad(img, ((0, 0), (0, height - h), (0, width - w)), mode='edge') + pad_img = np.pad(img, ((0, 0), (0, height - h), (0, width - w)), mode='edge') return pad_img @@ -91,7 +92,7 @@ def main(): input_batch_size, input_channel, input_height, input_width= net.input_info[input_blob].input_data.shape # Read and pre-process input image (NOTE: one image only) - input_image = preprocess_input(args.input, height=input_height, width=input_width)[None,:,:,:] + input_image = preprocess_input(args.input, height=input_height, width=input_width)[None, :, :, :] assert input_batch_size == input_image.shape[0], "The net's input batch size should equal the input image's batch size " assert input_channel == input_image.shape[1], "The net's input channel should equal the input image's channel" diff --git a/demos/python_demos/handwritten_text_recognition_demo/models.lst b/demos/handwritten_text_recognition_demo/python/models.lst similarity index 52% rename from demos/python_demos/handwritten_text_recognition_demo/models.lst rename to demos/handwritten_text_recognition_demo/python/models.lst index c4e7df14605..f4bde39a994 100644 --- a/demos/python_demos/handwritten_text_recognition_demo/models.lst +++ b/demos/handwritten_text_recognition_demo/python/models.lst @@ -1,3 +1,3 @@ # This file can be used with the --list option of the model downloader. handwritten-japanese-recognition-0001 -# handwritten-simplified-chinese-recognition-0001 # TODO: reenable this after the model is added +handwritten-simplified-chinese-recognition-0001 diff --git a/demos/python_demos/handwritten_text_recognition_demo/requirements.txt b/demos/handwritten_text_recognition_demo/python/requirements.txt similarity index 100% rename from demos/python_demos/handwritten_text_recognition_demo/requirements.txt rename to demos/handwritten_text_recognition_demo/python/requirements.txt diff --git a/demos/python_demos/handwritten_text_recognition_demo/utils/__init__.py b/demos/handwritten_text_recognition_demo/python/utils/__init__.py similarity index 100% rename from demos/python_demos/handwritten_text_recognition_demo/utils/__init__.py rename to demos/handwritten_text_recognition_demo/python/utils/__init__.py diff --git a/demos/python_demos/handwritten_text_recognition_demo/utils/codec.py b/demos/handwritten_text_recognition_demo/python/utils/codec.py similarity index 90% rename from demos/python_demos/handwritten_text_recognition_demo/utils/codec.py rename to demos/handwritten_text_recognition_demo/python/utils/codec.py index 973841074df..69661719e5f 100644 --- a/demos/python_demos/handwritten_text_recognition_demo/utils/codec.py +++ b/demos/handwritten_text_recognition_demo/python/utils/codec.py @@ -6,7 +6,7 @@ class CTCCodec(object): def __init__(self, characters, designated_characters, top_k): # characters (str): set of the possible characters. self.designated_character_list = None - if designated_characters != None: + if designated_characters is not None: with open(designated_characters, encoding='utf-8') as f: self.designated_character_list = [line.strip() for line in f] @@ -15,8 +15,8 @@ def __init__(self, characters, designated_characters, top_k): self.dict = {} for i, char in enumerate(dict_character): - # NOTE: 0 is reserved for 'blank' token required by CTCLoss - self.dict[char] = i + 1 + # NOTE: 0 is reserved for 'blank' token required by CTCLoss + self.dict[char] = i + 1 # dummy '[blank]' token for CTCLoss (index 0) self.characters = ['[blank]'] + dict_character @@ -30,7 +30,7 @@ def decode(self, preds): preds_index_reshape = preds_index.reshape(-1) # B*W char_list = [] - if self.designated_character_list != None: + if self.designated_character_list is not None: # Store the top k indices in each time step in a 2D matrix preds_index_filter = preds.transpose(1, 0, 2) # WBD -> BWD B=1 preds_index_filter = np.squeeze(preds_index_filter) # WD @@ -44,7 +44,7 @@ def decode(self, preds): if preds_index_reshape[i] != 0 and (not (i > 0 and preds_index_reshape[i - 1] == preds_index_reshape[i])): append_char = self.characters[preds_index_reshape[i]] # Traverse the top k index array until a designated character is found - if not append_char in self.designated_character_list: + if append_char not in self.designated_character_list: for index in preds_top_k_index_matrix[i, :]: if self.characters[int(index)] in self.designated_character_list: append_char = self.characters[int(index)] diff --git a/demos/python_demos/human_pose_estimation_3d_demo/README.md b/demos/human_pose_estimation_3d_demo/python/README.md similarity index 80% rename from demos/python_demos/human_pose_estimation_3d_demo/README.md rename to demos/human_pose_estimation_3d_demo/python/README.md index aea0dff383f..da92fdeadd9 100644 --- a/demos/python_demos/human_pose_estimation_3d_demo/README.md +++ b/demos/human_pose_estimation_3d_demo/python/README.md @@ -1,4 +1,7 @@ -# 3D Human Pose Estimation Python* Demo +# 3D Human Pose Estimation Python\* Demo + +![](./human_pose_estimation_3d.gif) +![](./human_pose_estimation_3d_canvas.gif) This demo demonstrates how to run 3D Human Pose Estimation models using OpenVINO™. The following pre-trained models can be used: @@ -31,9 +34,9 @@ Refer to [Using Open Model Zoo demos](../../README.md), for instructions on how Run the application with the `-h` option to see the following usage message: ``` -usage: human_pose_estimation_3d_demo.py [-h] -m MODEL [-i INPUT [INPUT ...]] - [-d DEVICE] - [--height_size HEIGHT_SIZE] +usage: human_pose_estimation_3d_demo.py [-h] -m MODEL -i INPUT [--loop] + [-o OUTPUT] [-limit OUTPUT_LIMIT] + [-d DEVICE] [--height_size HEIGHT_SIZE] [--extrinsics_path EXTRINSICS_PATH] [--fx FX] [--no_show] [-u UTILIZATION_MONITORS] @@ -45,9 +48,15 @@ Options: -h, --help Show this help message and exit. -m MODEL, --model MODEL Required. Path to an .xml file with a trained model. - -i INPUT [INPUT ...], --input INPUT [INPUT ...] - Required. Path to input image, images, video file or - camera id. + -i INPUT, --input INPUT + Required. An input to process. The input must be a single image, + a folder of images, video file or camera id. + --loop Optional. Enable reading the input in a loop. + -o OUTPUT, --output OUTPUT + Optional. Name of output to save. + -limit OUTPUT_LIMIT, --output_limit OUTPUT_LIMIT + Optional. Number of frames to store in output. + If -1 is set, all frames are stored. -d DEVICE, --device DEVICE Optional. Specify the target device to infer on: CPU, GPU, FPGA, HDDL or MYRIAD. The demo will look for a @@ -65,7 +74,7 @@ Options: Running the application with an empty list of options yields the short version of the usage message and an error message. -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). +To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (`*.xml` + `*.bin`) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). To run the demo, please provide paths to the model in the IR format, and to an input video or image(s): @@ -79,8 +88,6 @@ python human_pose_estimation_3d_demo.py \ The application uses OpenCV to display found poses and current inference performance. -![](./data/human_pose_estimation_3d_demo.jpg) - ## See Also * [Using Open Model Zoo demos](../../README.md) * [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) diff --git a/demos/python_demos/human_pose_estimation_3d_demo/data/extrinsics.json b/demos/human_pose_estimation_3d_demo/python/data/extrinsics.json similarity index 100% rename from demos/python_demos/human_pose_estimation_3d_demo/data/extrinsics.json rename to demos/human_pose_estimation_3d_demo/python/data/extrinsics.json diff --git a/demos/human_pose_estimation_3d_demo/python/human_pose_estimation_3d.gif b/demos/human_pose_estimation_3d_demo/python/human_pose_estimation_3d.gif new file mode 100644 index 00000000000..5a3f73e296f Binary files /dev/null and b/demos/human_pose_estimation_3d_demo/python/human_pose_estimation_3d.gif differ diff --git a/demos/human_pose_estimation_3d_demo/python/human_pose_estimation_3d_canvas.gif b/demos/human_pose_estimation_3d_demo/python/human_pose_estimation_3d_canvas.gif new file mode 100644 index 00000000000..71f0579fdb5 Binary files /dev/null and b/demos/human_pose_estimation_3d_demo/python/human_pose_estimation_3d_canvas.gif differ diff --git a/demos/python_demos/human_pose_estimation_3d_demo/human_pose_estimation_3d_demo.py b/demos/human_pose_estimation_3d_demo/python/human_pose_estimation_3d_demo.py similarity index 65% rename from demos/python_demos/human_pose_estimation_3d_demo/human_pose_estimation_3d_demo.py rename to demos/human_pose_estimation_3d_demo/python/human_pose_estimation_3d_demo.py index d09eb868786..70dbd84a1f2 100755 --- a/demos/python_demos/human_pose_estimation_3d_demo/human_pose_estimation_3d_demo.py +++ b/demos/human_pose_estimation_3d_demo/python/human_pose_estimation_3d_demo.py @@ -12,21 +12,21 @@ limitations under the License. """ -from argparse import ArgumentParser, SUPPRESS import json -import os import sys +from argparse import ArgumentParser, SUPPRESS +from pathlib import Path import cv2 import numpy as np from modules.inference_engine import InferenceEngine -from modules.input_reader import InputReader from modules.draw import Plotter3d, draw_poses from modules.parse_poses import parse_poses -sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'common')) +sys.path.append(str(Path(__file__).resolve().parents[2] / 'common/python')) import monitors +from images_capture import open_images_capture def rotate_poses(poses_3d, R, t): @@ -48,10 +48,17 @@ def rotate_poses(poses_3d, R, t): help='Show this help message and exit.') args.add_argument('-m', '--model', help='Required. Path to an .xml file with a trained model.', - type=str, required=True) - args.add_argument('-i', '--input', - help='Required. Path to input image, images, video file or camera id.', - nargs='+', default='') + type=Path, required=True) + args.add_argument('-i', '--input', required=True, + help='Required. An input to process. The input must be a single image, ' + 'a folder of images, video file or camera id.') + args.add_argument('--loop', default=False, action='store_true', + help='Optional. Enable reading the input in a loop.') + args.add_argument('-o', '--output', required=False, + help='Optional. Name of output to save.') + args.add_argument('-limit', '--output_limit', required=False, default=1000, type=int, + help='Optional. Number of frames to store in output. ' + 'If -1 is set, all frames are stored.') args.add_argument('-d', '--device', help='Optional. Specify the target device to infer on: CPU, GPU, FPGA, HDDL or MYRIAD. ' 'The demo will look for a suitable plugin for device specified ' @@ -60,16 +67,13 @@ def rotate_poses(poses_3d, R, t): args.add_argument('--height_size', help='Optional. Network input layer height size.', type=int, default=256) args.add_argument('--extrinsics_path', help='Optional. Path to file with camera extrinsics.', - type=str, default=None) + type=Path, default=None) args.add_argument('--fx', type=np.float32, default=-1, help='Optional. Camera focal length.') args.add_argument('--no_show', help='Optional. Do not display output.', action='store_true') args.add_argument("-u", "--utilization_monitors", default='', type=str, help="Optional. List of monitors to show initially.") args = parser.parse_args() - if args.input == '': - raise ValueError('Please, provide input data.') - stride = 8 inference_engine = InferenceEngine(args.model, args.device, stride) canvas_3d = np.zeros((720, 1280, 3), dtype=np.uint8) @@ -81,24 +85,37 @@ def rotate_poses(poses_3d, R, t): file_path = args.extrinsics_path if file_path is None: - file_path = os.path.join(os.path.dirname(__file__), 'data', 'extrinsics.json') + file_path = Path(__file__).parent / 'data/extrinsics.json' with open(file_path, 'r') as f: extrinsics = json.load(f) R = np.array(extrinsics['R'], dtype=np.float32) t = np.array(extrinsics['t'], dtype=np.float32) - frame_provider = InputReader(args.input) - is_video = frame_provider.is_video + cap = open_images_capture(args.input, args.loop) + is_video = cap.get_type() in ('VIDEO', 'CAMERA') + frame = cap.read() + if frame is None: + raise RuntimeError("Can't read an image from the input") + + video_writer = cv2.VideoWriter() + if args.output: + video_writer = cv2.VideoWriter(args.output, cv2.VideoWriter_fourcc(*'MJPG'), cap.fps(), + (frame.shape[1], frame.shape[0])) + if not video_writer.isOpened(): + raise RuntimeError("Can't open video writer") + base_height = args.height_size fx = args.fx + frames_processed = 0 delay = 1 esc_code = 27 p_code = 112 space_code = 32 mean_time = 0 presenter = monitors.Presenter(args.utilization_monitors, 0) - for frame in frame_provider: + + while frame is not None: current_time = cv2.getTickCount() input_scale = base_height / frame.shape[0] scaled_img = cv2.resize(frame, dsize=None, fx=input_scale, fy=input_scale) @@ -129,31 +146,36 @@ def rotate_poses(poses_3d, R, t): mean_time = mean_time * 0.95 + current_time * 0.05 cv2.putText(frame, 'FPS: {}'.format(int(1 / mean_time * 10) / 10), (40, 80), cv2.FONT_HERSHEY_COMPLEX, 1, (0, 0, 255)) - if args.no_show: - continue - cv2.imshow(canvas_3d_window_name, canvas_3d) - cv2.imshow('3D Human Pose Estimation', frame) - - key = cv2.waitKey(delay) - if key == esc_code: - break - if key == p_code: - if delay == 1: - delay = 0 - else: - delay = 1 - else: - presenter.handleKey(key) - if delay == 0 or not is_video: # allow to rotate 3D canvas while on pause - key = 0 - while (key != p_code - and key != esc_code - and key != space_code): - plotter.plot(canvas_3d, poses_3d, edges) - cv2.imshow(canvas_3d_window_name, canvas_3d) - key = cv2.waitKey(33) + + frames_processed += 1 + if video_writer.isOpened() and (args.output_limit == -1 or frames_processed <= args.output_limit): + video_writer.write(frame) + + if not args.no_show: + cv2.imshow(canvas_3d_window_name, canvas_3d) + cv2.imshow('3D Human Pose Estimation', frame) + + key = cv2.waitKey(delay) if key == esc_code: break + if key == p_code: + if delay == 1: + delay = 0 + else: + delay = 1 else: - delay = 1 + presenter.handleKey(key) + if delay == 0 or not is_video: # allow to rotate 3D canvas while on pause + key = 0 + while (key != p_code + and key != esc_code + and key != space_code): + plotter.plot(canvas_3d, poses_3d, edges) + cv2.imshow(canvas_3d_window_name, canvas_3d) + key = cv2.waitKey(33) + if key == esc_code: + break + else: + delay = 1 + frame = cap.read() print(presenter.reportMeans()) diff --git a/demos/python_demos/human_pose_estimation_3d_demo/models.lst b/demos/human_pose_estimation_3d_demo/python/models.lst similarity index 100% rename from demos/python_demos/human_pose_estimation_3d_demo/models.lst rename to demos/human_pose_estimation_3d_demo/python/models.lst diff --git a/demos/python_demos/human_pose_estimation_3d_demo/modules/__init__.py b/demos/human_pose_estimation_3d_demo/python/modules/__init__.py similarity index 100% rename from demos/python_demos/human_pose_estimation_3d_demo/modules/__init__.py rename to demos/human_pose_estimation_3d_demo/python/modules/__init__.py diff --git a/demos/python_demos/human_pose_estimation_3d_demo/modules/draw.py b/demos/human_pose_estimation_3d_demo/python/modules/draw.py similarity index 97% rename from demos/python_demos/human_pose_estimation_3d_demo/modules/draw.py rename to demos/human_pose_estimation_3d_demo/python/modules/draw.py index 0ac560fc04a..ccbf757a527 100644 --- a/demos/python_demos/human_pose_estimation_3d_demo/modules/draw.py +++ b/demos/human_pose_estimation_3d_demo/python/modules/draw.py @@ -71,9 +71,9 @@ def _plot_edges(self, img, vertices, edges, R): def _get_rotation(self, theta, phi): sin, cos = math.sin, math.cos return np.array([ - [ cos(theta), sin(theta) * sin(phi)], - [-sin(theta), cos(theta) * sin(phi)], - [ 0, -cos(phi)] + [ cos(theta), sin(theta) * sin(phi)], + [-sin(theta), cos(theta) * sin(phi)], + [ 0, -cos(phi)] ], dtype=np.float32) # transposed @staticmethod diff --git a/demos/python_demos/human_pose_estimation_3d_demo/modules/inference_engine.py b/demos/human_pose_estimation_3d_demo/python/modules/inference_engine.py similarity index 94% rename from demos/python_demos/human_pose_estimation_3d_demo/modules/inference_engine.py rename to demos/human_pose_estimation_3d_demo/python/modules/inference_engine.py index 582849fae0f..511c51ce708 100644 --- a/demos/python_demos/human_pose_estimation_3d_demo/modules/inference_engine.py +++ b/demos/human_pose_estimation_3d_demo/python/modules/inference_engine.py @@ -11,8 +11,6 @@ limitations under the License. """ -import os - import numpy as np from openvino.inference_engine import IECore @@ -25,7 +23,7 @@ def __init__(self, net_model_xml_path, device, stride): self.ie = IECore() - self.net = self.ie.read_network(net_model_xml_path, os.path.splitext(net_model_xml_path)[0] + '.bin') + self.net = self.ie.read_network(net_model_xml_path, net_model_xml_path.with_suffix('.bin')) required_input_key = {'data'} assert required_input_key == set(self.net.input_info), \ 'Demo supports only topologies with the following input key: {}'.format(', '.join(required_input_key)) diff --git a/demos/python_demos/human_pose_estimation_3d_demo/modules/one_euro_filter.py b/demos/human_pose_estimation_3d_demo/python/modules/one_euro_filter.py similarity index 100% rename from demos/python_demos/human_pose_estimation_3d_demo/modules/one_euro_filter.py rename to demos/human_pose_estimation_3d_demo/python/modules/one_euro_filter.py diff --git a/demos/python_demos/human_pose_estimation_3d_demo/modules/parse_poses.py b/demos/human_pose_estimation_3d_demo/python/modules/parse_poses.py similarity index 100% rename from demos/python_demos/human_pose_estimation_3d_demo/modules/parse_poses.py rename to demos/human_pose_estimation_3d_demo/python/modules/parse_poses.py diff --git a/demos/python_demos/human_pose_estimation_3d_demo/modules/pose.py b/demos/human_pose_estimation_3d_demo/python/modules/pose.py similarity index 100% rename from demos/python_demos/human_pose_estimation_3d_demo/modules/pose.py rename to demos/human_pose_estimation_3d_demo/python/modules/pose.py diff --git a/demos/python_demos/human_pose_estimation_3d_demo/pose_extractor/CMakeLists.txt b/demos/human_pose_estimation_3d_demo/python/pose_extractor/CMakeLists.txt similarity index 100% rename from demos/python_demos/human_pose_estimation_3d_demo/pose_extractor/CMakeLists.txt rename to demos/human_pose_estimation_3d_demo/python/pose_extractor/CMakeLists.txt diff --git a/demos/python_demos/human_pose_estimation_3d_demo/pose_extractor/src/extract_poses.cpp b/demos/human_pose_estimation_3d_demo/python/pose_extractor/src/extract_poses.cpp similarity index 100% rename from demos/python_demos/human_pose_estimation_3d_demo/pose_extractor/src/extract_poses.cpp rename to demos/human_pose_estimation_3d_demo/python/pose_extractor/src/extract_poses.cpp diff --git a/demos/python_demos/human_pose_estimation_3d_demo/pose_extractor/src/extract_poses.hpp b/demos/human_pose_estimation_3d_demo/python/pose_extractor/src/extract_poses.hpp similarity index 100% rename from demos/python_demos/human_pose_estimation_3d_demo/pose_extractor/src/extract_poses.hpp rename to demos/human_pose_estimation_3d_demo/python/pose_extractor/src/extract_poses.hpp diff --git a/demos/python_demos/human_pose_estimation_3d_demo/pose_extractor/src/human_pose.cpp b/demos/human_pose_estimation_3d_demo/python/pose_extractor/src/human_pose.cpp similarity index 100% rename from demos/python_demos/human_pose_estimation_3d_demo/pose_extractor/src/human_pose.cpp rename to demos/human_pose_estimation_3d_demo/python/pose_extractor/src/human_pose.cpp diff --git a/demos/python_demos/human_pose_estimation_3d_demo/pose_extractor/src/human_pose.hpp b/demos/human_pose_estimation_3d_demo/python/pose_extractor/src/human_pose.hpp similarity index 100% rename from demos/python_demos/human_pose_estimation_3d_demo/pose_extractor/src/human_pose.hpp rename to demos/human_pose_estimation_3d_demo/python/pose_extractor/src/human_pose.hpp diff --git a/demos/python_demos/human_pose_estimation_3d_demo/pose_extractor/src/peak.cpp b/demos/human_pose_estimation_3d_demo/python/pose_extractor/src/peak.cpp similarity index 100% rename from demos/python_demos/human_pose_estimation_3d_demo/pose_extractor/src/peak.cpp rename to demos/human_pose_estimation_3d_demo/python/pose_extractor/src/peak.cpp diff --git a/demos/python_demos/human_pose_estimation_3d_demo/pose_extractor/src/peak.hpp b/demos/human_pose_estimation_3d_demo/python/pose_extractor/src/peak.hpp similarity index 100% rename from demos/python_demos/human_pose_estimation_3d_demo/pose_extractor/src/peak.hpp rename to demos/human_pose_estimation_3d_demo/python/pose_extractor/src/peak.hpp diff --git a/demos/python_demos/human_pose_estimation_3d_demo/pose_extractor/wrapper.cpp b/demos/human_pose_estimation_3d_demo/python/pose_extractor/wrapper.cpp similarity index 100% rename from demos/python_demos/human_pose_estimation_3d_demo/pose_extractor/wrapper.cpp rename to demos/human_pose_estimation_3d_demo/python/pose_extractor/wrapper.cpp diff --git a/demos/python_demos/human_pose_estimation_3d_demo/requirements.txt b/demos/human_pose_estimation_3d_demo/python/requirements.txt similarity index 100% rename from demos/python_demos/human_pose_estimation_3d_demo/requirements.txt rename to demos/human_pose_estimation_3d_demo/python/requirements.txt diff --git a/demos/human_pose_estimation_demo/CMakeLists.txt b/demos/human_pose_estimation_demo/CMakeLists.txt deleted file mode 100644 index ddce9118dce..00000000000 --- a/demos/human_pose_estimation_demo/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (C) 2018-2019 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 -# - -file (GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) -file (GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) - -ie_add_sample(NAME human_pose_estimation_demo - SOURCES ${SOURCES} - HEADERS ${HEADERS} - INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include" - DEPENDENCIES monitors - OPENCV_DEPENDENCIES highgui) diff --git a/demos/human_pose_estimation_demo/cpp/CMakeLists.txt b/demos/human_pose_estimation_demo/cpp/CMakeLists.txt new file mode 100644 index 00000000000..cf602bb7cae --- /dev/null +++ b/demos/human_pose_estimation_demo/cpp/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (C) 2018-2021 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +# + +file(GLOB SRC_FILES ./*.cpp) +file(GLOB H_FILES ./*.h) + +ie_add_sample(NAME human_pose_estimation_demo + SOURCES ${SRC_FILES} + HEADERS ${H_FILES} + DEPENDENCIES monitors models pipelines + OPENCV_DEPENDENCIES highgui videoio imgproc) diff --git a/demos/human_pose_estimation_demo/README.md b/demos/human_pose_estimation_demo/cpp/README.md similarity index 60% rename from demos/human_pose_estimation_demo/README.md rename to demos/human_pose_estimation_demo/cpp/README.md index 2c329d2cf19..285b96edf94 100644 --- a/demos/human_pose_estimation_demo/README.md +++ b/demos/human_pose_estimation_demo/cpp/README.md @@ -1,10 +1,12 @@ # Human Pose Estimation C++ Demo +![](../human_pose_estimation.gif) + This demo showcases the work of multi-person 2D pose estimation algorithm. The task is to predict a pose: body skeleton, which consists of keypoints and connections between them, for every person in an input video. The pose may contain up to 18 keypoints: *ears, eyes, nose, neck, shoulders, elbows, wrists, hips, knees*, and *ankles*. Some of potential use cases of the algorithm are action recognition and behavior understanding. You can use the following pre-trained model with the demo: * `human-pose-estimation-0001`, which is a human pose estimation network, that produces two feature vectors. The algorithm uses these feature vectors to predict human poses. -For more information about the pre-trained model, refer to the [model documentation](../../models/intel/index.md). +For more information about the pre-trained model, refer to the [model documentation](../../../models/intel/index.md). The input frame height is scaled to model height, frame width is scaled to preserve initial aspect ratio and padded to multiple of 8. @@ -29,28 +31,36 @@ InferenceEngine: human_pose_estimation_demo [OPTION] Options: - -h Print a usage message. - -i Required. An input to process. The input must be a single image, a folder of images or anything that cv::VideoCapture can process. - -loop Optional. Enable reading the input in a loop. - -m "" Required. Path to the Human Pose Estimation model (.xml) file. - -d "" Optional. Specify the target device for Human Pose Estimation (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:" format to specify HETERO plugin. The application looks for a suitable plugin for the specified device. - -pc Optional. Enable per-layer performance report. - -no_show Optional. Do not show processed video. - -black Optional. Show black background. - -r Optional. Output inference results as raw values. - -u Optional. List of monitors to show initially. + -h Print a usage message. + -at "" Required. Type of the network, either "ae" for + Associative Embedding or "openpose" for OpenPose. + -i "" Required. An input to process. The input must be a single image, a folder of images or anything that cv::VideoCapture can process. + -m "" Required. Path to an .xml file with a trained model. + -tsize Optional. Target input size. + -t Optional. Probability threshold for poses filtering. + -l "" Required for CPU custom layers. Absolute path to a shared library with the kernel implementations. + Or + -c "" Required for GPU custom kernels. Absolute path to the .xml file with the kernel descriptions. + -d "" Optional. Specify the target device to infer on (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. + -pc Optional. Enables per-layer performance report. + -nireq "" Optional. Number of infer requests. If this option is omitted, number of infer requests is determined automatically. + -nthreads "" Optional. Number of threads. + -nstreams Optional. Number of streams to use for inference on the CPU or/and GPU in throughput mode (for HETERO and MULTI device cases use format :,: or just ) + -loop Optional. Enable reading the input in a loop. + -no_show Optional. Do not show processed video. + -u Optional. List of monitors to show initially. ``` Running the application with an empty list of options yields an error message. -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). +To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). For example, to do inference on a CPU, run the following command: ```sh -./human_pose_estimation_demo -i /input_video.mp4 -m /human-pose-estimation-0001.xml -d CPU +./human_pose_estimation_demo -i /input_video.mp4 -m /human-pose-estimation-0001.xml -d CPU -at openpose ``` ## Demo Output @@ -61,6 +71,6 @@ The demo uses OpenCV to display the resulting frame with estimated poses and tex > Other models may produce unexpected results on these devices. ## See Also -* [Using Open Model Zoo demos](../README.md) +* [Using Open Model Zoo demos](../../README.md) * [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) -* [Model Downloader](../../tools/downloader/README.md) +* [Model Downloader](../../../tools/downloader/README.md) diff --git a/demos/human_pose_estimation_demo/cpp/main.cpp b/demos/human_pose_estimation_demo/cpp/main.cpp new file mode 100644 index 00000000000..d13b499aafd --- /dev/null +++ b/demos/human_pose_estimation_demo/cpp/main.cpp @@ -0,0 +1,316 @@ +/* +// Copyright (C) 2018-2021 Intel Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +*/ + +/** +* \brief The entry point for the Inference Engine Human Pose Estimation demo application +* \file human_pose_estimation_demo/main.cpp +* \example human_pose_estimation_demo/main.cpp +*/ + +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + + +static const char help_message[] = "Print a usage message."; +static const char at_message[] = "Required. Type of the network, either 'ae' for Associative Embedding or 'openpose' for OpenPose."; +static const char video_message[] = "Required. Path to a video file (specify \"cam\" to work with camera)."; +static const char model_message[] = "Required. Path to an .xml file with a trained model."; +static const char target_size_message[] = "Optional. Target input size."; +static const char target_device_message[] = "Optional. Specify the target device to infer on (the list of available devices is shown below). " +"Default value is CPU. Use \"-d HETERO:\" format to specify HETERO plugin. " +"The demo will look for a suitable plugin for a specified device."; +static const char performance_counter_message[] = "Optional. Enables per-layer performance report."; +static const char custom_cldnn_message[] = "Required for GPU custom kernels. " +"Absolute path to the .xml file with the kernel descriptions."; +static const char custom_cpu_library_message[] = "Required for CPU custom layers. " +"Absolute path to a shared library with the kernel implementations."; +static const char thresh_output_message[] = "Optional. Probability threshold for poses filtering."; +static const char nireq_message[] = "Optional. Number of infer requests. If this option is omitted, number of infer requests is determined automatically."; +static const char num_threads_message[] = "Optional. Number of threads."; +static const char num_streams_message[] = "Optional. Number of streams to use for inference on the CPU or/and GPU in " +"throughput mode (for HETERO and MULTI device cases use format " +":,: or just )"; +static const char no_show_processed_video[] = "Optional. Do not show processed video."; +static const char utilization_monitors_message[] = "Optional. List of monitors to show initially."; + +DEFINE_bool(h, false, help_message); +DEFINE_string(at, "", at_message); +DEFINE_string(i, "", video_message); +DEFINE_string(m, "", model_message); +DEFINE_uint32(tsize, 0, target_size_message); +DEFINE_string(d, "CPU", target_device_message); +DEFINE_bool(pc, false, performance_counter_message); +DEFINE_string(c, "", custom_cldnn_message); +DEFINE_string(l, "", custom_cpu_library_message); +DEFINE_double(t, 0.1, thresh_output_message); +DEFINE_uint32(nireq, 0, nireq_message); +DEFINE_uint32(nthreads, 0, num_threads_message); +DEFINE_string(nstreams, "", num_streams_message); +DEFINE_bool(loop, false, loop_message); +DEFINE_bool(no_show, false, no_show_processed_video); +DEFINE_string(u, "", utilization_monitors_message); + +/** +* \brief This function shows a help message +*/ +static void showUsage() { + std::cout << std::endl; + std::cout << "human_pose_estimation [OPTION]" << std::endl; + std::cout << "Options:" << std::endl; + std::cout << std::endl; + std::cout << " -h " << help_message << std::endl; + std::cout << " -at \"\" " << at_message << std::endl; + std::cout << " -i \"\" " << video_message << std::endl; + std::cout << " -m \"\" " << model_message << std::endl; + std::cout << " -tsize " << target_size_message << std::endl; + std::cout << " -l \"\" " << custom_cpu_library_message << std::endl; + std::cout << " Or" << std::endl; + std::cout << " -c \"\" " << custom_cldnn_message << std::endl; + std::cout << " -d \"\" " << target_device_message << std::endl; + std::cout << " -pc " << performance_counter_message << std::endl; + std::cout << " -t " << thresh_output_message << std::endl; + std::cout << " -nireq \"\" " << nireq_message << std::endl; + std::cout << " -nthreads \"\" " << num_threads_message << std::endl; + std::cout << " -nstreams " << num_streams_message << std::endl; + std::cout << " -loop " << loop_message << std::endl; + std::cout << " -no_show " << no_show_processed_video << std::endl; + std::cout << " -u " << utilization_monitors_message << std::endl; +} + + +bool ParseAndCheckCommandLine(int argc, char *argv[]) { + // ---------------------------Parsing and validation of input args-------------------------------------- + gflags::ParseCommandLineNonHelpFlags(&argc, &argv, true); + if (FLAGS_h) { + showUsage(); + showAvailableDevices(); + return false; + } + slog::info << "Parsing input parameters" << slog::endl; + + if (FLAGS_i.empty()) { + throw std::logic_error("Parameter -i is not set"); + } + + if (FLAGS_m.empty()) { + throw std::logic_error("Parameter -m is not set"); + } + + if (FLAGS_at.empty()) { + throw std::logic_error("Parameter -at is not set"); + } + + return true; +} + + +cv::Mat renderHumanPose(const HumanPoseResult& result) { + if (!result.metaData) { + throw std::invalid_argument("Renderer: metadata is null"); + } + + auto outputImg = result.metaData->asRef().img; + + if (outputImg.empty()) { + throw std::invalid_argument("Renderer: image provided in metadata is empty"); + } + static const cv::Scalar colors[HPEOpenPose::keypointsNumber] = { + cv::Scalar(255, 0, 0), cv::Scalar(255, 85, 0), cv::Scalar(255, 170, 0), + cv::Scalar(255, 255, 0), cv::Scalar(170, 255, 0), cv::Scalar(85, 255, 0), + cv::Scalar(0, 255, 0), cv::Scalar(0, 255, 85), cv::Scalar(0, 255, 170), + cv::Scalar(0, 255, 255), cv::Scalar(0, 170, 255), cv::Scalar(0, 85, 255), + cv::Scalar(0, 0, 255), cv::Scalar(85, 0, 255), cv::Scalar(170, 0, 255), + cv::Scalar(255, 0, 255), cv::Scalar(255, 0, 170), cv::Scalar(255, 0, 85) + }; + static const std::pair limbKeypointsIds[] = { + {1, 2}, {1, 5}, {2, 3}, + {3, 4}, {5, 6}, {6, 7}, + {1, 8}, {8, 9}, {9, 10}, + {1, 11}, {11, 12}, {12, 13}, + {1, 0}, {0, 14}, {14, 16}, + {0, 15}, {15, 17} + }; + + const int stickWidth = 4; + const cv::Point2f absentKeypoint(-1.0f, -1.0f); + for (auto pose : result.poses) { + CV_Assert(pose.keypoints.size() == HPEOpenPose::keypointsNumber); + for (size_t keypointIdx = 0; keypointIdx < pose.keypoints.size(); keypointIdx++) { + if (pose.keypoints[keypointIdx] != absentKeypoint) { + cv::circle(outputImg, pose.keypoints[keypointIdx], 4, colors[keypointIdx], -1); + } + } + } + cv::Mat pane = outputImg.clone(); + for (auto pose : result.poses) { + for (const auto& limbKeypointsId : limbKeypointsIds) { + std::pair limbKeypoints(pose.keypoints[limbKeypointsId.first], + pose.keypoints[limbKeypointsId.second]); + if (limbKeypoints.first == absentKeypoint + || limbKeypoints.second == absentKeypoint) { + continue; + } + + float meanX = (limbKeypoints.first.x + limbKeypoints.second.x) / 2; + float meanY = (limbKeypoints.first.y + limbKeypoints.second.y) / 2; + cv::Point difference = limbKeypoints.first - limbKeypoints.second; + double length = std::sqrt(difference.x * difference.x + difference.y * difference.y); + int angle = static_cast(std::atan2(difference.y, difference.x) * 180 / CV_PI); + std::vector polygon; + cv::ellipse2Poly(cv::Point2d(meanX, meanY), cv::Size2d(length / 2, stickWidth), + angle, 0, 360, 1, polygon); + cv::fillConvexPoly(pane, polygon, colors[limbKeypointsId.second]); + } + } + cv::addWeighted(outputImg, 0.4, pane, 0.6, 0, outputImg); + return outputImg; +} + +int main(int argc, char *argv[]) { + try { + PerformanceMetrics metrics; + + slog::info << "InferenceEngine: " << printable(*InferenceEngine::GetInferenceEngineVersion()) << slog::endl; + + // ------------------------------ Parsing and validation of input args --------------------------------- + if (!ParseAndCheckCommandLine(argc, argv)) { + return 0; + } + + //------------------------------- Preparing Input ------------------------------------------------------ + slog::info << "Reading input" << slog::endl; + auto cap = openImagesCapture(FLAGS_i, FLAGS_loop); + auto startTime = std::chrono::steady_clock::now(); + cv::Mat curr_frame = cap->read(); + if (curr_frame.empty()) { + throw std::logic_error("Can't read an image from the input"); + } + + //------------------------------ Running Human Pose Estimation routines ---------------------------------------------- + + double aspectRatio = curr_frame.cols / static_cast(curr_frame.rows); + std::unique_ptr model; + if (FLAGS_at == "openpose") { + model.reset(new HPEOpenPose(FLAGS_m, aspectRatio, FLAGS_tsize, (float)FLAGS_t)); + } + else { + slog::err << "No model type or invalid model type (-at) provided: " + FLAGS_at << slog::endl; + return -1; + } + + InferenceEngine::Core core; + AsyncPipeline pipeline(std::move(model), + ConfigFactory::getUserConfig(FLAGS_d, FLAGS_l, FLAGS_c, FLAGS_pc, FLAGS_nireq, FLAGS_nstreams, FLAGS_nthreads), + core); + Presenter presenter(FLAGS_u); + + int64_t frameNum = 0; + frameNum = pipeline.submitData(ImageInputData(curr_frame), + std::make_shared(curr_frame, startTime)); + + bool keepRunning = true; + std::unique_ptr result; + + while (keepRunning) { + if (pipeline.isReadyToProcess()) { + //--- Capturing frame + startTime = std::chrono::steady_clock::now(); + curr_frame = cap->read(); + if (curr_frame.empty()) { + // Input stream is over + break; + } + frameNum = pipeline.submitData(ImageInputData(curr_frame), + std::make_shared(curr_frame, startTime)); + } + + //--- Waiting for free input slot or output data available. Function will return immediately if any of them are available. + pipeline.waitForData(); + + //--- Checking for results and rendering data if it's ready + //--- If you need just plain data without rendering - cast result's underlying pointer to HumanPoseResult* + // and use your own processing instead of calling renderDetectionData(). + while ((result = pipeline.getResult()) && keepRunning) { + cv::Mat outFrame = renderHumanPose(result->asRef()); + //--- Showing results and device information + presenter.drawGraphs(outFrame); + metrics.update(result->metaData->asRef().timeStamp, + outFrame, { 10, 22 }, cv::FONT_HERSHEY_COMPLEX, 0.65); + if (!FLAGS_no_show) { + cv::imshow("Human Pose Estimation Results", outFrame); + //--- Processing keyboard events + int key = cv::waitKey(1); + if (27 == key || 'q' == key || 'Q' == key) { // Esc + keepRunning = false; + } + else { + presenter.handleKey(key); + } + } + } + } + + //// ------------ Waiting for completion of data processing and rendering the rest of results --------- + pipeline.waitForTotalCompletion(); + while (result = pipeline.getResult()) { + cv::Mat outFrame = renderHumanPose(result->asRef()); + //--- Showing results and device information + presenter.drawGraphs(outFrame); + metrics.update(result->metaData->asRef().timeStamp, + outFrame, { 10, 22 }, cv::FONT_HERSHEY_COMPLEX, 0.65); + if (!FLAGS_no_show) { + cv::imshow("Human Pose Estimation Results", outFrame); + //--- Updating output window + cv::waitKey(1); + } + } + + //// --------------------------- Report metrics ------------------------------------------------------- + slog::info << slog::endl << "Metric reports:" << slog::endl; + metrics.printTotal(); + + slog::info << presenter.reportMeans() << slog::endl; + } + catch (const std::exception& error) { + slog::err << error.what() << slog::endl; + return 1; + } + catch (...) { + slog::err << "Unknown/internal exception happened." << slog::endl; + return 1; + } + + slog::info << slog::endl << "The execution has completed successfully" << slog::endl; + return 0; +} diff --git a/demos/python_demos/object_detection_demo_faceboxes/models.lst b/demos/human_pose_estimation_demo/cpp/models.lst similarity index 72% rename from demos/python_demos/object_detection_demo_faceboxes/models.lst rename to demos/human_pose_estimation_demo/cpp/models.lst index 7fcb28edd19..817b4de705a 100644 --- a/demos/python_demos/object_detection_demo_faceboxes/models.lst +++ b/demos/human_pose_estimation_demo/cpp/models.lst @@ -1,2 +1,2 @@ # This file can be used with the --list option of the model downloader. -faceboxes-pytorch +human-pose-estimation-0001 diff --git a/demos/human_pose_estimation_demo/human_pose_estimation.gif b/demos/human_pose_estimation_demo/human_pose_estimation.gif new file mode 100644 index 00000000000..490588a6f91 Binary files /dev/null and b/demos/human_pose_estimation_demo/human_pose_estimation.gif differ diff --git a/demos/human_pose_estimation_demo/include/human_pose.hpp b/demos/human_pose_estimation_demo/include/human_pose.hpp deleted file mode 100644 index 31a20a0d071..00000000000 --- a/demos/human_pose_estimation_demo/include/human_pose.hpp +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (C) 2018-2019 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include - -#include - -namespace human_pose_estimation { -struct HumanPose { - HumanPose(const std::vector& keypoints = std::vector(), - const float& score = 0); - - std::vector keypoints; - float score; -}; -} // namespace human_pose_estimation diff --git a/demos/human_pose_estimation_demo/include/human_pose_estimation_demo.hpp b/demos/human_pose_estimation_demo/include/human_pose_estimation_demo.hpp deleted file mode 100644 index 9eeabc953d8..00000000000 --- a/demos/human_pose_estimation_demo/include/human_pose_estimation_demo.hpp +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (C) 2018-2019 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include -#include - -#include - -DEFINE_INPUT_FLAGS - -static const char help_message[] = "Print a usage message."; -static const char human_pose_estimation_model_message[] = "Required. Path to the Human Pose Estimation model (.xml) file."; -static const char target_device_message[] = "Optional. Specify the target device for Human Pose Estimation " - "(the list of available devices is shown below). Default value is CPU. " - "Use \"-d HETERO:\" format to specify HETERO plugin. " - "The application looks for a suitable plugin for the specified device."; -static const char performance_counter_message[] = "Optional. Enable per-layer performance report."; -static const char no_show_processed_video[] = "Optional. Do not show processed video."; -static const char black_background[] = "Optional. Show black background."; -static const char raw_output_message[] = "Optional. Output inference results as raw values."; -static const char utilization_monitors_message[] = "Optional. List of monitors to show initially."; - -DEFINE_bool(h, false, help_message); -DEFINE_string(m, "", human_pose_estimation_model_message); -DEFINE_string(d, "CPU", target_device_message); -DEFINE_bool(pc, false, performance_counter_message); -DEFINE_bool(no_show, false, no_show_processed_video); -DEFINE_bool(black, false, black_background); -DEFINE_bool(r, false, raw_output_message); -DEFINE_string(u, "", utilization_monitors_message); - -/** -* @brief This function shows a help message -*/ -static void showUsage() { - std::cout << std::endl; - std::cout << "human_pose_estimation_demo [OPTION]" << std::endl; - std::cout << "Options:" << std::endl; - std::cout << std::endl; - std::cout << " -h " << help_message << std::endl; - std::cout << " -i " << input_message << std::endl; - std::cout << " -loop " << loop_message << std::endl; - std::cout << " -m \"\" " << human_pose_estimation_model_message << std::endl; - std::cout << " -d \"\" " << target_device_message << std::endl; - std::cout << " -pc " << performance_counter_message << std::endl; - std::cout << " -no_show " << no_show_processed_video << std::endl; - std::cout << " -black " << black_background << std::endl; - std::cout << " -r " << raw_output_message << std::endl; - std::cout << " -u " << utilization_monitors_message << std::endl; -} diff --git a/demos/human_pose_estimation_demo/include/human_pose_estimator.hpp b/demos/human_pose_estimation_demo/include/human_pose_estimator.hpp deleted file mode 100644 index 7f945466bbd..00000000000 --- a/demos/human_pose_estimation_demo/include/human_pose_estimator.hpp +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (C) 2018-2019 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include -#include - -#include -#include - -#include "human_pose.hpp" - -namespace human_pose_estimation { -class HumanPoseEstimator { -public: - static const size_t keypointsNumber = 18; - - HumanPoseEstimator(const std::string& modelPath, - const std::string& targetDeviceName, - bool enablePerformanceReport = false); - std::vector postprocessCurr(); - void reshape(const cv::Mat& image); - void frameToBlobCurr(const cv::Mat& image); - void frameToBlobNext(const cv::Mat& image); - void startCurr(); - void startNext(); - void waitCurr(); - void swapRequest(); - ~HumanPoseEstimator(); - -private: - void preprocess(const cv::Mat& image, uint8_t* buffer) const; - std::vector postprocess( - const float* heatMapsData, const int heatMapOffset, const int nHeatMaps, - const float* pafsData, const int pafOffset, const int nPafs, - const int featureMapWidth, const int featureMapHeight, - const cv::Size& imageSize) const; - std::vector extractPoses(const std::vector& heatMaps, - const std::vector& pafs) const; - void resizeFeatureMaps(std::vector& featureMaps) const; - void correctCoordinates(std::vector& poses, - const cv::Size& featureMapsSize, - const cv::Size& imageSize) const; - bool inputWidthIsChanged(const cv::Size& imageSize); - - int minJointsNumber; - int stride; - cv::Vec4i pad; - cv::Vec3f meanPixel; - float minPeaksDistance; - float midPointsScoreThreshold; - float foundMidPointsRatioThreshold; - float minSubsetScore; - cv::Size inputLayerSize; - cv::Size imageSize; - int upsampleRatio; - InferenceEngine::Core ie; - std::string targetDeviceName; - InferenceEngine::CNNNetwork network; - InferenceEngine::ExecutableNetwork executableNetwork; - InferenceEngine::InferRequest::Ptr requestNext; - InferenceEngine::InferRequest::Ptr requestCurr; - std::string pafsBlobName; - std::string heatmapsBlobName; - bool enablePerformanceReport; - std::string modelPath; -}; -} // namespace human_pose_estimation diff --git a/demos/human_pose_estimation_demo/include/render_human_pose.hpp b/demos/human_pose_estimation_demo/include/render_human_pose.hpp deleted file mode 100644 index 7993e2a3989..00000000000 --- a/demos/human_pose_estimation_demo/include/render_human_pose.hpp +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (C) 2018-2019 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include - -#include - -#include "human_pose.hpp" - -namespace human_pose_estimation { - void renderHumanPose(const std::vector& poses, cv::Mat& image); -} // namespace human_pose_estimation diff --git a/demos/human_pose_estimation_demo/main.cpp b/demos/human_pose_estimation_demo/main.cpp deleted file mode 100644 index 33eb172fcaa..00000000000 --- a/demos/human_pose_estimation_demo/main.cpp +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright (C) 2018-2019 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** -* \brief The entry point for the Inference Engine Human Pose Estimation demo application -* \file human_pose_estimation_demo/main.cpp -* \example human_pose_estimation_demo/main.cpp -*/ - -#include -#include - -#include - -#include -#include -#include - -#include "human_pose_estimation_demo.hpp" -#include "human_pose_estimator.hpp" -#include "render_human_pose.hpp" - -using namespace InferenceEngine; -using namespace human_pose_estimation; - -bool ParseAndCheckCommandLine(int argc, char* argv[]) { - // ---------------------------Parsing and validation of input args-------------------------------------- - - gflags::ParseCommandLineNonHelpFlags(&argc, &argv, true); - if (FLAGS_h) { - showUsage(); - showAvailableDevices(); - return false; - } - - std::cout << "Parsing input parameters" << std::endl; - - if (FLAGS_i.empty()) { - throw std::logic_error("Parameter -i is not set"); - } - - if (FLAGS_m.empty()) { - throw std::logic_error("Parameter -m is not set"); - } - - return true; -} - -int main(int argc, char* argv[]) { - try { - std::cout << "InferenceEngine: " << printable(*GetInferenceEngineVersion()) << std::endl; - - // ------------------------------ Parsing and validation of input args --------------------------------- - if (!ParseAndCheckCommandLine(argc, argv)) { - return EXIT_SUCCESS; - } - - HumanPoseEstimator estimator(FLAGS_m, FLAGS_d, FLAGS_pc); - - std::unique_ptr cap = openImagesCapture(FLAGS_i, FLAGS_loop); - cv::Mat curr_frame = cap->read(); - if (!curr_frame.data) { - throw std::runtime_error("Can't read an image from the input"); - } - - cv::Size graphSize{curr_frame.cols / 4, 60}; - Presenter presenter(FLAGS_u, curr_frame.rows - graphSize.height - 10, graphSize); - - estimator.reshape(curr_frame); // Do not measure network reshape, if it happened - - std::cout << "To close the application, press 'CTRL+C' here"; - if (!FLAGS_no_show) { - std::cout << " or switch to the output window and press ESC key" << std::endl; - std::cout << "To pause execution, switch to the output window and press 'p' key" << std::endl; - } - std::cout << std::endl; - - int delay = 1; - bool isAsyncMode = false; // execution is always started in SYNC mode - bool isModeChanged = false; // set to true when execution mode is changed (SYNC<->ASYNC) - bool blackBackground = FLAGS_black; - - typedef std::chrono::duration> ms; - auto total_t0 = std::chrono::high_resolution_clock::now(); - auto wallclock = std::chrono::high_resolution_clock::now(); - double render_time = 0; - do { - auto t0 = std::chrono::high_resolution_clock::now(); - //here is the first asynchronus point: - //in the async mode we capture frame to populate the NEXT infer request - //in the regular mode we capture frame to the current infer request - - cv::Mat next_frame = cap->read(); - if (isAsyncMode) { - if (isModeChanged) { - estimator.frameToBlobCurr(curr_frame); - } - if (next_frame.data) { - estimator.frameToBlobNext(next_frame); - } - } else if (!isModeChanged) { - estimator.frameToBlobCurr(curr_frame); - } - auto t1 = std::chrono::high_resolution_clock::now(); - double decode_time = std::chrono::duration_cast(t1 - t0).count(); - - t0 = std::chrono::high_resolution_clock::now(); - // Main sync point: - // in the truly Async mode we start the NEXT infer request, while waiting for the CURRENT to complete - // in the regular mode we start the CURRENT request and immediately wait for it's completion - if (isAsyncMode) { - if (isModeChanged) { - estimator.startCurr(); - } - if (next_frame.data) { - estimator.startNext(); - } - } else if (!isModeChanged) { - estimator.startCurr(); - } - - estimator.waitCurr(); - t1 = std::chrono::high_resolution_clock::now(); - ms detection = std::chrono::duration_cast(t1 - t0); - t0 = std::chrono::high_resolution_clock::now(); - ms wall = std::chrono::duration_cast(t0 - wallclock); - wallclock = t0; - - t0 = std::chrono::high_resolution_clock::now(); - - if (blackBackground) { - curr_frame = cv::Mat::zeros(curr_frame.size(), curr_frame.type()); - } - std::ostringstream out; - out << "OpenCV cap/render time: " << std::fixed << std::setprecision(1) - << (decode_time + render_time) << " ms"; - cv::putText(curr_frame, out.str(), cv::Point2f(0, 25), - cv::FONT_HERSHEY_TRIPLEX, 0.6, cv::Scalar(0, 255, 0)); - out.str(""); - out << "Wallclock time " << (isAsyncMode ? "(TRUE ASYNC): " : "(SYNC, press Tab): "); - out << std::fixed << std::setprecision(2) << wall.count() - << " ms (" << 1000.0 / wall.count() << " fps)"; - cv::putText(curr_frame, out.str(), cv::Point2f(0, 50), - cv::FONT_HERSHEY_TRIPLEX, 0.6, cv::Scalar(0, 0, 255)); - if (!isAsyncMode) { // In the true async mode, there is no way to measure detection time directly - out.str(""); - out << "Detection time : " << std::fixed << std::setprecision(1) << detection.count() - << " ms (" - << 1000.0 / detection.count() << " fps)"; - cv::putText(curr_frame, out.str(), cv::Point2f(0, 75), cv::FONT_HERSHEY_TRIPLEX, 0.6, - cv::Scalar(255, 0, 0)); - } - - std::vector poses = estimator.postprocessCurr(); - - if (FLAGS_r) { - if (!poses.empty()) { - std::time_t result = std::time(nullptr); - char timeString[sizeof("2020-01-01 00:00:00: ")]; - std::strftime(timeString, sizeof(timeString), "%Y-%m-%d %H:%M:%S: ", std::localtime(&result)); - std::cout << timeString; - } - - for (HumanPose const& pose : poses) { - std::stringstream rawPose; - rawPose << std::fixed << std::setprecision(0); - for (auto const& keypoint : pose.keypoints) { - rawPose << keypoint.x << "," << keypoint.y << " "; - } - rawPose << pose.score; - std::cout << rawPose.str() << std::endl; - } - } - - presenter.drawGraphs(curr_frame); - renderHumanPose(poses, curr_frame); - - if (!FLAGS_no_show) { - cv::imshow("Human Pose Estimation on " + FLAGS_d, curr_frame); - } - - t1 = std::chrono::high_resolution_clock::now(); - render_time = std::chrono::duration_cast(t1 - t0).count(); - - if (isModeChanged) { - isModeChanged = false; - } - - // Final point: - // in the truly Async mode we swap the NEXT and CURRENT requests for the next iteration - curr_frame = std::move(next_frame); - if (isAsyncMode) { - estimator.swapRequest(); - } - - if (!FLAGS_no_show) { - const int key = cv::waitKey(delay) & 255; - if (key == 'p') { - delay = (delay == 0) ? 1 : 0; - } else if (27 == key) { // Esc - break; - } else if (9 == key) { // Tab - isAsyncMode = !isAsyncMode; - isModeChanged = true; - } else if (32 == key) { // Space - blackBackground = !blackBackground; - } - presenter.handleKey(key); - } - } while (curr_frame.data); - - auto total_t1 = std::chrono::high_resolution_clock::now(); - ms total = std::chrono::duration_cast(total_t1 - total_t0); - std::cout << "Total Inference time: " << total.count() << std::endl; - std::cout << presenter.reportMeans() << '\n'; - } - catch (const std::exception& error) { - std::cerr << "[ ERROR ] " << error.what() << std::endl; - return EXIT_FAILURE; - } - catch (...) { - std::cerr << "[ ERROR ] Unknown/internal exception happened." << std::endl; - return EXIT_FAILURE; - } - - std::cout << "Execution successful" << std::endl; - return EXIT_SUCCESS; -} diff --git a/demos/human_pose_estimation_demo/python/README.md b/demos/human_pose_estimation_demo/python/README.md new file mode 100644 index 00000000000..550267765cf --- /dev/null +++ b/demos/human_pose_estimation_demo/python/README.md @@ -0,0 +1,122 @@ +# Human Pose Estimation Python\* Demo + +![](../human_pose_estimation.gif) + +This demo showcases the work of multi-person 2D pose estimation algorithms. The task is to predict a pose: body skeleton, which consists of a predefined set of keypoints and connections between them, for every person in an input image/video. + +Demo application supports inference in both sync and async modes. Please refer to [Optimization Guide](https://docs.openvinotoolkit.org/latest/_docs_optimization_guide_dldt_optimization_guide.html) for more information about Async API and its use. + +Other demo objectives are: +* Video as input support via OpenCV\* +* Visualization of the resulting poses +* Demonstration of the Async API in action. For this, the demo features two modes toggled by the **Tab** key: + - "User specified" mode, where you can set the number of Infer Requests, throughput streams and threads. + Inference, starting new requests and displaying the results of completed requests are all performed asynchronously. + The purpose of this mode is to get the higher FPS by fully utilizing all available devices. + - "Min latency" mode, which uses only one Infer Request. The purpose of this mode is to get the lowest latency. + +## How It Works + +On the start-up, the application reads command-line parameters and loads a network to the Inference +Engine. Upon getting a frame from the OpenCV VideoCapture, it performs inference and displays the results. + +> **NOTE**: By default, Open Model Zoo demos expect input with BGR channels order. If you trained your model to work +with RGB order, you need to manually rearrange the default channels order in the demo application or reconvert your +model using the Model Optimizer tool with `--reverse_input_channels` argument specified. For more information about +the argument, refer to **When to Reverse Input Channels** section of +[Converting a Model Using General Conversion Parameters](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_convert_model_Converting_Model_General.html). + +## Running + +Running the application with the `-h` option yields the following usage message: +``` +python3 human_pose_estimation.py -h +``` +The command yields the following usage message: +``` +usage: human_pose_estimation.py [-h] -i INPUT [--loop] [-o OUTPUT] + -m MODEL -at {ae,openpose} + [--tsize TSIZE] [-t PROB_THRESHOLD] [-r] + [-d DEVICE] [-nireq NUM_INFER_REQUESTS] + [-nstreams NUM_STREAMS] + [-nthreads NUM_THREADS] [-loop LOOP] + [-no_show] [-u UTILIZATION_MONITORS] + +Options: + -h, --help Show this help message and exit. + -i INPUT, --input INPUT + Required. An input to process. The input must be a + single image, a folder of images, video file or camera id. + --loop Optional. Enable reading the input in a loop. + -o OUTPUT, --output OUTPUT + Optional. Name of output to save. + -m MODEL, --model MODEL + Required. Path to an .xml file with a trained model. + -at {ae,openpose}, --architecture_type {ae,openpose} + Required. Type of the network, either "ae" for + Associative Embedding or "openpose" for OpenPose. + --tsize TSIZE Optional. Target input size. This demo implements + image pre-processing pipeline that is common to human + pose estimation approaches. Image is resize first to + some target size and then the network is reshaped to + fit the input image shape. By default target image + size is determined based on the input shape from IR. + Alternatively it can be manually set via this + parameter. Note that for OpenPose-like nets image is + resized to a predefined height, which is the target + size in this case. For Associative Embedding-like nets + target size is the length of a short image side. + -t PROB_THRESHOLD, --prob_threshold PROB_THRESHOLD + Optional. Probability threshold for poses filtering. + -r, --raw_output_message + Optional. Output inference results raw values showing. + -d DEVICE, --device DEVICE + Optional. Specify the target device to infer on; CPU, + GPU, FPGA, HDDL or MYRIAD is acceptable. The sample + will look for a suitable plugin for device specified. + Default value is CPU. + -nireq NUM_INFER_REQUESTS, --num_infer_requests NUM_INFER_REQUESTS + Optional. Number of infer requests. + -nstreams NUM_STREAMS, --num_streams NUM_STREAMS + Optional. Number of streams to use for inference on + the CPU or/and GPU in throughput mode (for HETERO and + MULTI device cases use format + :,: or just + ). + -nthreads NUM_THREADS, --num_threads NUM_THREADS + Optional. Number of threads to use for inference on + CPU (including HETERO cases). + -no_show, --no_show Optional. Don't show output. + -u UTILIZATION_MONITORS, --utilization_monitors UTILIZATION_MONITORS + Optional. List of monitors to show initially. +``` + +Running the application with the empty list of options yields the short usage message and an error message. +You can use the following command to do inference on CPU with a pre-trained human pose estimation model: +``` +python3 human_pose_estimation.py -i /inputVideo.mp4 -m /hpe.xml -d CPU +``` + +To run the demo, you can use public or pre-trained models. You can download the pre-trained models with the OpenVINO +[Model Downloader](../../../tools/downloader/README.md) or from +[https://download.01.org/opencv/](https://download.01.org/opencv/). + +> **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine +format (\*.xml + \*.bin) using the +[Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). + +The only GUI knob is to use **Tab** to switch between the synchronized execution ("Min latency" mode) +and the asynchronous mode configured with provided command-line parameters ("User specified" mode). + +## Demo Output + +The demo uses OpenCV to display the resulting frame with estimated poses. +The demo reports +* **FPS**: average rate of video frame processing (frames per second) +* **Latency**: average time required to process one frame (from reading the frame to displaying the results) +You can use both of these metrics to measure application-level performance. + +## See Also +* [Using Open Model Zoo demos](../../README.md) +* [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) +* [Model Downloader](../../../tools/downloader/README.md) diff --git a/demos/human_pose_estimation_demo/python/human_pose_estimation.py b/demos/human_pose_estimation_demo/python/human_pose_estimation.py new file mode 100755 index 00000000000..582fca68457 --- /dev/null +++ b/demos/human_pose_estimation_demo/python/human_pose_estimation.py @@ -0,0 +1,288 @@ +#!/usr/bin/env python3 +""" + Copyright (C) 2020 Intel Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + +import logging +import sys +from argparse import ArgumentParser, SUPPRESS +from pathlib import Path +from itertools import cycle +from enum import Enum +from time import perf_counter + +import cv2 +from openvino.inference_engine import IECore + +from human_pose_estimation_demo.model import HPEAssociativeEmbedding, HPEOpenPose +from human_pose_estimation_demo.visualization import show_poses + +sys.path.append(str(Path(__file__).resolve().parents[2] / 'common/python')) +import monitors +from images_capture import open_images_capture +from helpers import put_highlighted_text + + +logging.basicConfig(format='[ %(levelname)s ] %(message)s', level=logging.INFO, stream=sys.stdout) +log = logging.getLogger() + +def build_argparser(): + parser = ArgumentParser(add_help=False) + args = parser.add_argument_group('Options') + args.add_argument('-h', '--help', action='help', default=SUPPRESS, help='Show this help message and exit.') + args.add_argument('-i', '--input', required=True, + help='Required. An input to process. The input must be a ' + 'single image, a folder of images, video file or camera id.') + args.add_argument('--loop', default=False, action='store_true', + help='Optional. Enable reading the input in a loop.') + args.add_argument('-o', '--output', required=False, + help='Optional. Name of output to save.') + args.add_argument('-m', '--model', help='Required. Path to an .xml file with a trained model.', + required=True, type=str) + args.add_argument('-at', '--architecture_type', choices=('ae', 'openpose'), required=True, type=str, + help='Required. Type of the network, either "ae" for Associative Embedding ' + 'or "openpose" for OpenPose.') + args.add_argument('--tsize', default=None, type=int, + help='Optional. Target input size. This demo implements image pre-processing pipeline ' + 'that is common to human pose estimation approaches. Image is resize first to some ' + 'target size and then the network is reshaped to fit the input image shape. ' + 'By default target image size is determined based on the input shape from IR. ' + 'Alternatively it can be manually set via this parameter. Note that for OpenPose-like ' + 'nets image is resized to a predefined height, which is the target size in this case. ' + 'For Associative Embedding-like nets target size is the length of a short image side.') + args.add_argument('-t', '--prob_threshold', help='Optional. Probability threshold for poses filtering.', + default=0.1, type=float) + args.add_argument('-r', '--raw_output_message', help='Optional. Output inference results raw values showing.', + default=False, action='store_true') + args.add_argument('-d', '--device', + help='Optional. Specify the target device to infer on; CPU, GPU, FPGA, HDDL or MYRIAD is ' + 'acceptable. The sample will look for a suitable plugin for device specified. ' + 'Default value is CPU.', default='CPU', type=str) + args.add_argument('-nireq', '--num_infer_requests', help='Optional. Number of infer requests', + default=1, type=int) + args.add_argument('-nstreams', '--num_streams', + help='Optional. Number of streams to use for inference on the CPU or/and GPU in throughput mode ' + '(for HETERO and MULTI device cases use format :,: ' + 'or just )', + default='', type=str) + args.add_argument('-nthreads', '--num_threads', + help='Optional. Number of threads to use for inference on CPU (including HETERO cases)', + default=None, type=int) + args.add_argument('-no_show', '--no_show', help="Optional. Don't show output", action='store_true') + args.add_argument('-u', '--utilization_monitors', default='', type=str, + help='Optional. List of monitors to show initially.') + return parser + + +class Modes(Enum): + USER_SPECIFIED = 0 + MIN_LATENCY = 1 + + +class ModeInfo: + def __init__(self): + self.last_start_time = perf_counter() + self.last_end_time = None + self.frames_count = 0 + self.latency_sum = 0 + + +def get_plugin_configs(device, num_streams, num_threads): + config_user_specified = {} + config_min_latency = {} + + devices_nstreams = {} + if num_streams: + devices_nstreams = {device: num_streams for device in ['CPU', 'GPU'] if device in device} \ + if num_streams.isdigit() \ + else dict(device.split(':', 1) for device in num_streams.split(',')) + + if 'CPU' in device: + if num_threads is not None: + config_user_specified['CPU_THREADS_NUM'] = str(num_threads) + if 'CPU' in devices_nstreams: + config_user_specified['CPU_THROUGHPUT_STREAMS'] = devices_nstreams['CPU'] \ + if int(devices_nstreams['CPU']) > 0 \ + else 'CPU_THROUGHPUT_AUTO' + + config_min_latency['CPU_THROUGHPUT_STREAMS'] = '1' + + if 'GPU' in device: + if 'GPU' in devices_nstreams: + config_user_specified['GPU_THROUGHPUT_STREAMS'] = devices_nstreams['GPU'] \ + if int(devices_nstreams['GPU']) > 0 \ + else 'GPU_THROUGHPUT_AUTO' + + config_min_latency['GPU_THROUGHPUT_STREAMS'] = '1' + + return config_user_specified, config_min_latency + + +def main(): + args = build_argparser().parse_args() + + log.info('Initializing Inference Engine...') + ie = IECore() + + config_user_specified, config_min_latency = get_plugin_configs(args.device, args.num_streams, args.num_threads) + + log.info('Loading network...') + completed_request_results = {} + modes = cycle(Modes) + prev_mode = mode = next(modes) + log.info('Using {} mode'.format(mode.name)) + mode_info = {mode: ModeInfo()} + exceptions = [] + + if args.architecture_type == 'ae': + HPE = HPEAssociativeEmbedding + else: + HPE = HPEOpenPose + + hpes = { + Modes.USER_SPECIFIED: + HPE(ie, args.model, target_size=args.tsize, device=args.device, plugin_config=config_user_specified, + results=completed_request_results, max_num_requests=args.num_infer_requests, + caught_exceptions=exceptions), + Modes.MIN_LATENCY: + HPE(ie, args.model, target_size=args.tsize, device=args.device.split(':')[-1].split(',')[0], + plugin_config=config_min_latency, results=completed_request_results, max_num_requests=1, + caught_exceptions=exceptions) + } + + cap = open_images_capture(args.input, args.loop) + wait_key_time = 1 + + next_frame_id = 0 + next_frame_id_to_show = 0 + + log.info('Starting inference...') + print("To close the application, press 'CTRL+C' here or switch to the output window and press ESC key") + print("To switch between min_latency/user_specified modes, press TAB key in the output window") + + presenter = None + video_writer = cv2.VideoWriter() + + while True: + if next_frame_id_to_show in completed_request_results: + frame_meta, raw_outputs = completed_request_results.pop(next_frame_id_to_show) + poses, scores = hpes[mode].postprocess(raw_outputs, frame_meta) + valid_poses = scores > args.prob_threshold + poses = poses[valid_poses] + scores = scores[valid_poses] + + frame = frame_meta['frame'] + start_time = frame_meta['start_time'] + + if len(poses) and args.raw_output_message: + log.info('Poses:') + + origin_im_size = frame.shape[:-1] + presenter.drawGraphs(frame) + show_poses(frame, poses, scores, pose_score_threshold=args.prob_threshold, + point_score_threshold=args.prob_threshold) + + if args.raw_output_message: + for pose, pose_score in zip(poses, scores): + pose_str = ' '.join('({:.2f}, {:.2f}, {:.2f})'.format(p[0], p[1], p[2]) for p in pose) + log.info('{} | {:.2f}'.format(pose_str, pose_score)) + + mode_message = '{} mode'.format(mode.name) + put_highlighted_text(frame, mode_message, (10, int(origin_im_size[0] - 20)), + cv2.FONT_HERSHEY_COMPLEX, 0.75, (10, 10, 200), 2) + + next_frame_id_to_show += 1 + if prev_mode == mode: + mode_info[mode].frames_count += 1 + elif len(completed_request_results) == 0: + mode_info[prev_mode].last_end_time = perf_counter() + prev_mode = mode + + # Frames count is always zero if mode has just been switched (i.e. prev_mode != mode). + if mode_info[mode].frames_count != 0: + fps_message = 'FPS: {:.1f}'.format(mode_info[mode].frames_count / + (perf_counter() - mode_info[mode].last_start_time)) + mode_info[mode].latency_sum += perf_counter() - start_time + latency_message = 'Latency: {:.1f} ms'.format((mode_info[mode].latency_sum / + mode_info[mode].frames_count) * 1e3) + # Draw performance stats over frame. + put_highlighted_text(frame, fps_message, (15, 20), cv2.FONT_HERSHEY_COMPLEX, 0.75, (200, 10, 10), 2) + put_highlighted_text(frame, latency_message, (15, 50), cv2.FONT_HERSHEY_COMPLEX, 0.75, (200, 10, 10), 2) + + if video_writer.isOpened(): + video_writer.write(frame) + + if not args.no_show: + cv2.imshow('Pose estimation results', frame) + key = cv2.waitKey(wait_key_time) + + ESC_KEY = 27 + TAB_KEY = 9 + # Quit. + if key in {ord('q'), ord('Q'), ESC_KEY}: + break + # Switch mode. + # Disable mode switch if the previous switch has not been finished yet. + if key == TAB_KEY and mode_info[mode].frames_count > 0: + mode = next(modes) + hpes[prev_mode].await_all() + mode_info[prev_mode].last_end_time = perf_counter() + mode_info[mode] = ModeInfo() + log.info('Using {} mode'.format(mode.name)) + else: + presenter.handleKey(key) + + elif hpes[mode].empty_requests: + start_time = perf_counter() + frame = cap.read() + if frame is None: + if next_frame_id == 0: + raise ValueError("Can't read an image from the input") + break + if next_frame_id == 0: + presenter = monitors.Presenter(args.utilization_monitors, 55, + (round(frame.shape[1] / 4), round(frame.shape[0] / 8))) + if args.output: + video_writer = cv2.VideoWriter(args.output, cv2.VideoWriter_fourcc(*'MJPG'), cap.fps(), + (frame.shape[1], frame.shape[0])) + if not video_writer.isOpened(): + raise RuntimeError("Can't open video writer") + hpes[mode](frame, next_frame_id, {'frame': frame, 'start_time': start_time}) + next_frame_id += 1 + + else: + hpes[mode].await_any() + + if exceptions: + raise exceptions[0] + + for exec_net in hpes.values(): + exec_net.await_all() + + for mode_value, mode_stats in mode_info.items(): + log.info('') + log.info('Mode: {}'.format(mode_value.name)) + + end_time = mode_stats.last_end_time if mode_stats.last_end_time is not None \ + else perf_counter() + log.info('FPS: {:.1f}'.format(mode_stats.frames_count / + (end_time - mode_stats.last_start_time))) + log.info('Latency: {:.1f} ms'.format((mode_stats.latency_sum / + mode_stats.frames_count) * 1e3)) + print(presenter.reportMeans()) + + +if __name__ == '__main__': + sys.exit(main() or 0) diff --git a/demos/python_demos/image_retrieval_demo/image_retrieval_demo/__init__.py b/demos/human_pose_estimation_demo/python/human_pose_estimation_demo/__init__.py similarity index 100% rename from demos/python_demos/image_retrieval_demo/image_retrieval_demo/__init__.py rename to demos/human_pose_estimation_demo/python/human_pose_estimation_demo/__init__.py diff --git a/demos/human_pose_estimation_demo/python/human_pose_estimation_demo/decoder_ae.py b/demos/human_pose_estimation_demo/python/human_pose_estimation_demo/decoder_ae.py new file mode 100644 index 00000000000..9a3737f4601 --- /dev/null +++ b/demos/human_pose_estimation_demo/python/human_pose_estimation_demo/decoder_ae.py @@ -0,0 +1,216 @@ +""" + Copyright (C) 2020 Intel Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + +import numpy as np +from scipy.optimize import linear_sum_assignment + + +class Pose: + def __init__(self, num_joints, tag_size=1): + self.num_joints = num_joints + self.tag_size = tag_size + self.pose = np.zeros((num_joints, 2 + 1 + tag_size), dtype=np.float32) + self.pose_tag = np.zeros(tag_size, dtype=np.float32) + self.valid_points_num = 0 + + def add(self, idx, joint, tag): + self.pose[idx] = joint + self.pose_tag = (self.pose_tag * self.valid_points_num) + tag + self.valid_points_num += 1 + self.pose_tag /= self.valid_points_num + + @property + def tag(self): + if self.valid_points_num > 0: + return self.pose_tag + return None + + +class AssociativeEmbeddingDecoder: + def __init__(self, num_joints, max_num_people, detection_threshold, use_detection_val, + ignore_too_much, tag_threshold, + adjust=True, refine=True, delta=0.0, joints_order=None): + self.num_joints = num_joints + self.max_num_people = max_num_people + self.detection_threshold = detection_threshold + self.tag_threshold = tag_threshold + self.use_detection_val = use_detection_val + self.ignore_too_much = ignore_too_much + + if self.num_joints == 17 and joints_order is None: + self.joint_order = (0, 1, 2, 3, 4, 5, 6, 11, 12, 7, 8, 9, 10, 13, 14, 15, 16) + else: + self.joint_order = list(np.arange(self.num_joints)) + + self.do_adjust = adjust + self.do_refine = refine + self.delta = delta + + def match(self, tag_k, loc_k, val_k): + return list(map(self._match_by_tag, zip(tag_k, loc_k, val_k))) + + @staticmethod + def _max_match(scores): + r, c = linear_sum_assignment(scores) + tmp = np.stack((r, c), axis=1) + return tmp + + def _match_by_tag(self, inp): + tag_k, loc_k, val_k = inp + embd_size = tag_k.shape[2] + all_joints = np.concatenate((loc_k, val_k[..., None], tag_k), -1) + + poses = [] + for idx in self.joint_order: + tags = tag_k[idx] + joints = all_joints[idx] + mask = joints[:, 2] > self.detection_threshold + tags = tags[mask] + joints = joints[mask] + + if len(poses) == 0: + for tag, joint in zip(tags, joints): + pose = Pose(self.num_joints, embd_size) + pose.add(idx, joint, tag) + poses.append(pose) + continue + + if joints.shape[0] == 0 or (self.ignore_too_much and len(poses) == self.max_num_people): + continue + + poses_tags = np.stack([p.tag for p in poses], axis=0) + diff = tags[:, None] - poses_tags[None, :] + diff_normed = np.linalg.norm(diff, ord=2, axis=2) + diff_saved = np.copy(diff_normed) + if self.use_detection_val: + diff_normed = np.round(diff_normed) * 100 - joints[:, 2:3] + num_added = diff.shape[0] + num_grouped = diff.shape[1] + if num_added > num_grouped: + diff_normed = np.pad(diff_normed, ((0, 0), (0, num_added - num_grouped)), + mode='constant', constant_values=1e10) + + pairs = self._max_match(diff_normed) + for row, col in pairs: + if row < num_added and col < num_grouped and diff_saved[row][col] < self.tag_threshold: + poses[col].add(idx, joints[row], tags[row]) + else: + pose = Pose(self.num_joints, embd_size) + pose.add(idx, joints[row], tags[row]) + poses.append(pose) + + ans = np.asarray([p.pose for p in poses], dtype=np.float32).reshape(-1, self.num_joints, 2 + 1 + embd_size) + tags = np.asarray([p.tag for p in poses], dtype=np.float32).reshape(-1, embd_size) + return ans, tags + + def top_k(self, heatmaps, tags): + N, K, H, W = heatmaps.shape + heatmaps = heatmaps.reshape(N, K, -1) + ind = heatmaps.argpartition(-self.max_num_people, axis=2)[:, :, -self.max_num_people:] + val_k = np.take_along_axis(heatmaps, ind, axis=2) + subind = np.argsort(-val_k, axis=2) + ind = np.take_along_axis(ind, subind, axis=2) + val_k = np.take_along_axis(val_k, subind, axis=2) + + tags = tags.reshape(N, K, W * H, -1) + tag_k = [np.take_along_axis(tags[..., i], ind, axis=2) for i in range(tags.shape[3])] + tag_k = np.stack(tag_k, axis=3) + + x = ind % W + y = ind // W + ind_k = np.stack((x, y), axis=3) + + ans = {'tag_k': tag_k, 'loc_k': ind_k, 'val_k': val_k} + return ans + + @staticmethod + def adjust(ans, heatmaps): + H, W = heatmaps.shape[-2:] + for n, people in enumerate(ans): + for person in people: + for k, joint in enumerate(person): + heatmap = heatmaps[n, k] + px = int(joint[0]) + py = int(joint[1]) + if 1 < px < W - 1 and 1 < py < H - 1: + diff = np.array([ + heatmap[py, px + 1] - heatmap[py, px - 1], + heatmap[py + 1, px] - heatmap[py - 1, px] + ]) + joint[:2] += np.sign(diff) * .25 + return ans + + @staticmethod + def refine(heatmap, tag, keypoints, pose_tag=None): + K, H, W = heatmap.shape + if len(tag.shape) == 3: + tag = tag[..., None] + + if pose_tag is not None: + prev_tag = pose_tag + else: + tags = [] + for i in range(K): + if keypoints[i, 2] > 0: + x, y = keypoints[i][:2].astype(int) + tags.append(tag[i, y, x]) + prev_tag = np.mean(tags, axis=0) + + for i, (_heatmap, _tag) in enumerate(zip(heatmap, tag)): + if keypoints[i, 2] > 0: + continue + # Get position with the closest tag value to the pose tag. + diff = np.abs(_tag[..., 0] - prev_tag) + 0.5 + diff = diff.astype(np.int32).astype(_heatmap.dtype) + diff -= _heatmap + idx = diff.argmin() + y, x = np.divmod(idx, _heatmap.shape[-1]) + # Corresponding keypoint detection score. + val = _heatmap[y, x] + if val > 0: + keypoints[i, :3] = x, y, val + if 1 < x < W - 1 and 1 < y < H - 1: + diff = np.array([ + _heatmap[y, x + 1] - _heatmap[y, x - 1], + _heatmap[y + 1, x] - _heatmap[y - 1, x] + ]) + keypoints[i, :2] += np.sign(diff) * .25 + + return keypoints + + def __call__(self, heatmaps, tags, nms_heatmaps=None): + ans = self.match(**self.top_k(nms_heatmaps, tags)) + ans, ans_tags = map(list, zip(*ans)) + + if self.do_adjust: + ans = self.adjust(ans, heatmaps) + + if self.delta != 0.0: + for people in ans: + for person in people: + for joint in person: + joint[:2] += self.delta + + ans = ans[0] + scores = np.asarray([i[:, 2].mean() for i in ans]) + + if self.do_refine: + heatmap_numpy = heatmaps[0] + tag_numpy = tags[0] + for i, pose in enumerate(ans): + ans[i] = self.refine(heatmap_numpy, tag_numpy, pose, ans_tags[0][i]) + + return ans, scores diff --git a/demos/human_pose_estimation_demo/python/human_pose_estimation_demo/decoder_openpose.py b/demos/human_pose_estimation_demo/python/human_pose_estimation_demo/decoder_openpose.py new file mode 100644 index 00000000000..66fd9ca6e67 --- /dev/null +++ b/demos/human_pose_estimation_demo/python/human_pose_estimation_demo/decoder_openpose.py @@ -0,0 +1,282 @@ +""" + Copyright (C) 2020 Intel Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + +import numpy as np + +try: + from numpy.core.umath import clip +except ImportError: + from numpy import clip + + +class OpenPoseDecoder: + + BODY_PARTS_KPT_IDS = ((1, 2), (1, 5), (2, 3), (3, 4), (5, 6), (6, 7), (1, 8), (8, 9), (9, 10), (1, 11), + (11, 12), (12, 13), (1, 0), (0, 14), (14, 16), (0, 15), (15, 17), (2, 16), (5, 17)) + BODY_PARTS_PAF_IDS = (12, 20, 14, 16, 22, 24, 0, 2, 4, 6, 8, 10, 28, 30, 34, 32, 36, 18, 26) + + def __init__(self, num_joints=18, skeleton=BODY_PARTS_KPT_IDS, paf_indices=BODY_PARTS_PAF_IDS, + max_points=100, score_threshold=0.1, min_paf_alignment_score=0.05, delta=0.5): + self.num_joints = num_joints + self.skeleton = skeleton + self.paf_indices = paf_indices + self.max_points = max_points + self.score_threshold = score_threshold + self.min_paf_alignment_score = min_paf_alignment_score + self.delta = delta + + self.points_per_limb = 10 + self.grid = np.arange(self.points_per_limb, dtype=np.float32).reshape(1, -1, 1) + + def __call__(self, heatmaps, nms_heatmaps, pafs): + batch_size, _, h, w = heatmaps.shape + assert batch_size == 1, 'Batch size of 1 only supported' + + keypoints = self.extract_points(heatmaps, nms_heatmaps) + pafs = np.transpose(pafs, (0, 2, 3, 1)) + + if self.delta > 0: + for kpts in keypoints: + kpts[:, :2] += self.delta + clip(kpts[:, 0], 0, w - 1, out=kpts[:, 0]) + clip(kpts[:, 1], 0, h - 1, out=kpts[:, 1]) + + pose_entries, keypoints = self.group_keypoints(keypoints, pafs, pose_entry_size=self.num_joints + 2) + poses, scores = self.convert_to_coco_format(pose_entries, keypoints) + if len(poses) > 0: + poses = np.asarray(poses, dtype=np.float32) + poses = poses.reshape((poses.shape[0], -1, 3)) + else: + poses = np.empty((0, 17, 3), dtype=np.float32) + scores = np.empty(0, dtype=np.float32) + + return poses, scores + + def extract_points(self, heatmaps, nms_heatmaps): + batch_size, channels_num, h, w = heatmaps.shape + assert batch_size == 1, 'Batch size of 1 only supported' + assert channels_num >= self.num_joints + + xs, ys, scores = self.top_k(nms_heatmaps) + masks = scores > self.score_threshold + all_keypoints = [] + keypoint_id = 0 + for k in range(self.num_joints): + # Filter low-score points. + mask = masks[0, k] + x = xs[0, k][mask].ravel() + y = ys[0, k][mask].ravel() + score = scores[0, k][mask].ravel() + n = len(x) + if n == 0: + all_keypoints.append(np.empty((0, 4), dtype=np.float32)) + continue + # Apply quarter offset to improve localization accuracy. + x, y = self.refine(heatmaps[0, k], x, y) + clip(x, 0, w - 1, out=x) + clip(y, 0, h - 1, out=y) + # Pack resulting points. + keypoints = np.empty((n, 4), dtype=np.float32) + keypoints[:, 0] = x + keypoints[:, 1] = y + keypoints[:, 2] = score + keypoints[:, 3] = np.arange(keypoint_id, keypoint_id + n) + keypoint_id += n + all_keypoints.append(keypoints) + return all_keypoints + + def top_k(self, heatmaps): + N, K, _, W = heatmaps.shape + heatmaps = heatmaps.reshape(N, K, -1) + # Get positions with top scores. + ind = heatmaps.argpartition(-self.max_points, axis=2)[:, :, -self.max_points:] + scores = np.take_along_axis(heatmaps, ind, axis=2) + # Keep top scores sorted. + subind = np.argsort(-scores, axis=2) + ind = np.take_along_axis(ind, subind, axis=2) + scores = np.take_along_axis(scores, subind, axis=2) + y, x = np.divmod(ind, W) + return x, y, scores + + @staticmethod + def refine(heatmap, x, y): + h, w = heatmap.shape[-2:] + valid = np.logical_and(np.logical_and(x > 0, x < w - 1), np.logical_and(y > 0, y < h - 1)) + xx = x[valid] + yy = y[valid] + dx = np.sign(heatmap[yy, xx + 1] - heatmap[yy, xx - 1], dtype=np.float32) * 0.25 + dy = np.sign(heatmap[yy + 1, xx] - heatmap[yy - 1, xx], dtype=np.float32) * 0.25 + x = x.astype(np.float32) + y = y.astype(np.float32) + x[valid] += dx + y[valid] += dy + return x, y + + @staticmethod + def is_disjoint(pose_a, pose_b): + pose_a = pose_a[:-2] + pose_b = pose_b[:-2] + return np.all(np.logical_or.reduce((pose_a == pose_b, pose_a < 0, pose_b < 0))) + + def update_poses(self, kpt_a_id, kpt_b_id, all_keypoints, connections, pose_entries, pose_entry_size): + for connection in connections: + pose_a_idx = -1 + pose_b_idx = -1 + for j, pose in enumerate(pose_entries): + if pose[kpt_a_id] == connection[0]: + pose_a_idx = j + if pose[kpt_b_id] == connection[1]: + pose_b_idx = j + if pose_a_idx < 0 and pose_b_idx < 0: + # Create new pose entry. + pose_entry = np.full(pose_entry_size, -1, dtype=np.float32) + pose_entry[kpt_a_id] = connection[0] + pose_entry[kpt_b_id] = connection[1] + pose_entry[-1] = 2 + pose_entry[-2] = np.sum(all_keypoints[connection[0:2], 2]) + connection[2] + pose_entries.append(pose_entry) + elif pose_a_idx >= 0 and pose_b_idx >= 0 and pose_a_idx != pose_b_idx: + # Merge two poses are disjoint merge them, otherwise ignore connection. + pose_a = pose_entries[pose_a_idx] + pose_b = pose_entries[pose_b_idx] + if self.is_disjoint(pose_a, pose_b): + pose_a += pose_b + pose_a[:-2] += 1 + pose_a[-2] += connection[2] + del pose_entries[pose_b_idx] + elif pose_a_idx >= 0 and pose_b_idx >= 0: + # Adjust score of a pose. + pose_entries[pose_a_idx][-2] += connection[2] + elif pose_a_idx >= 0: + # Add a new limb into pose. + pose = pose_entries[pose_a_idx] + if pose[kpt_b_id] < 0: + pose[-2] += all_keypoints[connection[1], 2] + pose[kpt_b_id] = connection[1] + pose[-2] += connection[2] + pose[-1] += 1 + elif pose_b_idx >= 0: + # Add a new limb into pose. + pose = pose_entries[pose_b_idx] + if pose[kpt_a_id] < 0: + pose[-2] += all_keypoints[connection[0], 2] + pose[kpt_a_id] = connection[0] + pose[-2] += connection[2] + pose[-1] += 1 + return pose_entries + + @staticmethod + def connections_nms(a_idx, b_idx, affinity_scores): + # From all retrieved connections that share starting/ending keypoints leave only the top-scoring ones. + order = affinity_scores.argsort()[::-1] + affinity_scores = affinity_scores[order] + a_idx = a_idx[order] + b_idx = b_idx[order] + idx = [] + has_kpt_a = set() + has_kpt_b = set() + for t, (i, j) in enumerate(zip(a_idx, b_idx)): + if i not in has_kpt_a and j not in has_kpt_b: + idx.append(t) + has_kpt_a.add(i) + has_kpt_b.add(j) + idx = np.asarray(idx, dtype=np.int32) + return a_idx[idx], b_idx[idx], affinity_scores[idx] + + def group_keypoints(self, all_keypoints_by_type, pafs, pose_entry_size=20): + all_keypoints = np.concatenate(all_keypoints_by_type, axis=0) + pose_entries = [] + # For every limb. + for part_id, paf_channel in enumerate(self.paf_indices): + kpt_a_id, kpt_b_id = self.skeleton[part_id] + kpts_a = all_keypoints_by_type[kpt_a_id] + kpts_b = all_keypoints_by_type[kpt_b_id] + n = len(kpts_a) + m = len(kpts_b) + if n == 0 or m == 0: + continue + + # Get vectors between all pairs of keypoints, i.e. candidate limb vectors. + a = kpts_a[:, :2] + a = np.broadcast_to(a[None], (m, n, 2)) + b = kpts_b[:, :2] + vec_raw = (b[:, None, :] - a).reshape(-1, 1, 2) + + # Sample points along every candidate limb vector. + steps = (1 / (self.points_per_limb - 1) * vec_raw) + points = steps * self.grid + a.reshape(-1, 1, 2) + points = points.round().astype(dtype=np.int32) + x = points[..., 0].ravel() + y = points[..., 1].ravel() + + # Compute affinity score between candidate limb vectors and part affinity field. + part_pafs = pafs[0, :, :, paf_channel:paf_channel + 2] + field = part_pafs[y, x].reshape(-1, self.points_per_limb, 2) + vec_norm = np.linalg.norm(vec_raw, ord=2, axis=-1, keepdims=True) + vec = vec_raw / (vec_norm + 1e-6) + affinity_scores = (field * vec).sum(-1).reshape(-1, self.points_per_limb) + valid_affinity_scores = affinity_scores > self.min_paf_alignment_score + valid_num = valid_affinity_scores.sum(1) + affinity_scores = (affinity_scores * valid_affinity_scores).sum(1) / (valid_num + 1e-6) + success_ratio = valid_num / self.points_per_limb + + # Get a list of limbs according to the obtained affinity score. + valid_limbs = np.where(np.logical_and(affinity_scores > 0, success_ratio > 0.8))[0] + if len(valid_limbs) == 0: + continue + b_idx, a_idx = np.divmod(valid_limbs, n) + affinity_scores = affinity_scores[valid_limbs] + + # Suppress incompatible connections. + a_idx, b_idx, affinity_scores = self.connections_nms(a_idx, b_idx, affinity_scores) + connections = list(zip(kpts_a[a_idx, 3].astype(np.int32), + kpts_b[b_idx, 3].astype(np.int32), + affinity_scores)) + if len(connections) == 0: + continue + + # Update poses with new connections. + pose_entries = self.update_poses(kpt_a_id, kpt_b_id, all_keypoints, + connections, pose_entries, pose_entry_size) + + # Remove poses with not enough points. + pose_entries = np.asarray(pose_entries, dtype=np.float32).reshape(-1, pose_entry_size) + pose_entries = pose_entries[pose_entries[:, -1] >= 3] + return pose_entries, all_keypoints + + @staticmethod + def convert_to_coco_format(pose_entries, all_keypoints): + num_joints = 17 + coco_keypoints = [] + scores = [] + for pose in pose_entries: + if len(pose) == 0: + continue + keypoints = np.zeros(num_joints * 3) + reorder_map = [0, -1, 6, 8, 10, 5, 7, 9, 12, 14, 16, 11, 13, 15, 2, 1, 4, 3] + person_score = pose[-2] + for keypoint_id, target_id in zip(pose[:-2], reorder_map): + if target_id < 0: + continue + cx, cy, score = 0, 0, 0 # keypoint not found + if keypoint_id != -1: + cx, cy, score = all_keypoints[int(keypoint_id), 0:3] + keypoints[target_id * 3 + 0] = cx + keypoints[target_id * 3 + 1] = cy + keypoints[target_id * 3 + 2] = score + coco_keypoints.append(keypoints) + scores.append(person_score * max(0, (pose[-1] - 1))) # -1 for 'neck' + return np.asarray(coco_keypoints), np.asarray(scores) diff --git a/demos/human_pose_estimation_demo/python/human_pose_estimation_demo/model.py b/demos/human_pose_estimation_demo/python/human_pose_estimation_demo/model.py new file mode 100644 index 00000000000..bbcd68669ea --- /dev/null +++ b/demos/human_pose_estimation_demo/python/human_pose_estimation_demo/model.py @@ -0,0 +1,280 @@ +""" + Copyright (C) 2020 Intel Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + +import logging +import os.path as osp +import threading +from collections import deque + +import cv2 +import ngraph as ng +import numpy as np +from openvino.inference_engine import IENetwork + +from .decoder_ae import AssociativeEmbeddingDecoder +from .decoder_openpose import OpenPoseDecoder + + +log = logging.getLogger() + + +class Model: + def __init__(self, ie, xml_file_path, bin_file_path=None, + size_divisor=8, target_size=None, + device='CPU', plugin_config={}, max_num_requests=1, + results=None, caught_exceptions=None): + self.ie = ie + log.info('Reading network from IR...') + if bin_file_path is None: + bin_file_path = osp.splitext(xml_file_path)[0] + '.bin' + self.net = ie.read_network(model=xml_file_path, weights=bin_file_path) + + log.info('Loading network to plugin...') + self.max_num_requests = max_num_requests + self.device = device + self.plugin_config = plugin_config + self.exec_net = ie.load_network(network=self.net, device_name=device, config=plugin_config, num_requests=max_num_requests) + + self.image_blob_name = '' + self.size_divisor = size_divisor + self.target_size = target_size + + self.requests = self.exec_net.requests + self.empty_requests = deque(self.requests) + self.completed_request_results = results if results is not None else [] + self.callback_exceptions = caught_exceptions if caught_exceptions is not None else {} + self.event = threading.Event() + + def reshape_net(self, inputs): + input_shapes = {name: data.shape for name, data in inputs.items()} + reshape_needed = False + for input_name, input_shape in input_shapes.items(): + blob_shape = self.net.input_info[input_name].input_data.shape + if not np.array_equal(input_shape, blob_shape): + reshape_needed = True + break + if reshape_needed: + log.info('reshape net to {}'.format(input_shapes)) + self.await_all() + self.net.reshape(input_shapes) + self.exec_net = self.ie.load_network(network=self.net, device_name=self.device, num_requests=self.max_num_requests) + self.requests = self.exec_net.requests + self.empty_requests = deque(self.requests) + + def unify_inputs(self, inputs): + if not isinstance(inputs, dict): + inputs_dict = {next(iter(self.net.input_info)): inputs} + else: + inputs_dict = inputs + return inputs_dict + + @staticmethod + def _get_inputs(net): + image_blob_name = None + for blob_name, blob in net.input_info.items(): + if len(blob.input_data.shape) == 4: + image_blob_name = blob_name + else: + raise RuntimeError('Unsupported {}D input layer "{}". Only 2D and 4D input layers are supported' + .format(len(blob.shape), blob_name)) + if image_blob_name is None: + raise RuntimeError('Failed to identify the input for the image.') + return image_blob_name + + @staticmethod + def _resize_image(frame, size): + return cv2.resize(frame, (size, size)) + + def preprocess(self, inputs): + img = self._resize_image(inputs[self.image_blob_name], self.target_size) + meta = {'original_shape': inputs[self.image_blob_name].shape, + 'resized_shape': img.shape} + h, w = img.shape[:2] + divisor = self.size_divisor + if w % divisor != 0 or h % divisor != 0: + img = np.pad(img, ((0, (h + divisor - 1) // divisor * divisor - h), + (0, (w + divisor - 1) // divisor * divisor - w), + (0, 0)), + mode='constant', constant_values=0) + # Change data layout from HWC to CHW + img = img.transpose((2, 0, 1)) + inputs[self.image_blob_name] = img[None] + return inputs, meta + + def postprocess(self, outputs, meta): + return outputs + + def inference_completion_callback(self, status, callback_args): + request, frame_id, frame_meta = callback_args + try: + if status != 0: + raise RuntimeError('Infer Request has returned status code {}'.format(status)) + raw_outputs = {key: blob.buffer for key, blob in request.output_blobs.items()} + self.completed_request_results[frame_id] = (frame_meta, raw_outputs) + self.empty_requests.append(request) + except Exception as e: + self.callback_exceptions.append(e) + self.event.set() + + def __call__(self, inputs, id, meta): + inputs = self.unify_inputs(inputs) + inputs, preprocessing_meta = self.preprocess(inputs) + self.reshape_net(inputs) + meta.update(preprocessing_meta) + request = self.empty_requests.popleft() + request.set_completion_callback(py_callback=self.inference_completion_callback, + py_data=(request, id, meta)) + self.event.clear() + request.async_infer(inputs=inputs) + + def await_all(self): + for request in self.exec_net.requests: + request.wait() + + def await_any(self): + self.event.wait() + + +class HPEOpenPose(Model): + + def __init__(self, *args, upsample_ratio=1, **kwargs): + super().__init__(*args, **kwargs) + + self.pooled_heatmaps_blob_name = 'pooled_heatmaps' + self.heatmaps_blob_name = 'heatmaps' + self.pafs_blob_name = 'pafs' + + function = ng.function_from_cnn(self.net) + paf = function.get_output_op(0) + paf = paf.inputs()[0].get_source_output().get_node() + paf.set_friendly_name(self.pafs_blob_name) + heatmap = function.get_output_op(1) + heatmap = heatmap.inputs()[0].get_source_output().get_node() + heatmap.set_friendly_name(self.heatmaps_blob_name) + + # Add keypoints NMS to the network. + # Heuristic NMS kernel size adjustment depending on the feature maps upsampling ratio. + p = int(np.round(6 / 7 * upsample_ratio)) + k = 2 * p + 1 + pooled_heatmap = ng.max_pool(heatmap, kernel_shape=(k, k), pads_begin=(p, p), pads_end=(p, p), + strides=(1, 1), name=self.pooled_heatmaps_blob_name) + f = ng.impl.Function( + [ng.result(heatmap, name=self.heatmaps_blob_name), + ng.result(pooled_heatmap, name=self.pooled_heatmaps_blob_name), + ng.result(paf, name=self.pafs_blob_name)], + function.get_parameters(), 'hpe') + + self.image_blob_name = self._get_inputs(self.net) + self.net = IENetwork(ng.impl.Function.to_capsule(f)) + self.exec_net = self.ie.load_network(network=self.net, device_name=self.device, num_requests=self.max_num_requests) + self.requests = self.exec_net.requests + self.empty_requests = deque(self.requests) + + self.num_joints = self.net.outputs[self.heatmaps_blob_name].shape[1] - 1 # The last channel is for background. + target_size = self.net.input_info[self.image_blob_name].input_data.shape[-2] + self.output_scale = target_size / self.net.outputs[self.heatmaps_blob_name].shape[-2] + if self.target_size is None: + self.target_size = target_size + + self.decoder = OpenPoseDecoder(num_joints=self.num_joints) + + @staticmethod + def heatmap_nms(heatmaps, pooled_heatmaps): + return heatmaps * (heatmaps == pooled_heatmaps) + + @staticmethod + def _resize_image(frame, size): + h = frame.shape[0] + scale = size / h + resized_frame = cv2.resize(frame, None, fx=scale, fy=scale) + return resized_frame + + def postprocess(self, outputs, meta): + heatmaps = outputs[self.heatmaps_blob_name] + pafs = outputs[self.pafs_blob_name] + pooled_heatmaps = outputs[self.pooled_heatmaps_blob_name] + nms_heatmaps = self.heatmap_nms(heatmaps, pooled_heatmaps) + poses, scores = self.decoder(heatmaps, nms_heatmaps, pafs) + # Rescale poses to the original image. + original_image_shape = meta['original_shape'] + resized_image_shape = meta['resized_shape'] + scale_x = original_image_shape[1] / resized_image_shape[1] + scale_y = original_image_shape[0] / resized_image_shape[0] + poses[:, :, 0] *= scale_x * self.output_scale + poses[:, :, 1] *= scale_y * self.output_scale + return poses, scores + + +class HPEAssociativeEmbedding(Model): + + def __init__(self, *args, size_divisor=32, **kwargs): + super().__init__(*args, size_divisor=size_divisor, **kwargs) + + self.image_blob_name = self._get_inputs(self.net) + self.heatmaps_blob_name = find_layer_by_name('heatmaps', self.net.outputs) + self.nms_heatmaps_blob_name = find_layer_by_name('nms_heatmaps', self.net.outputs) + self.embeddings_blob_name = find_layer_by_name('embeddings', self.net.outputs) + + self.num_joints = self.net.outputs[self.heatmaps_blob_name].shape[1] + h, w = self.net.input_info[self.image_blob_name].input_data.shape[-2:] + target_size = min(h, w) + self.output_scale = target_size / self.net.outputs[self.heatmaps_blob_name].shape[-1] + if self.target_size is None: + self.target_size = target_size + + self.decoder = AssociativeEmbeddingDecoder( + num_joints=self.num_joints, + adjust=True, + refine=True, + delta=0.0, + max_num_people=30, + detection_threshold=0.1, + tag_threshold=1, + use_detection_val=True, + ignore_too_much=False) + + @staticmethod + def _resize_image(frame, size): + h, w = frame.shape[:2] + scale = max(size / h, size / w) + resized_frame = cv2.resize(frame, None, fx=scale, fy=scale) + return resized_frame + + def postprocess(self, outputs, meta): + heatmaps = outputs[self.heatmaps_blob_name] + nms_heatmaps = outputs[self.nms_heatmaps_blob_name] + aembds = outputs[self.embeddings_blob_name] + poses, scores = self.decoder(heatmaps, aembds, nms_heatmaps=nms_heatmaps) + # Rescale poses to the original image. + original_image_shape = meta['original_shape'] + resized_image_shape = meta['resized_shape'] + scale_x = original_image_shape[1] / resized_image_shape[1] + scale_y = original_image_shape[0] / resized_image_shape[0] + poses[:, :, 0] *= scale_x * self.output_scale + poses[:, :, 1] *= scale_y * self.output_scale + return poses, scores + + +def find_layer_by_name(name, all_outputs): + all_names = tuple(layer_name for layer_name in all_outputs) + suitable_layers = [layer_name for layer_name in all_outputs if layer_name.startswith(name)] + if not suitable_layers: + raise ValueError('Suitable layer for "{}" output is not found in {}'.format(name, all_names)) + + if len(suitable_layers) > 1: + raise ValueError('More than 1 layer matched to "{}" output: {}'.format(name, suitable_layers)) + + return suitable_layers[0] diff --git a/demos/human_pose_estimation_demo/python/human_pose_estimation_demo/visualization.py b/demos/human_pose_estimation_demo/python/human_pose_estimation_demo/visualization.py new file mode 100644 index 00000000000..e4d68389b9d --- /dev/null +++ b/demos/human_pose_estimation_demo/python/human_pose_estimation_demo/visualization.py @@ -0,0 +1,62 @@ +""" + Copyright (C) 2020 Intel Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + +import cv2 +import numpy as np + + +default_skeleton = ((15, 13), (13, 11), (16, 14), (14, 12), (11, 12), (5, 11), (6, 12), (5, 6), + (5, 7), (6, 8), (7, 9), (8, 10), (1, 2), (0, 1), (0, 2), (1, 3), (2, 4), (3, 5), (4, 6)) + +colors = ( + (255, 0, 0), (255, 0, 255), (170, 0, 255), (255, 0, 85), + (255, 0, 170), (85, 255, 0), (255, 170, 0), (0, 255, 0), + (255, 255, 0), (0, 255, 85), (170, 255, 0), (0, 85, 255), + (0, 255, 170), (0, 0, 255), (0, 255, 255), (85, 0, 255), + (0, 170, 255)) + + +def show_poses(img, poses, scores, pose_score_threshold=0.5, point_score_threshold=0.5, skeleton=None, draw_ellipses=False): + if poses.size == 0: + return img + if skeleton is None: + skeleton = default_skeleton + stick_width = 4 + + img_limbs = np.copy(img) + for pose, pose_score in zip(poses, scores): + if pose_score <= pose_score_threshold: + continue + points = pose[:, :2].astype(int).tolist() + points_scores = pose[:, 2] + # Draw joints. + for i, (p, v) in enumerate(zip(points, points_scores)): + if v > point_score_threshold: + cv2.circle(img, tuple(p), 1, colors[i], 2) + # Draw limbs. + for i, j in skeleton: + if points_scores[i] > point_score_threshold and points_scores[j] > point_score_threshold: + if draw_ellipses: + middle = (points[i] + points[j]) // 2 + vec = points[i] - points[j] + length = np.sqrt((vec * vec).sum()) + angle = int(np.arctan2(vec[1], vec[0]) * 180 / np.pi) + polygon = cv2.ellipse2Poly(tuple(middle), (int(length / 2), min(int(length / 50), stick_width)), angle, 0, 360, 1) + cv2.fillConvexPoly(img_limbs, polygon, colors[j]) + else: + cv2.line(img_limbs, tuple(points[i]), tuple(points[j]), color=colors[j], thickness=stick_width) + cv2.addWeighted(img, 0.4, img_limbs, 0.6, 0, dst=img) + return img diff --git a/demos/human_pose_estimation_demo/models.lst b/demos/human_pose_estimation_demo/python/models.lst similarity index 100% rename from demos/human_pose_estimation_demo/models.lst rename to demos/human_pose_estimation_demo/python/models.lst diff --git a/demos/human_pose_estimation_demo/src/human_pose.cpp b/demos/human_pose_estimation_demo/src/human_pose.cpp deleted file mode 100644 index 093042f5a15..00000000000 --- a/demos/human_pose_estimation_demo/src/human_pose.cpp +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2018-2019 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include - -#include "human_pose.hpp" - -namespace human_pose_estimation { -HumanPose::HumanPose(const std::vector& keypoints, - const float& score) - : keypoints(keypoints), - score(score) {} -} // namespace human_pose_estimation diff --git a/demos/human_pose_estimation_demo/src/human_pose_estimator.cpp b/demos/human_pose_estimation_demo/src/human_pose_estimator.cpp deleted file mode 100644 index 517daa81ab0..00000000000 --- a/demos/human_pose_estimation_demo/src/human_pose_estimator.cpp +++ /dev/null @@ -1,325 +0,0 @@ -// Copyright (C) 2018-2019 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include -#include - -#include - -#include - -#include "human_pose_estimator.hpp" -#include "peak.hpp" - -namespace human_pose_estimation { -HumanPoseEstimator::HumanPoseEstimator(const std::string& modelPath, - const std::string& targetDeviceName_, - bool enablePerformanceReport) - : minJointsNumber(3), - stride(8), - pad(cv::Vec4i::all(0)), - meanPixel(cv::Vec3f::all(128)), - minPeaksDistance(3.0f), - midPointsScoreThreshold(0.05f), - foundMidPointsRatioThreshold(0.8f), - minSubsetScore(0.2f), - inputLayerSize(-1, -1), - upsampleRatio(4), - targetDeviceName(targetDeviceName_), - enablePerformanceReport(enablePerformanceReport), - modelPath(modelPath) { - if (enablePerformanceReport) { - ie.SetConfig({{InferenceEngine::PluginConfigParams::KEY_PERF_COUNT, - InferenceEngine::PluginConfigParams::YES}}); - } - network = ie.ReadNetwork(modelPath); - - const auto& inputInfo = network.getInputsInfo(); - - if (inputInfo.size() != 1) { - throw std::runtime_error(modelPath + ": expected to have 1 input"); - } - - const auto& imageInputInfo = *inputInfo.begin(); - const auto& imageInputDims = imageInputInfo.second->getTensorDesc().getDims(); - - if (imageInputDims.size() != 4 || imageInputDims[0] != 1 || imageInputDims[1] != 3) { - throw std::runtime_error( - modelPath + ": expected \"" + imageInputInfo.first + "\" to have dimensions 1x3xHxW"); - } - - inputLayerSize = cv::Size(imageInputDims[3], imageInputDims[2]); - imageInputInfo.second->setPrecision(InferenceEngine::Precision::U8); - - InferenceEngine::OutputsDataMap outputInfo = network.getOutputsInfo(); - - if (outputInfo.size() != 2) { - throw std::runtime_error(modelPath + ": expected to have 2 outputs"); - } - - auto outputIt = outputInfo.begin(); - - const auto& pafsOutputInfo = *outputIt++; - - pafsBlobName = pafsOutputInfo.first; - - const auto& pafsOutputDims = pafsOutputInfo.second->getTensorDesc().getDims(); - - if (pafsOutputDims.size() != 4 || pafsOutputDims[0] != 1 - || pafsOutputDims[1] != 2 * (keypointsNumber + 1)) { - throw std::runtime_error( - modelPath + ": expected \"" + pafsBlobName + "\" to have dimensions " - "1x" + std::to_string(2 * (keypointsNumber + 1)) + "xHFMxWFM"); - } - - const auto& heatmapsOutputInfo = *outputIt++; - - heatmapsBlobName = heatmapsOutputInfo.first; - - const auto& heatmapsOutputDims = heatmapsOutputInfo.second->getTensorDesc().getDims(); - - if (heatmapsOutputDims.size() != 4 || heatmapsOutputDims[0] != 1 - || heatmapsOutputDims[1] != keypointsNumber + 1) { - throw std::runtime_error( - modelPath + ": expected \"" + heatmapsBlobName + "\" to have dimensions " - "1x" + std::to_string(keypointsNumber + 1) + "xHFMxWFM"); - } - - if (pafsOutputDims[2] != heatmapsOutputDims[2] || pafsOutputDims[3] != heatmapsOutputDims[3]) { - throw std::runtime_error( - modelPath + ": expected \"" + pafsBlobName + "\" and \"" + heatmapsBlobName + "\"" - "to have matching last two dimensions"); - } - - executableNetwork = ie.LoadNetwork(network, targetDeviceName); - requestNext = executableNetwork.CreateInferRequestPtr(); - requestCurr = executableNetwork.CreateInferRequestPtr(); -} - -void HumanPoseEstimator::reshape(const cv::Mat& image){ - CV_Assert(image.type() == CV_8UC3); - - imageSize = image.size(); - if (inputWidthIsChanged(imageSize)) { - auto input_shapes = network.getInputShapes(); - std::string input_name; - InferenceEngine::SizeVector input_shape; - std::tie(input_name, input_shape) = *input_shapes.begin(); - input_shape[2] = inputLayerSize.height; - input_shape[3] = inputLayerSize.width; - input_shapes[input_name] = input_shape; - network.reshape(input_shapes); - executableNetwork = ie.LoadNetwork(network, targetDeviceName); - requestNext = executableNetwork.CreateInferRequestPtr(); - requestCurr = executableNetwork.CreateInferRequestPtr(); - std::cout << "Reshape needed" << std::endl; - } -} - -void HumanPoseEstimator::frameToBlobCurr(const cv::Mat& image) { - CV_Assert(image.type() == CV_8UC3); - InferenceEngine::Blob::Ptr input = requestCurr->GetBlob(network.getInputsInfo().begin()->first); - InferenceEngine::LockedMemory requestCurrBlobMapped = - InferenceEngine::as(input)->wmap(); - auto buffer = requestCurrBlobMapped.as(); - preprocess(image, buffer); -} - -void HumanPoseEstimator::frameToBlobNext(const cv::Mat& image) { - CV_Assert(image.type() == CV_8UC3); - InferenceEngine::Blob::Ptr input = requestNext->GetBlob(network.getInputsInfo().begin()->first); - InferenceEngine::LockedMemory requestNextBlobMapped = - InferenceEngine::as(input)->wmap(); - auto buffer = requestNextBlobMapped.as(); - preprocess(image, buffer); -} - -void HumanPoseEstimator::startCurr() { - requestCurr->StartAsync(); -} - -void HumanPoseEstimator::startNext() { - requestNext->StartAsync(); -} - -void HumanPoseEstimator::waitCurr() { - if (InferenceEngine::OK != requestCurr->Wait(InferenceEngine::IInferRequest::WaitMode::RESULT_READY)) { - throw std::runtime_error("Waiting for inference results error"); - } -} - -void HumanPoseEstimator::swapRequest() { - requestCurr.swap(requestNext); -} - -std::vector HumanPoseEstimator::postprocessCurr() { - InferenceEngine::Blob::Ptr pafsBlob = requestCurr->GetBlob(pafsBlobName); - InferenceEngine::Blob::Ptr heatMapsBlob = requestCurr->GetBlob(heatmapsBlobName); - InferenceEngine::SizeVector heatMapDims = heatMapsBlob->getTensorDesc().getDims(); - - InferenceEngine::LockedMemory heatMapsBlobMapped = - InferenceEngine::as(heatMapsBlob)->rmap(); - InferenceEngine::LockedMemory pafsBlobMapped = - InferenceEngine::as(pafsBlob)->rmap(); - std::vector poses = postprocess( - heatMapsBlobMapped.as(), - heatMapDims[2] * heatMapDims[3], - keypointsNumber, - pafsBlobMapped.as(), - heatMapDims[2] * heatMapDims[3], - pafsBlob->getTensorDesc().getDims()[1], - heatMapDims[3], heatMapDims[2], imageSize); - - return poses; -} - -void HumanPoseEstimator::preprocess(const cv::Mat& image, uint8_t* buffer) const { - cv::Mat resizedImage; - double scale = inputLayerSize.height / static_cast(image.rows); - cv::resize(image, resizedImage, cv::Size(), scale, scale, cv::INTER_CUBIC); - cv::Mat paddedImage; - cv::copyMakeBorder(resizedImage, paddedImage, pad(0), pad(2), pad(1), pad(3), - cv::BORDER_CONSTANT, meanPixel); - std::vector planes(3); - for (size_t pId = 0; pId < planes.size(); pId++) { - planes[pId] = cv::Mat(inputLayerSize, CV_8UC1, buffer + pId * inputLayerSize.area()); - } - cv::split(paddedImage, planes); -} - -std::vector HumanPoseEstimator::postprocess( - const float* heatMapsData, const int heatMapOffset, const int nHeatMaps, - const float* pafsData, const int pafOffset, const int nPafs, - const int featureMapWidth, const int featureMapHeight, - const cv::Size& imageSize) const { - std::vector heatMaps(nHeatMaps); - for (size_t i = 0; i < heatMaps.size(); i++) { - heatMaps[i] = cv::Mat(featureMapHeight, featureMapWidth, CV_32FC1, - reinterpret_cast( - const_cast( - heatMapsData + i * heatMapOffset))); - } - resizeFeatureMaps(heatMaps); - - std::vector pafs(nPafs); - for (size_t i = 0; i < pafs.size(); i++) { - pafs[i] = cv::Mat(featureMapHeight, featureMapWidth, CV_32FC1, - reinterpret_cast( - const_cast( - pafsData + i * pafOffset))); - } - resizeFeatureMaps(pafs); - - std::vector poses = extractPoses(heatMaps, pafs); - correctCoordinates(poses, heatMaps[0].size(), imageSize); - return poses; -} - -class FindPeaksBody: public cv::ParallelLoopBody { -public: - FindPeaksBody(const std::vector& heatMaps, float minPeaksDistance, - std::vector >& peaksFromHeatMap) - : heatMaps(heatMaps), - minPeaksDistance(minPeaksDistance), - peaksFromHeatMap(peaksFromHeatMap) {} - - void operator()(const cv::Range& range) const override { - for (int i = range.start; i < range.end; i++) { - findPeaks(heatMaps, minPeaksDistance, peaksFromHeatMap, i); - } - } - -private: - const std::vector& heatMaps; - float minPeaksDistance; - std::vector >& peaksFromHeatMap; -}; - -std::vector HumanPoseEstimator::extractPoses( - const std::vector& heatMaps, - const std::vector& pafs) const { - std::vector > peaksFromHeatMap(heatMaps.size()); - FindPeaksBody findPeaksBody(heatMaps, minPeaksDistance, peaksFromHeatMap); - cv::parallel_for_(cv::Range(0, static_cast(heatMaps.size())), - findPeaksBody); - int peaksBefore = 0; - for (size_t heatmapId = 1; heatmapId < heatMaps.size(); heatmapId++) { - peaksBefore += static_cast(peaksFromHeatMap[heatmapId - 1].size()); - for (auto& peak : peaksFromHeatMap[heatmapId]) { - peak.id += peaksBefore; - } - } - std::vector poses = groupPeaksToPoses( - peaksFromHeatMap, pafs, keypointsNumber, midPointsScoreThreshold, - foundMidPointsRatioThreshold, minJointsNumber, minSubsetScore); - return poses; -} - -void HumanPoseEstimator::resizeFeatureMaps(std::vector& featureMaps) const { - for (auto& featureMap : featureMaps) { - cv::resize(featureMap, featureMap, cv::Size(), - upsampleRatio, upsampleRatio, cv::INTER_CUBIC); - } -} - -void HumanPoseEstimator::correctCoordinates(std::vector& poses, - const cv::Size& featureMapsSize, - const cv::Size& imageSize) const { - CV_Assert(stride % upsampleRatio == 0); - - cv::Size fullFeatureMapSize = featureMapsSize * stride / upsampleRatio; - - float scaleX = imageSize.width / - static_cast(fullFeatureMapSize.width - pad(1) - pad(3)); - float scaleY = imageSize.height / - static_cast(fullFeatureMapSize.height - pad(0) - pad(2)); - for (auto& pose : poses) { - for (auto& keypoint : pose.keypoints) { - if (keypoint != cv::Point2f(-1, -1)) { - keypoint.x *= stride / upsampleRatio; - keypoint.x -= pad(1); - keypoint.x *= scaleX; - - keypoint.y *= stride / upsampleRatio; - keypoint.y -= pad(0); - keypoint.y *= scaleY; - } - } - } -} - -bool HumanPoseEstimator::inputWidthIsChanged(const cv::Size& imageSize) { - double scale = static_cast(inputLayerSize.height) / static_cast(imageSize.height); - cv::Size scaledSize(static_cast(cvRound(imageSize.width * scale)), - static_cast(cvRound(imageSize.height * scale))); - cv::Size scaledImageSize(std::max(scaledSize.width, inputLayerSize.height), - inputLayerSize.height); - int minHeight = std::min(scaledImageSize.height, scaledSize.height); - scaledImageSize.width = static_cast(std::ceil( - scaledImageSize.width / static_cast(stride))) * stride; - pad(0) = static_cast(std::floor((scaledImageSize.height - minHeight) / 2.0)); - pad(1) = static_cast(std::floor((scaledImageSize.width - scaledSize.width) / 2.0)); - pad(2) = scaledImageSize.height - minHeight - pad(0); - pad(3) = scaledImageSize.width - scaledSize.width - pad(1); - if (scaledSize.width == (inputLayerSize.width - pad(1) - pad(3))) { - return false; - } - - inputLayerSize.width = scaledImageSize.width; - return true; -} - -HumanPoseEstimator::~HumanPoseEstimator() { - try { - if (enablePerformanceReport) { - std::cout << "Performance counts for " << modelPath << std::endl << std::endl; - printPerformanceCounts(*requestCurr, std::cout, getFullDeviceName(ie, targetDeviceName), false); - } - } - catch (...) { - std::cerr << "[ ERROR ] Unknown/internal exception happened." << std::endl; - } -} -} // namespace human_pose_estimation diff --git a/demos/human_pose_estimation_demo/src/render_human_pose.cpp b/demos/human_pose_estimation_demo/src/render_human_pose.cpp deleted file mode 100644 index 7e29222a0e2..00000000000 --- a/demos/human_pose_estimation_demo/src/render_human_pose.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (C) 2018-2019 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include - -#include - -#include "human_pose_estimator.hpp" -#include "render_human_pose.hpp" - -namespace human_pose_estimation { -void renderHumanPose(const std::vector& poses, cv::Mat& image) { - CV_Assert(image.type() == CV_8UC3); - - static const cv::Scalar colors[HumanPoseEstimator::keypointsNumber] = { - cv::Scalar(255, 0, 0), cv::Scalar(255, 85, 0), cv::Scalar(255, 170, 0), - cv::Scalar(255, 255, 0), cv::Scalar(170, 255, 0), cv::Scalar(85, 255, 0), - cv::Scalar(0, 255, 0), cv::Scalar(0, 255, 85), cv::Scalar(0, 255, 170), - cv::Scalar(0, 255, 255), cv::Scalar(0, 170, 255), cv::Scalar(0, 85, 255), - cv::Scalar(0, 0, 255), cv::Scalar(85, 0, 255), cv::Scalar(170, 0, 255), - cv::Scalar(255, 0, 255), cv::Scalar(255, 0, 170), cv::Scalar(255, 0, 85) - }; - static const std::pair limbKeypointsIds[] = { - {1, 2}, {1, 5}, {2, 3}, - {3, 4}, {5, 6}, {6, 7}, - {1, 8}, {8, 9}, {9, 10}, - {1, 11}, {11, 12}, {12, 13}, - {1, 0}, {0, 14}, {14, 16}, - {0, 15}, {15, 17} - }; - - const int stickWidth = 4; - const cv::Point2f absentKeypoint(-1.0f, -1.0f); - for (const auto& pose : poses) { - CV_Assert(pose.keypoints.size() == HumanPoseEstimator::keypointsNumber); - - for (size_t keypointIdx = 0; keypointIdx < pose.keypoints.size(); keypointIdx++) { - if (pose.keypoints[keypointIdx] != absentKeypoint) { - cv::circle(image, pose.keypoints[keypointIdx], 4, colors[keypointIdx], -1); - } - } - } - cv::Mat pane = image.clone(); - for (const auto& pose : poses) { - for (const auto& limbKeypointsId : limbKeypointsIds) { - std::pair limbKeypoints(pose.keypoints[limbKeypointsId.first], - pose.keypoints[limbKeypointsId.second]); - if (limbKeypoints.first == absentKeypoint - || limbKeypoints.second == absentKeypoint) { - continue; - } - - float meanX = (limbKeypoints.first.x + limbKeypoints.second.x) / 2; - float meanY = (limbKeypoints.first.y + limbKeypoints.second.y) / 2; - cv::Point difference = limbKeypoints.first - limbKeypoints.second; - double length = std::sqrt(difference.x * difference.x + difference.y * difference.y); - int angle = static_cast(std::atan2(difference.y, difference.x) * 180 / CV_PI); - std::vector polygon; - cv::ellipse2Poly(cv::Point2d(meanX, meanY), cv::Size2d(length / 2, stickWidth), - angle, 0, 360, 1, polygon); - cv::fillConvexPoly(pane, polygon, colors[limbKeypointsId.second]); - } - } - cv::addWeighted(image, 0.4, pane, 0.6, 0, image); -} -} // namespace human_pose_estimation diff --git a/demos/python_demos/image_inpainting_demo/README.md b/demos/image_inpainting_demo/python/README.md similarity index 97% rename from demos/python_demos/image_inpainting_demo/README.md rename to demos/image_inpainting_demo/python/README.md index ac96b4b917c..c9f992e33e6 100644 --- a/demos/python_demos/image_inpainting_demo/README.md +++ b/demos/image_inpainting_demo/python/README.md @@ -56,7 +56,7 @@ Options: -mbw, -mk and -mv). Cannot be used together with -ac. ``` -To run the demo, you can use public or pretrained models. You can download the pretrained models with the OpenVINO™ [Model Downloader](../../../tools/downloader/README.md). +To run the demo, you can use public or pretrained models. You can download the pretrained models with the OpenVINO™ [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). diff --git a/demos/python_demos/image_inpainting_demo/image_inpainting_demo.py b/demos/image_inpainting_demo/python/image_inpainting_demo.py similarity index 98% rename from demos/python_demos/image_inpainting_demo/image_inpainting_demo.py rename to demos/image_inpainting_demo/python/image_inpainting_demo.py index 97e022af1db..db9823aa3aa 100755 --- a/demos/python_demos/image_inpainting_demo/image_inpainting_demo.py +++ b/demos/image_inpainting_demo/python/image_inpainting_demo.py @@ -13,6 +13,7 @@ """ from argparse import ArgumentParser, SUPPRESS +from pathlib import Path import numpy as np import cv2 @@ -27,7 +28,7 @@ def build_arg_parser(): args = parser.add_argument_group('Options') args.add_argument('-h', '--help', action='help', default=SUPPRESS, help='Show this help message and exit.') args.add_argument("-m", "--model", help="Required. Path to an .xml file with a trained model.", - required=True, type=str) + required=True, type=Path) args.add_argument("-i", "--input", type=str, default='', help="path to image.") args.add_argument("-d", "--device", help="Optional. Specify the target device to infer on; CPU, GPU, FPGA, HDDL or MYRIAD is " @@ -123,7 +124,7 @@ def main(): if args.auto_mask_color or args.auto_mask_random: # Command-line inpaining for just one image - concat_image, result = inpaint_auto(img,args) + concat_image, result = inpaint_auto(img, args) if args.output != "": cv2.imwrite(args.output, result) if not args.no_show: diff --git a/demos/python_demos/image_inpainting_demo/inpainting.py b/demos/image_inpainting_demo/python/inpainting.py similarity index 95% rename from demos/python_demos/image_inpainting_demo/inpainting.py rename to demos/image_inpainting_demo/python/inpainting.py index 4f97383c50d..f1416864f6c 100644 --- a/demos/python_demos/image_inpainting_demo/inpainting.py +++ b/demos/image_inpainting_demo/python/inpainting.py @@ -11,14 +11,13 @@ limitations under the License. """ -import os import cv2 import numpy as np class ImageInpainting: def __init__(self, ie, model_path, device='CPU'): - model = ie.read_network(model_path, os.path.splitext(model_path)[0] + '.bin') + model = ie.read_network(model_path, model_path.with_suffix('.bin')) assert len(model.input_info) == 2, "Expected 2 input blob" assert len(model.outputs) == 1, "Expected 1 output blobs" diff --git a/demos/python_demos/image_inpainting_demo/inpainting_gui.py b/demos/image_inpainting_demo/python/inpainting_gui.py similarity index 100% rename from demos/python_demos/image_inpainting_demo/inpainting_gui.py rename to demos/image_inpainting_demo/python/inpainting_gui.py diff --git a/demos/python_demos/image_inpainting_demo/models.lst b/demos/image_inpainting_demo/python/models.lst similarity index 100% rename from demos/python_demos/image_inpainting_demo/models.lst rename to demos/image_inpainting_demo/python/models.lst diff --git a/demos/python_demos/image_retrieval_demo/README.md b/demos/image_retrieval_demo/python/README.md similarity index 82% rename from demos/python_demos/image_retrieval_demo/README.md rename to demos/image_retrieval_demo/python/README.md index f47173c60be..3885c03ee57 100644 --- a/demos/python_demos/image_retrieval_demo/README.md +++ b/demos/image_retrieval_demo/python/README.md @@ -1,4 +1,6 @@ -# Image Retrieval Python* Demo +# Image Retrieval Python\* Demo + +![](./image_retrieval.gif) This demo demonstrates how to run Image Retrieval models using OpenVINO™. @@ -29,17 +31,25 @@ The demo workflow is the following: Run the application with the `-h` option to see the following usage message: ``` -usage: image_retrieval_demo.py [-h] -m MODEL -i I -g GALLERY - [-gt GROUND_TRUTH] [-d DEVICE] - [-l CPU_EXTENSION] [--no_show] - [-u UTILIZATION_MONITORS] +usage: image_retrieval_demo.py [-h] -m MODEL -i INPUT [--loop] + [-o OUTPUT] [-limit OUTPUT_LIMIT] + -g GALLERY [-gt GROUND_TRUTH] + [-d DEVICE] [-l CPU_EXTENSION] + [--no_show] [-u UTILIZATION_MONITORS] Options: -h, --help Show this help message and exit. -m MODEL, --model MODEL Required. Path to an .xml file with a trained model. - -i I Required. Path to a video file or a device node of a + -i INPUT, --input INPUT + Required. Path to a video file or a device node of a web-camera. + --loop Optional. Enable reading the input in a loop. + -o OUTPUT, --output OUTPUT + Optional. Name of output to save. + -limit OUTPUT_LIMIT, --output_limit OUTPUT_LIMIT + Optional. Number of frames to store in output. + If -1 is set, all frames are stored. -g GALLERY, --gallery GALLERY Required. Path to a file listing gallery images. -gt GROUND_TRUTH, --ground_truth GROUND_TRUTH @@ -60,7 +70,7 @@ Options: Running the application with an empty list of options yields the short version of the usage message and an error message. -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). +To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (`*.xml` + `*.bin`) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). @@ -81,8 +91,6 @@ Examples of videos can be found [here](https://github.com/19900531/test). The application uses OpenCV to display gallery searching result and current inference performance. -![](./image_retrieval_demo.jpg) - ## See Also * [Using Open Model Zoo demos](../../README.md) * [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) diff --git a/demos/image_retrieval_demo/python/image_retrieval.gif b/demos/image_retrieval_demo/python/image_retrieval.gif new file mode 100644 index 00000000000..bceed86e055 Binary files /dev/null and b/demos/image_retrieval_demo/python/image_retrieval.gif differ diff --git a/demos/python_demos/image_retrieval_demo/image_retrieval_demo.py b/demos/image_retrieval_demo/python/image_retrieval_demo.py similarity index 78% rename from demos/python_demos/image_retrieval_demo/image_retrieval_demo.py rename to demos/image_retrieval_demo/python/image_retrieval_demo.py index 20f1cd9dbf2..248e4da1b9a 100755 --- a/demos/python_demos/image_retrieval_demo/image_retrieval_demo.py +++ b/demos/image_retrieval_demo/python/image_retrieval_demo.py @@ -16,11 +16,12 @@ """ import logging as log -import os +from pathlib import Path import sys import time from argparse import ArgumentParser, SUPPRESS +import cv2 import numpy as np from image_retrieval_demo.image_retrieval import ImageRetrieval @@ -28,8 +29,10 @@ from image_retrieval_demo.visualizer import visualize from image_retrieval_demo.roi_detector_on_video import RoiDetectorOnVideo -sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'common')) +sys.path.append(str(Path(__file__).resolve().parents[2] / 'common/python')) + import monitors +from images_capture import open_images_capture INPUT_SIZE = 224 @@ -45,9 +48,15 @@ def build_argparser(): args.add_argument('-m', '--model', help='Required. Path to an .xml file with a trained model.', required=True, type=str) - args.add_argument('-i', - help='Required. Path to a video file or a device node of a web-camera.', - required=True, type=str) + args.add_argument('-i', '--input', required=True, + help='Required. Path to a video file or a device node of a web-camera.') + args.add_argument('--loop', default=False, action='store_true', + help='Optional. Enable reading the input in a loop.') + args.add_argument('-o', '--output', required=False, + help='Optional. Name of output to save.') + args.add_argument('-limit', '--output_limit', required=False, default=1000, type=int, + help='Optional. Number of frames to store in output. ' + 'If -1 is set, all frames are stored.') args.add_argument('-g', '--gallery', help='Required. Path to a file listing gallery images.', required=True, type=str) @@ -113,14 +122,19 @@ def main(): img_retrieval = ImageRetrieval(args.model, args.device, args.gallery, INPUT_SIZE, args.cpu_extension) - frames = RoiDetectorOnVideo(args.i) + cap = open_images_capture(args.input, args.loop) + if cap.get_type() not in ('VIDEO', 'CAMERA'): + raise RuntimeError("The input should be a video file or a numeric camera ID") + frames = RoiDetectorOnVideo(cap) compute_embeddings_times = [] search_in_gallery_times = [] positions = [] + frames_processed = 0 presenter = monitors.Presenter(args.utilization_monitors, 0) + video_writer = cv2.VideoWriter() for image, view_frame in frames: position = None @@ -147,12 +161,21 @@ def main(): else: log.info("ROI detected, found: %s", sorted_classes[0]) - key = visualize(view_frame, position, + image, key = visualize(view_frame, position, [img_retrieval.impaths[i] for i in sorted_indexes], distances[sorted_indexes] if position is not None else None, img_retrieval.input_size, np.mean(compute_embeddings_times), np.mean(search_in_gallery_times), imshow_delay=3, presenter=presenter, no_show=args.no_show) + if args.output and not video_writer.isOpened(): + video_writer = cv2.VideoWriter(args.output, cv2.VideoWriter_fourcc(*'MJPG'), cap.fps(), + (image.shape[1], image.shape[0])) + if not video_writer.isOpened(): + raise RuntimeError("Can't open video writer") + frames_processed += 1 + if video_writer.isOpened() and (args.output_limit == -1 or frames_processed <= args.output_limit): + video_writer.write(image) + if key == 27: break print(presenter.reportMeans()) diff --git a/demos/python_demos/image_retrieval_demo/image_retrieval_demo/roi_cv_detector/__init__.py b/demos/image_retrieval_demo/python/image_retrieval_demo/__init__.py similarity index 100% rename from demos/python_demos/image_retrieval_demo/image_retrieval_demo/roi_cv_detector/__init__.py rename to demos/image_retrieval_demo/python/image_retrieval_demo/__init__.py diff --git a/demos/python_demos/image_retrieval_demo/image_retrieval_demo/common.py b/demos/image_retrieval_demo/python/image_retrieval_demo/common.py similarity index 100% rename from demos/python_demos/image_retrieval_demo/image_retrieval_demo/common.py rename to demos/image_retrieval_demo/python/image_retrieval_demo/common.py diff --git a/demos/python_demos/image_retrieval_demo/image_retrieval_demo/image_retrieval.py b/demos/image_retrieval_demo/python/image_retrieval_demo/image_retrieval.py similarity index 100% rename from demos/python_demos/image_retrieval_demo/image_retrieval_demo/image_retrieval.py rename to demos/image_retrieval_demo/python/image_retrieval_demo/image_retrieval.py diff --git a/demos/python_demos/instance_segmentation_demo/instance_segmentation_demo/__init__.py b/demos/image_retrieval_demo/python/image_retrieval_demo/roi_cv_detector/__init__.py similarity index 100% rename from demos/python_demos/instance_segmentation_demo/instance_segmentation_demo/__init__.py rename to demos/image_retrieval_demo/python/image_retrieval_demo/roi_cv_detector/__init__.py diff --git a/demos/python_demos/image_retrieval_demo/image_retrieval_demo/roi_cv_detector/detect_by_simple_dense_optical_flow.py b/demos/image_retrieval_demo/python/image_retrieval_demo/roi_cv_detector/detect_by_simple_dense_optical_flow.py similarity index 99% rename from demos/python_demos/image_retrieval_demo/image_retrieval_demo/roi_cv_detector/detect_by_simple_dense_optical_flow.py rename to demos/image_retrieval_demo/python/image_retrieval_demo/roi_cv_detector/detect_by_simple_dense_optical_flow.py index 1e001cb0f19..85ecd63ceea 100644 --- a/demos/python_demos/image_retrieval_demo/image_retrieval_demo/roi_cv_detector/detect_by_simple_dense_optical_flow.py +++ b/demos/image_retrieval_demo/python/image_retrieval_demo/roi_cv_detector/detect_by_simple_dense_optical_flow.py @@ -841,11 +841,14 @@ def handle_frame(self, frame, prev_frame, frame_id): def get_res_bbox(self): return self.res_bbox + def get_res_bbox_confidence(self): """ At the moment it either 0 or 1 """ return self.res_bbox_confidence + def get_num_summed_masks(self): return self.num_summed_masks + def get_result_img_to_show(self): return self.result_img_to_show diff --git a/demos/python_demos/image_retrieval_demo/image_retrieval_demo/roi_detector_on_video.py b/demos/image_retrieval_demo/python/image_retrieval_demo/roi_detector_on_video.py similarity index 87% rename from demos/python_demos/image_retrieval_demo/image_retrieval_demo/roi_detector_on_video.py rename to demos/image_retrieval_demo/python/image_retrieval_demo/roi_detector_on_video.py index caef9773708..1ea482204b4 100644 --- a/demos/python_demos/image_retrieval_demo/image_retrieval_demo/roi_detector_on_video.py +++ b/demos/image_retrieval_demo/python/image_retrieval_demo/roi_detector_on_video.py @@ -14,8 +14,6 @@ limitations under the License. """ -import os - import cv2 from image_retrieval_demo.roi_cv_detector.detect_by_simple_dense_optical_flow import RoiDetector, \ get_rect_tl, get_rect_br @@ -24,11 +22,9 @@ class RoiDetectorOnVideo: """ This class detects moving ROI on videos. """ - def __init__(self, path): - if not os.path.exists(path): - raise Exception('File not found: {}'.format(path)) + def __init__(self, cap): - self.cap = cv2.VideoCapture(path) + self.cap = cap self.frame_step = 5 self.roi_detector = RoiDetector(self.frame_step) @@ -38,7 +34,7 @@ def __iter__(self): def __next__(self): """ Returns cropped frame (ROI) and original frame with ROI drawn as a rectangle. """ - _, frame = self.cap.read() + frame = self.cap.read() if frame is None: raise StopIteration diff --git a/demos/python_demos/image_retrieval_demo/image_retrieval_demo/visualizer.py b/demos/image_retrieval_demo/python/image_retrieval_demo/visualizer.py similarity index 97% rename from demos/python_demos/image_retrieval_demo/image_retrieval_demo/visualizer.py rename to demos/image_retrieval_demo/python/image_retrieval_demo/visualizer.py index 4800c3560aa..eef2cd578ee 100644 --- a/demos/python_demos/image_retrieval_demo/image_retrieval_demo/visualizer.py +++ b/demos/image_retrieval_demo/python/image_retrieval_demo/visualizer.py @@ -101,6 +101,6 @@ def visualize(image, target_pos, impaths, distances, input_size, compute_embeddi cv2.imshow('demo_image', demo_image) key_pressed = cv2.waitKey(imshow_delay) presenter.handleKey(key_pressed) - return key_pressed & 0xff if key_pressed != -1 else -1 + return (demo_image, key_pressed & 0xff) if key_pressed != -1 else (demo_image, -1) - return -1 + return (demo_image, -1) diff --git a/demos/python_demos/image_retrieval_demo/models.lst b/demos/image_retrieval_demo/python/models.lst similarity index 100% rename from demos/python_demos/image_retrieval_demo/models.lst rename to demos/image_retrieval_demo/python/models.lst diff --git a/demos/image_translation_demo/python/README.md b/demos/image_translation_demo/python/README.md new file mode 100644 index 00000000000..4c3b234e035 --- /dev/null +++ b/demos/image_translation_demo/python/README.md @@ -0,0 +1,109 @@ +# Image Translation Demo + +This demo application demonstrates an example of using neural networks to synthesize a photo-realistic image based on exemplar image. You can use the following models with the demo: + +* `cocosnet` +* `hrnet-v2-c1-segmentation` + +## How It Works + +At the start-up the demo application reads command line parameters and loads a network to the Inference Engine plugin. To get the result, the demo performs the following steps: + +1. Reading input data (semantic segmentation mask of image for translation, exemplar image and mask of exemplar image). +2. Preprocessing for input image and masks. +3. Network inference (segmentation network (optional) + translation network). +4. Save results to folder. + +## Running + +Running the application with the `-h` option yields the following usage message: + +``` +python3 cocosnet_demo.py -h +``` + +The command yields the following usage message: + +``` +usage: image_translation_demo.py [-h] -m_trn TRANSLATION_MODEL + [-m_seg SEGMENTATION_MODEL] [-ii INPUT_IMAGES] + [-is INPUT_SEMANTICS] -ri REFERENCE_IMAGES + [-rs REFERENCE_SEMANTICS] -o OUTPUT_DIR + [-d DEVICE] + +Options: + -h, --help Show this help message and exit. + -m_trn TRANSLATION_MODEL, --translation_model TRANSLATION_MODEL + Required. Path to an .xml file with a trained + translation model + -m_seg SEGMENTATION_MODEL, --segmentation_model SEGMENTATION_MODEL + Optional. Path to an .xml file with a trained + semantic segmentation model + -ii INPUT_IMAGES, --input_images INPUT_IMAGES + Optional. Path to a folder with input images or path + to a input image + -is INPUT_SEMANTICS, --input_semantics INPUT_SEMANTICS + Optional. Path to a folder with semantic images or + path to a semantic image + -ri REFERENCE_IMAGES, --reference_images REFERENCE_IMAGES + Required. Path to a folder with reference images or + path to a reference image + -rs REFERENCE_SEMANTICS, --reference_semantics REFERENCE_SEMANTICS + Optional. Path to a folder with reference semantics + or path to a reference semantic + -o OUTPUT_DIR, --output_dir OUTPUT_DIR + Required. Path to a folder where output files will be + saved + -d DEVICE, --device DEVICE + Optional. Specify the target device to infer on; CPU, + GPU, FPGA, HDDL or MYRIAD is acceptable. Default + value is CPU + +``` + +Running the application with the empty list of options yields the usage message given above and an error message. + +To run the demo, you can use public or pre-trained models. You can download the pre-trained models with the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). + +> **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). + +There are two ways to use this demo: + +1. Run with segmentation model in addition to translation model. You should use only models trained on ADE20k dataset. Example: [hrnet-v2-c1-segmentation](../../../models/public/hrnet-v2-c1-segmentation/hrnet-v2-c1-segmentation.md). + In this case only input and reference images are required without any masks. + Segmentation masks will be generated via segmentation model. + + You can use the following command to run demo on CPU using cocosnet and hrnet-v2-c1-segmentation models: + + ``` + python3 image_translation_demo.py \ + -d CPU \ + -m_trn /cocosnet.xml \ + -m_seg /hrnet-v2-c1-segmentation.xml \ + -ii /input_image.jpg \ + -ri /reference_image.jpg + ``` + +2. Run with only translation model. + You can use the following command to run demo on CPU using cocosnet as translation model: + + ``` + python3 image_translation_demo.py \ + -d CPU \ + -m_trn /cocosnet.xml \ + -is /input_mask.png \ + -ri /reference_image.jpg \ + -rs /reference_mask.png + ``` + + > **NOTE**: For segmentation masks you should use mask (with shape: [height x width]) that specifies class for each pixel. Number of classes is 151 (from ADE20k), where '0' - background class. + +## Demo Output + +The results of the demo processing are saved to a folder that is specified by the parameter `output_dir`. + +## See Also + +* [Using Open Model Zoo demos](../../README.md) +* [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) +* [Model Downloader](../../../tools/downloader/README.md) diff --git a/demos/image_translation_demo/python/image_translation_demo.py b/demos/image_translation_demo/python/image_translation_demo.py new file mode 100644 index 00000000000..58e586c87a3 --- /dev/null +++ b/demos/image_translation_demo/python/image_translation_demo.py @@ -0,0 +1,151 @@ +""" + Copyright (C) 2020 Intel Corporation + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + +import logging as log +import sys +import os +from argparse import ArgumentParser, SUPPRESS + +import cv2 +import numpy as np +from openvino.inference_engine import IECore + +from image_translation_demo.models import CocosnetModel, SegmentationModel +from image_translation_demo.preprocessing import ( + preprocess_for_seg_model, preprocess_image, preprocess_semantics, +) +from image_translation_demo.postprocessing import postprocess, save_result + + +def build_argparser(): + parser = ArgumentParser(add_help=False) + args = parser.add_argument_group('Options') + args.add_argument('-h', '--help', action='help', default=SUPPRESS, + help='Show this help message and exit.') + args.add_argument("-m_trn", "--translation_model", + help="Required. Path to an .xml file with a trained translation model", + required=True, type=str) + args.add_argument("-m_seg", "--segmentation_model", + help="Optional. Path to an .xml file with a trained semantic segmentation model", + type=str) + args.add_argument("-ii", "--input_images", + help="Optional. Path to a folder with input images or path to a input image", + type=str) + args.add_argument("-is", "--input_semantics", + help="Optional. Path to a folder with semantic images or path to a semantic image", + type=str) + args.add_argument("-ri", "--reference_images", + help="Required. Path to a folder with reference images or path to a reference image", + required=True, type=str) + args.add_argument("-rs", "--reference_semantics", + help="Optional. Path to a folder with reference semantics or path to a reference semantic", + type=str) + args.add_argument("-o", "--output_dir", help="Required. Path to a folder where output files will be saved", + required=True, type=str) + args.add_argument("-d", "--device", + help="Optional. Specify the target device to infer on; CPU, GPU, FPGA, HDDL or MYRIAD is " + "acceptable. Default value is CPU", + default="CPU", type=str) + return parser + + +def get_files(path): + if path is None: + return [] + if os.path.isdir(path): + file_paths = [os.path.join(path, file) for file in os.listdir(path) if os.path.isfile(os.path.join(path, file))] + return sorted(file_paths) + return [path] + + +def get_mask_from_image(image, model): + image = preprocess_for_seg_model(image, input_size=model.input_size) + res = model.infer(image) + mask = np.argmax(res, axis=1) + mask = np.squeeze(mask, 0) + return mask + 1 + + +def main(): + log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout) + args = build_argparser().parse_args() + + log.info("Creating CoCosNet Model") + ie_core = IECore() + + gan_model = CocosnetModel(ie_core, args.translation_model, + args.translation_model.replace(".xml", ".bin"), + args.device) + seg_model = SegmentationModel(ie_core, args.segmentation_model, + args.segmentation_model.replace(".xml", ".bin"), + args.device) if args.segmentation_model else None + + log.info("Preparing input data") + input_data = [] + use_seg = bool(args.input_images) and bool(args.segmentation_model) + assert use_seg ^ (bool(args.input_semantics) and bool(args.reference_semantics)), "Don't know where to get data" + input_images = get_files(args.input_images) + input_semantics = get_files(args.input_semantics) + reference_images = get_files(args.reference_images) + reference_semantics = get_files(args.reference_semantics) + number_of_objects = len(reference_images) + + if use_seg: + samples = [input_images, number_of_objects * [''], reference_images, number_of_objects * ['']] + else: + samples = [number_of_objects * [''], input_semantics, reference_images, reference_semantics] + for input_img, input_sem, ref_img, ref_sem in zip(*samples): + if use_seg: + in_img = cv2.imread(input_img) + if in_img is None: + raise IOError('Image {} cannot be read'.format(input_img)) + input_sem = get_mask_from_image(in_img, seg_model) + r_img = cv2.imread(ref_img) + if r_img is None: + raise IOError('Image {} cannot be read'.format(ref_img)) + ref_sem = get_mask_from_image(r_img, seg_model) + else: + input_sem_file = input_sem + input_sem = cv2.imread(input_sem_file, cv2.IMREAD_GRAYSCALE) + if input_sem is None: + raise IOError('Image {} cannot be read'.format(input_sem_file)) + ref_sem_file = ref_sem + ref_sem = cv2.imread(ref_sem, cv2.IMREAD_GRAYSCALE) + if ref_sem is None: + raise IOError('Image {} cannot be read'.format(ref_sem_file)) + input_sem = preprocess_semantics(input_sem, input_size=gan_model.input_semantic_size) + ref_img_file = ref_img + ref_img = cv2.imread(ref_img_file) + if ref_img is None: + raise IOError('Image {} cannot be read'.format(ref_img_file)) + ref_img = preprocess_image(ref_img, input_size=gan_model.input_image_size) + ref_sem = preprocess_semantics(ref_sem, input_size=gan_model.input_semantic_size) + input_dict = { + 'input_semantics': input_sem, + 'reference_image': ref_img, + 'reference_semantics': ref_sem + } + input_data.append(input_dict) + + log.info("Inference for input") + outs = [gan_model.infer(**data) for data in input_data] + + log.info("Postprocessing for result") + results = [postprocess(out) for out in outs] + + save_result(results, args.output_dir) + log.info("Result image was saved to {}".format(args.output_dir)) + + +if __name__ == '__main__': + sys.exit(main() or 0) diff --git a/demos/python_demos/multi_camera_multi_target_tracking/utils/__init__.py b/demos/image_translation_demo/python/image_translation_demo/__init__.py similarity index 100% rename from demos/python_demos/multi_camera_multi_target_tracking/utils/__init__.py rename to demos/image_translation_demo/python/image_translation_demo/__init__.py diff --git a/demos/image_translation_demo/python/image_translation_demo/models.py b/demos/image_translation_demo/python/image_translation_demo/models.py new file mode 100644 index 00000000000..766dfcce291 --- /dev/null +++ b/demos/image_translation_demo/python/image_translation_demo/models.py @@ -0,0 +1,55 @@ +""" + Copyright (C) 2020 Intel Corporation + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + +class CocosnetModel: + def __init__(self, ie_core, model_xml, model_bin, device='CPU'): + print("Reading IR for CoCosNet model ....") + self.network = ie_core.read_network(model_xml, model_bin) + assert len(self.network.input_info) == 3, "Three inputs are expected" + assert len(self.network.outputs) == 1, "One output is expected" + self.inputs = list(self.network.input_info.keys()) + self.output_name = next(iter(self.network.outputs.keys())) + self.input_semantics, self.reference_image, self.reference_semantics = self.inputs + + print("Loading CoCosNet IR to the plugin...") + self.exec_net = ie_core.load_network(network=self.network, device_name=device) + self.input_semantic_size = self.network.input_info[self.input_semantics].input_data.shape + self.input_image_size = self.network.input_info[self.reference_image].input_data.shape + + def infer(self, input_semantics, reference_image, reference_semantics): + input_data = { + self.input_semantics: input_semantics, + self.reference_image: reference_image, + self.reference_semantics: reference_semantics + } + result = self.exec_net.infer(input_data) + return result[self.output_name] + + +class SegmentationModel: + def __init__(self, ie_core, model_xml, model_bin, device='CPU'): + print("Reading IR for segmentation model ....") + self.network = ie_core.read_network(model_xml, model_bin) + assert len(self.network.input_info) == 1, "One input is expected" + assert len(self.network.outputs) == 1, "One output is expected" + self.input_name = next(iter(self.network.input_info)) + self.output_name = next(iter(self.network.outputs)) + + print("Loading IR to the plugin...") + self.exec_net = ie_core.load_network(network=self.network, device_name=device) + self.input_size = self.network.input_info[self.input_name].input_data.shape + + def infer(self, input): + input_data = {self.input_name: input} + result = self.exec_net.infer(input_data) + return result[self.output_name] diff --git a/demos/image_translation_demo/python/image_translation_demo/postprocessing.py b/demos/image_translation_demo/python/image_translation_demo/postprocessing.py new file mode 100644 index 00000000000..b1cb09daf8c --- /dev/null +++ b/demos/image_translation_demo/python/image_translation_demo/postprocessing.py @@ -0,0 +1,30 @@ +""" + Copyright (C) 2020 Intel Corporation + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + +import numpy as np +import cv2 +import os + + +def postprocess(out): + out = np.squeeze(out) + out = np.transpose(out, (1, 2, 0)) + result = np.uint8(127.5 * out + 127.5) + result = cv2.cvtColor(result, cv2.COLOR_RGB2BGR) + return result + + +def save_result(results, out_path): + os.makedirs(out_path, exist_ok=True) + for index, result in enumerate(results): + cv2.imwrite(os.path.join(out_path, "out_{}.jpg".format(index)), result) diff --git a/demos/image_translation_demo/python/image_translation_demo/preprocessing.py b/demos/image_translation_demo/python/image_translation_demo/preprocessing.py new file mode 100644 index 00000000000..411ff3df1f6 --- /dev/null +++ b/demos/image_translation_demo/python/image_translation_demo/preprocessing.py @@ -0,0 +1,49 @@ +""" + Copyright (C) 2020 Intel Corporation + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + +import numpy as np +import cv2 + + +def scatter(source, classes, axis=1, base=0, value=1): + shape = [1, 1, *source.shape] + shape[axis] = classes + label_map = np.full(shape, base, np.int) + ndim = len(shape) + expanded_index = [] + for i in range(ndim): + arr = (source if axis == i + else np.arange(shape[i]).reshape([shape[i] if i == j else 1 for j in range(ndim)])) + expanded_index.append(arr) + label_map[tuple(expanded_index)] = value + return label_map + + +def preprocess_semantics(semantic_mask, input_size): + semantic_mask = cv2.resize(semantic_mask, dsize=tuple(input_size[2:]), + interpolation=cv2.INTER_NEAREST) + # create one-hot label map + semantic_mask = scatter(semantic_mask, classes=input_size[1]) + return semantic_mask + + +def preprocess_for_seg_model(image, input_size): + image = cv2.resize(image, dsize=tuple(input_size[2:]), interpolation=cv2.INTER_LINEAR) + image = np.transpose(image, (2, 0, 1)) + return image + + +def preprocess_image(image, input_size): + image = cv2.resize(image, dsize=tuple(input_size[2:]), interpolation=cv2.INTER_CUBIC) + image = np.transpose(image, (2, 0, 1)) + return image diff --git a/demos/object_detection_demo_yolov3_async/models.lst b/demos/image_translation_demo/python/models.lst similarity index 67% rename from demos/object_detection_demo_yolov3_async/models.lst rename to demos/image_translation_demo/python/models.lst index 2a5ff0a08dc..41ad2b7d35b 100644 --- a/demos/object_detection_demo_yolov3_async/models.lst +++ b/demos/image_translation_demo/python/models.lst @@ -1,3 +1,3 @@ # This file can be used with the --list option of the model downloader. -yolo-v3-tf -yolo-v3-tiny-tf +cocosnet +hrnet-v2-c1-segmentation diff --git a/demos/python_demos/instance_segmentation_demo/README.md b/demos/instance_segmentation_demo/python/README.md similarity index 83% rename from demos/python_demos/instance_segmentation_demo/README.md rename to demos/instance_segmentation_demo/python/README.md index cd04a90d913..2d646cc0290 100644 --- a/demos/python_demos/instance_segmentation_demo/README.md +++ b/demos/instance_segmentation_demo/python/README.md @@ -1,4 +1,6 @@ -# Instance Segmentation Python* Demo +# Instance Segmentation Python\* Demo + +![](./instance_segmentation.gif) This demo shows how to run Instance Segmentation models from [OpenVINO™ Training Extensions (OTE)](https://github.com/openvinotoolkit/training_extensions/tree/develop/pytorch_toolkit/instance_segmentation#get-pretrained-models) and `yolact` models family. @@ -41,21 +43,28 @@ The demo workflow is the following: Run the application with the `-h` option to see the following usage message: ``` -usage: instance_segmentation_demo.py [-h] -m "" --labels "" -i - "" [-d ""] - [-l ""] [--delay ""] - [-pt ""] [--no_keep_aspect_ratio] - [--no_track] [--show_scores] - [--show_boxes] [-pc] [-r] [--no_show] - [-u UTILIZATION_MONITORS] +usage: instance_segmentation_demo.py [-h] -m "" --labels "" -i INPUT + [--loop] [-o OUTPUT] [-limit OUTPUT_LIMIT] + [-d ""] [-l ""] + [--delay ""] [-pt ""] + [--no_keep_aspect_ratio] [--no_track] + [--show_scores] [--show_boxes] [-pc] [-r] + [--no_show] [-u UTILIZATION_MONITORS] Options: -h, --help Show this help message and exit. -m "", --model "" Required. Path to an .xml file with a trained model. --labels "" Required. Path to a text file with class labels. - -i "" Required. Path to an image, video file or a numeric - camera ID. + -i INPUT, --input INPUT + Required. An input to process. The input must be a single image, + a folder of images, video file or camera id. + --loop Optional. Enable reading the input in a loop. + -o OUTPUT, --output OUTPUT + Optional. Name of output to save. + -limit OUTPUT_LIMIT, --output_limit OUTPUT_LIMIT + Optional. Number of frames to store in output. + If -1 is set, all frames are stored. -d "", --device "" Optional. Specify the target device to infer on: CPU, GPU, FPGA, HDDL or MYRIAD. The demo will look for a @@ -84,7 +93,7 @@ Options: Running the application with an empty list of options yields the short version of the usage message and an error message. -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). +To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (`*.xml` + `*.bin`) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). @@ -92,7 +101,7 @@ To run the demo, please provide paths to the model in the IR format, to a file w ```bash python3 instance_segmentation_demo/instance_segmentation_demo.py \ -m /instance-segmentation-security-0050.xml \ - --label instance_segmentation_demo/coco_labels.txt \ + --label /data/dataset_classes/coco.txt \ --no_keep_aspect_ratio \ -i 0 \ --delay 1 diff --git a/demos/instance_segmentation_demo/python/instance_segmentation.gif b/demos/instance_segmentation_demo/python/instance_segmentation.gif new file mode 100644 index 00000000000..0742c955624 Binary files /dev/null and b/demos/instance_segmentation_demo/python/instance_segmentation.gif differ diff --git a/demos/python_demos/instance_segmentation_demo/instance_segmentation_demo.py b/demos/instance_segmentation_demo/python/instance_segmentation_demo.py similarity index 80% rename from demos/python_demos/instance_segmentation_demo/instance_segmentation_demo.py rename to demos/instance_segmentation_demo/python/instance_segmentation_demo.py index 155a7342860..884b6fc4fd9 100755 --- a/demos/python_demos/instance_segmentation_demo/instance_segmentation_demo.py +++ b/demos/instance_segmentation_demo/python/instance_segmentation_demo.py @@ -16,10 +16,10 @@ """ import logging as log -import os import sys import time from argparse import ArgumentParser, SUPPRESS +from pathlib import Path import cv2 import numpy as np @@ -29,8 +29,9 @@ from instance_segmentation_demo.tracker import StaticIOUTracker from instance_segmentation_demo.visualizer import Visualizer -sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'common')) +sys.path.append(str(Path(__file__).resolve().parents[2] / 'common/python')) import monitors +from images_capture import open_images_capture def build_argparser(): @@ -40,14 +41,20 @@ def build_argparser(): help='Show this help message and exit.') args.add_argument('-m', '--model', help='Required. Path to an .xml file with a trained model.', - required=True, type=str, metavar='""') + required=True, type=Path, metavar='""') args.add_argument('--labels', help='Required. Path to a text file with class labels.', required=True, type=str, metavar='""') - args.add_argument('-i', - dest='input_source', - help='Required. Path to an image, video file or a numeric camera ID.', - required=True, type=str, metavar='""') + args.add_argument('-i', '--input', required=True, + help='Required. An input to process. The input must be a single image, ' + 'a folder of images, video file or camera id.') + args.add_argument('--loop', default=False, action='store_true', + help='Optional. Enable reading the input in a loop.') + args.add_argument('-o', '--output', required=False, + help='Optional. Name of output to save.') + args.add_argument('-limit', '--output_limit', required=False, default=1000, type=int, + help='Optional. Number of frames to store in output. ' + 'If -1 is set, all frames are stored.') args.add_argument('-d', '--device', help='Optional. Specify the target device to infer on: CPU, GPU, FPGA, HDDL or MYRIAD. ' 'The demo will look for a suitable plugin for device specified ' @@ -82,7 +89,7 @@ def build_argparser(): help='Optional. Output inference results raw values.', action='store_true') args.add_argument("--no_show", - help="Optional. Don't show output", + help="Optional. Don't show output.", action='store_true') args.add_argument('-u', '--utilization_monitors', default='', type=str, help='Optional. List of monitors to show initially.') @@ -100,20 +107,16 @@ def main(): ie.add_extension(args.cpu_extension, 'CPU') # Read IR log.info('Loading network') - net = ie.read_network(args.model, os.path.splitext(args.model)[0] + '.bin') + net = ie.read_network(args.model, args.model.with_suffix('.bin')) image_input, image_info_input, (n, c, h, w), postprocessor = check_model(net) log.info('Loading IR to the plugin...') exec_net = ie.load_network(network=net, device_name=args.device, num_requests=2) - try: - input_source = int(args.input_source) - except ValueError: - input_source = args.input_source - cap = cv2.VideoCapture(input_source) - if not cap.isOpened(): - log.error('Failed to open "{}"'.format(args.input_source)) - cap.set(cv2.CAP_PROP_BUFFERSIZE, 1) + cap = open_images_capture(args.input, args.loop) + frame = cap.read() + if frame is None: + raise RuntimeError("Can't read an image from the input") if args.no_track: tracker = None @@ -123,19 +126,29 @@ def main(): with open(args.labels, 'rt') as labels_file: class_labels = labels_file.read().splitlines() + if args.delay: + delay = args.delay + else: + delay = int(cap.get_type() in ('VIDEO', 'CAMERA')) + + frames_processed = 0 + out_frame_size = (frame.shape[1], frame.shape[0]) presenter = monitors.Presenter(args.utilization_monitors, 45, - (round(cap.get(cv2.CAP_PROP_FRAME_WIDTH) / 4), round(cap.get(cv2.CAP_PROP_FRAME_HEIGHT) / 8))) + (round(out_frame_size[0] / 4), round(out_frame_size[1] / 8))) visualizer = Visualizer(class_labels, show_boxes=args.show_boxes, show_scores=args.show_scores) + video_writer = cv2.VideoWriter() + if args.output: + video_writer = cv2.VideoWriter(args.output, cv2.VideoWriter_fourcc(*'MJPG'), cap.fps(), + out_frame_size) + if not video_writer.isOpened(): + raise RuntimeError("Can't open video writer") render_time = 0 log.info('Starting inference...') print("To close the application, press 'CTRL+C' here or switch to the output window and press ESC key") - while cap.isOpened(): - ret, frame = cap.read() - if not ret: - break + while frame is not None: if args.no_keep_aspect_ratio: # Resize the image to a target size. scale_x = w / frame.shape[1] @@ -167,7 +180,7 @@ def main(): # Parse detection results of the current request scores, classes, boxes, masks = postprocessor( - outputs, scale_x, scale_y, *frame.shape[:2], h, w, args.prob_threshold) + outputs, scale_x, scale_y, *frame.shape[:2], h, w, args.prob_threshold) render_start = time.time() @@ -200,6 +213,9 @@ def main(): for layer, stats in perf_counts.items(): print('{:<70} {:<15} {:<15} {:<15} {:<10}'.format(layer, stats['layer_type'], stats['exec_type'], stats['status'], stats['real_time'])) + frames_processed += 1 + if video_writer.isOpened() and (args.output_limit == -1 or frames_processed <= args.output_limit): + video_writer.write(frame) if not args.no_show: # Show resulting image. @@ -208,15 +224,15 @@ def main(): render_time = render_end - render_start if not args.no_show: - key = cv2.waitKey(args.delay) + key = cv2.waitKey(delay) esc_code = 27 if key == esc_code: break presenter.handleKey(key) + frame = cap.read() print(presenter.reportMeans()) cv2.destroyAllWindows() - cap.release() if __name__ == '__main__': diff --git a/demos/python_demos/speech_recognition_demo/utils/__init__.py b/demos/instance_segmentation_demo/python/instance_segmentation_demo/__init__.py similarity index 100% rename from demos/python_demos/speech_recognition_demo/utils/__init__.py rename to demos/instance_segmentation_demo/python/instance_segmentation_demo/__init__.py diff --git a/demos/python_demos/instance_segmentation_demo/instance_segmentation_demo/model_utils.py b/demos/instance_segmentation_demo/python/instance_segmentation_demo/model_utils.py similarity index 97% rename from demos/python_demos/instance_segmentation_demo/instance_segmentation_demo/model_utils.py rename to demos/instance_segmentation_demo/python/instance_segmentation_demo/model_utils.py index 21bc9ee7351..80c5f050a00 100644 --- a/demos/python_demos/instance_segmentation_demo/instance_segmentation_demo/model_utils.py +++ b/demos/instance_segmentation_demo/python/instance_segmentation_demo/model_utils.py @@ -162,7 +162,7 @@ def nms(x1, y1, x2, y2, scores, thresh, include_boundaries=True, keep_top_k=None def sanitize_coordinates(_x1, _x2, img_size, shift=0, padding=0): - _x1 = (_x1 + shift / 2) * img_size + _x1 = (_x1 + shift / 2) * img_size _x2 = (_x2 + shift / 2) * img_size x1 = np.clip(_x1 - padding, 0, img_size) x2 = np.clip(_x2 + padding, 0, img_size) @@ -238,7 +238,7 @@ def crop_mask(masks, boxes, padding: int = 1): def check_model(net): num_inputs = len(net.input_info) - assert num_inputs <= 2,'Demo supports only topologies with 1 or 2 inputs.' + assert num_inputs <= 2, 'Demo supports only topologies with 1 or 2 inputs.' image_input = [input_name for input_name, in_info in net.input_info.items() if len(in_info.input_data.shape) == 4] assert len(image_input) == 1, 'Demo supports only model with single input for images' image_input = image_input[0] @@ -252,11 +252,9 @@ def check_model(net): image_info_input = image_info_input[0] model_type = 'mask_rcnn' if image_info_input else 'yolact' model_attributes = MODEL_ATTRIBUTES[model_type] - assert ( - set(model_attributes.required_outputs).issubset(net.outputs.keys()), - 'Demo supports only topologies with the following output keys: ' - '{}'.format(', '.join(model_attributes.required_outputs)) - ) + assert set(model_attributes.required_outputs) <= net.outputs.keys(), \ + 'Demo supports only topologies with the following output keys: {}'.format( + ', '.join(model_attributes.required_outputs)) input_shape = net.input_info[image_input].input_data.shape assert input_shape[0] == 1, 'Only batch 1 is supported by the demo application' diff --git a/demos/python_demos/instance_segmentation_demo/instance_segmentation_demo/tracker.py b/demos/instance_segmentation_demo/python/instance_segmentation_demo/tracker.py similarity index 100% rename from demos/python_demos/instance_segmentation_demo/instance_segmentation_demo/tracker.py rename to demos/instance_segmentation_demo/python/instance_segmentation_demo/tracker.py diff --git a/demos/python_demos/instance_segmentation_demo/instance_segmentation_demo/visualizer.py b/demos/instance_segmentation_demo/python/instance_segmentation_demo/visualizer.py similarity index 100% rename from demos/python_demos/instance_segmentation_demo/instance_segmentation_demo/visualizer.py rename to demos/instance_segmentation_demo/python/instance_segmentation_demo/visualizer.py diff --git a/demos/python_demos/instance_segmentation_demo/models.lst b/demos/instance_segmentation_demo/python/models.lst similarity index 100% rename from demos/python_demos/instance_segmentation_demo/models.lst rename to demos/instance_segmentation_demo/python/models.lst diff --git a/demos/interactive_face_detection_demo/CMakeLists.txt b/demos/interactive_face_detection_demo/cpp/CMakeLists.txt similarity index 76% rename from demos/interactive_face_detection_demo/CMakeLists.txt rename to demos/interactive_face_detection_demo/cpp/CMakeLists.txt index 085fa7b17e2..da3e91b3327 100644 --- a/demos/interactive_face_detection_demo/CMakeLists.txt +++ b/demos/interactive_face_detection_demo/cpp/CMakeLists.txt @@ -2,8 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 # -file (GLOB MAIN_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) -file (GLOB MAIN_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.h*) +file(GLOB MAIN_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +file(GLOB MAIN_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.h*) ie_add_sample(NAME interactive_face_detection_demo SOURCES ${MAIN_SRC} diff --git a/demos/interactive_face_detection_demo/README.md b/demos/interactive_face_detection_demo/cpp/README.md similarity index 83% rename from demos/interactive_face_detection_demo/README.md rename to demos/interactive_face_detection_demo/cpp/README.md index dad1c1b4604..f1dc33860d5 100644 --- a/demos/interactive_face_detection_demo/README.md +++ b/demos/interactive_face_detection_demo/cpp/README.md @@ -1,22 +1,25 @@ # Interactive Face Detection C++ Demo +![](../interactive_face_detection.gif) + This demo showcases Object Detection task applied for face recognition using sequence of neural networks. Async API can improve overall frame-rate of the application, because rather than wait for inference to complete, the application can continue operating on the host while accelerator is busy. -This demo executes four parallel infer requests for the Age/Gender Recognition, Head Pose Estimation, Emotions Recognition, and Facial Landmarks Detection networks that run simultaneously. You can use a set of the following pre-trained models with the demo: +This demo executes five parallel infer requests for the Age/Gender Recognition, Head Pose Estimation, Emotions Recognition, Facial Landmarks Detection and Antispoofing Classifier networks that run simultaneously. You can use a set of the following pre-trained models with the demo: * `face-detection-adas-0001`, which is a primary detection network for finding faces * `age-gender-recognition-retail-0013`, which is executed on top of the results of the first model and reports estimated age and gender for each detected face * `head-pose-estimation-adas-0001`, which is executed on top of the results of the first model and reports estimated head pose in Tait-Bryan angles * `emotions-recognition-retail-0003`, which is executed on top of the results of the first model and reports an emotion for each detected face * `facial-landmarks-35-adas-0002`, which is executed on top of the results of the first model and reports normed coordinates of estimated facial landmarks +* `anti-spoof-mn3`, which is executed on top of the results of the first model and reports estimated probability whether spoof or real face is shown -For more information about the pre-trained models, refer to the [model documentation](../../models/intel/index.md). +For more information about the pre-trained models, refer to the [model documentation](../../../models/intel/index.md). Other demo objectives are: * Video as input support via OpenCV\* * Visualization of the resulting face bounding boxes from Face Detection network -* Visualization of age/gender, head pose, emotion information, and facial landmarks positions for each detected face +* Visualization of age/gender, spoof/real, head pose, emotion information, and facial landmarks positions for each detected face OpenCV is used to draw resulting bounding boxes, labels, and other information. You can copy and paste this code without pulling Inference Engine demo helpers into your application. @@ -26,12 +29,12 @@ OpenCV is used to draw resulting bounding boxes, labels, and other information. Engine. 2. The application gets a frame from the OpenCV VideoCapture. 3. The application performs inference on the Face Detection network. -4. The application performs four simultaneous inferences, using the Age/Gender, Head Pose, Emotions, and Facial Landmarks detection networks if they are specified in the command line. +4. The application performs up to five simultaneous inferences, using the Age/Gender, Head Pose, Emotions, Facial Landmarks and Anti-spoof detection networks if they are specified in the command line. 5. The application displays the results. > **NOTE**: By default, Open Model Zoo demos expect input with BGR channels order. If you trained your model to work with RGB order, you need to manually rearrange the default channels order in the demo application or reconvert your model using the Model Optimizer tool with `--reverse_input_channels` argument specified. For more information about the argument, refer to **When to Reverse Input Channels** section of [Converting a Model Using General Conversion Parameters](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_convert_model_Converting_Model_General.html). -The new Async API operates with a new notion of the Infer Request that encapsulates the inputs/outputs and separates scheduling and waiting for result. For more information about Async API and the difference between Sync and Async modes performance, refer to **How it Works** and **Async API** sections in [Object Detection SSD, Async API Performance Showcase Demo](../object_detection_demo_ssd_async/README.md). +The new Async API operates with a new notion of the Infer Request that encapsulates the inputs/outputs and separates scheduling and waiting for result. ## Running @@ -54,6 +57,7 @@ Options: -m_hp "" Optional. Path to an .xml file with a trained Head Pose Estimation model. -m_em "" Optional. Path to an .xml file with a trained Emotions Recognition model. -m_lm "" Optional. Path to an .xml file with a trained Facial Landmarks Estimation model. + -m_am "" Optional. Path to an .xml file with a trained Antispoofing Classification model. -l "" Required for CPU custom layers. Absolute path to a shared library with the kernels implementation. Or -c "" Required for GPU custom kernels. Absolute path to an .xml file with the kernels description. @@ -62,14 +66,17 @@ Options: -d_hp "" Optional. Target device for Head Pose Estimation network (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. -d_em "" Optional. Target device for Emotions Recognition network (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. -d_lm "" Optional. Target device for Facial Landmarks Estimation network (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. + -d_am "" Optional. Target device for Antispoofing Classification network (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. -n_ag "" Optional. Number of maximum simultaneously processed faces for Age/Gender Recognition network (by default, it is 16) -n_hp "" Optional. Number of maximum simultaneously processed faces for Head Pose Estimation network (by default, it is 16) -n_em "" Optional. Number of maximum simultaneously processed faces for Emotions Recognition network (by default, it is 16) -n_lm "" Optional. Number of maximum simultaneously processed faces for Facial Landmarks Estimation network (by default, it is 16) + -n_am "" Optional. Number of maximum simultaneously processed faces for Antispoofing Classification network (by default, it is 16) -dyn_ag Optional. Enable dynamic batch size for Age/Gender Recognition network -dyn_hp Optional. Enable dynamic batch size for Head Pose Estimation network -dyn_em Optional. Enable dynamic batch size for Emotions Recognition network -dyn_lm Optional. Enable dynamic batch size for Facial Landmarks Estimation network + -dyn_am Optional. Enable dynamic batch size for Antispoofing Classification network" -async Optional. Enable asynchronous mode -no_show Optional. Do not show processed video. -pc Optional. Enable per-layer performance report @@ -86,14 +93,14 @@ Options: Running the application with an empty list of options yields the usage message given above and an error message. -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). +To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). For example, to do inference on a GPU with the OpenVINO™ toolkit pre-trained models, run the following command: ```sh -./interactive_face_detection_demo -i /.mp4 -m /face-detection-adas-0001.xml -m_ag /age-gender-recognition-retail-0013.xml -m_hp /head-pose-estimation-adas-0001.xml -m_em /emotions-recognition-retail-0003.xml -m_lm /facial-landmarks-35-adas-0002.xml -d GPU +./interactive_face_detection_demo -i /.mp4 -m /face-detection-adas-0001.xml -m_ag /age-gender-recognition-retail-0013.xml -m_hp /head-pose-estimation-adas-0001.xml -m_em /emotions-recognition-retail-0003.xml -m_lm /facial-landmarks-35-adas-0002.xml -m_am /anti-spoof-mn3.xml -d GPU ``` ## Demo Output @@ -107,9 +114,10 @@ The demo reports total image throughput which includes frame decoding time, infe >* `face-detection-adas-0001` >* `facial-landmarks-35-adas-0002` >* `head-pose-estimation-adas-0001` +>* `anti-spoof-mn3` > Other models may produce unexpected results on these devices. ## See Also -* [Using Open Model Zoo demos](../README.md) +* [Using Open Model Zoo demos](../../README.md) * [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) -* [Model Downloader](../../tools/downloader/README.md) +* [Model Downloader](../../../tools/downloader/README.md) diff --git a/demos/interactive_face_detection_demo/detectors.cpp b/demos/interactive_face_detection_demo/cpp/detectors.cpp similarity index 90% rename from demos/interactive_face_detection_demo/detectors.cpp rename to demos/interactive_face_detection_demo/cpp/detectors.cpp index a24f31a9428..32222332595 100644 --- a/demos/interactive_face_detection_demo/detectors.cpp +++ b/demos/interactive_face_detection_demo/cpp/detectors.cpp @@ -19,8 +19,8 @@ #include #include -#include -#include +#include +#include #include "detectors.hpp" @@ -285,6 +285,90 @@ void FaceDetection::fetchResults() { } } +AntispoofingClassifier::AntispoofingClassifier(const std::string& pathToModel, + const std::string& deviceForInference, + int maxBatch, bool isBatchDynamic, bool isAsync, bool doRawOutputMessages) + : BaseDetection("Antispoofing", pathToModel, deviceForInference, maxBatch, isBatchDynamic, isAsync, doRawOutputMessages), + enquedFaces(0) { +} + +void AntispoofingClassifier::submitRequest() { + if (!enquedFaces) + return; + if (isBatchDynamic) { + request->SetBatch(enquedFaces); + } + BaseDetection::submitRequest(); + enquedFaces = 0; +} + +void AntispoofingClassifier::enqueue(const cv::Mat& face) { + if (!enabled()) { + return; + } + if (enquedFaces == maxBatch) { + slog::warn << "Number of detected faces more than maximum(" << maxBatch << ") processed by Antispoofing Classifier network" << slog::endl; + return; + } + if (!request) { + request = net.CreateInferRequestPtr(); + } + + Blob::Ptr inputBlob = request->GetBlob(input); + + matU8ToBlob(face, inputBlob, enquedFaces); + + enquedFaces++; +} + +float AntispoofingClassifier::operator[] (int idx) const { + Blob::Ptr ProbBlob = request->GetBlob(prob_output); + LockedMemory ProbBlobMapped = as(ProbBlob)->rmap(); + // use prediction for real face only + float r = ProbBlobMapped.as()[2 * idx] * 100; + if (doRawOutputMessages) { + std::cout << "[" << idx << "] element, real face probability = " << r << std::endl; + } + + return r; +} + +CNNNetwork AntispoofingClassifier::read(const InferenceEngine::Core& ie) { + slog::info << "Loading network files for Antispoofing Classifier network" << slog::endl; + // Read network + auto network = ie.ReadNetwork(pathToModel); + // Set maximum batch size to be used. + network.setBatchSize(maxBatch); + slog::info << "Batch size is set to " << network.getBatchSize() << " for Antispoofing Classifier network" << slog::endl; + + // ---------------------------Check inputs ------------------------------------------------------------- + // Antispoofing Classifier network should have one input and one output + slog::info << "Checking Antispoofing Classifier network inputs" << slog::endl; + InputsDataMap inputInfo(network.getInputsInfo()); + if (inputInfo.size() != 1) { + throw std::logic_error("Antispoofing Classifier network should have only one input"); + } + InputInfo::Ptr& inputInfoFirst = inputInfo.begin()->second; + inputInfoFirst->setPrecision(Precision::U8); + input = inputInfo.begin()->first; + // ----------------------------------------------------------------------------------------------------- + + // ---------------------------Check outputs ------------------------------------------------------------ + slog::info << "Checking Antispoofing Classifier network outputs" << slog::endl; + OutputsDataMap outputInfo(network.getOutputsInfo()); + if (outputInfo.size() != 1) { + throw std::logic_error("Antispoofing Classifier network should have one output layers"); + } + auto it = outputInfo.begin(); + + DataPtr ptrProbOutput = (it++)->second; + + prob_output = ptrProbOutput->getName(); + + slog::info << "Loading Antispoofing Classifier model to the " << deviceForInference << " plugin" << slog::endl; + _enabled = true; + return network; +} AgeGenderDetection::AgeGenderDetection(const std::string &pathToModel, const std::string &deviceForInference, diff --git a/demos/interactive_face_detection_demo/detectors.hpp b/demos/interactive_face_detection_demo/cpp/detectors.hpp similarity index 91% rename from demos/interactive_face_detection_demo/detectors.hpp rename to demos/interactive_face_detection_demo/cpp/detectors.hpp index da7364b2f57..ba78322a13e 100644 --- a/demos/interactive_face_detection_demo/detectors.hpp +++ b/demos/interactive_face_detection_demo/cpp/detectors.hpp @@ -20,8 +20,8 @@ #include -#include -#include +#include +#include #include @@ -181,6 +181,23 @@ struct FacialLandmarksDetection : BaseDetection { std::vector operator[] (int idx) const; }; +struct AntispoofingClassifier : BaseDetection { + std::string input; + std::string prob_output; + size_t enquedFaces; + + AntispoofingClassifier(const std::string &pathToModel, + const std::string &deviceForInference, + int maxBatch, bool isBatchDynamic, bool isAsync, + bool doRawOutputMessages); + + InferenceEngine::CNNNetwork read(const InferenceEngine::Core& ie) override; + void submitRequest() override; + + void enqueue(const cv::Mat& frame); + float operator[] (int idx) const; +}; + struct Load { BaseDetection& detector; diff --git a/demos/interactive_face_detection_demo/face.cpp b/demos/interactive_face_detection_demo/cpp/face.cpp similarity index 84% rename from demos/interactive_face_detection_demo/face.cpp rename to demos/interactive_face_detection_demo/cpp/face.cpp index db386e94d6c..3d172daf395 100644 --- a/demos/interactive_face_detection_demo/face.cpp +++ b/demos/interactive_face_detection_demo/cpp/face.cpp @@ -12,8 +12,9 @@ Face::Face(size_t id, cv::Rect& location): _location(location), _intensity_mean(0.f), _id(id), _age(-1), - _maleScore(0), _femaleScore(0), _headPose({0.f, 0.f, 0.f}), - _isAgeGenderEnabled(false), _isEmotionsEnabled(false), _isHeadPoseEnabled(false), _isLandmarksEnabled(false) { + _maleScore(0), _femaleScore(0), _headPose({0.f, 0.f, 0.f}), _realFaceConfidence(0), + _isAgeGenderEnabled(false), _isEmotionsEnabled(false), + _isHeadPoseEnabled(false), _isLandmarksEnabled(false), _isAntispoofingEnabled(false) { } void Face::updateAge(float value) { @@ -49,6 +50,10 @@ void Face::updateLandmarks(std::vector values) { _landmarks = std::move(values); } +void Face::updateRealFaceConfidence(float value) { + _realFaceConfidence = value; +} + int Face::getAge() { return static_cast(std::floor(_age + 0.5f)); } @@ -57,6 +62,10 @@ bool Face::isMale() { return _maleScore > _femaleScore; } +bool Face::isReal() { + return _realFaceConfidence > 50.; +} + std::map Face::getEmotions() { return _emotions; } @@ -93,6 +102,9 @@ void Face::headPoseEnable(bool value) { void Face::landmarksEnable(bool value) { _isLandmarksEnabled = value; } +void Face::antispoofingEnable(bool value) { + _isAntispoofingEnabled = value; +} bool Face::isAgeGenderEnabled() { return _isAgeGenderEnabled; @@ -106,6 +118,9 @@ bool Face::isHeadPoseEnabled() { bool Face::isLandmarksEnabled() { return _isLandmarksEnabled; } +bool Face::isAntispoofingEnabled() { + return _isAntispoofingEnabled; +} float calcIoU(cv::Rect& src, cv::Rect& dst) { cv::Rect i = src & dst; diff --git a/demos/interactive_face_detection_demo/face.hpp b/demos/interactive_face_detection_demo/cpp/face.hpp similarity index 90% rename from demos/interactive_face_detection_demo/face.hpp rename to demos/interactive_face_detection_demo/cpp/face.hpp index 9bc70e37329..d54b7b2adb5 100644 --- a/demos/interactive_face_detection_demo/face.hpp +++ b/demos/interactive_face_detection_demo/cpp/face.hpp @@ -26,9 +26,11 @@ struct Face { void updateEmotions(std::map values); void updateHeadPose(HeadPoseDetection::Results values); void updateLandmarks(std::vector values); + void updateRealFaceConfidence(float value); int getAge(); bool isMale(); + bool isReal(); std::map getEmotions(); std::pair getMainEmotion(); HeadPoseDetection::Results getHeadPose(); @@ -39,11 +41,13 @@ struct Face { void emotionsEnable(bool value); void headPoseEnable(bool value); void landmarksEnable(bool value); + void antispoofingEnable(bool value); bool isAgeGenderEnabled(); bool isEmotionsEnabled(); bool isHeadPoseEnabled(); bool isLandmarksEnabled(); + bool isAntispoofingEnabled(); public: cv::Rect _location; @@ -57,11 +61,13 @@ struct Face { std::map _emotions; HeadPoseDetection::Results _headPose; std::vector _landmarks; + float _realFaceConfidence; bool _isAgeGenderEnabled; bool _isEmotionsEnabled; bool _isHeadPoseEnabled; bool _isLandmarksEnabled; + bool _isAntispoofingEnabled; }; // ----------------------------------- Utils ----------------------------------------------------------------- diff --git a/demos/interactive_face_detection_demo/interactive_face_detection.hpp b/demos/interactive_face_detection_demo/cpp/interactive_face_detection.hpp similarity index 88% rename from demos/interactive_face_detection_demo/interactive_face_detection.hpp rename to demos/interactive_face_detection_demo/cpp/interactive_face_detection.hpp index fc0df38e289..07f6872ab2d 100644 --- a/demos/interactive_face_detection_demo/interactive_face_detection.hpp +++ b/demos/interactive_face_detection_demo/cpp/interactive_face_detection.hpp @@ -10,7 +10,7 @@ #include #include -#include +#include DEFINE_INPUT_FLAGS @@ -21,6 +21,7 @@ static const char age_gender_model_message[] = "Optional. Path to an .xml file w static const char head_pose_model_message[] = "Optional. Path to an .xml file with a trained Head Pose Estimation model."; static const char emotions_model_message[] = "Optional. Path to an .xml file with a trained Emotions Recognition model."; static const char facial_landmarks_model_message[] = "Optional. Path to an .xml file with a trained Facial Landmarks Estimation model."; +static const char antispoofing_model_message[] = "Optional. Path to an .xml file with a trained Antispoofing Classification model."; static const char target_device_message[] = "Optional. Target device for Face Detection network (the list of available devices is shown below). " "Default value is CPU. Use \"-d HETERO:\" format to specify HETERO plugin. " "The demo will look for a suitable plugin for a specified device."; @@ -36,6 +37,9 @@ static const char target_device_message_em[] = "Optional. Target device for Emot static const char target_device_message_lm[] = "Optional. Target device for Facial Landmarks Estimation network " "(the list of available devices is shown below). Default value is CPU. Use \"-d HETERO:\" format to specify HETERO plugin. " "The demo will look for a suitable plugin for a specified device."; +static const char target_device_message_am[] = "Optional. Target device for Antispoofing Classification network (the list of available devices is shown below). " + "Default value is CPU. Use \"-d HETERO:\" format to specify HETERO plugin. " + "The demo will look for a suitable plugin for a specified device."; static const char num_batch_ag_message[] = "Optional. Number of maximum simultaneously processed faces for Age/Gender Recognition network " "(by default, it is 16)"; static const char num_batch_hp_message[] = "Optional. Number of maximum simultaneously processed faces for Head Pose Estimation network " @@ -44,10 +48,13 @@ static const char num_batch_em_message[] = "Optional. Number of maximum simultan "(by default, it is 16)"; static const char num_batch_lm_message[] = "Optional. Number of maximum simultaneously processed faces for Facial Landmarks Estimation network " "(by default, it is 16)"; +static const char num_batch_am_message[] = "Optional. Number of maximum simultaneously processed faces for Antispoofing Classification network " + "(by default, it is 16)"; static const char dyn_batch_ag_message[] = "Optional. Enable dynamic batch size for Age/Gender Recognition network"; static const char dyn_batch_hp_message[] = "Optional. Enable dynamic batch size for Head Pose Estimation network"; static const char dyn_batch_em_message[] = "Optional. Enable dynamic batch size for Emotions Recognition network"; static const char dyn_batch_lm_message[] = "Optional. Enable dynamic batch size for Facial Landmarks Estimation network"; +static const char dyn_batch_am_message[] = "Optional. Enable dynamic batch size for Antispoofing Classification network"; static const char performance_counter_message[] = "Optional. Enable per-layer performance report"; static const char custom_cldnn_message[] = "Required for GPU custom kernels. " "Absolute path to an .xml file with the kernels description."; @@ -72,11 +79,13 @@ DEFINE_string(m_ag, "", age_gender_model_message); DEFINE_string(m_hp, "", head_pose_model_message); DEFINE_string(m_em, "", emotions_model_message); DEFINE_string(m_lm, "", facial_landmarks_model_message); +DEFINE_string(m_am, "", antispoofing_model_message); DEFINE_string(d, "CPU", target_device_message); DEFINE_string(d_ag, "CPU", target_device_message_ag); DEFINE_string(d_hp, "CPU", target_device_message_hp); DEFINE_string(d_em, "CPU", target_device_message_em); DEFINE_string(d_lm, "CPU", target_device_message_lm); +DEFINE_string(d_am, "CPU", target_device_message_am); DEFINE_uint32(n_ag, 16, num_batch_ag_message); DEFINE_bool(dyn_ag, false, dyn_batch_ag_message); DEFINE_uint32(n_hp, 16, num_batch_hp_message); @@ -85,6 +94,8 @@ DEFINE_uint32(n_em, 16, num_batch_em_message); DEFINE_bool(dyn_em, false, dyn_batch_em_message); DEFINE_uint32(n_lm, 16, num_batch_em_message); DEFINE_bool(dyn_lm, false, dyn_batch_em_message); +DEFINE_uint32(n_am, 16, num_batch_am_message); +DEFINE_bool(dyn_am, false, dyn_batch_am_message); DEFINE_bool(pc, false, performance_counter_message); DEFINE_string(c, "", custom_cldnn_message); DEFINE_string(l, "", custom_cpu_library_message); @@ -114,11 +125,12 @@ static void showUsage() { std::cout << " -i " << input_message << std::endl; std::cout << " -loop " << loop_message << std::endl; std::cout << " -o \"\" " << output_video_message << std::endl; - std::cout << " -m \"\" " << face_detection_model_message<< std::endl; + std::cout << " -m \"\" " << face_detection_model_message << std::endl; std::cout << " -m_ag \"\" " << age_gender_model_message << std::endl; std::cout << " -m_hp \"\" " << head_pose_model_message << std::endl; std::cout << " -m_em \"\" " << emotions_model_message << std::endl; std::cout << " -m_lm \"\" " << facial_landmarks_model_message << std::endl; + std::cout << " -m_am \"\" " << antispoofing_model_message << std::endl; std::cout << " -l \"\" " << custom_cpu_library_message << std::endl; std::cout << " Or" << std::endl; std::cout << " -c \"\" " << custom_cldnn_message << std::endl; @@ -127,14 +139,17 @@ static void showUsage() { std::cout << " -d_hp \"\" " << target_device_message_hp << std::endl; std::cout << " -d_em \"\" " << target_device_message_em << std::endl; std::cout << " -d_lm \"\" " << target_device_message_lm << std::endl; + std::cout << " -d_am \"\" " << target_device_message_am << std::endl; std::cout << " -n_ag \"\" " << num_batch_ag_message << std::endl; std::cout << " -n_hp \"\" " << num_batch_hp_message << std::endl; std::cout << " -n_em \"\" " << num_batch_em_message << std::endl; std::cout << " -n_lm \"\" " << num_batch_lm_message << std::endl; + std::cout << " -n_am \"\" " << num_batch_am_message << std::endl; std::cout << " -dyn_ag " << dyn_batch_ag_message << std::endl; std::cout << " -dyn_hp " << dyn_batch_hp_message << std::endl; std::cout << " -dyn_em " << dyn_batch_em_message << std::endl; std::cout << " -dyn_lm " << dyn_batch_lm_message << std::endl; + std::cout << " -dyn_am " << dyn_batch_am_message << std::endl; std::cout << " -async " << async_message << std::endl; std::cout << " -no_show " << no_show_processed_video << std::endl; std::cout << " -pc " << performance_counter_message << std::endl; diff --git a/demos/interactive_face_detection_demo/main.cpp b/demos/interactive_face_detection_demo/cpp/main.cpp similarity index 92% rename from demos/interactive_face_detection_demo/main.cpp rename to demos/interactive_face_detection_demo/cpp/main.cpp index fd6be35b866..f27849aac60 100644 --- a/demos/interactive_face_detection_demo/main.cpp +++ b/demos/interactive_face_detection_demo/cpp/main.cpp @@ -25,9 +25,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "interactive_face_detection.hpp" #include "detectors.hpp" @@ -84,7 +84,8 @@ int main(int argc, char *argv[]) { {FLAGS_d_ag, FLAGS_m_ag}, {FLAGS_d_hp, FLAGS_m_hp}, {FLAGS_d_em, FLAGS_m_em}, - {FLAGS_d_lm, FLAGS_m_lm} + {FLAGS_d_lm, FLAGS_m_lm}, + {FLAGS_d_am, FLAGS_m_am}, }; FaceDetection faceDetector(FLAGS_m, FLAGS_d, 1, false, FLAGS_async, FLAGS_t, FLAGS_r, static_cast(FLAGS_bb_enlarge_coef), static_cast(FLAGS_dx_coef), static_cast(FLAGS_dy_coef)); @@ -92,6 +93,7 @@ int main(int argc, char *argv[]) { HeadPoseDetection headPoseDetector(FLAGS_m_hp, FLAGS_d_hp, FLAGS_n_hp, FLAGS_dyn_hp, FLAGS_async, FLAGS_r); EmotionsDetection emotionsDetector(FLAGS_m_em, FLAGS_d_em, FLAGS_n_em, FLAGS_dyn_em, FLAGS_async, FLAGS_r); FacialLandmarksDetection facialLandmarksDetector(FLAGS_m_lm, FLAGS_d_lm, FLAGS_n_lm, FLAGS_dyn_lm, FLAGS_async, FLAGS_r); + AntispoofingClassifier antispoofingClassifier(FLAGS_m_am, FLAGS_d_am, FLAGS_n_am, FLAGS_dyn_am, FLAGS_async, FLAGS_r); for (auto && option : cmdOptions) { auto deviceName = option.first; @@ -137,10 +139,11 @@ int main(int argc, char *argv[]) { Load(headPoseDetector).into(ie, FLAGS_d_hp, FLAGS_dyn_hp); Load(emotionsDetector).into(ie, FLAGS_d_em, FLAGS_dyn_em); Load(facialLandmarksDetector).into(ie, FLAGS_d_lm, FLAGS_dyn_lm); + Load(antispoofingClassifier).into(ie, FLAGS_d_am, FLAGS_dyn_am); // ---------------------------------------------------------------------------------------------------- bool isFaceAnalyticsEnabled = ageGenderDetector.enabled() || headPoseDetector.enabled() || - emotionsDetector.enabled() || facialLandmarksDetector.enabled(); + emotionsDetector.enabled() || facialLandmarksDetector.enabled() || antispoofingClassifier.enabled(); Timer timer; std::ostringstream out; @@ -213,15 +216,17 @@ int main(int argc, char *argv[]) { headPoseDetector.enqueue(face); emotionsDetector.enqueue(face); facialLandmarksDetector.enqueue(face); + antispoofingClassifier.enqueue(face); } } - // Running Age/Gender Recognition, Head Pose Estimation, Emotions Recognition, and Facial Landmarks Estimation networks simultaneously + // Running Age/Gender Recognition, Head Pose Estimation, Emotions Recognition, Facial Landmarks Estimation and Antispoofing Classifier networks simultaneously if (isFaceAnalyticsEnabled) { ageGenderDetector.submitRequest(); headPoseDetector.submitRequest(); emotionsDetector.submitRequest(); facialLandmarksDetector.submitRequest(); + antispoofingClassifier.submitRequest(); } // Read the next frame while waiting for inference results @@ -232,6 +237,7 @@ int main(int argc, char *argv[]) { headPoseDetector.wait(); emotionsDetector.wait(); facialLandmarksDetector.wait(); + antispoofingClassifier.wait(); } // Postprocessing @@ -292,6 +298,12 @@ int main(int argc, char *argv[]) { face->updateLandmarks(facialLandmarksDetector[i]); } + face->antispoofingEnable((antispoofingClassifier.enabled() && + i < antispoofingClassifier.maxBatch)); + if (face->isAntispoofingEnabled()) { + face->updateRealFaceConfidence(antispoofingClassifier[i]); + } + faces.push_back(face); } @@ -332,6 +344,7 @@ int main(int argc, char *argv[]) { headPoseDetector.printPerformanceCounts(getFullDeviceName(ie, FLAGS_d_hp)); emotionsDetector.printPerformanceCounts(getFullDeviceName(ie, FLAGS_d_em)); facialLandmarksDetector.printPerformanceCounts(getFullDeviceName(ie, FLAGS_d_lm)); + antispoofingClassifier.printPerformanceCounts(getFullDeviceName(ie, FLAGS_d_am)); } std::cout << presenter.reportMeans() << '\n'; diff --git a/demos/interactive_face_detection_demo/cpp/models.lst b/demos/interactive_face_detection_demo/cpp/models.lst new file mode 100644 index 00000000000..aa23b80810b --- /dev/null +++ b/demos/interactive_face_detection_demo/cpp/models.lst @@ -0,0 +1,8 @@ +# This file can be used with the --list option of the model downloader. +age-gender-recognition-retail-???? +anti-spoof-mn3 +emotions-recognition-retail-???? +face-detection-adas-???? +face-detection-retail-???? +facial-landmarks-35-adas-???? +head-pose-estimation-adas-???? diff --git a/demos/interactive_face_detection_demo/visualizer.cpp b/demos/interactive_face_detection_demo/cpp/visualizer.cpp similarity index 97% rename from demos/interactive_face_detection_demo/visualizer.cpp rename to demos/interactive_face_detection_demo/cpp/visualizer.cpp index 1fa79d5bece..2bddcb2e7f9 100644 --- a/demos/interactive_face_detection_demo/visualizer.cpp +++ b/demos/interactive_face_detection_demo/cpp/visualizer.cpp @@ -15,8 +15,8 @@ EmotionBarVisualizer::EmotionBarVisualizer(std::vector const& emotionNames, cv::Size size, cv::Size padding, double opacity, double textScale, int textThickness): emotionNames(emotionNames), size(size), padding(padding), - opacity(opacity), textScale(textScale), textThickness(textThickness), - internalPadding(0) { + opacity(opacity), textScale(textScale), textThickness(textThickness) +{ auto itMax = std::max_element(emotionNames.begin(), emotionNames.end(), [] (std::string const& lhs, std::string const& rhs) { return lhs.length() < rhs.length(); }); @@ -188,9 +188,9 @@ void Visualizer::enableEmotionBar(std::vector const& emotionNames) void Visualizer::drawFace(cv::Mat& img, Face::Ptr f, bool drawEmotionBar) { auto genderColor = (f->isAgeGenderEnabled()) ? - ((f->isMale()) ? cv::Scalar(255, 0, 0) : - cv::Scalar(147, 20, 255)) : - cv::Scalar(100, 100, 100); + ((f->isMale()) ? cv::Scalar(255, 0, 0) : + cv::Scalar(147, 20, 255)) : + cv::Scalar(192, 192, 192); std::ostringstream out; if (f->isAgeGenderEnabled()) { @@ -198,6 +198,10 @@ void Visualizer::drawFace(cv::Mat& img, Face::Ptr f, bool drawEmotionBar) { out << "," << f->getAge(); } + if (f->isAntispoofingEnabled()) { + out << (f->isReal() ? ",real" : ",spoof"); + } + if (f->isEmotionsEnabled()) { auto emotion = f->getMainEmotion(); out << "," << emotion.first; diff --git a/demos/interactive_face_detection_demo/visualizer.hpp b/demos/interactive_face_detection_demo/cpp/visualizer.hpp similarity index 99% rename from demos/interactive_face_detection_demo/visualizer.hpp rename to demos/interactive_face_detection_demo/cpp/visualizer.hpp index c08d4bfda1e..5f82557bae7 100644 --- a/demos/interactive_face_detection_demo/visualizer.hpp +++ b/demos/interactive_face_detection_demo/cpp/visualizer.hpp @@ -35,7 +35,6 @@ class EmotionBarVisualizer { double opacity; double textScale; int textThickness; - int internalPadding; }; // Drawing a photo frame around detected face diff --git a/demos/interactive_face_detection_demo/cpp_gapi/CMakeLists.txt b/demos/interactive_face_detection_demo/cpp_gapi/CMakeLists.txt new file mode 100644 index 00000000000..92dfaf8f07f --- /dev/null +++ b/demos/interactive_face_detection_demo/cpp_gapi/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (C) 2020 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +# + +file(GLOB MAIN_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +file(GLOB MAIN_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.h*) + +ie_add_sample(NAME interactive_face_detection_demo_gapi + SOURCES ${MAIN_SRC} + HEADERS ${MAIN_HEADERS} + DEPENDENCIES monitors + OPENCV_DEPENDENCIES gapi highgui) diff --git a/demos/interactive_face_detection_demo/cpp_gapi/README.md b/demos/interactive_face_detection_demo/cpp_gapi/README.md new file mode 100644 index 00000000000..eac8fa73d48 --- /dev/null +++ b/demos/interactive_face_detection_demo/cpp_gapi/README.md @@ -0,0 +1,96 @@ +# G-API Interactive Face Detection Demo + +This demo showcases Object Detection task applied for face recognition using sequence of neural networks. +The pipeline is based on [G-API framework](https://docs.opencv.org/master/d0/d1e/gapi.html). This demo executes six [kernels](https://docs.opencv.org/master/d0/d25/gapi_kernel_api.html), five of them infer networks and another one is a postprocessing kernel. +This demo executes the Face Detection, Age/Gender Recognition, Head Pose Estimation, Emotions Recognition, and Facial Landmarks Detection networks. You can use a set of the following pre-trained models with the demo: +* `face-detection-adas-0001`, which is a primary detection network for finding faces +* `age-gender-recognition-retail-0013`, which is executed on top of the results of the first model and reports estimated age and gender for each detected face +* `head-pose-estimation-adas-0001`, which is executed on top of the results of the first model and reports estimated head pose in Tait-Bryan angles +* `emotions-recognition-retail-0003`, which is executed on top of the results of the first model and reports an emotion for each detected face +* `facial-landmarks-35-adas-0002`, which is executed on top of the results of the first model and reports normed coordinates of estimated facial landmarks + +For more information about the pre-trained models, refer to the [model documentation](../../../models/intel/index.md). + +Other demo objectives are: + +* Visualization of the resulting face bounding boxes from Face Detection network +* Visualization of age/gender, head pose, emotion information, and facial landmarks positions for each detected face + +OpenCV is used to draw resulting bounding boxes, labels, and other information. You can copy and paste this code without pulling Inference Engine demo helpers into your application. + +## How It Works + +1. The application reads command-line parameters and loads up to five networks depending on `-m...` options family to the Inference +Engine. +2. G-API pipeline gets a video/image/camera like a source using the OpenCV VideoCapture. +3. G-API pipeline performs inference on the Face Detection network. +4. G-API pipeline runs post processing kernel. +5. G-API pipeline performs four inferences, using the Age/Gender, Head Pose, Emotions, and Facial Landmarks detection networks if they are specified in the command line. +6. The application displays the results. + +> **NOTE**: By default, Open Model Zoo demos expect input with BGR channels order. If you trained your model to work with RGB order, you need to manually rearrange the default channels order in the demo application or reconvert your model using the Model Optimizer tool with `--reverse_input_channels` argument specified. For more information about the argument, refer to **When to Reverse Input Channels** section of [Converting a Model Using General Conversion Parameters](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_convert_model_Converting_Model_General.html). + +## Running + +Running the application with the `-h` option yields the following usage message: + +```sh +./interactive_face_detection_demo_gapi -h + +interactive_face_detection_demo [OPTION] +Options: + + -h Print a usage message + -i "" Required. Path to a video file (specify "cam" to work with camera). + -o "" Optional. Path to an output video file. + -m "" Required. Path to an .xml file with a trained Face Detection model. + -m_ag "" Optional. Path to an .xml file with a trained Age/Gender Recognition model. + -m_hp "" Optional. Path to an .xml file with a trained Head Pose Estimation model. + -m_em "" Optional. Path to an .xml file with a trained Emotions Recognition model. + -m_lm "" Optional. Path to an .xml file with a trained Facial Landmarks Estimation model. + -d "" Optional. Target device for Face Detection network (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. + -d_ag "" Optional. Target device for Age/Gender Recognition network (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. + -d_hp "" Optional. Target device for Head Pose Estimation network (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. + -d_em "" Optional. Target device for Emotions Recognition network (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. + -d_lm "" Optional. Target device for Facial Landmarks Estimation network (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. + -no_show Optional. Do not show processed video. + -r Optional. Output inference results as raw values + -t Optional. Probability threshold for detections + -bb_enlarge_coef Optional. Coefficient to enlarge/reduce the size of the bounding box around the detected face + -dx_coef Optional. Coefficient to shift the bounding box around the detected face along the Ox axis + -dy_coef Optional. Coefficient to shift the bounding box around the detected face along the Oy axis + -loop Optional. Enable playing video on a loop + -no_smooth Optional. Do not smooth person attributes + -no_show_emotion_bar Optional. Do not show emotion bar + -u Optional. List of monitors to show initially. +``` + +Running the application with an empty list of options yields the usage message given above and an error message. + +To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](models.lst). + +> **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). + +For example, to do inference on a GPU with the OpenVINO™ toolkit pre-trained models, run the following command: + +```sh +./interactive_face_detection_demo -i /inputVideo.mp4 -m /face-detection-adas-0001.xml -m_ag /age-gender-recognition-retail-0013.xml -m_hp /head-pose-estimation-adas-0001.xml -m_em /emotions-recognition-retail-0003.xml -m_lm /facial-landmarks-35-adas-0002.xml -d GPU +``` + +## Demo Output + +The demo uses OpenCV to display the resulting frame with detections (rendered as bounding boxes and labels, if provided). +The demo reports total image throughput which includes frame decoding time, inference time, time to render bounding boxes and labels, and time to display the results. + +> **NOTE**: On VPU devices (Intel® Movidius™ Neural Compute Stick, Intel® Neural Compute Stick 2, and Intel® Vision Accelerator Design with Intel® Movidius™ VPUs) this demo has been tested on the following Model Downloader available topologies: +>* `age-gender-recognition-retail-0013` +>* `emotions-recognition-retail-0003` +>* `face-detection-adas-0001` +>* `facial-landmarks-35-adas-0002` +>* `head-pose-estimation-adas-0001` +> Other models may produce unexpected results on these devices. + +## See Also +* [Using Open Model Zoo demos](../../README.md) +* [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) +* [Model Downloader](../../../tools/downloader/README.md) diff --git a/demos/interactive_face_detection_demo/cpp_gapi/face.cpp b/demos/interactive_face_detection_demo/cpp_gapi/face.cpp new file mode 100644 index 00000000000..d369b392b51 --- /dev/null +++ b/demos/interactive_face_detection_demo/cpp_gapi/face.cpp @@ -0,0 +1,94 @@ +// Copyright (C) 2020 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "face.hpp" + +Face::Face(size_t id, cv::Rect& location): + _location(location), _intensity_mean(0.f), _id(id), _age(-1), + _maleScore(0), _femaleScore(0), _yaw(0.f), _pitch(0.f), _roll(0.f) {} + +void Face::updateAge(float value) { + _age = (_age == -1) ? value : 0.95f * _age + 0.05f * value; +} + +void Face::updateGender(float value) { + if (value < 0) + return; + + if (value > 0.5) { + _maleScore += value - 0.5f; + } else { + _femaleScore += 0.5f - value; + } +} + +void Face::updateEmotions(const std::map& values) { + for (auto& kv : values) { + if (_emotions.find(kv.first) == _emotions.end()) { + _emotions[kv.first] = kv.second; + } else { + _emotions[kv.first] = 0.9f * _emotions[kv.first] + 0.1f * kv.second; + } + } +} + +void Face::updateHeadPose(float y, float p, float r) { + _yaw = y; + _pitch = p; + _roll = r; +} + +void Face::updateLandmarks(std::vector values) { + _landmarks = std::move(values); +} + +int Face::getAge() { + return static_cast(std::floor(_age + 0.5f)); +} + +bool Face::isMale() { + return _maleScore > _femaleScore; +} + +std::map Face::getEmotions() { + return _emotions; +} + +std::pair Face::getMainEmotion() { + auto x = std::max_element(_emotions.begin(), _emotions.end(), + [](const std::pair& p1, const std::pair& p2) { + return p1.second < p2.second; }); + + return *x; +} + +const std::vector& Face::getLandmarks() { + return _landmarks; +} + +size_t Face::getId() { + return _id; +} + +float calcIoU(cv::Rect& src, cv::Rect& dst) { + cv::Rect i = src & dst; + cv::Rect u = src | dst; + + return static_cast(i.area()) / static_cast(u.area()); +} + +Face::Ptr matchFace(cv::Rect rect, const std::list& faces) { + Face::Ptr face(nullptr); + float maxIoU = 0.55f; + + for (auto&& f : faces) { + float iou = calcIoU(rect, f->_location); + if (iou > maxIoU) { + face = f; + maxIoU = iou; + } + } + + return face; +} diff --git a/demos/interactive_face_detection_demo/cpp_gapi/face.hpp b/demos/interactive_face_detection_demo/cpp_gapi/face.hpp new file mode 100644 index 00000000000..4d9f5d99eb3 --- /dev/null +++ b/demos/interactive_face_detection_demo/cpp_gapi/face.hpp @@ -0,0 +1,50 @@ +// Copyright (C) 2020 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +# pragma once + +#include + +#include + +#include "utils.hpp" + +// -------------------------Describe detected face on a frame------------------------------------------------- + +struct Face { +public: + using Ptr = std::shared_ptr; + + explicit Face(size_t id, cv::Rect& location); + + void updateAge(float value); + void updateGender(float value); + void updateEmotions(const std::map& values); + void updateHeadPose(float y, float p, float r); + void updateLandmarks(std::vector values); + + int getAge(); + bool isMale(); + std::map getEmotions(); + std::pair getMainEmotion(); + const std::vector& getLandmarks(); + size_t getId(); + +public: + cv::Rect _location; + float _intensity_mean; + + size_t _id; + float _age; + float _maleScore; + float _femaleScore; + std::map _emotions; + float _yaw; + float _pitch; + float _roll; + std::vector _landmarks; +}; + +// ----------------------------------- Utils ----------------------------------------------------------------- +Face::Ptr matchFace(cv::Rect rect, const std::list& faces); diff --git a/demos/interactive_face_detection_demo/cpp_gapi/interactive_face_detection_gapi.hpp b/demos/interactive_face_detection_demo/cpp_gapi/interactive_face_detection_gapi.hpp new file mode 100644 index 00000000000..d39fc6a4ecf --- /dev/null +++ b/demos/interactive_face_detection_demo/cpp_gapi/interactive_face_detection_gapi.hpp @@ -0,0 +1,109 @@ +// Copyright (C) 2020 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#include + +static const char help_message[] = "Print a usage message"; +static const char input_video_message[] = "Required. Path to a video file (specify \"cam\" to work with camera)."; +static const char output_video_message[] = "Optional. Path to an output video file."; +static const char face_detection_model_message[] = "Required. Path to an .xml file with a trained Face Detection model."; +static const char age_gender_model_message[] = "Optional. Path to an .xml file with a trained Age/Gender Recognition model."; +static const char head_pose_model_message[] = "Optional. Path to an .xml file with a trained Head Pose Estimation model."; +static const char emotions_model_message[] = "Optional. Path to an .xml file with a trained Emotions Recognition model."; +static const char facial_landmarks_model_message[] = "Optional. Path to an .xml file with a trained Facial Landmarks Estimation model."; +static const char target_device_message[] = "Optional. Target device for Face Detection network (the list of available devices is shown below). " + "Default value is CPU. The demo will look for a suitable plugin for a specified device."; +static const char target_device_message_ag[] = "Optional. Target device for Age/Gender Recognition network (the list of available devices is shown below). " + "Default value is CPU. The demo will look for a suitable plugin for a specified device."; +static const char target_device_message_hp[] = "Optional. Target device for Head Pose Estimation network (the list of available devices is shown below). " + "Default value is CPU. The demo will look for a suitable plugin for a specified device."; +static const char target_device_message_em[] = "Optional. Target device for Emotions Recognition network (the list of available devices is shown below). " + "Default value is CPU. The demo will look for a suitable plugin for a specified device."; +static const char target_device_message_lm[] = "Optional. Target device for Facial Landmarks Estimation network " + "(the list of available devices is shown below). Default value is CPU. The demo will look for a suitable plugin for device specified."; +static const char thresh_output_message[] = "Optional. Probability threshold for detections"; +static const char bb_enlarge_coef_output_message[] = "Optional. Coefficient to enlarge/reduce the size of the bounding box around the detected face"; +static const char raw_output_message[] = "Optional. Output inference results as raw values"; +static const char no_show_processed_video[] = "Optional. Do not show processed video."; +static const char dx_coef_output_message[] = "Optional. Coefficient to shift the bounding box around the detected face along the Ox axis"; +static const char dy_coef_output_message[] = "Optional. Coefficient to shift the bounding box around the detected face along the Oy axis"; +// TODO: Make this option valid for single image case +static const char loop_output_message[] = "Optional. Enable playing video on a loop"; +static const char no_smooth_output_message[] = "Optional. Do not smooth person attributes"; +static const char no_show_emotion_bar_message[] = "Optional. Do not show emotion bar"; +static const char utilization_monitors_message[] = "Optional. List of monitors to show initially."; + +// TODO: Support options: +// Set number of maximum simultaneously processed faces for Age/Gender, +// Head Pose Estimation, Emotions Recognition, Facial Landmarks Estimation networks + +// Enabling dynamic batch size for Age/Gender, Head Pose Estimation, Emotions Recognition, +// Facial Landmarks Estimation networks + +// Enabling per-layer performance report + +// Enabling using of CPU custom layers. +// Enabling using of GPU custom kernels. + +// Set maximum FPS for playing video + +DEFINE_bool(h, false, help_message); +DEFINE_string(i, "", input_video_message); +DEFINE_string(o, "", output_video_message); +DEFINE_string(m, "", face_detection_model_message); +DEFINE_string(m_ag, "", age_gender_model_message); +DEFINE_string(m_hp, "", head_pose_model_message); +DEFINE_string(m_em, "", emotions_model_message); +DEFINE_string(m_lm, "", facial_landmarks_model_message); +DEFINE_string(d, "CPU", target_device_message); +DEFINE_string(d_ag, "CPU", target_device_message_ag); +DEFINE_string(d_hp, "CPU", target_device_message_hp); +DEFINE_string(d_em, "CPU", target_device_message_em); +DEFINE_string(d_lm, "CPU", target_device_message_lm); +DEFINE_bool(r, false, raw_output_message); +DEFINE_double(t, 0.5, thresh_output_message); +DEFINE_double(bb_enlarge_coef, 1.2, bb_enlarge_coef_output_message); +DEFINE_bool(no_show, false, no_show_processed_video); +DEFINE_double(dx_coef, 1, dx_coef_output_message); +DEFINE_double(dy_coef, 1, dy_coef_output_message); +DEFINE_bool(loop, false, loop_output_message); +DEFINE_bool(no_smooth, false, no_smooth_output_message); +DEFINE_bool(no_show_emotion_bar, false, no_show_emotion_bar_message); +DEFINE_string(u, "", utilization_monitors_message); + +/** +* \brief This function shows a help message +*/ + +static void showUsage() { + std::cout << std::endl; + std::cout << "interactive_face_detection [OPTION]" << std::endl; + std::cout << "Options:" << std::endl; + std::cout << std::endl; + std::cout << " -h " << help_message << std::endl; + std::cout << " -i \"\" " << input_video_message << std::endl; + std::cout << " -o \"\" " << output_video_message << std::endl; + std::cout << " -m \"\" " << face_detection_model_message<< std::endl; + std::cout << " -m_ag \"\" " << age_gender_model_message << std::endl; + std::cout << " -m_hp \"\" " << head_pose_model_message << std::endl; + std::cout << " -m_em \"\" " << emotions_model_message << std::endl; + std::cout << " -m_lm \"\" " << facial_landmarks_model_message << std::endl; + std::cout << " -d \"\" " << target_device_message << std::endl; + std::cout << " -d_ag \"\" " << target_device_message_ag << std::endl; + std::cout << " -d_hp \"\" " << target_device_message_hp << std::endl; + std::cout << " -d_em \"\" " << target_device_message_em << std::endl; + std::cout << " -d_lm \"\" " << target_device_message_lm << std::endl; + std::cout << " -no_show " << no_show_processed_video << std::endl; + std::cout << " -r " << raw_output_message << std::endl; + std::cout << " -t " << thresh_output_message << std::endl; + std::cout << " -bb_enlarge_coef " << bb_enlarge_coef_output_message << std::endl; + std::cout << " -dx_coef " << dx_coef_output_message << std::endl; + std::cout << " -dy_coef " << dy_coef_output_message << std::endl; + std::cout << " -loop " << loop_output_message << std::endl; + std::cout << " -no_smooth " << no_smooth_output_message << std::endl; + std::cout << " -no_show_emotion_bar " << no_show_emotion_bar_message << std::endl; + std::cout << " -u " << utilization_monitors_message << std::endl; +} diff --git a/demos/interactive_face_detection_demo/cpp_gapi/main.cpp b/demos/interactive_face_detection_demo/cpp_gapi/main.cpp new file mode 100644 index 00000000000..098f15b03de --- /dev/null +++ b/demos/interactive_face_detection_demo/cpp_gapi/main.cpp @@ -0,0 +1,573 @@ +// Copyright (C) 2020 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +/** +* \brief The entry point for the G-API/Inference Engine interactive_face_detection_gapi demo application +* \file interactive_face_detection_demo_gapi/main.cpp +* \example interactive_face_detection_demo_gapi/main.cpp +*/ +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "interactive_face_detection_gapi.hpp" +#include "utils.hpp" +#include "face.hpp" +#include "visualizer.hpp" + +static const std::vector EMOTION_VECTOR = {"neutral", + "happy", + "sad", + "surprise", + "anger"}; + +using AGInfo = std::tuple; +using HPInfo = std::tuple; +G_API_NET(Faces, , "face-detector"); +G_API_NET(AgeGender, , "age-gender-recognition"); +G_API_NET(HeadPose, , "head-pose-recognition"); +G_API_NET(FacialLandmark, , "facial-landmark-recognition"); +G_API_NET(Emotions, , "emotions-recognition"); + +G_API_OP(PostProc, (cv::GMat, cv::GMat, double, double, double, double)>, "custom.fd_postproc") { + static cv::GArrayDesc outMeta(const cv::GMatDesc &, const cv::GMatDesc &, double, double, double, double) { + return cv::empty_array_desc(); + } +}; + +GAPI_OCV_KERNEL(OCVPostProc, PostProc) { + static void run(const cv::Mat &in_ssd_result, + const cv::Mat &in_frame, + double threshold, + double bb_enlarge_coefficient, + double bb_dx_coefficient, + double bb_dy_coefficient, + std::vector &out_faces) { + const auto &in_ssd_dims = in_ssd_result.size; + CV_Assert(in_ssd_dims.dims() == 4u); + + const int MAX_PROPOSALS = in_ssd_dims[2]; + const int OBJECT_SIZE = in_ssd_dims[3]; + CV_Assert(OBJECT_SIZE == 7); + + const cv::Size upscale = in_frame.size(); + const cv::Rect surface({0,0}, upscale); + out_faces.clear(); + + const float *data = in_ssd_result.ptr(); + for (int i = 0; i < MAX_PROPOSALS; i++) { + const float image_id = data[i * OBJECT_SIZE + 0]; // batch id + const float confidence = data[i * OBJECT_SIZE + 2]; + const float rc_left = data[i * OBJECT_SIZE + 3]; + const float rc_top = data[i * OBJECT_SIZE + 4]; + const float rc_right = data[i * OBJECT_SIZE + 5]; + const float rc_bottom = data[i * OBJECT_SIZE + 6]; + + if (image_id < 0.f) { // indicates end of detections + break; + } + if (confidence < threshold) { + continue; + } + + cv::Rect rc; + rc.x = static_cast(rc_left * upscale.width); + rc.y = static_cast(rc_top * upscale.height); + rc.width = static_cast(rc_right * upscale.width) - rc.x; + rc.height = static_cast(rc_bottom * upscale.height) - rc.y; + + // Make square and enlarge face bounding box for more robust operation of face analytics networks + int bb_width = rc.width; + int bb_height = rc.height; + + int bb_center_x = rc.x + bb_width / 2; + int bb_center_y = rc.y + bb_height / 2; + + int max_of_sizes = std::max(bb_width, bb_height); + + int bb_new_width = static_cast(bb_enlarge_coefficient * max_of_sizes); + int bb_new_height = static_cast(bb_enlarge_coefficient * max_of_sizes); + + rc.x = bb_center_x - static_cast(std::floor(bb_dx_coefficient * bb_new_width / 2)); + rc.y = bb_center_y - static_cast(std::floor(bb_dy_coefficient * bb_new_height / 2)); + + rc.width = bb_new_width; + rc.height = bb_new_height; + + out_faces.push_back(rc & surface); + } + } +}; + +void rawOutputDetections(const cv::Mat &ssd_result, + const cv::Size &upscale, + const double detectionThreshold) { + const auto &in_ssd_dims = ssd_result.size; + CV_Assert(in_ssd_dims.dims() == 4u); + + const int OBJECT_SIZE = in_ssd_dims[3]; + CV_Assert(OBJECT_SIZE == 7); + + const float *data = ssd_result.ptr(); + + const int detection_num = in_ssd_dims[2]; + for (int i = 0; i < detection_num; ++i) { + const float image_id = data[i * OBJECT_SIZE + 0]; + const float label = data[i * OBJECT_SIZE + 1]; + const float confidence = data[i * OBJECT_SIZE + 2]; + const float rc_left = data[i * OBJECT_SIZE + 3]; + const float rc_top = data[i * OBJECT_SIZE + 4]; + const float rc_right = data[i * OBJECT_SIZE + 5]; + const float rc_bottom = data[i * OBJECT_SIZE + 6]; + + if (image_id < 0.f) { // indicates end of detections + break; + } + + int x = static_cast(rc_left * upscale.width); + int y = static_cast(rc_top * upscale.height); + int width = static_cast(rc_right * upscale.width) - x; + int height = static_cast(rc_bottom * upscale.height) - y; + + std::cout << "[" << i << "," << label << "] element, prob = " << confidence << + " (" << x << "," << y << ")-(" << width << "," << height << ")" + << ((confidence > detectionThreshold) ? " WILL BE RENDERED!" : "") << std::endl; + } +} + +void rawOutputAgeGender(const int idx, const cv::Mat &out_ages, const cv::Mat &out_genders) { + const float *age_data = out_ages.ptr(); + const float *gender_data = out_genders.ptr(); + + float maleProb = gender_data[1]; + float age = age_data[0] * 100; + + std::cout << "[" << idx << "] element, male prob = " << maleProb << ", age = " << age << std::endl; +} + +void rawOutputHeadpose(const int idx, + const cv::Mat &out_y_fc, + const cv::Mat &out_p_fc, + const cv::Mat &out_r_fc) { + const float *y_data = out_y_fc.ptr(); + const float *p_data = out_p_fc.ptr(); + const float *r_data = out_r_fc.ptr(); + + std::cout << "[" << idx << "] element, yaw = " << y_data[0] << + ", pitch = " << p_data[0] << + ", roll = " << r_data[0] << std::endl; +} + +void rawOutputLandmarks(const int idx, const cv::Mat &out_landmark) { + const float *lm_data = out_landmark.ptr(); + + std::cout << "[" << idx << "] element, normed facial landmarks coordinates (x, y):" << std::endl; + + int n_lm = 70; + for (int i_lm = 0; i_lm < n_lm / 2; ++i_lm) { + float normed_x = lm_data[2 * i_lm]; + float normed_y = lm_data[2 * i_lm + 1]; + + std::cout << normed_x << ", " << normed_y << std::endl; + } +} + +void rawOutputEmotions(const int idx, const cv::Mat &out_emotion) { + size_t emotionsVecSize = EMOTION_VECTOR.size(); + + const float *em_data = out_emotion.ptr(); + + std::cout << "[" << idx << "] element, predicted emotions (name = prob):" << std::endl; + for (size_t i = 0; i < emotionsVecSize; i++) { + std::cout << EMOTION_VECTOR[i] << " = " << em_data[i]; + if (emotionsVecSize - 1 != i) { + std::cout << ", "; + } else { + std::cout << std::endl; + } + } +} + +float calcMean(const cv::Mat& src) { + cv::Mat tmp; + cv::cvtColor(src, tmp, cv::COLOR_BGR2GRAY); + cv::Scalar mean = cv::mean(tmp); + + return static_cast(mean[0]); +} + +void faceDataUpdate(const cv::Mat &frame, + Face::Ptr &face, + const cv::Rect &face_rect, + std::list &prev_faces, + const std::vector &face_hub, + size_t &id, + bool no_smooth) { + // Face update + cv::Rect rect = face_rect & cv::Rect({0, 0}, frame.size()); + + if (!no_smooth) { + face = matchFace(rect, prev_faces); + float intensity_mean = calcMean(frame(rect)); + intensity_mean += 1.0; + + if ((face == nullptr) || + ((std::abs(intensity_mean - face->_intensity_mean) / face->_intensity_mean) > 0.07f)) { + face = std::make_shared(id++, rect); + } else { + prev_faces.remove(face); + } + + face->_intensity_mean = intensity_mean; + face->_location = rect; + } else { + face = std::make_shared(id++, rect); + } +} + +void ageGenderDataUpdate(const Face::Ptr &face, + const cv::Mat &out_age, + const cv::Mat &out_gender) { + const float *age_data = out_age.ptr(); + const float *gender_data = out_gender.ptr(); + + float maleProb = gender_data[1]; + float age = age_data[0] * 100; + + face->updateGender(maleProb); + face->updateAge(age); +} + +void headPoseDataUpdate(const Face::Ptr &face, + const cv::Mat &out_y_fc, + const cv::Mat &out_p_fc, + const cv::Mat &out_r_fc) { + const float *y_data = out_y_fc.ptr(); + const float *p_data = out_p_fc.ptr(); + const float *r_data = out_r_fc.ptr(); + + face->updateHeadPose(y_data[0], p_data[0], r_data[0]); +} + +void emotionsDataUpdate(const Face::Ptr &face, const cv::Mat &out_emotion) { + const float *em_data = out_emotion.ptr(); + + std::map em_val_map; + for(size_t i = 0; i < EMOTION_VECTOR.size(); i++) { + em_val_map[EMOTION_VECTOR[i]] = em_data[i]; + } + + face->updateEmotions(em_val_map); +} + +void landmarksDataUpdate(const Face::Ptr &face, const cv::Mat &out_landmark) { + const float *lm_data = out_landmark.ptr(); + + size_t n_lm = 70; + + std::vector normedLandmarks(&lm_data[0], &lm_data[n_lm]); + + face->updateLandmarks(normedLandmarks); +} + +void setInput(cv::GStreamingCompiled stream, const std::string& input ) { + try { + // If stoi() throws exception input should be a path not a camera id + stream.setSource(cv::gapi::wip::make_src(std::stoi(input))); + } catch (std::invalid_argument&) { + slog::info << "Input source is treated as a file path" << slog::endl; + stream.setSource(cv::gapi::wip::make_src(input)); + } +} + +static std::string fileNameNoExt(const std::string &filepath) { + auto pos = filepath.rfind('.'); + if (pos == std::string::npos) return filepath; + return filepath.substr(0, pos); +} + +int main(int argc, char *argv[]) { + try { + // ------------------------------ Parsing and validating of input arguments -------------------------- + + slog::info << "Parsing input parameters" << slog::endl; + gflags::ParseCommandLineNonHelpFlags(&argc, &argv, true); + if (FLAGS_h) { + showUsage(); + showAvailableDevices(); + return 0; + } + + if (FLAGS_i.empty()) + throw std::logic_error("Parameter -i is not set"); + if (FLAGS_m.empty()) + throw std::logic_error("Parameter -m is not set"); + + std::cout << "To close the application, press 'CTRL+C' here"; + if (!FLAGS_no_show) { + std::cout << " or switch to the output window and press any key"; + } + std::cout << std::endl; + + cv::GComputation pipeline([=]() { + cv::GMat in; + + cv::GMat frame = cv::gapi::copy(in); + + cv::GMat detections = cv::gapi::infer(in); + + cv::GArray faces = PostProc::on(detections, in, + FLAGS_t, + FLAGS_bb_enlarge_coef, + FLAGS_dx_coef, + FLAGS_dy_coef); + auto outs = GOut(frame, detections, faces); + + cv::GArray ages, genders; + if (!FLAGS_m_ag.empty()) { + std::tie(ages, genders) = cv::gapi::infer(faces, in); + outs += GOut(ages, genders); + } + + cv::GArray y_fc, p_fc, r_fc; + if (!FLAGS_m_hp.empty()) { + std::tie(y_fc, p_fc, r_fc) = cv::gapi::infer(faces, in); + outs += GOut(y_fc, p_fc, r_fc); + } + + cv::GArray emotions; + if (!FLAGS_m_em.empty()) { + emotions = cv::gapi::infer(faces, in); + outs += GOut(emotions); + } + + cv::GArray landmarks; + if (!FLAGS_m_lm.empty()) { + landmarks = cv::gapi::infer(faces, in); + outs += GOut(landmarks); + } + + return cv::GComputation(cv::GIn(in), std::move(outs)); + }); + + auto det_net = cv::gapi::ie::Params { + FLAGS_m, // path to model + fileNameNoExt(FLAGS_m) + ".bin", // path to weights + FLAGS_d // device to use + }; + + auto age_net = cv::gapi::ie::Params { + FLAGS_m_ag, // path to model + fileNameNoExt(FLAGS_m_ag) + ".bin", // path to weights + FLAGS_d_ag // device to use + }.cfgOutputLayers({ "age_conv3", "prob" }); + + + auto hp_net = cv::gapi::ie::Params { + FLAGS_m_hp, // path to model + fileNameNoExt(FLAGS_m_hp) + ".bin", // path to weights + FLAGS_d_hp // device to use + }.cfgOutputLayers({ "angle_y_fc", "angle_p_fc", "angle_r_fc" }); + + auto lm_net = cv::gapi::ie::Params { + FLAGS_m_lm, // path to model + fileNameNoExt(FLAGS_m_lm) + ".bin",// path to weights + FLAGS_d_lm // device to use + }.cfgOutputLayers({ "align_fc3" }); + + auto emo_net = cv::gapi::ie::Params { + FLAGS_m_em, // path to model + fileNameNoExt(FLAGS_m_em) + ".bin", // path to weights + FLAGS_d_em // device to use + }; + + // Form a kernel package (including an OpenCV-based implementation of our + // post-processing) and a network package (holding our three networks). + auto kernels = cv::gapi::kernels(); + auto networks = cv::gapi::networks(det_net, age_net, hp_net, lm_net, emo_net); + + cv::GStreamingCompiled stream = pipeline.compileStreaming(cv::compile_args(kernels, networks)); + + cv::Mat frame, ssd_res; + std::vector face_hub; + auto out_vector = cv::gout(frame, ssd_res, face_hub); + + std::vector out_ages, out_genders; + if (!FLAGS_m_ag.empty()) out_vector += cv::gout(out_ages, out_genders); + + std::vector out_y_fc, out_p_fc, out_r_fc; + if (!FLAGS_m_hp.empty()) out_vector += cv::gout(out_y_fc, out_p_fc, out_r_fc); + + std::vector out_emotions; + if (!FLAGS_m_em.empty()) out_vector += cv::gout(out_emotions); + + std::vector out_landmarks; + if (!FLAGS_m_lm.empty()) out_vector += cv::gout(out_landmarks); + + Visualizer::Ptr visualizer; + if (!FLAGS_no_show || !FLAGS_o.empty()) { + visualizer = std::make_shared(!FLAGS_m_ag.empty(), !FLAGS_m_em.empty(), !FLAGS_m_hp.empty(), !FLAGS_m_lm.empty()); + } else { + std::cout<< "To close the application, press 'CTRL+C' here" << std::endl; + } + + std::list faces; + std::ostringstream out; + size_t framesCounter = 0; + size_t id = 0; + cv::VideoWriter videoWriter; + + const cv::Point THROUGHPUT_METRIC_POSITION{10, 45}; + std::unique_ptr presenter; + + Timer timer; + do { + slog::info << "Setting media source" << slog::endl; + try { + setInput(stream, FLAGS_i); + } catch (const std::exception& error) { + std::stringstream msg; + msg << "Can't open source {" << FLAGS_i << "}" << std::endl << + error.what() << std::endl; + throw std::invalid_argument(msg.str()); + } + slog::info << "Start inference " << slog::endl; + + timer.start("total"); + stream.start(); + while (stream.pull(cv::GRunArgsP(out_vector))) { + if (!FLAGS_no_show && !FLAGS_m_em.empty() && !FLAGS_no_show_emotion_bar) { + visualizer->enableEmotionBar(frame.size(), EMOTION_VECTOR); + } + + // Init presenter + if (presenter == nullptr) { + cv::Size graphSize{static_cast(frame.rows / 4), 60}; + presenter.reset(new Presenter(FLAGS_u, THROUGHPUT_METRIC_POSITION.y + 15, graphSize)); + } + + // Postprocessing + std::list prev_faces; + + if (!FLAGS_no_smooth) { + prev_faces.insert(prev_faces.begin(), faces.begin(), faces.end()); + } + + faces.clear(); + + // Raw output of detected faces + if (FLAGS_r) + rawOutputDetections(ssd_res, frame.size(), FLAGS_t); + + // For every detected face + for (size_t i = 0; i < face_hub.size(); i++) { + Face::Ptr face; + + cv::Rect rect = face_hub[i] & cv::Rect({0, 0}, frame.size()); + faceDataUpdate(frame, face, rect, + prev_faces, face_hub, + id, FLAGS_no_smooth); + + if (!FLAGS_m_ag.empty()) { + ageGenderDataUpdate(face, out_ages[i], out_genders[i]); + if (FLAGS_r) + rawOutputAgeGender(i, out_ages[i], out_genders[i]); + } + + if (!FLAGS_m_em.empty()) { + emotionsDataUpdate(face, out_emotions[i]); + if (FLAGS_r) + rawOutputEmotions(i, out_emotions[i]); + } + + if (!FLAGS_m_hp.empty()) { + headPoseDataUpdate(face, out_y_fc[i], out_p_fc[i], out_r_fc[i]); + if (FLAGS_r) + rawOutputHeadpose(i, out_y_fc[i], out_p_fc[i], out_r_fc[i]); + } + + if (!FLAGS_m_lm.empty()) { + landmarksDataUpdate(face, out_landmarks[i]); + if (FLAGS_r) + rawOutputLandmarks(i, out_landmarks[i]); + } + // End of face postprocesing + + faces.push_back(face); + } + + presenter->drawGraphs(frame); + + // Visualizing results + if (!FLAGS_no_show || !FLAGS_o.empty()) { + out.str(""); + out << "Total image throughput: " << std::fixed << std::setprecision(2) + << 1000.f / (timer["total"].getSmoothedDuration()) << " fps"; + cv::putText(frame, out.str(), THROUGHPUT_METRIC_POSITION, cv::FONT_HERSHEY_TRIPLEX, 1, + cv::Scalar(255, 0, 0), 2); + + // drawing faces + visualizer->draw(frame, faces); + + cv::imshow("Detection results", frame); + + int key = cv::waitKey(1); + if (27 == key || 'Q' == key || 'q' == key) { + stream.stop(); + } else { + presenter->handleKey(key); + } + } + + if (!FLAGS_o.empty() && !videoWriter.isOpened()) { + videoWriter.open(FLAGS_o, cv::VideoWriter::fourcc('I', 'Y', 'U', 'V'), 25, cv::Size(frame.size())); + } + if (!FLAGS_o.empty()) { + videoWriter.write(frame); + } + + timer["total"].calculateDuration(); + framesCounter++; + } + timer.finish("total"); + + slog::info << "Number of processed frames: " << framesCounter << slog::endl; + slog::info << "Total image throughput: " << framesCounter * (1000.f / timer["total"].getTotalDuration()) << " fps" << slog::endl; + + std::cout << presenter->reportMeans() << '\n'; + } while (FLAGS_loop); + + slog::info << "No more frames to process!" << slog::endl; + + if (!FLAGS_o.empty()) { + videoWriter.release(); + } + + cv::destroyAllWindows(); + } + catch (const std::exception& error) { + slog::err << error.what() << slog::endl; + return 1; + } + catch (...) { + slog::err << "Unknown/internal exception happened." << slog::endl; + return 1; + } + + slog::info << "Execution successful" << slog::endl; + return 0; +} diff --git a/demos/interactive_face_detection_demo/models.lst b/demos/interactive_face_detection_demo/cpp_gapi/models.lst similarity index 100% rename from demos/interactive_face_detection_demo/models.lst rename to demos/interactive_face_detection_demo/cpp_gapi/models.lst diff --git a/demos/interactive_face_detection_demo/cpp_gapi/utils.hpp b/demos/interactive_face_detection_demo/cpp_gapi/utils.hpp new file mode 100644 index 00000000000..d7591cf6b1b --- /dev/null +++ b/demos/interactive_face_detection_demo/cpp_gapi/utils.hpp @@ -0,0 +1,77 @@ +// Copyright (C) 2020 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +# pragma once + +class CallStat { +public: + typedef std::chrono::duration> ms; + + CallStat(): + _number_of_calls(0), _total_duration(0.0), _last_call_duration(0.0), _smoothed_duration(-1.0) { + } + + double getSmoothedDuration() { + // Additional check is needed for the first frame while duration of the first + // visualisation is not calculated yet. + if (_smoothed_duration < 0) { + auto t = std::chrono::high_resolution_clock::now(); + return std::chrono::duration_cast(t - _last_call_start).count(); + } + return _smoothed_duration; + } + + double getTotalDuration() { + return _total_duration; + } + + double getLastCallDuration() { + return _last_call_duration; + } + + void calculateDuration() { + auto t = std::chrono::high_resolution_clock::now(); + _last_call_duration = std::chrono::duration_cast(t - _last_call_start).count(); + _number_of_calls++; + _total_duration += _last_call_duration; + if (_smoothed_duration < 0) { + _smoothed_duration = _last_call_duration; + } + double alpha = 0.1; + _smoothed_duration = _smoothed_duration * (1.0 - alpha) + _last_call_duration * alpha; + } + + void setStartTime() { + _last_call_start = std::chrono::high_resolution_clock::now(); + } + +private: + size_t _number_of_calls; + double _total_duration; + double _last_call_duration; + double _smoothed_duration; + std::chrono::time_point _last_call_start; +}; + +class Timer { +public: + void start(const std::string& name) { + _timers[name].setStartTime(); + } + + void finish(const std::string& name) { + auto& timer = (*this)[name]; + timer.calculateDuration(); + } + + CallStat& operator[](const std::string& name) { + if (_timers.find(name) == _timers.end()) { + throw std::logic_error("No timer with name " + name + "."); + } + return _timers[name]; + } + +private: + std::map _timers; +}; diff --git a/demos/interactive_face_detection_demo/cpp_gapi/visualizer.cpp b/demos/interactive_face_detection_demo/cpp_gapi/visualizer.cpp new file mode 100644 index 00000000000..e7911562185 --- /dev/null +++ b/demos/interactive_face_detection_demo/cpp_gapi/visualizer.cpp @@ -0,0 +1,357 @@ +// Copyright (C) 2020 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include + +#include "visualizer.hpp" + +// EmotionBarVisualizer +EmotionBarVisualizer::EmotionBarVisualizer(std::vector const& emotionNames, cv::Size size, cv::Size padding, + double opacity, double textScale, int textThickness): + emotionNames(emotionNames), size(size), padding(padding), + opacity(opacity), textScale(textScale), textThickness(textThickness), + internalPadding(0) { + auto itMax = std::max_element(emotionNames.begin(), emotionNames.end(), [] (std::string const& lhs, std::string const& rhs) { + return lhs.length() < rhs.length(); + }); + + textSize = cv::getTextSize(*itMax, cv::FONT_HERSHEY_COMPLEX_SMALL, textScale, textThickness, &textBaseline); + ystep = (emotionNames.size() < 2) ? 0 : (size.height - 2 * padding.height - textSize.height) / (emotionNames.size() - 1); +} + +cv::Size EmotionBarVisualizer::getSize() { + return size; +} + +void EmotionBarVisualizer::draw(cv::Mat& img, std::map emotions, cv::Point org, cv::Scalar fgcolor, cv::Scalar bgcolor) { + cv::Mat tmp = img(cv::Rect(org.x, org.y, size.width, size.height)); + cv::addWeighted(tmp, 1.f - opacity, bgcolor, opacity, 0, tmp); + + auto drawEmotion = [&](int n, std::string text, float value) { + cv::Point torg(org.x + padding.width, org.y + n * ystep + textSize.height + padding.height); + + int textWidth = textSize.width + 10; + cv::Rect r(torg.x + textWidth, torg.y - textSize.height, size.width - 2 * padding.width - textWidth, textSize.height + textBaseline / 2); + + cv::putText(img, text, torg, cv::FONT_HERSHEY_COMPLEX_SMALL, textScale, fgcolor, textThickness); + cv::rectangle(img, r, fgcolor, 1); + r.width = static_cast(r.width * value); + cv::rectangle(img, r, fgcolor, cv::FILLED); + }; + + for (size_t i = 0; i< emotionNames.size(); i++) { + drawEmotion(i, emotionNames[i], emotions[emotionNames[i]]); + } +} + +// PhotoFrameVisualizer +PhotoFrameVisualizer::PhotoFrameVisualizer(int bbThickness, int photoFrameThickness, float photoFrameLength): + bbThickness(bbThickness), photoFrameThickness(photoFrameThickness), photoFrameLength(photoFrameLength) { +} + +void PhotoFrameVisualizer::draw(cv::Mat& img, cv::Rect& bb, cv::Scalar color) { + cv::rectangle(img, bb, color, bbThickness); + + auto drawPhotoFrameCorner = [&](cv::Point p, int dx, int dy) { + cv::line(img, p, cv::Point(p.x, p.y + dy), color, photoFrameThickness); + cv::line(img, p, cv::Point(p.x + dx, p.y), color, photoFrameThickness); + }; + + int dx = static_cast(photoFrameLength * bb.width); + int dy = static_cast(photoFrameLength * bb.height); + + drawPhotoFrameCorner(bb.tl(), dx, dy); + drawPhotoFrameCorner(cv::Point(bb.x + bb.width - 1, bb.y), -dx, dy); + drawPhotoFrameCorner(cv::Point(bb.x, bb.y + bb.height - 1), dx, -dy); + drawPhotoFrameCorner(cv::Point(bb.x + bb.width - 1, bb.y + bb.height - 1), -dx, -dy); +} + +// HeadPoseVisualizer +HeadPoseVisualizer::HeadPoseVisualizer(float scale, cv::Scalar xAxisColor, cv::Scalar yAxisColor, cv::Scalar zAxisColor, int axisThickness): + xAxisColor(xAxisColor), yAxisColor(yAxisColor), zAxisColor(zAxisColor), axisThickness(axisThickness), scale(scale) { +} + +void HeadPoseVisualizer::buildCameraMatrix(cv::Mat& cameraMatrix, int cx, int cy, float focalLength) { + if (!cameraMatrix.empty()) return; + cameraMatrix = cv::Mat::zeros(3, 3, CV_32F); + cameraMatrix.at(0) = focalLength; + cameraMatrix.at(2) = static_cast(cx); + cameraMatrix.at(4) = focalLength; + cameraMatrix.at(5) = static_cast(cy); + cameraMatrix.at(8) = 1; +} + +void HeadPoseVisualizer::draw(cv::Mat& frame, cv::Point3f cpoint, float yaw, float pitch, float roll) { + pitch *= static_cast(CV_PI / 180.0); + yaw *= static_cast(CV_PI / 180.0); + roll *= static_cast(CV_PI / 180.0); + + cv::Matx33f Rx(1, 0, 0, + 0, static_cast(cos(pitch)), static_cast(-sin(pitch)), + 0, static_cast(sin(pitch)), static_cast(cos(pitch))); + + cv::Matx33f Ry(static_cast(cos(yaw)), 0, static_cast(-sin(yaw)), + 0, 1, 0, + static_cast(sin(yaw)), 0, static_cast(cos(yaw))); + + cv::Matx33f Rz(static_cast(cos(roll)), static_cast(-sin(roll)), 0, + static_cast(sin(roll)), static_cast(cos(roll)), 0, + 0, 0, 1); + + + auto r = cv::Mat(Rz*Ry*Rx); + cv::Mat cameraMatrix; + buildCameraMatrix(cameraMatrix, frame.cols / 2, frame.rows / 2, 950.0); + + cv::Mat xAxis(3, 1, CV_32F), yAxis(3, 1, CV_32F), zAxis(3, 1, CV_32F), zAxis1(3, 1, CV_32F); + + xAxis.at(0) = 1 * scale; + xAxis.at(1) = 0; + xAxis.at(2) = 0; + + yAxis.at(0) = 0; + yAxis.at(1) = -1 * scale; + yAxis.at(2) = 0; + + zAxis.at(0) = 0; + zAxis.at(1) = 0; + zAxis.at(2) = -1 * scale; + + zAxis1.at(0) = 0; + zAxis1.at(1) = 0; + zAxis1.at(2) = 1 * scale; + + cv::Mat o(3, 1, CV_32F, cv::Scalar(0)); + o.at(2) = cameraMatrix.at(0); + + xAxis = r * xAxis + o; + yAxis = r * yAxis + o; + zAxis = r * zAxis + o; + zAxis1 = r * zAxis1 + o; + + cv::Point p1, p2; + + p2.x = static_cast((xAxis.at(0) / xAxis.at(2) * cameraMatrix.at(0)) + cpoint.x); + p2.y = static_cast((xAxis.at(1) / xAxis.at(2) * cameraMatrix.at(4)) + cpoint.y); + cv::line(frame, cv::Point(static_cast(cpoint.x), static_cast(cpoint.y)), p2, xAxisColor, axisThickness); + + p2.x = static_cast((yAxis.at(0) / yAxis.at(2) * cameraMatrix.at(0)) + cpoint.x); + p2.y = static_cast((yAxis.at(1) / yAxis.at(2) * cameraMatrix.at(4)) + cpoint.y); + cv::line(frame, cv::Point(static_cast(cpoint.x), static_cast(cpoint.y)), p2, yAxisColor, axisThickness); + + p1.x = static_cast((zAxis1.at(0) / zAxis1.at(2) * cameraMatrix.at(0)) + cpoint.x); + p1.y = static_cast((zAxis1.at(1) / zAxis1.at(2) * cameraMatrix.at(4)) + cpoint.y); + + p2.x = static_cast((zAxis.at(0) / zAxis.at(2) * cameraMatrix.at(0)) + cpoint.x); + p2.y = static_cast((zAxis.at(1) / zAxis.at(2) * cameraMatrix.at(4)) + cpoint.y); + cv::line(frame, p1, p2, zAxisColor, axisThickness); + cv::circle(frame, p2, 3, zAxisColor, axisThickness); +} + +// Visualizer +Visualizer::Visualizer(bool m_ag, bool m_em, bool m_hp, bool m_lm, + int leftPadding, int rightPadding, int topPadding, int bottomPadding): + emotionVisualizer(nullptr), photoFrameVisualizer(std::make_shared()), + headPoseVisualizer(std::make_shared()), + nxcells(0), nycells(0), xstep(0), ystep(0), leftPadding(leftPadding), + rightPadding(rightPadding), topPadding(topPadding), + bottomPadding(bottomPadding), frameCounter(0), + _isAgeGenderEnabled(m_ag), _isEmotionsEnabled(m_em), + _isHeadPoseEnabled(m_hp), _isLandmarksEnabled(m_lm) {} + +void Visualizer::enableEmotionBar(const cv::Size inImgSize, std::vector const& emotionNames) { + if (inImgSize != imgSize) { + imgSize = inImgSize; + + emotionVisualizer = std::make_shared(emotionNames); + emotionBarSize = emotionVisualizer->getSize(); + + cv::Size imgSizePadded; + imgSizePadded.width = imgSize.width - leftPadding - rightPadding; + imgSizePadded.height = imgSize.height - topPadding - bottomPadding; + + nxcells = (imgSizePadded.width - 1) / emotionBarSize.width; + nycells = (imgSizePadded.height - 1) / emotionBarSize.height; + if (0 < nxcells && 0 < nycells) { + drawMap.create(nycells, nxcells, CV_8UC1); + + xstep = imgSizePadded.width / nxcells; + ystep = imgSizePadded.height / nycells; + } else { + emotionVisualizer.reset(); + std::cerr << "Disabling emotion bar due to small frame resolution to draw on\n"; + } + } + +} + +void Visualizer::drawFace(cv::Mat& img, Face::Ptr f, bool drawEmotionBar) { + auto genderColor = (_isAgeGenderEnabled) ? + ((f->isMale()) ? cv::Scalar(255, 0, 0) : + cv::Scalar(147, 20, 255)) : + cv::Scalar(100, 100, 100); + + std::ostringstream out; + if (_isAgeGenderEnabled) { + out << (f->isMale() ? "Male" : "Female"); + out << "," << f->getAge(); + } + + if (_isEmotionsEnabled) { + auto emotion = f->getMainEmotion(); + out << "," << emotion.first; + } + + cv::putText(img, + out.str(), + cv::Point2f(static_cast(f->_location.x), static_cast(f->_location.y - 20)), + cv::FONT_HERSHEY_COMPLEX_SMALL, + 1.5, + genderColor, 2); + + if (_isHeadPoseEnabled) { + cv::Point3f center(static_cast(f->_location.x + f->_location.width / 2), + static_cast(f->_location.y + f->_location.height / 2), + 0.0f); + headPoseVisualizer->draw(img, center, f->_yaw, f->_pitch, f->_roll); + } + + if (_isLandmarksEnabled) { + auto& normed_landmarks = f->getLandmarks(); + size_t n_lm = normed_landmarks.size(); + for (size_t i_lm = 0UL; i_lm < n_lm / 2; ++i_lm) { + float normed_x = normed_landmarks[2 * i_lm]; + float normed_y = normed_landmarks[2 * i_lm + 1]; + + int x_lm = f->_location.x + static_cast(f->_location.width * normed_x); + int y_lm = f->_location.y + static_cast(f->_location.height * normed_y); + cv::circle(img, cv::Point(x_lm, y_lm), 1 + static_cast(0.012 * f->_location.width), cv::Scalar(0, 255, 255), -1); + } + } + + photoFrameVisualizer->draw(img, f->_location, genderColor); + + if (drawEmotionBar) { + DrawParams& dp = drawParams[f->getId()]; + cv::Point org(dp.cell.x * xstep + leftPadding, imgSize.height - dp.cell.y * ystep - emotionBarSize.height - bottomPadding); + + emotionVisualizer->draw(img, f->getEmotions(), org, cv::Scalar(255, 255, 255), genderColor); + + auto getCorner = [](cv::Rect r, AnchorType anchor) -> cv::Point { + cv::Point p; + if (anchor == AnchorType::TL) { + p = r.tl(); + } else if (anchor == AnchorType::TR) { + p.x = r.x + r.width - 1; + p.y = r.y; + } else if (anchor == AnchorType::BL) { + p.x = r.x; + p.y = r.y + r.height - 1; + } else { + p.x = r.x + r.width - 1; + p.y = r.y + r.height - 1; + } + + return p; + }; + + cv::Point p0 = getCorner(cv::Rect(org, emotionBarSize), dp.barAnchor); + cv::Point p1 = getCorner(f->_location, dp.rectAnchor); + cv::line(img, p0, p1, genderColor); + } +} + +cv::Point Visualizer::findCellForEmotionBar() { + cv::Point p; + int yEnd = std::max(nycells / 2, 1); + for (p.y = 0; p.y < yEnd; p.y++) { + for (p.x = 0; p.x < nxcells; p.x++) { + if (drawMap.at(p.y, p.x) == 0) { + return p; + } + } + } + + for (p.x = 0, p.y = yEnd; p.y < nycells; p.y++) { + if (drawMap.at(p.y, p.x) == 0) { + return p; + } + } + + for (p.x = nxcells - 1, p.y = yEnd; p.y < nycells; p.y++) { + if (drawMap.at(p.y, p.x) == 0) { + return p; + } + } + + return cv::Point(-1, -1); +} + +void Visualizer::draw(cv::Mat img, std::list faces) { + drawMap.setTo(0); + frameCounter++; + + std::vector newFaces; + for (auto&& face : faces) { + if (emotionVisualizer) { + if (drawParams.find(face->getId()) == drawParams.end()) { + newFaces.push_back(face); + continue; + } + + drawFace(img, face, true); + + drawParams[face->getId()].frameIdx = frameCounter; + + cv::Point& cell = drawParams[face->getId()].cell; + drawMap.at(cell.y, cell.x) = 1; + } else { + drawFace(img, face, false); + } + } + + if (!newFaces.empty()) { + auto it = drawParams.begin(); + auto endIt = drawParams.end(); + for (; it != endIt; ) { + if (it->second.frameIdx != frameCounter) { + it = drawParams.erase(it); + } else { + ++it; + } + } + + for (auto&& face : newFaces) { + DrawParams dp; + dp.cell = findCellForEmotionBar(); + + if ((dp.cell.x < 0) || (dp.cell.y < 0)) { + drawFace(img, face, false); + } else { + int nycells2 = (nycells + 1) / 2; + int nxcells2 = (nxcells + 1) / 2; + if ((dp.cell.x < nxcells2) && (dp.cell.y < nycells2)) { + dp.barAnchor = AnchorType::TR; + dp.rectAnchor = AnchorType::BL; + } else if ((dp.cell.x >= nxcells2) && (dp.cell.y < nycells2)) { + dp.barAnchor = AnchorType::TL; + dp.rectAnchor = AnchorType::BR; + } else if ((dp.cell.x < nxcells2) && (dp.cell.y >= nycells2)) { + dp.barAnchor = AnchorType::BR; + dp.rectAnchor = AnchorType::TL; + } else { + dp.barAnchor = AnchorType::BL; + dp.rectAnchor = AnchorType::TR; + } + dp.frameIdx = frameCounter; + drawParams[face->getId()] = dp; + + drawFace(img, face, true); + + cv::Point& cell = drawParams[face->getId()].cell; + drawMap.at(cell.y, cell.x) = 1; + } + } + } +} diff --git a/demos/interactive_face_detection_demo/cpp_gapi/visualizer.hpp b/demos/interactive_face_detection_demo/cpp_gapi/visualizer.hpp new file mode 100644 index 00000000000..d97ed97891d --- /dev/null +++ b/demos/interactive_face_detection_demo/cpp_gapi/visualizer.hpp @@ -0,0 +1,127 @@ +// Copyright (C) 2020 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "face.hpp" + +// -------------------------Generic routines for visualization of detection results------------------------------------------------- + +// Drawing a bar of emotions +class EmotionBarVisualizer { +public: + using Ptr = std::shared_ptr; + + explicit EmotionBarVisualizer(std::vector const& emotionNames, cv::Size size = cv::Size(300, 140), cv::Size padding = cv::Size(10, 10), + double opacity = 0.6, double textScale = 1, int textThickness = 1); + + void draw(cv::Mat& img, std::map emotions, cv::Point org, cv::Scalar fgcolor, cv::Scalar bgcolor); + cv::Size getSize(); +private: + std::vector emotionNames; + cv::Size size; + cv::Size padding; + cv::Size textSize; + int textBaseline; + int ystep; + double opacity; + double textScale; + int textThickness; + int internalPadding; +}; + +// Drawing a photo frame around detected face +class PhotoFrameVisualizer { +public: + using Ptr = std::shared_ptr; + + explicit PhotoFrameVisualizer(int bbThickness = 1, int photoFrameThickness = 2, float photoFrameLength = 0.1); + + void draw(cv::Mat& img, cv::Rect& bb, cv::Scalar color); + +private: + int bbThickness; + int photoFrameThickness; + float photoFrameLength; +}; + +// Drawing the position of the head +class HeadPoseVisualizer { +public: + using Ptr = std::shared_ptr; + + explicit HeadPoseVisualizer(float scale = 50, + cv::Scalar xAxisColor = cv::Scalar(0, 0, 255), + cv::Scalar yAxisColor = cv::Scalar(0, 255, 0), + cv::Scalar zAxisColor = cv::Scalar(255, 0, 0), + int axisThickness = 2); + + void draw(cv::Mat& frame, cv::Point3f cpoint, float yaw, float pitch, float roll); + +private: + void buildCameraMatrix(cv::Mat& cameraMatrix, int cx, int cy, float focalLength); + +private: + cv::Scalar xAxisColor; + cv::Scalar yAxisColor; + cv::Scalar zAxisColor; + int axisThickness; + float scale; +}; + +// Drawing detected faces on the frame +class Visualizer { +public: + using Ptr = std::shared_ptr; + + enum AnchorType { + TL = 0, + TR, + BL, + BR + }; + + struct DrawParams { + cv::Point cell; + AnchorType barAnchor; + AnchorType rectAnchor; + size_t frameIdx; + }; + + explicit Visualizer(bool m_ag = false, bool m_em = false, + bool m_hp = false, bool m_lm = false, + int leftPadding = 10, int rightPadding = 10, + int topPadding = 75, int bottomPadding = 10); + + void enableEmotionBar(const cv::Size inImgSize, std::vector const& emotionNames); + void draw(cv::Mat img, std::list faces); + +private: + void drawFace(cv::Mat& img, Face::Ptr f, bool drawEmotionBar); + cv::Point findCellForEmotionBar(); + + std::map drawParams; + EmotionBarVisualizer::Ptr emotionVisualizer; + PhotoFrameVisualizer::Ptr photoFrameVisualizer; + HeadPoseVisualizer::Ptr headPoseVisualizer; + + cv::Mat drawMap; + int nxcells; + int nycells; + int xstep; + int ystep; + + cv::Size imgSize; + int leftPadding; + int rightPadding; + int topPadding; + int bottomPadding; + cv::Size emotionBarSize; + size_t frameCounter; + + bool _isAgeGenderEnabled; + bool _isEmotionsEnabled; + bool _isHeadPoseEnabled; + bool _isLandmarksEnabled; +}; diff --git a/demos/interactive_face_detection_demo/interactive_face_detection.gif b/demos/interactive_face_detection_demo/interactive_face_detection.gif new file mode 100644 index 00000000000..7ae1b57a6f9 Binary files /dev/null and b/demos/interactive_face_detection_demo/interactive_face_detection.gif differ diff --git a/demos/python_demos/machine_translation_demo/README.md b/demos/machine_translation_demo/python/README.md similarity index 86% rename from demos/python_demos/machine_translation_demo/README.md rename to demos/machine_translation_demo/python/README.md index 519c7eb35ed..0526a424157 100644 --- a/demos/python_demos/machine_translation_demo/README.md +++ b/demos/machine_translation_demo/python/README.md @@ -15,6 +15,7 @@ Running the application with the `-h` option yields the following usage message: ``` usage: machine_translation_demo.py [-h] -m MODEL --tokenizer-src TOKENIZER_SRC --tokenizer-tgt TOKENIZER_TGT + [-i [INPUT [INPUT ...]]] [--output-name OUTPUT_NAME] optional arguments: @@ -27,11 +28,13 @@ optional arguments: --tokenizer-tgt TOKENIZER_TGT Required. Path to the folder with tgt tokenizer that contains vocab.json and merges.txt. + -i [INPUT [INPUT ...]], --input [INPUT [INPUT ...]] + Optional. Text for translation. Replaces console input. --output-name OUTPUT_NAME Optional. Name of the models output node. ``` -To run the demo, you can use Intel's pretrained model. To download pretrained models, use the OpenVINO™ [Model Downloader](../../../tools/downloader/README.md) or go to the [Intel® Open Source Technology Center](https://download.01.org/opencv/). +To run the demo, you can use Intel's pretrained model. To download pretrained models, use the OpenVINO™ [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). diff --git a/demos/python_demos/machine_translation_demo/machine_translation_demo.py b/demos/machine_translation_demo/python/machine_translation_demo.py similarity index 85% rename from demos/python_demos/machine_translation_demo/machine_translation_demo.py rename to demos/machine_translation_demo/python/machine_translation_demo.py index 105f7b1e436..4e1b71bc219 100755 --- a/demos/python_demos/machine_translation_demo/machine_translation_demo.py +++ b/demos/machine_translation_demo/python/machine_translation_demo.py @@ -15,9 +15,9 @@ import argparse import itertools import logging as log -import os import sys import time +from pathlib import Path import numpy as np from openvino.inference_engine import IECore @@ -68,8 +68,8 @@ class TranslationEngine: def __init__(self, model_xml, model_bin, output_name): self.logger = log.getLogger("TranslationEngine") self.logger.info("loading network") - self.logger.info("model_xml: " + model_xml) - self.logger.info("model_bin: " + model_bin) + self.logger.info(f"model_xml: {model_xml}") + self.logger.info(f"model_bin: {model_bin}") self.ie = IECore() self.net = self.ie.read_network( model=model_xml, @@ -112,11 +112,11 @@ class Tokenizer: def __init__(self, path, max_tokens): self.logger = log.getLogger("Tokenizer") self.logger.info("loading tokenizer") - self.logger.info("path: " + path) - self.logger.info("max_tokens: " + str(max_tokens)) + self.logger.info(f"path: {path}") + self.logger.info(f"max_tokens: {max_tokens}") self.tokenizer = SentencePieceBPETokenizer( - os.path.join(path, "vocab.json"), - os.path.join(path, "merges.txt") + str(path / "vocab.json"), + str(path / "merges.txt"), ) self.max_tokens = max_tokens self.idx = {} @@ -184,12 +184,14 @@ def build_argparser(): """ Build argument parser. """ parser = argparse.ArgumentParser() - parser.add_argument("-m", "--model", required=True, type=str, + parser.add_argument("-m", "--model", required=True, type=Path, help="Required. Path to an .xml file with a trained model") - parser.add_argument('--tokenizer-src', type=str, required=True, + parser.add_argument('--tokenizer-src', type=Path, required=True, help='Required. Path to the folder with src tokenizer that contains vocab.json and merges.txt.') - parser.add_argument('--tokenizer-tgt', type=str, required=True, + parser.add_argument('--tokenizer-tgt', type=Path, required=True, help='Required. Path to the folder with tgt tokenizer that contains vocab.json and merges.txt.') + parser.add_argument('-i', '--input', type=str, required=False, nargs='*', + help='Optional. Text for translation. Replaces console input.') parser.add_argument('--output-name', type=str, default='pred/Squeeze', help='Optional. Name of the models output node.') return parser @@ -201,23 +203,34 @@ def main(args): logger.info("creating translator") model = Translator( model_xml=args.model, - model_bin=os.path.splitext(args.model)[0] + ".bin", + model_bin=args.model.with_suffix(".bin"), tokenizer_src=args.tokenizer_src, tokenizer_tgt=args.tokenizer_tgt, output_name=args.output_name ) - logger.info("enter empty string to exit.") - while True: - sentence = input("> ") - if not sentence: + + if args.input: + def sentences(): + for sentence in args.input: + print("> {}".format(sentence)) + yield sentence + else: + def sentences(): + while True: + yield input("> ") + + # loop on user's or prepared questions + for sentence in sentences(): + if not sentence.strip(): break + try: start = time.perf_counter() translation = model(sentence) stop = time.perf_counter() print(translation) - logger.info("time: " + str(stop - start) + " s.") - except Exception as e: + logger.info(f"time: {stop - start} s.") + except Exception: log.error("an error occurred", exc_info=True) diff --git a/demos/python_demos/machine_translation_demo/models.lst b/demos/machine_translation_demo/python/models.lst similarity index 100% rename from demos/python_demos/machine_translation_demo/models.lst rename to demos/machine_translation_demo/python/models.lst diff --git a/demos/python_demos/machine_translation_demo/requirements.txt b/demos/machine_translation_demo/python/requirements.txt similarity index 100% rename from demos/python_demos/machine_translation_demo/requirements.txt rename to demos/machine_translation_demo/python/requirements.txt diff --git a/demos/mask_rcnn_demo/CMakeLists.txt b/demos/mask_rcnn_demo/cpp/CMakeLists.txt similarity index 100% rename from demos/mask_rcnn_demo/CMakeLists.txt rename to demos/mask_rcnn_demo/cpp/CMakeLists.txt diff --git a/demos/mask_rcnn_demo/README.md b/demos/mask_rcnn_demo/cpp/README.md similarity index 94% rename from demos/mask_rcnn_demo/README.md rename to demos/mask_rcnn_demo/cpp/README.md index b8cdcfa88a2..a867efca0b2 100644 --- a/demos/mask_rcnn_demo/README.md +++ b/demos/mask_rcnn_demo/cpp/README.md @@ -35,7 +35,7 @@ Options: Running the application with the empty list of options yields the usage message given above and an error message. -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). +To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). @@ -51,6 +51,6 @@ For each input image the application outputs a segmented image. For example, `ou > **NOTE**: On VPU devices (Intel® Movidius™ Neural Compute Stick, Intel® Neural Compute Stick 2, and Intel® Vision Accelerator Design with Intel® Movidius™ VPUs) this demo is not supported with any of the Model Downloader available topologies. Other models may produce unexpected results on these devices as well. ## See Also -* [Using Open Model Zoo demos](../README.md) +* [Using Open Model Zoo demos](../../README.md) * [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) -* [Model Downloader](../../tools/downloader/README.md) +* [Model Downloader](../../../tools/downloader/README.md) diff --git a/demos/mask_rcnn_demo/main.cpp b/demos/mask_rcnn_demo/cpp/main.cpp similarity index 97% rename from demos/mask_rcnn_demo/main.cpp rename to demos/mask_rcnn_demo/cpp/main.cpp index e85c60b22d4..2c50b76f03e 100644 --- a/demos/mask_rcnn_demo/main.cpp +++ b/demos/mask_rcnn_demo/cpp/main.cpp @@ -18,9 +18,9 @@ #include -#include -#include -#include +#include +#include +#include #include "mask_rcnn_demo.h" @@ -252,10 +252,10 @@ int main(int argc, char *argv[]) { float y1 = std::min(std::max(0.0f, box_info[4] * images[batch].rows), static_cast(images[batch].rows)); float x2 = std::min(std::max(0.0f, box_info[5] * images[batch].cols), static_cast(images[batch].cols)); float y2 = std::min(std::max(0.0f, box_info[6] * images[batch].rows), static_cast(images[batch].rows)); - int box_width = std::min(static_cast(std::max(0.0f, x2 - x1)), images[batch].cols); - int box_height = std::min(static_cast(std::max(0.0f, y2 - y1)), images[batch].rows); + int box_width = static_cast(x2 - x1); + int box_height = static_cast(y2 - y1); auto class_id = static_cast(box_info[1] + 1e-6f); - if (prob > PROBABILITY_THRESHOLD) { + if (prob > PROBABILITY_THRESHOLD && box_width > 0 && box_height > 0) { size_t color_index = class_color.emplace(class_id, class_color.size()).first->second; auto& color = CITYSCAPES_COLORS[color_index % arraySize(CITYSCAPES_COLORS)]; float* mask_arr = masks_data + box_stride * box + H * W * (class_id - 1); diff --git a/demos/mask_rcnn_demo/mask_rcnn_demo.h b/demos/mask_rcnn_demo/cpp/mask_rcnn_demo.h similarity index 100% rename from demos/mask_rcnn_demo/mask_rcnn_demo.h rename to demos/mask_rcnn_demo/cpp/mask_rcnn_demo.h diff --git a/demos/mask_rcnn_demo/models.lst b/demos/mask_rcnn_demo/cpp/models.lst similarity index 100% rename from demos/mask_rcnn_demo/models.lst rename to demos/mask_rcnn_demo/cpp/models.lst diff --git a/demos/python_demos/monodepth_demo/README.md b/demos/monodepth_demo/python/README.md similarity index 100% rename from demos/python_demos/monodepth_demo/README.md rename to demos/monodepth_demo/python/README.md diff --git a/demos/python_demos/monodepth_demo/models.lst b/demos/monodepth_demo/python/models.lst similarity index 100% rename from demos/python_demos/monodepth_demo/models.lst rename to demos/monodepth_demo/python/models.lst diff --git a/demos/python_demos/monodepth_demo/monodepth_demo.py b/demos/monodepth_demo/python/monodepth_demo.py similarity index 95% rename from demos/python_demos/monodepth_demo/monodepth_demo.py rename to demos/monodepth_demo/python/monodepth_demo.py index ff226bc8787..380bccf2c7c 100755 --- a/demos/python_demos/monodepth_demo/monodepth_demo.py +++ b/demos/monodepth_demo/python/monodepth_demo.py @@ -1,7 +1,9 @@ #!/usr/bin/env python3 + import sys -import os from argparse import ArgumentParser +from pathlib import Path + import cv2 import numpy as np import logging as log @@ -14,7 +16,7 @@ def main(): parser = ArgumentParser() parser.add_argument( - "-m", "--model", help="Required. Path to an .xml file with a trained model", required=True, type=str) + "-m", "--model", help="Required. Path to an .xml file with a trained model", required=True, type=Path) parser.add_argument( "-i", "--input", help="Required. Path to a input image file", required=True, type=str) parser.add_argument("-l", "--cpu_extension", @@ -36,7 +38,7 @@ def main(): ie.add_extension(args.cpu_extension, "CPU") log.info("Loading network") - net = ie.read_network(args.model, os.path.splitext(args.model)[0] + ".bin") + net = ie.read_network(args.model, args.model.with_suffix(".bin")) assert len(net.input_info) == 1, "Sample supports only single input topologies" assert len(net.outputs) == 1, "Sample supports only single output topologies" diff --git a/demos/python_demos/multi_camera_multi_target_tracking/README.md b/demos/multi_camera_multi_target_tracking/python/README.md similarity index 97% rename from demos/python_demos/multi_camera_multi_target_tracking/README.md rename to demos/multi_camera_multi_target_tracking/python/README.md index abb5e7802af..cada1350704 100644 --- a/demos/python_demos/multi_camera_multi_target_tracking/README.md +++ b/demos/multi_camera_multi_target_tracking/python/README.md @@ -1,6 +1,6 @@ -# Multi Camera Multi Target Python* Demo +# Multi Camera Multi Target Python\* Demo -This demo demonstrates how to run Multi Camera Multi Target (e.g. person or vehicle) demo using OpenVINOTM. +This demo demonstrates how to run Multi Camera Multi Target (e.g. person or vehicle) demo using OpenVINO™. ## How It Works @@ -60,8 +60,10 @@ Multi camera multi target tracking live demo script optional arguments: -h, --help show this help message and exit - -i I [I ...] Input sources (indexes of cameras or paths to video + -i INPUT, --input INPUT + Input sources (indexes of cameras or paths to video files) + --loop Optional. Enable reading the input in a loop --config CONFIG Configuration file --detections DETECTIONS JSON file with bounding boxes diff --git a/demos/python_demos/multi_camera_multi_target_tracking/configs/person.py b/demos/multi_camera_multi_target_tracking/python/configs/person.py similarity index 100% rename from demos/python_demos/multi_camera_multi_target_tracking/configs/person.py rename to demos/multi_camera_multi_target_tracking/python/configs/person.py diff --git a/demos/python_demos/multi_camera_multi_target_tracking/configs/vehicle.py b/demos/multi_camera_multi_target_tracking/python/configs/vehicle.py similarity index 100% rename from demos/python_demos/multi_camera_multi_target_tracking/configs/vehicle.py rename to demos/multi_camera_multi_target_tracking/python/configs/vehicle.py diff --git a/demos/python_demos/multi_camera_multi_target_tracking/mc_tracker/mct.py b/demos/multi_camera_multi_target_tracking/python/mc_tracker/mct.py similarity index 98% rename from demos/python_demos/multi_camera_multi_target_tracking/mc_tracker/mct.py rename to demos/multi_camera_multi_target_tracking/python/mc_tracker/mct.py index 345c0c545d6..fc6dc2ede36 100644 --- a/demos/python_demos/multi_camera_multi_target_tracking/mc_tracker/mct.py +++ b/demos/multi_camera_multi_target_tracking/python/mc_tracker/mct.py @@ -139,7 +139,7 @@ def get_all_tracks_history(self): cam_tracks = sct.get_archived_tracks() + sct.get_tracks() for i in range(len(cam_tracks)): cam_tracks[i] = {'id': cam_tracks[i].id, - 'timestamps': cam_tracks[i].timestamps, + 'timestamps': cam_tracks[i].timestamps, 'boxes': cam_tracks[i].boxes} history.append(cam_tracks) return history diff --git a/demos/python_demos/multi_camera_multi_target_tracking/mc_tracker/sct.py b/demos/multi_camera_multi_target_tracking/python/mc_tracker/sct.py similarity index 100% rename from demos/python_demos/multi_camera_multi_target_tracking/mc_tracker/sct.py rename to demos/multi_camera_multi_target_tracking/python/mc_tracker/sct.py diff --git a/demos/python_demos/multi_camera_multi_target_tracking/models.lst b/demos/multi_camera_multi_target_tracking/python/models.lst similarity index 100% rename from demos/python_demos/multi_camera_multi_target_tracking/models.lst rename to demos/multi_camera_multi_target_tracking/python/models.lst diff --git a/demos/python_demos/multi_camera_multi_target_tracking/multi_camera_multi_target_tracking.py b/demos/multi_camera_multi_target_tracking/python/multi_camera_multi_target_tracking.py similarity index 89% rename from demos/python_demos/multi_camera_multi_target_tracking/multi_camera_multi_target_tracking.py rename to demos/multi_camera_multi_target_tracking/python/multi_camera_multi_target_tracking.py index 28b7dd1f846..226ec52acd9 100755 --- a/demos/python_demos/multi_camera_multi_target_tracking/multi_camera_multi_target_tracking.py +++ b/demos/multi_camera_multi_target_tracking/python/multi_camera_multi_target_tracking.py @@ -33,7 +33,8 @@ from utils.visualization import visualize_multicam_detections, get_target_size from openvino.inference_engine import IECore # pylint: disable=import-error,E0611 -sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'common')) +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), + 'common/python')) import monitors @@ -119,14 +120,8 @@ def run(params, config, capture, detector, reid): frames_thread = Thread(target=thread_body) frames_thread.start() - if len(params.output_video): - frame_size, fps = capture.get_source_parameters() - target_width, target_height = get_target_size(frame_size, None, **config['visualization_config']) - video_output_size = (target_width, target_height) - fourcc = cv.VideoWriter_fourcc(*'XVID') - output_video = cv.VideoWriter(params.output_video, fourcc, min(fps), video_output_size) - else: - output_video = None + frames_read = False + set_output_params = False prev_frames = thread_body.frames_queue.get() detector.run_async(prev_frames, frame_number) @@ -141,6 +136,7 @@ def run(params, config, capture, detector, reid): start = time.perf_counter() try: frames = thread_body.frames_queue.get_nowait() + frames_read = True except queue.Empty: frames = None @@ -170,7 +166,18 @@ def run(params, config, capture, detector, reid): if not params.no_show: cv.imshow(win_name, vis) - if output_video: + if frames_read and not set_output_params: + set_output_params = True + if len(params.output_video): + frame_size = [frame.shape[::-1] for frame in frames] + fps = capture.get_fps() + target_width, target_height = get_target_size(frame_size, None, **config['visualization_config']) + video_output_size = (target_width, target_height) + fourcc = cv.VideoWriter_fourcc(*'XVID') + output_video = cv.VideoWriter(params.output_video, fourcc, min(fps), video_output_size) + else: + output_video = None + if set_output_params and output_video: output_video.write(cv.resize(vis, video_output_size)) print('\rProcessing frame: {}, fps = {} (avg_fps = {:.3})'.format( @@ -196,8 +203,10 @@ def main(): """Prepares data for the object tracking demo""" parser = argparse.ArgumentParser(description='Multi camera multi object \ tracking live demo script') - parser.add_argument('-i', type=str, nargs='+', help='Input sources (indexes \ - of cameras or paths to video files)', required=True) + parser.add_argument('-i', '--input', required=True, nargs='+', + help='Input sources (indexes of cameras or paths to video files)') + parser.add_argument('--loop', default=False, action='store_true', + help='Optional. Enable reading the input in a loop') parser.add_argument('--config', type=str, default=os.path.join(current_dir, 'configs/person.py'), required=False, help='Configuration file') @@ -244,7 +253,7 @@ def main(): sys.exit(1) random.seed(config['random_seed']) - capture = MulticamCapture(args.i) + capture = MulticamCapture(args.input, args.loop) log.info("Creating Inference Engine") ie = IECore() diff --git a/demos/python_demos/multi_camera_multi_target_tracking/requirements.txt b/demos/multi_camera_multi_target_tracking/python/requirements.txt similarity index 100% rename from demos/python_demos/multi_camera_multi_target_tracking/requirements.txt rename to demos/multi_camera_multi_target_tracking/python/requirements.txt diff --git a/demos/python_demos/multi_camera_multi_target_tracking/run_evaluate.py b/demos/multi_camera_multi_target_tracking/python/run_evaluate.py similarity index 100% rename from demos/python_demos/multi_camera_multi_target_tracking/run_evaluate.py rename to demos/multi_camera_multi_target_tracking/python/run_evaluate.py diff --git a/demos/python_demos/multi_camera_multi_target_tracking/run_history_visualize.py b/demos/multi_camera_multi_target_tracking/python/run_history_visualize.py similarity index 90% rename from demos/python_demos/multi_camera_multi_target_tracking/run_history_visualize.py rename to demos/multi_camera_multi_target_tracking/python/run_history_visualize.py index 5be9dac77c6..df05bab56b1 100644 --- a/demos/python_demos/multi_camera_multi_target_tracking/run_history_visualize.py +++ b/demos/multi_camera_multi_target_tracking/python/run_history_visualize.py @@ -140,18 +140,10 @@ def main(): assert len(history) == capture.get_num_sources() - # Configure output video files output_video = None output_video_gt = None - frame_size, fps_source = capture.get_source_parameters() - if len(args.output_video): - video_output_size, fps = calc_output_video_params(frame_size, fps_source, args.gt_files, args.merge_outputs) - fourcc = cv.VideoWriter_fourcc(*'XVID') - output_video = cv.VideoWriter(args.output_video, fourcc, fps, video_output_size) - if args.gt_files and not args.merge_outputs: - ext = args.output_video.split('.')[-1] - output_path = args.output_video[:len(args.output_video) - len(ext) - 1] + '_gt.' + ext - output_video_gt = cv.VideoWriter(output_path, fourcc, fps, video_output_size) + frames_read = False + set_output_params = False # Read GT tracks if necessary if args.gt_files: @@ -179,6 +171,7 @@ def main(): if key == 27: break has_frames, frames = capture.get_frames() + frames_read = True if not has_frames: break @@ -202,6 +195,18 @@ def main(): cv.imshow(win_name, vis) time += 1 + if frames_read and not set_output_params: + set_output_params = True + if len(args.output_video): + frame_size = [frame.shape[::-1] for frame in frames] + fps_source = capture.get_fps() + video_output_size, fps = calc_output_video_params(frame_size, fps_source, args.gt_files, args.merge_outputs) + fourcc = cv.VideoWriter_fourcc(*'XVID') + output_video = cv.VideoWriter(args.output_video, fourcc, fps, video_output_size) + if args.gt_files and not args.merge_outputs: + ext = args.output_video.split('.')[-1] + output_path = args.output_video[:len(args.output_video) - len(ext) - 1] + '_gt.' + ext + output_video_gt = cv.VideoWriter(output_path, fourcc, fps, video_output_size) if output_video: output_video.write(cv.resize(vis, video_output_size)) if vis_gt is not None and output_video_gt is not None: diff --git a/demos/python_demos/text_spotting_demo/text_spotting_demo/__init__.py b/demos/multi_camera_multi_target_tracking/python/utils/__init__.py similarity index 100% rename from demos/python_demos/text_spotting_demo/text_spotting_demo/__init__.py rename to demos/multi_camera_multi_target_tracking/python/utils/__init__.py diff --git a/demos/python_demos/multi_camera_multi_target_tracking/utils/analyzer.py b/demos/multi_camera_multi_target_tracking/python/utils/analyzer.py similarity index 100% rename from demos/python_demos/multi_camera_multi_target_tracking/utils/analyzer.py rename to demos/multi_camera_multi_target_tracking/python/utils/analyzer.py diff --git a/demos/python_demos/multi_camera_multi_target_tracking/utils/ie_tools.py b/demos/multi_camera_multi_target_tracking/python/utils/ie_tools.py similarity index 99% rename from demos/python_demos/multi_camera_multi_target_tracking/utils/ie_tools.py rename to demos/multi_camera_multi_target_tracking/python/utils/ie_tools.py index 4e43da7e778..f7912fc81ce 100644 --- a/demos/python_demos/multi_camera_multi_target_tracking/utils/ie_tools.py +++ b/demos/multi_camera_multi_target_tracking/python/utils/ie_tools.py @@ -11,7 +11,6 @@ limitations under the License. """ -import sys import os import logging as log diff --git a/demos/python_demos/multi_camera_multi_target_tracking/utils/misc.py b/demos/multi_camera_multi_target_tracking/python/utils/misc.py similarity index 100% rename from demos/python_demos/multi_camera_multi_target_tracking/utils/misc.py rename to demos/multi_camera_multi_target_tracking/python/utils/misc.py diff --git a/demos/python_demos/multi_camera_multi_target_tracking/utils/network_wrappers.py b/demos/multi_camera_multi_target_tracking/python/utils/network_wrappers.py similarity index 99% rename from demos/python_demos/multi_camera_multi_target_tracking/utils/network_wrappers.py rename to demos/multi_camera_multi_target_tracking/python/utils/network_wrappers.py index ab78da17bd4..d1ba977a4dc 100644 --- a/demos/python_demos/multi_camera_multi_target_tracking/utils/network_wrappers.py +++ b/demos/multi_camera_multi_target_tracking/python/utils/network_wrappers.py @@ -13,7 +13,6 @@ import json import logging as log -from collections import namedtuple from abc import ABC, abstractmethod import cv2 diff --git a/demos/python_demos/multi_camera_multi_target_tracking/utils/segm_postprocess.py b/demos/multi_camera_multi_target_tracking/python/utils/segm_postprocess.py similarity index 99% rename from demos/python_demos/multi_camera_multi_target_tracking/utils/segm_postprocess.py rename to demos/multi_camera_multi_target_tracking/python/utils/segm_postprocess.py index cfd1b680a19..82767e77b42 100644 --- a/demos/python_demos/multi_camera_multi_target_tracking/utils/segm_postprocess.py +++ b/demos/multi_camera_multi_target_tracking/python/utils/segm_postprocess.py @@ -41,7 +41,7 @@ def postprocess(scores, classes, boxes, raw_cls_masks, im_h, im_w, im_scale_y=None, im_scale_x=None, im_scale=None, full_image_masks=True, encode_masks=False, confidence_threshold=0.0): - no_detections = (np.empty((0, ), dtype=np.float32), np.empty((0, ), dtype=np.float32),\ + no_detections = (np.empty((0, ), dtype=np.float32), np.empty((0, ), dtype=np.float32), np.empty((0, 4), dtype=np.float32), []) if scores is None: return no_detections diff --git a/demos/python_demos/multi_camera_multi_target_tracking/utils/video.py b/demos/multi_camera_multi_target_tracking/python/utils/video.py similarity index 52% rename from demos/python_demos/multi_camera_multi_target_tracking/utils/video.py rename to demos/multi_camera_multi_target_tracking/python/utils/video.py index 5b27e2ccb5e..889f250a5d5 100644 --- a/demos/python_demos/multi_camera_multi_target_tracking/utils/video.py +++ b/demos/multi_camera_multi_target_tracking/python/utils/video.py @@ -11,38 +11,24 @@ limitations under the License. """ -import logging as log import cv2 as cv +import sys +from pathlib import Path + +sys.path.append(str(Path(__file__).resolve().parents[3] / 'common/python')) +from images_capture import open_images_capture class MulticamCapture: - def __init__(self, sources): + def __init__(self, sources, loop): assert sources self.captures = [] self.transforms = [] - - try: - sources = [int(src) for src in sources] - mode = 'cam' - except ValueError: - mode = 'video' - - if mode == 'cam': - for id in sources: - log.info('Connection cam {}'.format(id)) - cap = cv.VideoCapture(id) - cap.set(cv.CAP_PROP_FRAME_WIDTH, 1280) - cap.set(cv.CAP_PROP_FRAME_HEIGHT, 720) - cap.set(cv.CAP_PROP_FPS, 30) - cap.set(cv.CAP_PROP_FOURCC, cv.VideoWriter_fourcc(*'MJPG')) - assert cap.isOpened() - self.captures.append(cap) - else: - for video_path in sources: - log.info('Opening file {}'.format(video_path)) - cap = cv.VideoCapture(video_path) - assert cap.isOpened() - self.captures.append(cap) + self.fps = [] + for src in sources: + capture = open_images_capture(src, loop) + self.captures.append(capture) + self.fps.append(capture.fps()) def add_transform(self, t): self.transforms.append(t) @@ -50,8 +36,8 @@ def add_transform(self, t): def get_frames(self): frames = [] for capture in self.captures: - has_frame, frame = capture.read() - if has_frame: + frame = capture.read() + if frame is not None: for t in self.transforms: frame = t(frame) frames.append(frame) @@ -61,14 +47,8 @@ def get_frames(self): def get_num_sources(self): return len(self.captures) - def get_source_parameters(self): - frame_size = [] - fps = [] - for cap in self.captures: - frame_size.append((int(cap.get(cv.CAP_PROP_FRAME_WIDTH)), - int(cap.get(cv.CAP_PROP_FRAME_HEIGHT)))) - fps.append(int(cap.get(cv.CAP_PROP_FPS))) - return frame_size, fps + def get_fps(self): + return self.fps class NormalizerCLAHE: diff --git a/demos/python_demos/multi_camera_multi_target_tracking/utils/visualization.py b/demos/multi_camera_multi_target_tracking/python/utils/visualization.py similarity index 100% rename from demos/python_demos/multi_camera_multi_target_tracking/utils/visualization.py rename to demos/multi_camera_multi_target_tracking/python/utils/visualization.py diff --git a/demos/multi_channel/CMakeLists.txt b/demos/multi_channel/CMakeLists.txt deleted file mode 100644 index 7fad8e4ba1b..00000000000 --- a/demos/multi_channel/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (C) 2018-2019 Intel Corporation - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -option(MULTICHANNEL_DEMO_USE_TBB "Use TBB-based threading in multichannel face detection demo" OFF) -option(MULTICHANNEL_DEMO_USE_NATIVE_CAM "Use native camera api in multichannel face detection demo" OFF) - -if(MULTICHANNEL_DEMO_USE_NATIVE_CAM OR MULTICHANNEL_DEMO_USE_TBB) - set(CMAKE_CXX_STANDARD 14) - set(CMAKE_CXX_STANDARD_REQUIRED ON) -endif() - -add_subdirectory(common) -add_subdirectory(face_detection_demo) -add_subdirectory(human_pose_estimation_demo) -add_subdirectory(object_detection_demo_yolov3) diff --git a/demos/multi_channel/README.md b/demos/multi_channel/README.md deleted file mode 100644 index 3876b9d5a6a..00000000000 --- a/demos/multi_channel/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Multi-Channel C++ Demos - -The demos provide an inference pipeline for three multi-channel scenarios: face detection, human pose estimation and object detection yolov3. For more information, refer to the corresponding pages: -* [Multi-Channel Face Detection C++ Demo](./face_detection_demo/README.md) -* [Multi-Channel Human Pose Estimation C++ Demo](./human_pose_estimation_demo/README.md) -* [Multi-Channel Object Detection Yolov3 C++ Demo](./object_detection_demo_yolov3/README.md) diff --git a/demos/multi_channel/common/CMakeLists.txt b/demos/multi_channel_common/cpp/CMakeLists.txt similarity index 88% rename from demos/multi_channel/common/CMakeLists.txt rename to demos/multi_channel_common/cpp/CMakeLists.txt index ecbbc293758..bf361071e50 100644 --- a/demos/multi_channel/common/CMakeLists.txt +++ b/demos/multi_channel_common/cpp/CMakeLists.txt @@ -4,6 +4,12 @@ set(TARGET_NAME "multi_channel_common") +if(MULTICHANNEL_DEMO_USE_NATIVE_CAM OR MULTICHANNEL_DEMO_USE_TBB) + set(CMAKE_CXX_STANDARD 14) + set(CMAKE_CXX_STANDARD_REQUIRED ON) +endif() + +find_package(InferenceEngine 2.0 REQUIRED) # Find OpenCV components if exist find_package(OpenCV COMPONENTS highgui QUIET) if(NOT(OpenCV_FOUND)) @@ -11,13 +17,8 @@ if(NOT(OpenCV_FOUND)) return() endif() -file (GLOB MAIN_SRC - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp - ) - -file (GLOB MAIN_HEADERS - ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp - ) +file(GLOB MAIN_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +file(GLOB MAIN_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) # Create named folders for the sources within the .vcproj # Empty name lists them directly under the .vcproj @@ -51,7 +52,7 @@ if(MULTICHANNEL_DEMO_USE_NATIVE_CAM) # LIBVA_INCLUDE_DIR # LIBVA_LIB_DIR - if ((NOT LIBVA_INCLUDE_DIR) OR (NOT LIBVA_LIB_DIR)) + if((NOT LIBVA_INCLUDE_DIR) OR (NOT LIBVA_LIB_DIR)) message(FATAL_ERROR "\"LIBVA_INCLUDE_DIR\" and \"LIBVA_LIB_DIR\" must be set") endif() unset(_LIBVA_LIB CACHE) @@ -78,7 +79,7 @@ if(MULTICHANNEL_DEMO_USE_NATIVE_CAM) NO_DEFAULT_PATH PATHS ${LIBVA_INCLUDE_DIR} ) - if ((NOT _LIBVA_LIB) OR + if((NOT _LIBVA_LIB) OR (NOT _LIBVA_X11_LIB) OR (NOT _LIBVA_DRM_LIB) OR (NOT _LIBVA_INCLUDE_DIR)) @@ -107,4 +108,4 @@ find_package(Threads REQUIRED) target_link_libraries(${TARGET_NAME} PRIVATE ${InferenceEngine_LIBRARIES} gflags ${OpenCV_LIBRARIES} Threads::Threads - PUBLIC common) + PUBLIC utils) diff --git a/demos/multi_channel/common/decoder.cpp b/demos/multi_channel_common/cpp/decoder.cpp similarity index 100% rename from demos/multi_channel/common/decoder.cpp rename to demos/multi_channel_common/cpp/decoder.cpp diff --git a/demos/multi_channel/common/decoder.hpp b/demos/multi_channel_common/cpp/decoder.hpp similarity index 100% rename from demos/multi_channel/common/decoder.hpp rename to demos/multi_channel_common/cpp/decoder.hpp diff --git a/demos/multi_channel/common/graph.cpp b/demos/multi_channel_common/cpp/graph.cpp similarity index 100% rename from demos/multi_channel/common/graph.cpp rename to demos/multi_channel_common/cpp/graph.cpp diff --git a/demos/multi_channel/common/graph.hpp b/demos/multi_channel_common/cpp/graph.hpp similarity index 98% rename from demos/multi_channel/common/graph.hpp rename to demos/multi_channel_common/cpp/graph.hpp index 267b0996927..5050e87a377 100644 --- a/demos/multi_channel/common/graph.hpp +++ b/demos/multi_channel_common/cpp/graph.hpp @@ -17,8 +17,8 @@ #include -#include -#include +#include +#include #include "perf_timer.hpp" #include "input.hpp" diff --git a/demos/multi_channel/common/input.cpp b/demos/multi_channel_common/cpp/input.cpp similarity index 99% rename from demos/multi_channel/common/input.cpp rename to demos/multi_channel_common/cpp/input.cpp index dc8e00760d7..95849384957 100644 --- a/demos/multi_channel/common/input.cpp +++ b/demos/multi_channel_common/cpp/input.cpp @@ -12,8 +12,8 @@ #include #include -#include -#include +#include +#include #include "perf_timer.hpp" diff --git a/demos/multi_channel/common/input.hpp b/demos/multi_channel_common/cpp/input.hpp similarity index 100% rename from demos/multi_channel/common/input.hpp rename to demos/multi_channel_common/cpp/input.hpp diff --git a/demos/multi_channel/common/multicam/CMakeLists.txt b/demos/multi_channel_common/cpp/multicam/CMakeLists.txt similarity index 100% rename from demos/multi_channel/common/multicam/CMakeLists.txt rename to demos/multi_channel_common/cpp/multicam/CMakeLists.txt diff --git a/demos/multi_channel/common/multicam/camera.cpp b/demos/multi_channel_common/cpp/multicam/camera.cpp similarity index 100% rename from demos/multi_channel/common/multicam/camera.cpp rename to demos/multi_channel_common/cpp/multicam/camera.cpp diff --git a/demos/multi_channel/common/multicam/camera.hpp b/demos/multi_channel_common/cpp/multicam/camera.hpp similarity index 100% rename from demos/multi_channel/common/multicam/camera.hpp rename to demos/multi_channel_common/cpp/multicam/camera.hpp diff --git a/demos/multi_channel/common/multicam/controller.cpp b/demos/multi_channel_common/cpp/multicam/controller.cpp similarity index 100% rename from demos/multi_channel/common/multicam/controller.cpp rename to demos/multi_channel_common/cpp/multicam/controller.cpp diff --git a/demos/multi_channel/common/multicam/controller.hpp b/demos/multi_channel_common/cpp/multicam/controller.hpp similarity index 100% rename from demos/multi_channel/common/multicam/controller.hpp rename to demos/multi_channel_common/cpp/multicam/controller.hpp diff --git a/demos/multi_channel/common/multicam/utils.cpp b/demos/multi_channel_common/cpp/multicam/utils.cpp similarity index 100% rename from demos/multi_channel/common/multicam/utils.cpp rename to demos/multi_channel_common/cpp/multicam/utils.cpp diff --git a/demos/multi_channel/common/multicam/utils.hpp b/demos/multi_channel_common/cpp/multicam/utils.hpp similarity index 100% rename from demos/multi_channel/common/multicam/utils.hpp rename to demos/multi_channel_common/cpp/multicam/utils.hpp diff --git a/demos/multi_channel/common/multichannel_params.hpp b/demos/multi_channel_common/cpp/multichannel_params.hpp similarity index 100% rename from demos/multi_channel/common/multichannel_params.hpp rename to demos/multi_channel_common/cpp/multichannel_params.hpp diff --git a/demos/multi_channel/common/output.cpp b/demos/multi_channel_common/cpp/output.cpp similarity index 100% rename from demos/multi_channel/common/output.cpp rename to demos/multi_channel_common/cpp/output.cpp diff --git a/demos/multi_channel/common/output.hpp b/demos/multi_channel_common/cpp/output.hpp similarity index 100% rename from demos/multi_channel/common/output.hpp rename to demos/multi_channel_common/cpp/output.hpp diff --git a/demos/multi_channel/common/perf_timer.cpp b/demos/multi_channel_common/cpp/perf_timer.cpp similarity index 100% rename from demos/multi_channel/common/perf_timer.cpp rename to demos/multi_channel_common/cpp/perf_timer.cpp diff --git a/demos/multi_channel/common/perf_timer.hpp b/demos/multi_channel_common/cpp/perf_timer.hpp similarity index 100% rename from demos/multi_channel/common/perf_timer.hpp rename to demos/multi_channel_common/cpp/perf_timer.hpp diff --git a/demos/multi_channel/common/threading.cpp b/demos/multi_channel_common/cpp/threading.cpp similarity index 100% rename from demos/multi_channel/common/threading.cpp rename to demos/multi_channel_common/cpp/threading.cpp diff --git a/demos/multi_channel/common/threading.hpp b/demos/multi_channel_common/cpp/threading.hpp similarity index 100% rename from demos/multi_channel/common/threading.hpp rename to demos/multi_channel_common/cpp/threading.hpp diff --git a/demos/multi_channel/face_detection_demo/CMakeLists.txt b/demos/multi_channel_face_detection_demo/cpp/CMakeLists.txt similarity index 87% rename from demos/multi_channel/face_detection_demo/CMakeLists.txt rename to demos/multi_channel_face_detection_demo/cpp/CMakeLists.txt index 33f9b0bf3f7..6070f40b492 100644 --- a/demos/multi_channel/face_detection_demo/CMakeLists.txt +++ b/demos/multi_channel_face_detection_demo/cpp/CMakeLists.txt @@ -14,6 +14,11 @@ set(TARGET_NAME "multi_channel_face_detection_demo") +if(MULTICHANNEL_DEMO_USE_NATIVE_CAM OR MULTICHANNEL_DEMO_USE_TBB) + set(CMAKE_CXX_STANDARD 14) + set(CMAKE_CXX_STANDARD_REQUIRED ON) +endif() + if( BUILD_DEMO_NAME AND NOT ${BUILD_DEMO_NAME} STREQUAL ${TARGET_NAME} ) message(STATUS "DEMO ${TARGET_NAME} SKIPPED") return() @@ -26,13 +31,8 @@ if(NOT(OpenCV_FOUND)) return() endif() -file (GLOB MAIN_SRC - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp - ) - -file (GLOB MAIN_HEADERS - ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp - ) +file(GLOB MAIN_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +file(GLOB MAIN_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) # Create named folders for the sources within the .vcproj # Empty name lists them directly under the .vcproj diff --git a/demos/multi_channel/face_detection_demo/README.md b/demos/multi_channel_face_detection_demo/cpp/README.md similarity index 98% rename from demos/multi_channel/face_detection_demo/README.md rename to demos/multi_channel_face_detection_demo/cpp/README.md index b32bc70a41e..2f959083fd9 100644 --- a/demos/multi_channel/face_detection_demo/README.md +++ b/demos/multi_channel_face_detection_demo/cpp/README.md @@ -50,7 +50,7 @@ Options: -u Optional. List of monitors to show initially. ``` -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). +To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). diff --git a/demos/multi_channel/face_detection_demo/main.cpp b/demos/multi_channel_face_detection_demo/cpp/main.cpp similarity index 99% rename from demos/multi_channel/face_detection_demo/main.cpp rename to demos/multi_channel_face_detection_demo/cpp/main.cpp index 73d2d0ee744..7978934597b 100644 --- a/demos/multi_channel/face_detection_demo/main.cpp +++ b/demos/multi_channel_face_detection_demo/cpp/main.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include "input.hpp" #include "multichannel_params.hpp" diff --git a/demos/multi_channel/face_detection_demo/models.lst b/demos/multi_channel_face_detection_demo/cpp/models.lst similarity index 100% rename from demos/multi_channel/face_detection_demo/models.lst rename to demos/multi_channel_face_detection_demo/cpp/models.lst diff --git a/demos/multi_channel/face_detection_demo/multichannel_face_detection_params.hpp b/demos/multi_channel_face_detection_demo/cpp/multichannel_face_detection_params.hpp similarity index 100% rename from demos/multi_channel/face_detection_demo/multichannel_face_detection_params.hpp rename to demos/multi_channel_face_detection_demo/cpp/multichannel_face_detection_params.hpp diff --git a/demos/multi_channel/human_pose_estimation_demo/CMakeLists.txt b/demos/multi_channel_human_pose_estimation_demo/cpp/CMakeLists.txt similarity index 87% rename from demos/multi_channel/human_pose_estimation_demo/CMakeLists.txt rename to demos/multi_channel_human_pose_estimation_demo/cpp/CMakeLists.txt index 109c0e1af14..7b4ad28aa08 100644 --- a/demos/multi_channel/human_pose_estimation_demo/CMakeLists.txt +++ b/demos/multi_channel_human_pose_estimation_demo/cpp/CMakeLists.txt @@ -14,6 +14,11 @@ set(TARGET_NAME "multi_channel_human_pose_estimation_demo") +if(MULTICHANNEL_DEMO_USE_NATIVE_CAM OR MULTICHANNEL_DEMO_USE_TBB) + set(CMAKE_CXX_STANDARD 14) + set(CMAKE_CXX_STANDARD_REQUIRED ON) +endif() + if( BUILD_DEMO_NAME AND NOT ${BUILD_DEMO_NAME} STREQUAL ${TARGET_NAME} ) message(STATUS "DEMO ${TARGET_NAME} SKIPPED") return() @@ -26,13 +31,8 @@ if(NOT(OpenCV_FOUND)) return() endif() -file (GLOB MAIN_SRC - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp - ) - -file (GLOB MAIN_HEADERS - ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp - ) +file(GLOB MAIN_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +file(GLOB MAIN_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) # Create named folders for the sources within the .vcproj # Empty name lists them directly under the .vcproj diff --git a/demos/multi_channel/human_pose_estimation_demo/README.md b/demos/multi_channel_human_pose_estimation_demo/cpp/README.md similarity index 98% rename from demos/multi_channel/human_pose_estimation_demo/README.md rename to demos/multi_channel_human_pose_estimation_demo/cpp/README.md index 317683d9754..b70fcdd3d82 100644 --- a/demos/multi_channel/human_pose_estimation_demo/README.md +++ b/demos/multi_channel_human_pose_estimation_demo/cpp/README.md @@ -51,7 +51,7 @@ Options: Running the application with an empty list of options yields the usage message given above and an error message. -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). +To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). diff --git a/demos/multi_channel/human_pose_estimation_demo/human_pose.cpp b/demos/multi_channel_human_pose_estimation_demo/cpp/human_pose.cpp similarity index 100% rename from demos/multi_channel/human_pose_estimation_demo/human_pose.cpp rename to demos/multi_channel_human_pose_estimation_demo/cpp/human_pose.cpp diff --git a/demos/multi_channel/human_pose_estimation_demo/human_pose.hpp b/demos/multi_channel_human_pose_estimation_demo/cpp/human_pose.hpp similarity index 100% rename from demos/multi_channel/human_pose_estimation_demo/human_pose.hpp rename to demos/multi_channel_human_pose_estimation_demo/cpp/human_pose.hpp diff --git a/demos/multi_channel/human_pose_estimation_demo/main.cpp b/demos/multi_channel_human_pose_estimation_demo/cpp/main.cpp similarity index 99% rename from demos/multi_channel/human_pose_estimation_demo/main.cpp rename to demos/multi_channel_human_pose_estimation_demo/cpp/main.cpp index ce222db9c08..120ef690066 100644 --- a/demos/multi_channel/human_pose_estimation_demo/main.cpp +++ b/demos/multi_channel_human_pose_estimation_demo/cpp/main.cpp @@ -37,8 +37,8 @@ #include #include -#include -#include +#include +#include #include "input.hpp" #include "multichannel_params.hpp" diff --git a/demos/multi_channel/human_pose_estimation_demo/models.lst b/demos/multi_channel_human_pose_estimation_demo/cpp/models.lst similarity index 100% rename from demos/multi_channel/human_pose_estimation_demo/models.lst rename to demos/multi_channel_human_pose_estimation_demo/cpp/models.lst diff --git a/demos/multi_channel/human_pose_estimation_demo/peak.cpp b/demos/multi_channel_human_pose_estimation_demo/cpp/peak.cpp similarity index 99% rename from demos/multi_channel/human_pose_estimation_demo/peak.cpp rename to demos/multi_channel_human_pose_estimation_demo/cpp/peak.cpp index 51b423c1c2b..0871ecb2d75 100644 --- a/demos/multi_channel/human_pose_estimation_demo/peak.cpp +++ b/demos/multi_channel_human_pose_estimation_demo/cpp/peak.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include "peak.hpp" diff --git a/demos/multi_channel/human_pose_estimation_demo/peak.hpp b/demos/multi_channel_human_pose_estimation_demo/cpp/peak.hpp similarity index 100% rename from demos/multi_channel/human_pose_estimation_demo/peak.hpp rename to demos/multi_channel_human_pose_estimation_demo/cpp/peak.hpp diff --git a/demos/multi_channel/human_pose_estimation_demo/postprocess.cpp b/demos/multi_channel_human_pose_estimation_demo/cpp/postprocess.cpp similarity index 100% rename from demos/multi_channel/human_pose_estimation_demo/postprocess.cpp rename to demos/multi_channel_human_pose_estimation_demo/cpp/postprocess.cpp diff --git a/demos/multi_channel/human_pose_estimation_demo/postprocess.hpp b/demos/multi_channel_human_pose_estimation_demo/cpp/postprocess.hpp similarity index 100% rename from demos/multi_channel/human_pose_estimation_demo/postprocess.hpp rename to demos/multi_channel_human_pose_estimation_demo/cpp/postprocess.hpp diff --git a/demos/multi_channel/human_pose_estimation_demo/postprocessor.cpp b/demos/multi_channel_human_pose_estimation_demo/cpp/postprocessor.cpp similarity index 100% rename from demos/multi_channel/human_pose_estimation_demo/postprocessor.cpp rename to demos/multi_channel_human_pose_estimation_demo/cpp/postprocessor.cpp diff --git a/demos/multi_channel/human_pose_estimation_demo/postprocessor.hpp b/demos/multi_channel_human_pose_estimation_demo/cpp/postprocessor.hpp similarity index 100% rename from demos/multi_channel/human_pose_estimation_demo/postprocessor.hpp rename to demos/multi_channel_human_pose_estimation_demo/cpp/postprocessor.hpp diff --git a/demos/multi_channel/human_pose_estimation_demo/render_human_pose.cpp b/demos/multi_channel_human_pose_estimation_demo/cpp/render_human_pose.cpp similarity index 100% rename from demos/multi_channel/human_pose_estimation_demo/render_human_pose.cpp rename to demos/multi_channel_human_pose_estimation_demo/cpp/render_human_pose.cpp diff --git a/demos/multi_channel/human_pose_estimation_demo/render_human_pose.hpp b/demos/multi_channel_human_pose_estimation_demo/cpp/render_human_pose.hpp similarity index 100% rename from demos/multi_channel/human_pose_estimation_demo/render_human_pose.hpp rename to demos/multi_channel_human_pose_estimation_demo/cpp/render_human_pose.hpp diff --git a/demos/multi_channel/object_detection_demo_yolov3/CMakeLists.txt b/demos/multi_channel_object_detection_demo_yolov3/cpp/CMakeLists.txt similarity index 87% rename from demos/multi_channel/object_detection_demo_yolov3/CMakeLists.txt rename to demos/multi_channel_object_detection_demo_yolov3/cpp/CMakeLists.txt index 602a8eb7227..856516e73dd 100644 --- a/demos/multi_channel/object_detection_demo_yolov3/CMakeLists.txt +++ b/demos/multi_channel_object_detection_demo_yolov3/cpp/CMakeLists.txt @@ -14,6 +14,11 @@ set(TARGET_NAME "multi_channel_object_detection_demo_yolov3") +if(MULTICHANNEL_DEMO_USE_NATIVE_CAM OR MULTICHANNEL_DEMO_USE_TBB) + set(CMAKE_CXX_STANDARD 14) + set(CMAKE_CXX_STANDARD_REQUIRED ON) +endif() + if( BUILD_DEMO_NAME AND NOT ${BUILD_DEMO_NAME} STREQUAL ${TARGET_NAME} ) message(STATUS "DEMO ${TARGET_NAME} SKIPPED") return() @@ -26,13 +31,8 @@ if(NOT(OpenCV_FOUND)) return() endif() -file (GLOB MAIN_SRC - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp - ) - -file (GLOB MAIN_HEADERS - ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp - ) +file(GLOB MAIN_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +file(GLOB MAIN_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) # Create named folders for the sources within the .vcproj # Empty name lists them directly under the .vcproj diff --git a/demos/multi_channel/object_detection_demo_yolov3/README.md b/demos/multi_channel_object_detection_demo_yolov3/cpp/README.md similarity index 96% rename from demos/multi_channel/object_detection_demo_yolov3/README.md rename to demos/multi_channel_object_detection_demo_yolov3/cpp/README.md index 0bce5c92cf2..12fafe6002d 100644 --- a/demos/multi_channel/object_detection_demo_yolov3/README.md +++ b/demos/multi_channel_object_detection_demo_yolov3/cpp/README.md @@ -49,7 +49,7 @@ Options: -u Optional. List of monitors to show initially. ``` -To run the demo, you can use public pre-train model and follow [this](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_YOLO_From_Tensorflow.html) page for instruction of how to convert it to IR model. +To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). diff --git a/demos/multi_channel/object_detection_demo_yolov3/main.cpp b/demos/multi_channel_object_detection_demo_yolov3/cpp/main.cpp similarity index 99% rename from demos/multi_channel/object_detection_demo_yolov3/main.cpp rename to demos/multi_channel_object_detection_demo_yolov3/cpp/main.cpp index e871f9bf3fe..ae7b66e4ad3 100644 --- a/demos/multi_channel/object_detection_demo_yolov3/main.cpp +++ b/demos/multi_channel_object_detection_demo_yolov3/cpp/main.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include "input.hpp" #include "multichannel_params.hpp" diff --git a/demos/multi_channel_object_detection_demo_yolov3/cpp/models.lst b/demos/multi_channel_object_detection_demo_yolov3/cpp/models.lst new file mode 100644 index 00000000000..eacce1f8add --- /dev/null +++ b/demos/multi_channel_object_detection_demo_yolov3/cpp/models.lst @@ -0,0 +1,4 @@ +# This file can be used with the --list option of the model downloader. +person-vehicle-bike-detection-crossroad-yolov3-1020 +yolo-v3-tf +yolo-v3-tiny-tf diff --git a/demos/multi_channel/object_detection_demo_yolov3/multichannel_object_detection_demo_yolov3_params.hpp b/demos/multi_channel_object_detection_demo_yolov3/cpp/multichannel_object_detection_demo_yolov3_params.hpp similarity index 100% rename from demos/multi_channel/object_detection_demo_yolov3/multichannel_object_detection_demo_yolov3_params.hpp rename to demos/multi_channel_object_detection_demo_yolov3/cpp/multichannel_object_detection_demo_yolov3_params.hpp diff --git a/demos/object_detection_demo/CMakeLists.txt b/demos/object_detection_demo/cpp/CMakeLists.txt similarity index 85% rename from demos/object_detection_demo/CMakeLists.txt rename to demos/object_detection_demo/cpp/CMakeLists.txt index c803388487e..afaf798a57d 100644 --- a/demos/object_detection_demo/CMakeLists.txt +++ b/demos/object_detection_demo/cpp/CMakeLists.txt @@ -2,8 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 # -FILE(GLOB SRC_FILES ./*.cpp) -FILE(GLOB H_FILES ./*.h) +file(GLOB SRC_FILES ./*.cpp) +file(GLOB H_FILES ./*.h) ie_add_sample(NAME object_detection_demo SOURCES ${SRC_FILES} diff --git a/demos/object_detection_demo/README.md b/demos/object_detection_demo/cpp/README.md similarity index 88% rename from demos/object_detection_demo/README.md rename to demos/object_detection_demo/cpp/README.md index 39274737479..5f55ac705b9 100644 --- a/demos/object_detection_demo/README.md +++ b/demos/object_detection_demo/cpp/README.md @@ -1,5 +1,7 @@ # Object Detection C++ Demo +![](../object_detection.gif) + This demo showcases Object Detection and Async API. Async API usage can improve overall frame-rate of the application, because rather than wait for inference to complete, the app can continue doing things on the host, while accelerator is busy. @@ -65,12 +67,12 @@ InferenceEngine: API version ............ Build .................. -object_detection_demo_async [OPTION] +object_detection_demo [OPTION] Options: -h Print a usage message. - -at "" Required. Architecture type: ssd or yolo - -i "" Required. Path to a video file (specify "cam" to work with camera). + -at "" Required. Architecture type: centernet, faceboxes, retinaface, ssd or yolo + -i "" Required. An input to process. The input must be a single image, a folder of images or anything that cv::VideoCapture can process. -m "" Required. Path to an .xml file with a trained model. -l "" Required for CPU custom layers. Absolute path to a shared library with the kernel implementations. Or @@ -81,7 +83,7 @@ Options: -r Optional. Inference results as raw values. -t Optional. Probability threshold for detections. -auto_resize Optional. Enables resizable input with support of ROI crop & auto resize. - -nireq "" Optional. Number of infer requests. + -nireq "" Optional. Number of infer requests. If this option is omitted, number of infer requests is determined automatically. -nthreads "" Optional. Number of threads. -nstreams Optional. Number of streams to use for inference on the CPU or/and GPU in throughput mode (for HETERO and MULTI device cases use format :,: or just ) -loop Optional. Enable reading the input in a loop. @@ -92,10 +94,12 @@ Options: Running the application with the empty list of options yields the usage message given above and an error message. -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). +To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). +If labels file is used, it should correspond to model output. Demo suggests labels listed in the file to be indexed from 0, one line - one label (i.e. very first line contains label for ID 0). Note that some models may return labels IDs in range 1..N, in this case label file should contain "background" label at the very first line. + You can use the following command to do inference on GPU with a pre-trained object detection model: ```sh ./object_detection_demo -i /inputVideo.mp4 -at ssd -m /ssd.xml -d GPU @@ -112,6 +116,6 @@ You can use both of these metrics to measure application-level performance. ## See Also -* [Using Open Model Zoo demos](../README.md) +* [Using Open Model Zoo demos](../../README.md) * [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) -* [Model Downloader](../../tools/downloader/README.md) +* [Model Downloader](../../../tools/downloader/README.md) diff --git a/demos/object_detection_demo/main.cpp b/demos/object_detection_demo/cpp/main.cpp similarity index 61% rename from demos/object_detection_demo/main.cpp rename to demos/object_detection_demo/cpp/main.cpp index 0eab4976909..3eae278157c 100644 --- a/demos/object_detection_demo/main.cpp +++ b/demos/object_detection_demo/cpp/main.cpp @@ -1,5 +1,5 @@ /* -// Copyright (C) 2018-2020 Intel Corporation +// Copyright (C) 2018-2021 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,29 +23,30 @@ #include #include #include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include -#include - -#include - -#include "pipelines/async_pipeline.h" -#include "pipelines/config_factory.h" -#include "pipelines/metadata.h" -#include "models/detection_model_yolo.h" -#include "models/detection_model_ssd.h" +#include +#include +#include +#include +#include +#include +#include +#include static const char help_message[] = "Print a usage message."; -static const char at_message[] = "Required. Architecture type: ssd or yolo"; -static const char video_message[] = "Required. Path to a video file (specify \"cam\" to work with camera)."; +static const char at_message[] = "Required. Architecture type: centernet, faceboxes, retinaface, ssd or yolo"; static const char model_message[] = "Required. Path to an .xml file with a trained model."; static const char target_device_message[] = "Optional. Specify the target device to infer on (the list of available devices is shown below). " "Default value is CPU. Use \"-d HETERO:\" format to specify HETERO plugin. " @@ -59,7 +60,7 @@ static const char custom_cpu_library_message[] = "Required for CPU custom layers static const char thresh_output_message[] = "Optional. Probability threshold for detections."; static const char raw_output_message[] = "Optional. Inference results as raw values."; static const char input_resizable_message[] = "Optional. Enables resizable input with support of ROI crop & auto resize."; -static const char num_inf_req_message[] = "Optional. Number of infer requests."; +static const char nireq_message[] = "Optional. Number of infer requests. If this option is omitted, number of infer requests is determined automatically."; static const char num_threads_message[] = "Optional. Number of threads."; static const char num_streams_message[] = "Optional. Number of streams to use for inference on the CPU or/and GPU in " "throughput mode (for HETERO and MULTI device cases use format " @@ -71,7 +72,7 @@ static const char yolo_af_message[] = "Optional. Use advanced postprocessing/fil DEFINE_bool(h, false, help_message); DEFINE_string(at, "", at_message); -DEFINE_string(i, "", video_message); +DEFINE_string(i, "", input_message); DEFINE_string(m, "", model_message); DEFINE_string(d, "CPU", target_device_message); DEFINE_string(labels, "", labels_message); @@ -82,7 +83,7 @@ DEFINE_bool(r, false, raw_output_message); DEFINE_double(t, 0.5, thresh_output_message); DEFINE_double(iou_t, 0.4, iou_thresh_output_message); DEFINE_bool(auto_resize, false, input_resizable_message); -DEFINE_uint32(nireq, 2, num_inf_req_message); +DEFINE_uint32(nireq, 0, nireq_message); DEFINE_uint32(nthreads, 0, num_threads_message); DEFINE_string(nstreams, "", num_streams_message); DEFINE_bool(loop, false, loop_message); @@ -95,12 +96,12 @@ DEFINE_bool(yolo_af, false, yolo_af_message); */ static void showUsage() { std::cout << std::endl; - std::cout << "object_detection_demo_ssd_async [OPTION]" << std::endl; + std::cout << "object_detection_demo [OPTION]" << std::endl; std::cout << "Options:" << std::endl; std::cout << std::endl; std::cout << " -h " << help_message << std::endl; std::cout << " -at \"\" " << at_message << std::endl; - std::cout << " -i \"\" " << video_message << std::endl; + std::cout << " -i \"\" " << input_message << std::endl; std::cout << " -m \"\" " << model_message << std::endl; std::cout << " -l \"\" " << custom_cpu_library_message << std::endl; std::cout << " Or" << std::endl; @@ -111,7 +112,7 @@ static void showUsage() { std::cout << " -r " << raw_output_message << std::endl; std::cout << " -t " << thresh_output_message << std::endl; std::cout << " -auto_resize " << input_resizable_message << std::endl; - std::cout << " -nireq \"\" " << num_inf_req_message << std::endl; + std::cout << " -nireq \"\" " << nireq_message << std::endl; std::cout << " -nthreads \"\" " << num_threads_message << std::endl; std::cout << " -nstreams " << num_streams_message << std::endl; std::cout << " -loop " << loop_message << std::endl; @@ -120,6 +121,72 @@ static void showUsage() { std::cout << " -yolo_af " << yolo_af_message << std::endl; } +class ColorPalette { +private: + std::vector palette; + + static double getRandom(double a = 0.0, double b = 1.0) { + static std::default_random_engine e; + std::uniform_real_distribution<> dis(a, std::nextafter(b, std::numeric_limits::max())); + return dis(e); + } + + static double distance(const cv::Scalar& c1, const cv::Scalar& c2) { + auto dh = std::fmin(std::fabs(c1[0] - c2[0]), 1 - fabs(c1[0] - c2[0])) * 2; + auto ds = std::fabs(c1[1] - c2[1]); + auto dv = std::fabs(c1[2] - c2[2]); + + return dh * dh + ds * ds + dv * dv; + } + + static cv::Scalar maxMinDistance(const std::vector& colorSet, const std::vector& colorCandidates) { + std::vector distances; + distances.reserve(colorCandidates.size()); + for (auto& c1 : colorCandidates) { + auto min = *std::min_element(colorSet.begin(), colorSet.end(), + [&c1](const cv::Scalar& a, const cv::Scalar& b) { return distance(c1, a) < distance(c1, b); }); + distances.push_back(distance(c1, min)); + } + auto max = std::max_element(distances.begin(), distances.end()); + return colorCandidates[std::distance(distances.begin(), max)]; + } + + static cv::Scalar hsv2rgb(const cv::Scalar& hsvColor) { + cv::Mat rgb; + cv::Mat hsv(1, 1, CV_8UC3, hsvColor); + cv::cvtColor(hsv, rgb, cv::COLOR_HSV2RGB); + return cv::Scalar(rgb.data[0], rgb.data[1], rgb.data[2]); + } + +public: + explicit ColorPalette(size_t n) { + palette.reserve(n); + std::vector hsvColors(1, { 1., 1., 1. }); + std::vector colorCandidates; + size_t numCandidates = 100; + + hsvColors.reserve(n); + colorCandidates.resize(numCandidates); + for (size_t i = 1; i < n; ++i) { + std::generate(colorCandidates.begin(), colorCandidates.end(), + [] () { return cv::Scalar{ getRandom(), getRandom(0.8, 1.0), getRandom(0.5, 1.0) }; }); + hsvColors.push_back(maxMinDistance(hsvColors, colorCandidates)); + } + + for (auto& hsv : hsvColors) { + // Convert to OpenCV HSV format + hsv[0] *= 179; + hsv[1] *= 255; + hsv[2] *= 255; + + palette.push_back(hsv2rgb(hsv)); + } + } + + const cv::Scalar& operator[] (size_t index) const { + return palette[index % palette.size()]; + } +}; bool ParseAndCheckCommandLine(int argc, char *argv[]) { // ---------------------------Parsing and validation of input args-------------------------------------- @@ -147,7 +214,7 @@ bool ParseAndCheckCommandLine(int argc, char *argv[]) { } // Input image is stored inside metadata, as we put it there during submission stage -cv::Mat renderDetectionData(const DetectionResult& result) { +cv::Mat renderDetectionData(const DetectionResult& result, const ColorPalette& palette) { if (!result.metaData) { throw std::invalid_argument("Renderer: metadata is null"); } @@ -159,15 +226,38 @@ cv::Mat renderDetectionData(const DetectionResult& result) { } // Visualizing result data over source image + if (FLAGS_r) { + slog::info << " Class ID | Confidence | XMIN | YMIN | XMAX | YMAX " << slog::endl; + } for (auto obj : result.objects) { + if (FLAGS_r) { + slog::info << " " + << std::left << std::setw(9) << obj.label << " | " + << std::setw(10) << obj.confidence << " | " + << std::setw(4) << std::max(int(obj.x), 0) << " | " + << std::setw(4) << std::max(int(obj.y), 0) << " | " + << std::setw(4) << std::min(int(obj.x + obj.width), outputImg.cols) << " | " + << std::setw(4) << std::min(int(obj.y + obj.height), outputImg.rows) + << slog::endl; + } + std::ostringstream conf; - conf << ":" << std::fixed << std::setprecision(3) << obj.confidence; + conf << ":" << std::fixed << std::setprecision(1) << obj.confidence * 100 << '%'; + auto color = palette[obj.labelID]; + cv::putText(outputImg, obj.label + conf.str(), + cv::Point2f(obj.x, obj.y - 5), cv::FONT_HERSHEY_COMPLEX_SMALL, 1, { 230, 230, 230 }, 3); cv::putText(outputImg, obj.label + conf.str(), - cv::Point2f(obj.x, obj.y - 5), cv::FONT_HERSHEY_COMPLEX_SMALL, 1, - cv::Scalar(0, 0, 255)); - cv::rectangle(outputImg, obj, cv::Scalar(0, 0, 255)); + cv::Point2f(obj.x, obj.y - 5), cv::FONT_HERSHEY_COMPLEX_SMALL, 1, color); + cv::rectangle(outputImg, obj, color, 2); + } + + try { + for (auto lmark : result.asRef().landmarks) { + cv::circle(outputImg, lmark, 2, cv::Scalar(0, 255, 255), -1); + } } + catch (const std::bad_cast&) {} return outputImg; } @@ -193,9 +283,19 @@ int main(int argc, char *argv[]) { std::vector labels; if (!FLAGS_labels.empty()) labels = DetectionModel::loadLabels(FLAGS_labels); + ColorPalette palette(labels.size() > 0 ? labels.size() : 100); std::unique_ptr model; - if (FLAGS_at == "ssd") { + if (FLAGS_at == "centernet") { + model.reset(new ModelCenterNet(FLAGS_m, (float)FLAGS_t, labels)); + } + else if (FLAGS_at == "faceboxes") { + model.reset(new ModelFaceBoxes(FLAGS_m, (float)FLAGS_t, FLAGS_auto_resize, (float)FLAGS_iou_t)); + } + else if (FLAGS_at == "retinaface") { + model.reset(new ModelRetinaFace(FLAGS_m, (float)FLAGS_t, FLAGS_auto_resize, (float)FLAGS_iou_t)); + } + else if (FLAGS_at == "ssd") { model.reset(new ModelSSD(FLAGS_m, (float)FLAGS_t, FLAGS_auto_resize, labels)); } else if (FLAGS_at == "yolo") { @@ -210,17 +310,19 @@ int main(int argc, char *argv[]) { AsyncPipeline pipeline(std::move(model), ConfigFactory::getUserConfig(FLAGS_d, FLAGS_l, FLAGS_c, FLAGS_pc, FLAGS_nireq, FLAGS_nstreams, FLAGS_nthreads), core); - Presenter presenter; + Presenter presenter(FLAGS_u); bool keepRunning = true; - int64_t frameNum = 0; + int64_t frameNum = -1; + std::unique_ptr result; + while (keepRunning) { if (pipeline.isReadyToProcess()) { - //--- Capturing frame. If previous frame hasn't been inferred yet, reuse it instead of capturing new one + //--- Capturing frame auto startTime = std::chrono::steady_clock::now(); curr_frame = cap->read(); if (curr_frame.empty()) { - if (!frameNum) { + if (frameNum == -1) { throw std::logic_error("Can't read an image from the input"); } else { @@ -239,13 +341,12 @@ int main(int argc, char *argv[]) { //--- Checking for results and rendering data if it's ready //--- If you need just plain data without rendering - cast result's underlying pointer to DetectionResult* // and use your own processing instead of calling renderDetectionData(). - std::unique_ptr result; while ((result = pipeline.getResult()) && keepRunning) { - cv::Mat outFrame = renderDetectionData(result->asRef()); + cv::Mat outFrame = renderDetectionData(result->asRef(), palette); //--- Showing results and device information presenter.drawGraphs(outFrame); metrics.update(result->metaData->asRef().timeStamp, - outFrame, { 10,22 }, 0.65); + outFrame, { 10, 22 }, cv::FONT_HERSHEY_COMPLEX, 0.65); if (!FLAGS_no_show) { cv::imshow("Detection Results", outFrame); //--- Processing keyboard events @@ -260,6 +361,21 @@ int main(int argc, char *argv[]) { } } + //// ------------ Waiting for completion of data processing and rendering the rest of results --------- + pipeline.waitForTotalCompletion(); + while (result = pipeline.getResult()) { + cv::Mat outFrame = renderDetectionData(result->asRef(), palette); + //--- Showing results and device information + presenter.drawGraphs(outFrame); + metrics.update(result->metaData->asRef().timeStamp, + outFrame, { 10, 22 }, cv::FONT_HERSHEY_COMPLEX, 0.65); + if (!FLAGS_no_show) { + cv::imshow("Detection Results", outFrame); + //--- Updating output window + cv::waitKey(1); + } + } + //// --------------------------- Report metrics ------------------------------------------------------- slog::info << slog::endl << "Metric reports:" << slog::endl; metrics.printTotal(); @@ -267,11 +383,11 @@ int main(int argc, char *argv[]) { slog::info << presenter.reportMeans() << slog::endl; } catch (const std::exception& error) { - slog::err << "[ ERROR ] " << error.what() << slog::endl; + slog::err << error.what() << slog::endl; return 1; } catch (...) { - slog::err << "[ ERROR ] Unknown/internal exception happened." << slog::endl; + slog::err << "Unknown/internal exception happened." << slog::endl; return 1; } diff --git a/demos/object_detection_demo/cpp/models.lst b/demos/object_detection_demo/cpp/models.lst new file mode 100644 index 00000000000..c3405480bbb --- /dev/null +++ b/demos/object_detection_demo/cpp/models.lst @@ -0,0 +1,38 @@ +# This file can be used with the --list option of the model downloader. +# For -at centernet +ctdet_coco_dlav0_384 +ctdet_coco_dlav0_512 +# For -at faceboxes +faceboxes-pytorch +# For -at retinaface +retinaface-anti-cov +retinaface-resnet50 +# For -at ssd +efficientdet-d0-tf +efficientdet-d1-tf +face-detection-adas-???? +face-detection-retail-???? +faster-rcnn-resnet101-coco-sparse-60-0001 +pedestrian-and-vehicle-detector-adas-???? +pedestrian-detection-adas-???? +pelee-coco +person-detection-???? +person-detection-retail-0013 +person-vehicle-bike-detection-???? +product-detection-0001 +rfcn-resnet101-coco-tf +retinanet-tf +ssd300 +ssd512 +ssd_mobilenet_v1_coco +ssd_mobilenet_v1_fpn_coco +ssd_mobilenet_v2_coco +ssd_resnet50_v1_fpn_coco +ssdlite_mobilenet_v2 +vehicle-detection-???? +vehicle-detection-adas-???? +vehicle-license-plate-detection-barrier-???? +# For -at yolo +person-vehicle-bike-detection-crossroad-yolov3-1020 +yolo-v3-tf +yolo-v3-tiny-tf diff --git a/demos/object_detection_demo/models.lst b/demos/object_detection_demo/models.lst deleted file mode 100644 index 6560a8c6887..00000000000 --- a/demos/object_detection_demo/models.lst +++ /dev/null @@ -1,17 +0,0 @@ -# This file can be used with the --list option of the model downloader. -# For -at ssd -face-detection-adas-???? -face-detection-retail-???? -pedestrian-and-vehicle-detector-adas-???? -pedestrian-detection-adas-???? -pelee-coco -person-detection-???? -person-detection-asl-???? -person-detection-retail-0013 -retinanet-tf -vehicle-detection-adas-???? -vehicle-license-plate-detection-barrier-???? -ssd-resnet34-1200-onnx -# For -at yolo -yolo-v3-tf -yolo-v3-tiny-tf diff --git a/demos/object_detection_demo/object_detection.gif b/demos/object_detection_demo/object_detection.gif new file mode 100644 index 00000000000..e85b1dfd046 Binary files /dev/null and b/demos/object_detection_demo/object_detection.gif differ diff --git a/demos/python_demos/object_detection_demo_ssd_async/README.md b/demos/object_detection_demo/python/README.md similarity index 50% rename from demos/python_demos/object_detection_demo_ssd_async/README.md rename to demos/object_detection_demo/python/README.md index bb8ad7f421f..337ea854395 100644 --- a/demos/python_demos/object_detection_demo_ssd_async/README.md +++ b/demos/object_detection_demo/python/README.md @@ -1,6 +1,8 @@ -# Object Detection SSD Python* Demo, Async API performance showcase +# Object Detection Python\* Demo -This demo showcases Object Detection with SSD and Async API. +![](../object_detection.gif) + +This demo showcases Object Detection with Sync and Async API. Async API usage can improve overall frame-rate of the application, because rather than wait for inference to complete, the app can continue doing things on the host, while accelerator is busy. @@ -25,11 +27,6 @@ Other demo objectives are: * Video as input support via OpenCV\* * Visualization of the resulting bounding boxes and text labels (from the `.labels` file) or class number (if no file is provided) -* Demonstration of the Async API in action. For this, the demo features two modes toggled by the **Tab** key: - - "User specified" mode, where you can set the number of Infer Requests, throughput streams and threads. - Inference, starting new requests and displaying the results of completed requests are all performed asynchronously. - The purpose of this mode is to get the higher FPS by fully utilizing all available devices. - - "Min latency" mode, which uses only one Infer Request. The purpose of this mode is to get the lowest latency. ## How It Works @@ -39,144 +36,52 @@ Engine. Upon getting a frame from the OpenCV VideoCapture, it performs inference Async API operates with a notion of the "Infer Request" that encapsulates the inputs/outputs and separates *scheduling and waiting for result*. -The pipeline is the same for both modes. The difference is in the number of Infer Requests used. -``` -while True: - if (Infer Request containing the next video frame has completed): - get inference results - process inference results - display the frame - elif (one of the Infer Requests is idle and it is not the end of the input video): - capture frame - populate empty Infer Request - start Infer Request -``` - > **NOTE**: By default, Open Model Zoo demos expect input with BGR channels order. If you trained your model to work with RGB order, you need to manually rearrange the default channels order in the demo application or reconvert your model using the Model Optimizer tool with `--reverse_input_channels` argument specified. For more information about the argument, refer to **When to Reverse Input Channels** section of [Converting a Model Using General Conversion Parameters](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_convert_model_Converting_Model_General.html). -### Async API - -The Inference Engine offers Async API based on the notion of Infer Requests. You can execute a Infer Requests -asynchronously (in the background) and wait until ready, when the result is actually needed. -In a mean time your app can continue : - -```python -# load network as usual -ie = IECore() -net = ie.read_network(model='Model.xml', weights='Model.bin') -# load network to the plugin, setting the maximal number of concurrent Infer Requests to be used -exec_net = ie.load_network(network=net, device_name='GPU', num_requests=2) -# start concurrent Infer Requests (put requests to the queue and immediately return) -for i, request in enumerate(exec_net.requests): - request.async_infer(inputs={'data': imgs[i]}) -# here you can continue execution on the host until results of requests are really needed -# ... -outputs = [request.wait(-1) for request in exec_net.requests] -``` - -Another option is to set a callback on Infer Request completion: - -```python -# load network as usual -ie = IECore() -net = ie.read_network(model='Model.xml', weights='Model.bin') -# load network to the plugin, setting the maximal number of concurrent Infer Requests to be used -exec_net = ie.load_network(network=net, device_name='GPU', num_requests=2) -# define a callback function -def callback(status, py_data): - request, id = py_data - print(id, {key: blob.buffer for key, blob in request.output_blobs.items()}) - -# start concurrent Infer Requests and set their completion callbacks -for i, request in enumerate(exec_net.requests): - request.set_completion_callback(py_callback=callback, py_data=(request, i)) - request.async_infer(inputs={'data': imgs[i]}) - -# here you can continue execution on the host until results of requests are really needed -# ... -``` - -For more details on the requests-based Inference Engine API, including the Async execution, refer to -[Integrate the Inference Engine New Request API with Your Application](https://docs.openvinotoolkit.org/latest/_docs_IE_DG_Integrate_with_customer_application_new_API.html). - - ## Running Running the application with the `-h` option yields the following usage message: ``` -python3 object_detection_demo_ssd_async.py -h +python3 object_detection_demo.py -h ``` The command yields the following usage message: ``` -usage: object_detection_demo_ssd_async.py [-h] -m MODEL -i INPUT [-d DEVICE] - [--labels LABELS] - [-t PROB_THRESHOLD] [-r] - [-nireq NUM_INFER_REQUESTS] - [-nstreams NUM_STREAMS] - [-nthreads NUM_THREADS] - [-loop LOOP] [-no_show] - [-u UTILIZATION_MONITORS] - [--keep_aspect_ratio] +usage: object_detection_demo.py [-h] -m MODEL -at + {ssd,yolo,faceboxes,centernet,retina} -i INPUT + [-d DEVICE] [--labels LABELS] + [-t PROB_THRESHOLD] [--keep_aspect_ratio] + [-nireq NUM_INFER_REQUESTS] + [-nstreams NUM_STREAMS] [-nthreads NUM_THREADS] + [--loop] [-o OUTPUT] [-limit OUTPUT_LIMIT] [--no_show] + [-u UTILIZATION_MONITORS] [-r] Options: -h, --help Show this help message and exit. -m MODEL, --model MODEL Required. Path to an .xml file with a trained model. + -at {ssd,yolo,faceboxes,centernet,retina}, --architecture_type {ssd,yolo,faceboxes,centernet,retina} + Required. Specify model' architecture type. -i INPUT, --input INPUT - Required. Path to an image, video file or a numeric - camera ID. - -d DEVICE, --device DEVICE - Optional. Specify the target device to infer on; CPU, - GPU, FPGA, HDDL or MYRIAD is acceptable. The sample - will look for a suitable plugin for device specified. - Default value is CPU. -Options: - -h, --help Show this help message and exit. - -m MODEL, --model MODEL - Required. Path to an .xml file with a trained model. - -i INPUT, --input INPUT - Required. Path to an image, video file or a numeric - camera ID. - -d DEVICE, --device DEVICE - Optional. Specify the target device to infer on; CPU, - GPU, FPGA, HDDL or MYRIAD is acceptable. The sample - will look for a suitable plugin for device specified. - Default value is CPU. - --labels LABELS Optional. Labels mapping file. - -t PROB_THRESHOLD, --prob_threshold PROB_THRESHOLD - Optional. Probability threshold for detections - filtering. - -r, --raw_output_message - Optional. Output inference results raw values showing. - -nireq NUM_INFER_REQUESTS, --num_infer_requests NUM_INFER_REQUESTS - Optional. Number of infer requests - -nstreams NUM_STREAMS, --num_streams NUM_STREAMS - Optional. Number of streams to use for inference on - the CPU or/and GPU in throughput mode (for HETERO and - MULTI device cases use format - :,: or just - ) - -nthreads NUM_THREADS, --num_threads NUM_THREADS - -m MODEL, --model MODEL - Required. Path to an .xml file with a trained model. - -i INPUT, --input INPUT - Required. Path to an image, video file or a numeric - camera ID. + Required. An input to process. The input must be a + single image, a folder of images, video file or camera id. -d DEVICE, --device DEVICE Optional. Specify the target device to infer on; CPU, GPU, FPGA, HDDL or MYRIAD is acceptable. The sample will look for a suitable plugin for device specified. Default value is CPU. + +Common model options: --labels LABELS Optional. Labels mapping file. -t PROB_THRESHOLD, --prob_threshold PROB_THRESHOLD Optional. Probability threshold for detections filtering. - -r, --raw_output_message - Optional. Output inference results raw values showing. + --keep_aspect_ratio Optional. Keeps aspect ratio on resize. + +Inference options: -nireq NUM_INFER_REQUESTS, --num_infer_requests NUM_INFER_REQUESTS Optional. Number of infer requests -nstreams NUM_STREAMS, --num_streams NUM_STREAMS @@ -184,16 +89,25 @@ Options: the CPU or/and GPU in throughput mode (for HETERO and MULTI device cases use format :,: or just - ) + ). -nthreads NUM_THREADS, --num_threads NUM_THREADS Optional. Number of threads to use for inference on - CPU (including HETERO cases) - -loop LOOP, --loop LOOP - Optional. Number of times to repeat the input. - -no_show, --no_show Optional. Don't show output + CPU (including HETERO cases). + +Input/output options: + --loop Optional. Enable reading the input in a loop. + -o OUTPUT, --output OUTPUT + Optional. Name of output to save. + -limit OUTPUT_LIMIT, --output_limit OUTPUT_LIMIT + Optional. Number of frames to store in output. + If -1 is set, all frames are stored. + --no_show Optional. Don't show output. -u UTILIZATION_MONITORS, --utilization_monitors UTILIZATION_MONITORS Optional. List of monitors to show initially. - --keep_aspect_ratio Optional. Keeps aspect ratio on resize. + +Debug options: + -r, --raw_output_message + Optional. Output inference results raw values showing. ``` The number of Infer Requests is specified by `-nireq` flag. An increase of this number usually leads to an increase @@ -216,16 +130,12 @@ python3 object_detection_demo_ssd_async.py -i /inputVideo.mp4 -m ``` To run the demo, you can use public or pre-trained models. You can download the pre-trained models with the OpenVINO -[Model Downloader](../../../tools/downloader/README.md) or from -[https://download.01.org/opencv/](https://download.01.org/opencv/). +[Model Downloader](../../../tools/downloader/README.md). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). -The only GUI knob is to use **Tab** to switch between the synchronized execution ("Min latency" mode) -and the asynchronous mode configured with provided command-line parameters ("User specified" mode). - ## Demo Output The demo uses OpenCV to display the resulting frame with detections (rendered as bounding boxes and labels, if provided). diff --git a/demos/object_detection_demo/python/models.lst b/demos/object_detection_demo/python/models.lst new file mode 100644 index 00000000000..5f6c81c2d31 --- /dev/null +++ b/demos/object_detection_demo/python/models.lst @@ -0,0 +1,50 @@ +# This file can be used with the --list option of the model downloader. +# For --architecture_type=centernet +ctdet_coco_dlav0_384 +ctdet_coco_dlav0_512 +# For --architecture_type=faceboxes +faceboxes-pytorch +# For --architecture_type=ssd +efficientdet-d0-tf +efficientdet-d1-tf +face-detection-???? +face-detection-adas-???? +face-detection-retail-???? +faster-rcnn-resnet101-coco-sparse-60-0001 +pedestrian-and-vehicle-detector-adas-???? +pedestrian-detection-adas-???? +pelee-coco +person-detection-???? +person-detection-retail-0013 +person-vehicle-bike-detection-???? +product-detection-0001 +retinanet-tf +rfcn-resnet101-coco-tf +ssd300 +ssd512 +ssd_mobilenet_v1_coco +ssd_mobilenet_v1_fpn_coco +ssd_mobilenet_v2_coco +ssd_resnet50_v1_fpn_coco +ssd-resnet34-1200-onnx +ssdlite_mobilenet_v2 +vehicle-detection-???? +vehicle-detection-adas-???? +vehicle-license-plate-detection-barrier-???? +# For --architecture_type=retina +retinaface-anti-cov +retinaface-resnet50 +ssh-mxnet +# For --architecture_type=yolo +mobilefacedet-v1-mxnet +person-vehicle-bike-detection-crossroad-yolov3-1020 +yolo-v1-tiny-tf +yolo-v2-ava-0001 +yolo-v2-ava-sparse-??-0001 +yolo-v2-tf +yolo-v2-tiny-ava-0001 +yolo-v2-tiny-ava-sparse-??-0001 +yolo-v2-tiny-tf +yolo-v2-tiny-vehicle-detection-0001 +yolo-v3-tf +yolo-v3-tiny-tf diff --git a/demos/object_detection_demo/python/object_detection_demo.py b/demos/object_detection_demo/python/object_detection_demo.py new file mode 100755 index 00000000000..3ada6e19d9d --- /dev/null +++ b/demos/object_detection_demo/python/object_detection_demo.py @@ -0,0 +1,338 @@ +#!/usr/bin/env python3 +""" + Copyright (C) 2018-2020 Intel Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + +import colorsys +import logging +import random +import sys +from argparse import ArgumentParser, SUPPRESS +from pathlib import Path +from time import perf_counter + +import cv2 +import numpy as np +from openvino.inference_engine import IECore + +sys.path.append(str(Path(__file__).resolve().parents[2] / 'common/python')) + + +import models +import monitors +from pipelines import AsyncPipeline +from images_capture import open_images_capture +from performance_metrics import PerformanceMetrics + +logging.basicConfig(format='[ %(levelname)s ] %(message)s', level=logging.INFO, stream=sys.stdout) +log = logging.getLogger() + + +def build_argparser(): + parser = ArgumentParser(add_help=False) + args = parser.add_argument_group('Options') + args.add_argument('-h', '--help', action='help', default=SUPPRESS, help='Show this help message and exit.') + args.add_argument('-m', '--model', help='Required. Path to an .xml file with a trained model.', + required=True, type=Path) + args.add_argument('-at', '--architecture_type', help='Required. Specify model\' architecture type.', + type=str, required=True, choices=('ssd', 'yolo', 'faceboxes', 'centernet', 'retina')) + args.add_argument('-i', '--input', required=True, + help='Required. An input to process. The input must be a single image, ' + 'a folder of images, video file or camera id.') + args.add_argument('-d', '--device', default='CPU', type=str, + help='Optional. Specify the target device to infer on; CPU, GPU, FPGA, HDDL or MYRIAD is ' + 'acceptable. The sample will look for a suitable plugin for device specified. ' + 'Default value is CPU.') + + common_model_args = parser.add_argument_group('Common model options') + common_model_args.add_argument('--labels', help='Optional. Labels mapping file.', default=None, type=str) + common_model_args.add_argument('-t', '--prob_threshold', default=0.5, type=float, + help='Optional. Probability threshold for detections filtering.') + common_model_args.add_argument('--keep_aspect_ratio', action='store_true', default=False, + help='Optional. Keeps aspect ratio on resize.') + + infer_args = parser.add_argument_group('Inference options') + infer_args.add_argument('-nireq', '--num_infer_requests', help='Optional. Number of infer requests', + default=1, type=int) + infer_args.add_argument('-nstreams', '--num_streams', + help='Optional. Number of streams to use for inference on the CPU or/and GPU in throughput ' + 'mode (for HETERO and MULTI device cases use format ' + ':,: or just ).', + default='', type=str) + infer_args.add_argument('-nthreads', '--num_threads', default=None, type=int, + help='Optional. Number of threads to use for inference on CPU (including HETERO cases).') + + io_args = parser.add_argument_group('Input/output options') + io_args.add_argument('--loop', default=False, action='store_true', + help='Optional. Enable reading the input in a loop.') + io_args.add_argument('-o', '--output', required=False, + help='Optional. Name of output to save.') + io_args.add_argument('-limit', '--output_limit', required=False, default=1000, type=int, + help='Optional. Number of frames to store in output. ' + 'If -1 is set, all frames are stored.') + io_args.add_argument('--no_show', help="Optional. Don't show output.", action='store_true') + io_args.add_argument('-u', '--utilization_monitors', default='', type=str, + help='Optional. List of monitors to show initially.') + + debug_args = parser.add_argument_group('Debug options') + debug_args.add_argument('-r', '--raw_output_message', help='Optional. Output inference results raw values showing.', + default=False, action='store_true') + return parser + + +class ColorPalette: + def __init__(self, n, rng=None): + assert n > 0 + + if rng is None: + rng = random.Random(0xACE) + + candidates_num = 100 + hsv_colors = [(1.0, 1.0, 1.0)] + for _ in range(1, n): + colors_candidates = [(rng.random(), rng.uniform(0.8, 1.0), rng.uniform(0.5, 1.0)) + for _ in range(candidates_num)] + min_distances = [self.min_distance(hsv_colors, c) for c in colors_candidates] + arg_max = np.argmax(min_distances) + hsv_colors.append(colors_candidates[arg_max]) + + self.palette = [self.hsv2rgb(*hsv) for hsv in hsv_colors] + + @staticmethod + def dist(c1, c2): + dh = min(abs(c1[0] - c2[0]), 1 - abs(c1[0] - c2[0])) * 2 + ds = abs(c1[1] - c2[1]) + dv = abs(c1[2] - c2[2]) + return dh * dh + ds * ds + dv * dv + + @classmethod + def min_distance(cls, colors_set, color_candidate): + distances = [cls.dist(o, color_candidate) for o in colors_set] + return np.min(distances) + + @staticmethod + def hsv2rgb(h, s, v): + return tuple(round(c * 255) for c in colorsys.hsv_to_rgb(h, s, v)) + + def __getitem__(self, n): + return self.palette[n % len(self.palette)] + + def __len__(self): + return len(self.palette) + + +def get_model(ie, args): + if args.architecture_type == 'ssd': + return models.SSD(ie, args.model, labels=args.labels, keep_aspect_ratio_resize=args.keep_aspect_ratio) + elif args.architecture_type == 'yolo': + return models.YOLO(ie, args.model, labels=args.labels, + threshold=args.prob_threshold, keep_aspect_ratio=args.keep_aspect_ratio) + elif args.architecture_type == 'faceboxes': + return models.FaceBoxes(ie, args.model, threshold=args.prob_threshold) + elif args.architecture_type == 'centernet': + return models.CenterNet(ie, args.model, labels=args.labels, threshold=args.prob_threshold) + elif args.architecture_type == 'retina': + return models.RetinaFace(ie, args.model, threshold=args.prob_threshold) + else: + raise RuntimeError('No model type or invalid model type (-at) provided: {}'.format(args.architecture_type)) + + +def put_highlighted_text(frame, message, position, font_face, font_scale, color, thickness): + cv2.putText(frame, message, position, font_face, font_scale, (255, 255, 255), thickness + 1) # white border + cv2.putText(frame, message, position, font_face, font_scale, color, thickness) + + +def get_plugin_configs(device, num_streams, num_threads): + config_user_specified = {} + + devices_nstreams = {} + if num_streams: + devices_nstreams = {device: num_streams for device in ['CPU', 'GPU'] if device in device} \ + if num_streams.isdigit() \ + else dict(device.split(':', 1) for device in num_streams.split(',')) + + if 'CPU' in device: + if num_threads is not None: + config_user_specified['CPU_THREADS_NUM'] = str(num_threads) + if 'CPU' in devices_nstreams: + config_user_specified['CPU_THROUGHPUT_STREAMS'] = devices_nstreams['CPU'] \ + if int(devices_nstreams['CPU']) > 0 \ + else 'CPU_THROUGHPUT_AUTO' + + if 'GPU' in device: + if 'GPU' in devices_nstreams: + config_user_specified['GPU_THROUGHPUT_STREAMS'] = devices_nstreams['GPU'] \ + if int(devices_nstreams['GPU']) > 0 \ + else 'GPU_THROUGHPUT_AUTO' + + return config_user_specified + + +def draw_detections(frame, detections, palette, labels, threshold): + size = frame.shape[:2] + for detection in detections: + if detection.score > threshold: + xmin = max(int(detection.xmin), 0) + ymin = max(int(detection.ymin), 0) + xmax = min(int(detection.xmax), size[1]) + ymax = min(int(detection.ymax), size[0]) + class_id = int(detection.id) + color = palette[class_id] + det_label = labels[class_id] if labels and len(labels) >= class_id else '#{}'.format(class_id) + cv2.rectangle(frame, (xmin, ymin), (xmax, ymax), color, 2) + cv2.putText(frame, '{} {:.1%}'.format(det_label, detection.score), + (xmin, ymin - 7), cv2.FONT_HERSHEY_COMPLEX, 0.6, color, 1) + if isinstance(detection, models.DetectionWithLandmarks): + for landmark in detection.landmarks: + cv2.circle(frame, landmark, 2, (0, 255, 255), 2) + return frame + + +def print_raw_results(size, detections, labels, threshold): + log.info(' Class ID | Confidence | XMIN | YMIN | XMAX | YMAX ') + for detection in detections: + if detection.score > threshold: + xmin = max(int(detection.xmin), 0) + ymin = max(int(detection.ymin), 0) + xmax = min(int(detection.xmax), size[1]) + ymax = min(int(detection.ymax), size[0]) + class_id = int(detection.id) + det_label = labels[class_id] if labels and len(labels) >= class_id else '#{}'.format(class_id) + log.info('{:^9} | {:10f} | {:4} | {:4} | {:4} | {:4} ' + .format(det_label, detection.score, xmin, ymin, xmax, ymax)) + + +def main(): + args = build_argparser().parse_args() + + log.info('Initializing Inference Engine...') + ie = IECore() + + plugin_config = get_plugin_configs(args.device, args.num_streams, args.num_threads) + + log.info('Loading network...') + + model = get_model(ie, args) + + detector_pipeline = AsyncPipeline(ie, model, plugin_config, + device=args.device, max_num_requests=args.num_infer_requests) + + cap = open_images_capture(args.input, args.loop) + + next_frame_id = 0 + next_frame_id_to_show = 0 + + log.info('Starting inference...') + print("To close the application, press 'CTRL+C' here or switch to the output window and press ESC key") + + palette = ColorPalette(len(model.labels) if model.labels else 100) + metrics = PerformanceMetrics() + presenter = None + video_writer = cv2.VideoWriter() + + while True: + if detector_pipeline.callback_exceptions: + raise detector_pipeline.callback_exceptions[0] + # Process all completed requests + results = detector_pipeline.get_result(next_frame_id_to_show) + if results: + objects, frame_meta = results + frame = frame_meta['frame'] + start_time = frame_meta['start_time'] + + if len(objects) and args.raw_output_message: + print_raw_results(frame.shape[:2], objects, model.labels, args.prob_threshold) + + presenter.drawGraphs(frame) + frame = draw_detections(frame, objects, palette, model.labels, args.prob_threshold) + metrics.update(start_time, frame) + + if video_writer.isOpened() and (args.output_limit == -1 or next_frame_id_to_show <= args.output_limit-1): + video_writer.write(frame) + + if not args.no_show: + cv2.imshow('Detection Results', frame) + key = cv2.waitKey(1) + + ESC_KEY = 27 + # Quit. + if key in {ord('q'), ord('Q'), ESC_KEY}: + break + presenter.handleKey(key) + next_frame_id_to_show += 1 + continue + + if detector_pipeline.is_ready(): + # Get new image/frame + start_time = perf_counter() + frame = cap.read() + if frame is None: + if next_frame_id == 0: + raise ValueError("Can't read an image from the input") + break + if next_frame_id == 0: + presenter = monitors.Presenter(args.utilization_monitors, 55, + (round(frame.shape[1] / 4), round(frame.shape[0] / 8))) + if args.output: + video_writer = cv2.VideoWriter(args.output, cv2.VideoWriter_fourcc(*'MJPG'), cap.fps(), + (frame.shape[1], frame.shape[0])) + if not video_writer.isOpened(): + raise RuntimeError("Can't open video writer") + # Submit for inference + detector_pipeline.submit_data(frame, next_frame_id, {'frame': frame, 'start_time': start_time}) + next_frame_id += 1 + + else: + # Wait for empty request + detector_pipeline.await_any() + + detector_pipeline.await_all() + # Process completed requests + while detector_pipeline.has_completed_request(): + results = detector_pipeline.get_result(next_frame_id_to_show) + if results: + objects, frame_meta = results + frame = frame_meta['frame'] + start_time = frame_meta['start_time'] + + if len(objects) and args.raw_output_message: + print_raw_results(frame.shape[:2], objects, model.labels, args.prob_threshold) + + presenter.drawGraphs(frame) + frame = draw_detections(frame, objects, palette, model.labels, args.prob_threshold) + metrics.update(start_time, frame) + + if video_writer.isOpened(): + video_writer.write(frame) + + if not args.no_show: + cv2.imshow('Detection Results', frame) + key = cv2.waitKey(1) + + ESC_KEY = 27 + # Quit. + if key in {ord('q'), ord('Q'), ESC_KEY}: + break + presenter.handleKey(key) + next_frame_id_to_show += 1 + else: + break + + metrics.print_total() + print(presenter.reportMeans()) + + +if __name__ == '__main__': + sys.exit(main() or 0) diff --git a/demos/object_detection_demo_faster_rcnn/CMakeLists.txt b/demos/object_detection_demo_faster_rcnn/CMakeLists.txt deleted file mode 100644 index 04eb26e8867..00000000000 --- a/demos/object_detection_demo_faster_rcnn/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (C) 2018-2019 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 -# - -ie_add_sample(NAME object_detection_demo_faster_rcnn - SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp" - HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/object_detection_demo_faster_rcnn.h" - "${CMAKE_CURRENT_SOURCE_DIR}/detectionoutput.h" - OPENCV_DEPENDENCIES core imgcodecs imgproc) diff --git a/demos/object_detection_demo_faster_rcnn/README.md b/demos/object_detection_demo_faster_rcnn/README.md deleted file mode 100644 index 3c768efbc42..00000000000 --- a/demos/object_detection_demo_faster_rcnn/README.md +++ /dev/null @@ -1,72 +0,0 @@ -# Object Detection Faster R-CNN C++ Demo - -This topic demonstrates how to run the Object Detection demo application, which does inference using object detection -networks like Faster R-CNN on Intel® Processors and Intel® HD Graphics. - -## Downloading and Converting Caffe* Model -VGG16-Faster-RCNN is a public CNN that can be easily obtained from GitHub: - -1. Download test.prototxt from [https://raw.githubusercontent.com/rbgirshick/py-faster-rcnn/master/models/pascal_voc/VGG16/faster_rcnn_end2end/test.prototxt](https://raw.githubusercontent.com/rbgirshick/py-faster-rcnn/master/models/pascal_voc/VGG16/faster_rcnn_end2end/test.prototxt) -2. Download pre-trained models from [https://dl.dropboxusercontent.com/s/o6ii098bu51d139/faster_rcnn_models.tgz?dl=0](https://dl.dropboxusercontent.com/s/o6ii098bu51d139/faster_rcnn_models.tgz?dl=0) -3. Unzip the archive. You will need the VGG16_faster_rcnn_final.caffemodel file. - -To convert the source model, run the Model Optimizer. -You can use the following command to convert the source model: -```sh -python3 ${MO_ROOT_PATH}/mo_caffe.py --input_model /VGG16_faster_rcnn_final.caffemodel --input_proto /deploy.prototxt -``` - -For documentation on how to convert Caffe models, refer to [Converting a Caffe Model](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_Caffe.html). - -## How It Works - -Upon the start-up, the demo application reads command line parameters and loads a network and an image to the Inference -Engine plugin. When inference is done, the application creates an -output image and outputs data to the standard output stream. - -> **NOTE**: By default, Open Model Zoo demos expect input with BGR channels order. If you trained your model to work with RGB order, you need to manually rearrange the default channels order in the demo application or reconvert your model using the Model Optimizer tool with `--reverse_input_channels` argument specified. For more information about the argument, refer to **When to Reverse Input Channels** section of [Converting a Model Using General Conversion Parameters](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_convert_model_Converting_Model_General.html). - -## Running - -Running the application with the `-h` option yields the following usage message: -``` -[ INFO ] InferenceEngine: - -object_detection_demo_faster_rcnn [OPTION] -Options: - - -h Print a usage message. - -i "" Required. Path to a .bmp image. - -m "" Required. Path to an .xml file with a trained model. - -l "" Required for CPU custom layers. Absolute path to a shared library with the kernels implementations. - -c "" Required for GPU custom kernels. Absolute path to the .xml file with the kernels descriptions. - -d "" Optional. Specify the target device to infer on (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. - -bbox_name "" Optional. The name of output box prediction layer. Default value is "bbox_pred" - -proposal_name "" Optional. The name of output proposal layer. Default value is "proposal" - -prob_name "" Optional. The name of output probability layer. Default value is "cls_prob" -``` - -Running the application with the empty list of options yields an error message. - -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). - -> **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). - -You can use the following command to do inference on CPU on an image using a trained Faster R-CNN network: -```sh -./object_detection_demo_faster_rcnn -i /inputImage.bmp -m /faster-rcnn.xml -d CPU -``` - -## Demo Output - -The application outputs an image (`out_0.bmp`) with detected objects enclosed in rectangles. It outputs the list of classes -of the detected objects along with the respective confidence values and the coordinates of the -rectangles to the standard output stream. - -> **NOTE**: On VPU devices (Intel® Movidius™ Neural Compute Stick, Intel® Neural Compute Stick 2, and Intel® Vision Accelerator Design with Intel® Movidius™ VPUs) this demo is not supported with any of the Model Downloader available topologies. Other models may work incorrectly on these devices as well. - -## See Also -* [Using Open Model Zoo demos](../README.md) -* [Model Downloader](../../tools/downloader/README.md) -* [Converting a Model Using General Conversion Parameters](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_convert_model_Converting_Model_General.html) -* [Converting a Caffe Model](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_Caffe.html) diff --git a/demos/object_detection_demo_faster_rcnn/detectionoutput.h b/demos/object_detection_demo_faster_rcnn/detectionoutput.h deleted file mode 100644 index 42746c8ec16..00000000000 --- a/demos/object_detection_demo_faster_rcnn/detectionoutput.h +++ /dev/null @@ -1,453 +0,0 @@ -// Copyright (C) 2018-2019 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include -#include -#include -#include -#include - -#include - -using namespace InferenceEngine; -using InferenceEngine::details::InferenceEngineException; - -template -static bool SortScorePairDescend(const std::pair& pair1, - const std::pair& pair2) { - return pair1.first > pair2.first; -} - -/** - * @class DetectionOutputPostProcessor - * @brief This class is almost a copy of MKLDNN extension implementation DetectionOutputImpl. - * In our demo we use it as a post-processing class for Faster-RCNN networks - */ -class DetectionOutputPostProcessor { -public: - explicit DetectionOutputPostProcessor(const SizeVector &image_dims, - const SizeVector &loc_dims, - const SizeVector &conf_dims, - const SizeVector &prior_dims) { - try { - IE_ASSERT(4 == image_dims.size()); - - _image_height = image_dims[2]; - _image_width = image_dims[3]; - - IE_ASSERT(2 <= prior_dims.size()); - int priors_size = prior_dims[prior_dims.size() - 2] * prior_dims[prior_dims.size() - 1]; - - IE_ASSERT(2 <= loc_dims.size()); - int loc_size = loc_dims[loc_dims.size() - 2]*loc_dims[loc_dims.size() - 1]; - - IE_ASSERT(2 <= conf_dims.size()); - size_t conf_size = conf_dims[0]*conf_dims[1]; - - _num_priors = static_cast(priors_size / _prior_size); - - // num_classes guessed from the output dims - if (loc_size % (_num_priors * 4) != 0) { - throw std::runtime_error("Can't guess number of classes. Something's wrong with output layers dims"); - } - - _num_classes = loc_size / (_num_priors * 4); - _num_loc_classes = _num_classes; - - if (_num_priors * _num_loc_classes * 4 != loc_size) - THROW_IE_EXCEPTION << "Number of priors must match number of location predictions."; - - if (_num_priors * _num_classes != static_cast(conf_size)) - THROW_IE_EXCEPTION << "Number of priors must match number of confidence predictions."; - - SizeVector bboxes_size{conf_size, - static_cast(_num_classes), - static_cast(_num_priors), - 4}; - _decoded_bboxes = make_shared_blob({Precision::FP32, bboxes_size, NCHW}); - _decoded_bboxes->allocate(); - - SizeVector buf_size{conf_size, - static_cast(_num_classes), - static_cast(_num_priors)}; - _buffer = make_shared_blob({Precision::I32, buf_size, {buf_size, {0, 1, 2}}}); - _buffer->allocate(); - - SizeVector indices_size{conf_size, - static_cast(_num_classes), - static_cast(_num_priors)}; - _indices = make_shared_blob( - {Precision::I32, indices_size, {indices_size, {0, 1, 2}}}); - _indices->allocate(); - - SizeVector detections_size{conf_size * static_cast(_num_classes)}; - _detections_count = make_shared_blob({Precision::I32, detections_size, C}); - _detections_count->allocate(); - - SizeVector conf_size1 = { conf_size, 1 }; - _reordered_conf = make_shared_blob({Precision::FP32, conf_size1, ANY}); - _reordered_conf->allocate(); - - SizeVector decoded_bboxes_size{conf_size, - static_cast(_num_priors), - static_cast(_num_classes)}; - _bbox_sizes = make_shared_blob( - {Precision::FP32, decoded_bboxes_size, {decoded_bboxes_size, {0, 1, 2}}}); - _bbox_sizes->allocate(); - - SizeVector num_priors_actual_size{conf_size}; - _num_priors_actual = make_shared_blob({Precision::I32, num_priors_actual_size, C}); - _num_priors_actual->allocate(); - } catch (const InferenceEngineException& ex) { - throw std::logic_error(std::string("Can't create detection output: ") + ex.what()); - } - } - - StatusCode execute(std::vector& inputs, std::vector& outputs, - ResponseDesc *resp) noexcept { - LockedMemory outputMapped = as(outputs[0])->wmap(); - float *dst_data = outputMapped; - - LockedMemory idxLocationMapped = as(inputs[idx_location])->rmap(); - const float *loc_data = idxLocationMapped.as(); - LockedMemory idxConfidenceMapped = as(inputs[idx_confidence])->rmap(); - const float *conf_data = idxConfidenceMapped.as(); - LockedMemory idxPriorsMapped = as(inputs[idx_priors])->rmap(); - const float *prior_data = idxPriorsMapped.as(); - - const int N = 1; // TODO: Support batch - - LockedMemory decodedBboxesMapped = as(_decoded_bboxes)->rmap(); - float *decoded_bboxes_data = decodedBboxesMapped.as(); - LockedMemory reorderedConfMapped = as(_reordered_conf)->rmap(); - float *reordered_conf_data = reorderedConfMapped.as(); - LockedMemory bboxSizesMapped = as(_bbox_sizes)->rmap(); - float *bbox_sizes_data = bboxSizesMapped.as(); - LockedMemory detectionsCountMapped = as(_detections_count)->rmap(); - int *detections_data = detectionsCountMapped.as(); - LockedMemory bufferMapped = as(_buffer)->rmap(); - int *buffer_data = bufferMapped.as(); - LockedMemory indicesMapped = as(_indices)->rmap(); - int *indices_data = indicesMapped.as(); - LockedMemory numPriorsActualMapped = as(_num_priors_actual)->rmap(); - int *num_priors_actual = numPriorsActualMapped.as(); - - const float *prior_variances = prior_data + _num_priors*_prior_size; - const float *ppriors = prior_data; - - for (int n = 0; n < N; ++n) { - for (int c = 0; c < _num_loc_classes; ++c) { - if (c == _background_label_id) { - continue; - } - - const float *ploc = loc_data + n*4*_num_loc_classes*_num_priors + c*4; - float *pboxes = decoded_bboxes_data + n*4*_num_loc_classes*_num_priors + c*4*_num_priors; - float *psizes = bbox_sizes_data + n*_num_loc_classes*_num_priors + c*_num_priors; - decodeBBoxes(ppriors, ploc, prior_variances, pboxes, psizes, num_priors_actual, n); - } - } - - for (int n = 0; n < N; ++n) { - for (int c = 0; c < _num_classes; ++c) { - for (int p = 0; p < _num_priors; ++p) { - reordered_conf_data[n*_num_priors*_num_classes + c*_num_priors + p] = conf_data[n*_num_priors*_num_classes + p*_num_classes + c]; - } - } - } - - memset(detections_data, 0, N*_num_classes*sizeof(int)); - - for (int n = 0; n < N; ++n) { - int detections_total = 0; - - for (int c = 0; c < _num_classes; ++c) { - if (c == _background_label_id) { - // Ignore background class. - continue; - } - - int *pindices = indices_data + n*_num_classes*_num_priors + c*_num_priors; - int *pbuffer = buffer_data + c*_num_priors; - int *pdetections = detections_data + n*_num_classes + c; - - const float *pconf = reordered_conf_data + n*_num_classes*_num_priors + c*_num_priors; - const float *pboxes = decoded_bboxes_data + n*4*_num_classes*_num_priors + c*4*_num_priors; - const float *psizes = bbox_sizes_data + n*_num_classes*_num_priors + c*_num_priors; - - nms(pconf, pboxes, psizes, pbuffer, pindices, *pdetections, num_priors_actual[n]); - } - - for (int c = 0; c < _num_classes; ++c) { - detections_total += detections_data[n*_num_classes + c]; - } - - if (_keep_top_k > -1 && detections_total > _keep_top_k) { - std::vector>> conf_index_class_map; - - for (int c = 0; c < _num_classes; ++c) { - int detections = detections_data[n*_num_classes + c]; - int *pindices = indices_data + n*_num_classes*_num_priors + c*_num_priors; - float *pconf = reordered_conf_data + n*_num_classes*_num_priors + c*_num_priors; - - for (int i = 0; i < detections; ++i) { - int idx = pindices[i]; - conf_index_class_map.push_back(std::make_pair(pconf[idx], std::make_pair(c, idx))); - } - } - - std::sort(conf_index_class_map.begin(), conf_index_class_map.end(), - SortScorePairDescend>); - conf_index_class_map.resize(_keep_top_k); - - // Store the new indices. - memset(detections_data + n*_num_classes, 0, _num_classes * sizeof(int)); - - for (size_t j = 0; j < conf_index_class_map.size(); ++j) { - int label = conf_index_class_map[j].second.first; - int idx = conf_index_class_map[j].second.second; - int *pindices = indices_data + n * _num_classes * _num_priors + label * _num_priors; - pindices[detections_data[n*_num_classes + label]] = idx; - detections_data[n*_num_classes + label]++; - } - } - } - - const int DETECTION_SIZE = outputs[0]->getTensorDesc().getDims()[3]; - if (DETECTION_SIZE != 7) { - return NOT_IMPLEMENTED; - } - - auto dst_data_size = N * _keep_top_k * DETECTION_SIZE * sizeof(float); - - if (dst_data_size > outputs[0]->byteSize()) { - return OUT_OF_BOUNDS; - } - - memset(dst_data, 0, dst_data_size); - - int count = 0; - for (int n = 0; n < N; ++n) { - const float *pconf = reordered_conf_data + n * _num_priors * _num_classes; - const float *pboxes = decoded_bboxes_data + n*_num_priors*4*_num_loc_classes; - const int *pindices = indices_data + n*_num_classes*_num_priors; - - for (int c = 0; c < _num_classes; ++c) { - for (int i = 0; i < detections_data[n*_num_classes + c]; ++i) { - int idx = pindices[c*_num_priors + i]; - - dst_data[count * DETECTION_SIZE + 0] = static_cast(n); - dst_data[count * DETECTION_SIZE + 1] = static_cast(c); - dst_data[count * DETECTION_SIZE + 2] = pconf[c*_num_priors + idx]; - - float xmin = pboxes[c*4*_num_priors + idx*4 + 0]; - float ymin = pboxes[c*4*_num_priors + idx*4 + 1]; - float xmax = pboxes[c*4*_num_priors + idx*4 + 2]; - float ymax = pboxes[c*4*_num_priors + idx*4 + 3]; - - dst_data[count * DETECTION_SIZE + 3] = xmin; - dst_data[count * DETECTION_SIZE + 4] = ymin; - dst_data[count * DETECTION_SIZE + 5] = xmax; - dst_data[count * DETECTION_SIZE + 6] = ymax; - - ++count; - } - } - } - - if (count < N*_keep_top_k) { - // marker at end of boxes list - dst_data[count * DETECTION_SIZE + 0] = -1; - } - - return OK; - } - -private: - const int idx_location = 0; - const int idx_confidence = 1; - const int idx_priors = 2; - - - int _num_classes = 0; - const int _background_label_id = 0; - const int _top_k = 400; - const int _keep_top_k = 200; - - int _image_width = 0; - int _image_height = 0; - const int _prior_size = 5; - const int _offset = 1; - - const float _nms_threshold = 0.3f; - const float _confidence_threshold = -FLT_MAX; - - int _num_loc_classes = 0; - int _num_priors = 0; - - void decodeBBoxes(const float *prior_data, const float *loc_data, const float *variance_data, - float *decoded_bboxes, float *decoded_bbox_sizes, int* num_priors_actual, int n); - - void nms(const float *conf_data, const float *bboxes, const float *sizes, - int *buffer, int *indices, int &detections, int num_priors_actual); - - Blob::Ptr _decoded_bboxes; - Blob::Ptr _buffer; - Blob::Ptr _indices; - Blob::Ptr _detections_count; - Blob::Ptr _reordered_conf; - Blob::Ptr _bbox_sizes; - Blob::Ptr _num_priors_actual; -}; - -struct ConfidenceComparator { - explicit ConfidenceComparator(const float* conf_data) : _conf_data(conf_data) {} - - bool operator()(int idx1, int idx2) { - if (_conf_data[idx1] > _conf_data[idx2]) return true; - if (_conf_data[idx1] < _conf_data[idx2]) return false; - return idx1 < idx2; - } - - const float* _conf_data; -}; - -static inline float JaccardOverlap(const float *decoded_bbox, - const float *bbox_sizes, - const int idx1, - const int idx2) { - float xmin1 = decoded_bbox[idx1*4 + 0]; - float ymin1 = decoded_bbox[idx1*4 + 1]; - float xmax1 = decoded_bbox[idx1*4 + 2]; - float ymax1 = decoded_bbox[idx1*4 + 3]; - - float xmin2 = decoded_bbox[idx2*4 + 0]; - float ymin2 = decoded_bbox[idx2*4 + 1]; - float ymax2 = decoded_bbox[idx2*4 + 3]; - float xmax2 = decoded_bbox[idx2*4 + 2]; - - if (xmin2 > xmax1 || xmax2 < xmin1 || ymin2 > ymax1 || ymax2 < ymin1) { - return 0.0f; - } - - float intersect_xmin = std::max(xmin1, xmin2); - float intersect_ymin = std::max(ymin1, ymin2); - float intersect_xmax = std::min(xmax1, xmax2); - float intersect_ymax = std::min(ymax1, ymax2); - - float intersect_width = intersect_xmax - intersect_xmin; - float intersect_height = intersect_ymax - intersect_ymin; - - if (intersect_width <= 0 || intersect_height <= 0) { - return 0.0f; - } - - float intersect_size = intersect_width * intersect_height; - float bbox1_size = bbox_sizes[idx1]; - float bbox2_size = bbox_sizes[idx2]; - - return intersect_size / (bbox1_size + bbox2_size - intersect_size); -} - -void DetectionOutputPostProcessor::decodeBBoxes(const float *prior_data, - const float *loc_data, - const float *variance_data, - float *decoded_bboxes, - float *decoded_bbox_sizes, - int* num_priors_actual, - int n) { - num_priors_actual[n] = _num_priors; - - for (int num = 0; num < _num_priors; ++num) { - float batch_id = prior_data[num * _prior_size + 0]; - if (batch_id == -1.f) { - num_priors_actual[n] = num; - break; - } - } - - for (int p = 0; p < num_priors_actual[n]; ++p) { - float prior_xmin = prior_data[p*_prior_size + 0 + _offset]; - float prior_ymin = prior_data[p*_prior_size + 1 + _offset]; - float prior_xmax = prior_data[p*_prior_size + 2 + _offset]; - float prior_ymax = prior_data[p*_prior_size + 3 + _offset]; - - float loc_xmin = loc_data[4*p*_num_loc_classes + 0]; - float loc_ymin = loc_data[4*p*_num_loc_classes + 1]; - float loc_xmax = loc_data[4*p*_num_loc_classes + 2]; - float loc_ymax = loc_data[4*p*_num_loc_classes + 3]; - - prior_xmin /= _image_width; - prior_ymin /= _image_height; - prior_xmax /= _image_width; - prior_ymax /= _image_height; - - float prior_width = prior_xmax - prior_xmin; - float prior_height = prior_ymax - prior_ymin; - float prior_center_x = (prior_xmin + prior_xmax) / 2.0f; - float prior_center_y = (prior_ymin + prior_ymax) / 2.0f; - - float decode_bbox_center_x, decode_bbox_center_y; - float decode_bbox_width, decode_bbox_height; - - // variance is encoded in target, we simply need to restore the offset predictions. - decode_bbox_center_x = loc_xmin * prior_width + prior_center_x; - decode_bbox_center_y = loc_ymin * prior_height + prior_center_y; - decode_bbox_width = std::exp(loc_xmax) * prior_width; - decode_bbox_height = std::exp(loc_ymax) * prior_height; - - float new_xmin = decode_bbox_center_x - decode_bbox_width / 2.0f; - float new_ymin = decode_bbox_center_y - decode_bbox_height / 2.0f; - float new_xmax = decode_bbox_center_x + decode_bbox_width / 2.0f; - float new_ymax = decode_bbox_center_y + decode_bbox_height / 2.0f; - - decoded_bboxes[p*4 + 0] = new_xmin; - decoded_bboxes[p*4 + 1] = new_ymin; - decoded_bboxes[p*4 + 2] = new_xmax; - decoded_bboxes[p*4 + 3] = new_ymax; - - decoded_bbox_sizes[p] = (new_xmax - new_xmin) * (new_ymax - new_ymin); - } -} - -void DetectionOutputPostProcessor::nms(const float* conf_data, - const float* bboxes, - const float* sizes, - int* buffer, - int* indices, - int& detections, - int num_priors_actual) { - int count = 0; - for (int i = 0; i < num_priors_actual; ++i) { - if (conf_data[i] > _confidence_threshold) { - indices[count] = i; - count++; - } - } - - int num_output_scores = (_top_k == -1 ? count : std::min(_top_k, count)); - - std::partial_sort_copy(indices, indices + count, - buffer, buffer + num_output_scores, - ConfidenceComparator(conf_data)); - - for (int i = 0; i < num_output_scores; ++i) { - const int idx = buffer[i]; - - bool keep = true; - for (int k = 0; k < detections; ++k) { - const int kept_idx = indices[k]; - float overlap = JaccardOverlap(bboxes, sizes, idx, kept_idx); - if (overlap > _nms_threshold) { - keep = false; - break; - } - } - if (keep) { - indices[detections] = idx; - detections++; - } - } -} diff --git a/demos/object_detection_demo_faster_rcnn/main.cpp b/demos/object_detection_demo_faster_rcnn/main.cpp deleted file mode 100644 index fd2c29106aa..00000000000 --- a/demos/object_detection_demo_faster_rcnn/main.cpp +++ /dev/null @@ -1,310 +0,0 @@ -// Copyright (C) 2018-2019 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include -#include -#include -#include "object_detection_demo_faster_rcnn.h" -#include "detectionoutput.h" - -using namespace InferenceEngine; - -bool ParseAndCheckCommandLine(int argc, char *argv[]) { - // ---------------------------Parsing and validation of input args-------------------------------------- - - gflags::ParseCommandLineNonHelpFlags(&argc, &argv, true); - if (FLAGS_h) { - showUsage(); - showAvailableDevices(); - return false; - } - - slog::info << "Parsing input parameters" << slog::endl; - - if (FLAGS_i.empty()) { - throw std::logic_error("Parameter -i is not set"); - } - - if (FLAGS_m.empty()) { - throw std::logic_error("Parameter -m is not set"); - } - - return true; -} - -/** -* \brief The entry point for the Inference Engine object_detection demo Faster RCNN application -* \file object_detection_demo_faster_rcnn/main.cpp -* \example object_detection_demo_faster_rcnn/main.cpp -*/ -int main(int argc, char *argv[]) { - try { - /** This demo covers certain topology and cannot be generalized for any object detection one **/ - slog::info << "InferenceEngine: " << printable(*GetInferenceEngineVersion()) << "\n"; - - // ------------------------------ Parsing and validation of input args --------------------------------- - if (!ParseAndCheckCommandLine(argc, argv)) { - return 0; - } - - /** This vector stores paths to the processed images **/ - std::vector imagePaths; - parseInputFilesArguments(imagePaths); - if (imagePaths.empty()) throw std::logic_error("No suitable images were found"); - // ----------------------------------------------------------------------------------------------------- - - // --------------------------- 1. Load inference engine ------------------------------------- - slog::info << "Loading Inference Engine" << slog::endl; - Core ie; - - if (!FLAGS_l.empty()) { - // CPU(MKLDNN) extensions are loaded as a shared library and passed as a pointer to base extension - IExtensionPtr extension_ptr = make_so_pointer(FLAGS_l); - ie.AddExtension(extension_ptr, "CPU"); - slog::info << "CPU Extension loaded: " << FLAGS_l << slog::endl; - } - - if (!FLAGS_c.empty()) { - // clDNN Extensions are loaded from an .xml description and OpenCL kernel files - ie.SetConfig({ { PluginConfigParams::KEY_CONFIG_FILE, FLAGS_c } }, "GPU"); - slog::info << "GPU Extension loaded: " << FLAGS_c << slog::endl; - } - - /** Printing plugin version **/ - slog::info << "Device info: " << slog::endl; - slog::info << printable(ie.GetVersions(FLAGS_d)) << slog::endl; - // ----------------------------------------------------------------------------------------------------- - - // --------------------------- 2. Read IR Generated by ModelOptimizer (.xml and .bin files) ------------ - slog::info << "Loading network file:" - "\n\t" << FLAGS_m << - slog::endl; - - /** Read network model **/ - CNNNetwork network = ie.ReadNetwork(FLAGS_m); - - // ----------------------------------------------------------------------------------------------------- - - // --------------------------- 3. Configure input & output --------------------------------------------- - - network.addOutput(FLAGS_bbox_name, 0); - network.addOutput(FLAGS_prob_name, 0); - network.addOutput(FLAGS_proposal_name, 0); - - // --------------------------- Prepare input blobs ----------------------------------------------------- - slog::info << "Preparing input blobs" << slog::endl; - - /** Taking information about all topology inputs **/ - InputsDataMap inputsInfo(network.getInputsInfo()); - - /** SSD network has one input and one output **/ - if (inputsInfo.size() != 1 && inputsInfo.size() != 2) throw std::logic_error("Demo supports topologies only with 1 or 2 inputs"); - - std::string imageInputName, imInfoInputName; - - /** Stores input image **/ - - /** Iterating over all input blobs **/ - for (auto & item : inputsInfo) { - /** Working with first input tensor that stores image **/ - if (item.second->getInputData()->getTensorDesc().getDims().size() == 4) { - imageInputName = item.first; - - slog::info << "Batch size is " << std::to_string(network.getBatchSize()) << slog::endl; - - /** Creating first input blob **/ - Precision inputPrecision = Precision::U8; - item.second->setPrecision(inputPrecision); - - } else if (item.second->getInputData()->getTensorDesc().getDims().size() == 2) { - imInfoInputName = item.first; - - Precision inputPrecision = Precision::FP32; - item.second->setPrecision(inputPrecision); - if ((item.second->getTensorDesc().getDims()[1] != 3 && item.second->getTensorDesc().getDims()[1] != 6) || - item.second->getTensorDesc().getDims()[0] != 1) { - throw std::logic_error("Invalid input info. Should be 3 or 6 values length"); - } - } - } - - // ------------------------------ Prepare output blobs ------------------------------------------------- - slog::info << "Preparing output blobs" << slog::endl; - - OutputsDataMap outputsInfo(network.getOutputsInfo()); - - const size_t maxProposalCount = 200; - const size_t objectSize = 7; - - /** Set the precision of output data provided by the user, should be called before load of the network to the device **/ - - outputsInfo[FLAGS_bbox_name]->setPrecision(Precision::FP32); - outputsInfo[FLAGS_prob_name]->setPrecision(Precision::FP32); - outputsInfo[FLAGS_proposal_name]->setPrecision(Precision::FP32); - // ----------------------------------------------------------------------------------------------------- - - // ------------------------------ Adding DetectionOutput post-processor--------------------------------- - - /** - * The only meaningful difference between Faster-RCNN and SSD-like topologies is the interpretation - * of the output data. Faster-RCNN has 2 output layers which (the same format) are presented inside SSD. - * - * But SSD has an additional post-processing DetectionOutput layer that simplifies output filtering. - * So here we use a post-processor to convert the output of Faster-RCNN into the same format as SSD, - * so that we can easily parse it. - */ - - DetectionOutputPostProcessor detOutPostProcessor( - inputsInfo[imageInputName]->getTensorDesc().getDims(), - outputsInfo[FLAGS_bbox_name]->getTensorDesc().getDims(), - outputsInfo[FLAGS_prob_name]->getTensorDesc().getDims(), - outputsInfo[FLAGS_proposal_name]->getTensorDesc().getDims()); - - // --------------------------- 4. Loading model to the device ------------------------------------------ - slog::info << "Loading model to the device" << slog::endl; - ExecutableNetwork executable_network = ie.LoadNetwork(network, FLAGS_d); - // ----------------------------------------------------------------------------------------------------- - - // --------------------------- 5. Create infer request ------------------------------------------------- - slog::info << "Create infer request" << slog::endl; - InferRequest infer_request = executable_network.CreateInferRequest(); - // ----------------------------------------------------------------------------------------------------- - - // --------------------------- 6. Prepare input -------------------------------------------------------- - /** Collect images **/ - std::vector images; - for (auto &path: imagePaths) { - cv::Mat image = cv::imread(path, cv::IMREAD_COLOR); - if (image.empty()) { - slog::warn << "Image " + path + " cannot be read!" << slog::endl; - continue; - } - images.push_back(image); - } - if (images.empty()) throw std::logic_error("Valid input images were not found!"); - - size_t batchSize = network.getBatchSize(); - slog::info << "Batch size is " << std::to_string(batchSize) << slog::endl; - if (batchSize != images.size()) { - slog::warn << "Number of images " + std::to_string(images.size()) + - " doesn't match batch size " + std::to_string(batchSize) << slog::endl; - batchSize = std::min(batchSize, images.size()); - slog::warn << "Number of images to be processed is "<< std::to_string(batchSize) << slog::endl; - } - - /** Filling input tensor with images **/ - Blob::Ptr imageInput = infer_request.GetBlob(imageInputName); - - for (size_t image_id = 0; image_id < std::min(images.size(), batchSize); ++image_id) - matU8ToBlob(images[image_id], imageInput, image_id); - - if (!imInfoInputName.empty()) { - Blob::Ptr input2 = infer_request.GetBlob(imInfoInputName); - auto imInfoDim = inputsInfo.find(imInfoInputName)->second->getTensorDesc().getDims()[1]; - - /** Fill input tensor with values **/ - LockedMemory input2Mapped = as(input2)->wmap(); - float *p = input2Mapped.as(); - - for (size_t image_id = 0; image_id < std::min(images.size(), batchSize); ++image_id) { - p[image_id * imInfoDim + 0] = static_cast(inputsInfo[imageInputName]->getTensorDesc().getDims()[2]); - p[image_id * imInfoDim + 1] = static_cast(inputsInfo[imageInputName]->getTensorDesc().getDims()[3]); - for (size_t k = 2; k < imInfoDim; k++) { - p[image_id * imInfoDim + k] = 1.0f; // all scale factors are set to 1.0 - } - } - } - // ----------------------------------------------------------------------------------------------------- - - // ---------------------------- 7. Do inference -------------------------------------------------------- - slog::info << "Start inference" << slog::endl; - infer_request.Infer(); - // ----------------------------------------------------------------------------------------------------- - - // ---------------------------- 8. Process output ------------------------------------------------------ - slog::info << "Processing output blobs" << slog::endl; - - Blob::Ptr bbox_output_blob = infer_request.GetBlob(FLAGS_bbox_name); - Blob::Ptr prob_output_blob = infer_request.GetBlob(FLAGS_prob_name); - Blob::Ptr rois_output_blob = infer_request.GetBlob(FLAGS_proposal_name); - - std::vector detOutInBlobs = { bbox_output_blob, prob_output_blob, rois_output_blob }; - - Blob::Ptr output_blob = std::make_shared>(TensorDesc(Precision::FP32, {1, 1, maxProposalCount, objectSize}, Layout::NCHW)); - output_blob->allocate(); - std::vector detOutOutBlobs = { output_blob }; - - detOutPostProcessor.execute(detOutInBlobs, detOutOutBlobs, nullptr); - - LockedMemory outputBlobMapped = as(output_blob)->rmap(); - const float* detection = outputBlobMapped.as(); - - /* Each detection has image_id that denotes processed image */ - for (size_t curProposal = 0; curProposal < maxProposalCount; curProposal++) { - auto image_id = static_cast(detection[curProposal * objectSize + 0]); - if (image_id < 0) { - break; - } - - float confidence = detection[curProposal * objectSize + 2]; - auto label = static_cast(detection[curProposal * objectSize + 1]); - auto xmin = static_cast(detection[curProposal * objectSize + 3] * images[image_id].cols); - auto ymin = static_cast(detection[curProposal * objectSize + 4] * images[image_id].rows); - auto xmax = static_cast(detection[curProposal * objectSize + 5] * images[image_id].cols); - auto ymax = static_cast(detection[curProposal * objectSize + 6] * images[image_id].rows); - - std::cout << "[" << curProposal << "," << label << "] element, prob = " << confidence << - " (" << xmin << "," << ymin << ")-(" << xmax << "," << ymax << ")" << " batch id : " << image_id; - - if (confidence > 0.5) { - /** Drawing only objects with >50% probability **/ - std::cout << " WILL BE PRINTED!"; - - const auto &color = CITYSCAPES_COLORS[label % arraySize(CITYSCAPES_COLORS)]; - cv::rectangle(images[image_id], - cv::Point(xmin, ymin), cv::Point(xmax, ymax), - cv::Scalar(color.blue(), color.green(), color.red())); - } - std::cout << std::endl; - } - - for (size_t batch_id = 0; batch_id < batchSize; ++batch_id) { - const std::string image_path = "out_" + std::to_string(batch_id) + ".bmp"; - - if (cv::imwrite(image_path, images[batch_id])) { - slog::info << "Image " + image_path + " created!" << slog::endl; - } else { - throw std::logic_error(std::string("Can't create a file: ") + image_path); - } - } - // ----------------------------------------------------------------------------------------------------- - } - catch (const std::exception& error) { - slog::err << error.what() << slog::endl; - return 1; - } - catch (...) { - slog::err << "Unknown/internal exception happened." << slog::endl; - return 1; - } - - slog::info << "Execution successful" << slog::endl; - slog::info << slog::endl << "This demo is an API example, for any performance measurements " - "please use the dedicated benchmark_app tool from the openVINO toolkit" << slog::endl; - return 0; -} diff --git a/demos/object_detection_demo_faster_rcnn/object_detection_demo_faster_rcnn.h b/demos/object_detection_demo_faster_rcnn/object_detection_demo_faster_rcnn.h deleted file mode 100644 index 1447f514f58..00000000000 --- a/demos/object_detection_demo_faster_rcnn/object_detection_demo_faster_rcnn.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (C) 2018-2019 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static const char help_message[] = "Print a usage message."; -static const char image_message[] = "Required. Path to a .bmp image."; -static const char model_message[] = "Required. Path to an .xml file with a trained model."; -static const char target_device_message[] = "Optional. Specify the target device to infer on (the list of available devices is shown below). " - "Default value is CPU. Use \"-d HETERO:\" format to specify HETERO plugin. " - "The demo will look for a suitable plugin for a specified device."; -static const char custom_cldnn_message[] = "Required for GPU custom kernels. " - "Absolute path to the .xml file with the kernels descriptions."; -static const char custom_cpu_library_message[] = "Required for CPU custom layers. " - "Absolute path to a shared library with the kernels implementations."; -static const char bbox_layer_name_message[] = "Optional. The name of output box prediction layer. Default value is \"bbox_pred\""; -static const char proposal_layer_name_message[] = "Optional. The name of output proposal layer. Default value is \"proposal\""; -static const char prob_layer_name_message[] = "Optional. The name of output probability layer. Default value is \"cls_prob\""; - -DEFINE_bool(h, false, help_message); -DEFINE_string(i, "", image_message); -DEFINE_string(m, "", model_message); -DEFINE_string(d, "CPU", target_device_message); -DEFINE_string(c, "", custom_cldnn_message); -DEFINE_string(l, "", custom_cpu_library_message); -DEFINE_string(bbox_name, "bbox_pred", bbox_layer_name_message); -DEFINE_string(proposal_name, "proposal", proposal_layer_name_message); -DEFINE_string(prob_name, "cls_prob", prob_layer_name_message); - -/** -* @brief This function show a help message -*/ -static void showUsage() { - std::cout << std::endl; - std::cout << "object_detection_demo_faster_rcnn [OPTION]" << std::endl; - std::cout << "Options:" << std::endl; - std::cout << std::endl; - std::cout << " -h " << help_message << std::endl; - std::cout << " -i \"\" " << image_message << std::endl; - std::cout << " -m \"\" " << model_message << std::endl; - std::cout << " -l \"\" " << custom_cpu_library_message << std::endl; - std::cout << " -c \"\" " << custom_cldnn_message << std::endl; - std::cout << " -d \"\" " << target_device_message << std::endl; - std::cout << " -bbox_name \"\" " << bbox_layer_name_message << std::endl; - std::cout << " -proposal_name \"\" " << proposal_layer_name_message << std::endl; - std::cout << " -prob_name \"\" " << prob_layer_name_message << std::endl; -} diff --git a/demos/object_detection_demo_ssd_async/CMakeLists.txt b/demos/object_detection_demo_ssd_async/CMakeLists.txt deleted file mode 100644 index 1460b0c2806..00000000000 --- a/demos/object_detection_demo_ssd_async/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (C) 2018-2019 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 -# - -ie_add_sample(NAME object_detection_demo_ssd_async - SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp" - HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/object_detection_demo_ssd_async.hpp" - DEPENDENCIES monitors - OPENCV_DEPENDENCIES highgui videoio imgproc) - -target_link_libraries(object_detection_demo_ssd_async PRIVATE ngraph::ngraph) diff --git a/demos/object_detection_demo_ssd_async/README.md b/demos/object_detection_demo_ssd_async/README.md deleted file mode 100644 index 0c8902eecd3..00000000000 --- a/demos/object_detection_demo_ssd_async/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# Object Detection SSD C++ Demo, Async API Performance Showcase - -This demo showcases Object Detection with SSD and new Async API. -Async API usage can improve overall frame-rate of the application, because rather than wait for inference to complete, -the app can continue doing things on the host, while accelerator is busy. -Specifically, this demo keeps the number of Infer Requests that you have set using `nireq` flag. While some of the Infer Requests are processed by IE, the other ones can be filled with new frame data and asynchronously started or the next output can be taken from the Infer Request and displayed. - -> **NOTE:** This topic describes usage of C++ implementation of the Object Detection SSD Demo Async API. For the Python* implementation, refer to [Object Detection SSD Python* Demo, Async API Performance Showcase](../python_demos/object_detection_demo_ssd_async/README.md). - -The technique can be generalized to any available parallel slack, for example, doing inference and simultaneously encoding the resulting -(previous) frames or running further inference, like some emotion detection on top of the face detection results. -There are important performance caveats though, for example the tasks that run in parallel should try to avoid oversubscribing the shared compute resources. -For example, if the inference is performed on the FPGA, and the CPU is essentially idle, than it makes sense to do things on the CPU -in parallel. But if the inference is performed say on the GPU, than it can take little gain to do the (resulting video) encoding -on the same GPU in parallel, because the device is already busy. - -This and other performance implications and tips for the Async API are covered in the [Optimization Guide](https://docs.openvinotoolkit.org/latest/_docs_optimization_guide_dldt_optimization_guide.html) - -Other demo objectives are: -* Video as input support via OpenCV -* Visualization of the resulting bounding boxes and text labels (from the labels file, see `-labels` option) or class number (if no file is provided) -* OpenCV is used to draw resulting bounding boxes, labels, so you can copy paste this code without -need to pull Inference Engine demos helpers to your app -* Demonstration of the Async API in action, so the demo features two modes (toggled by the Tab key) - - "User specified" mode, where you can set the number of Infer Requests, throughput streams and threads. Inference, starting new requests and displaying the results of completed requests are all performed asynchronously. The purpose of this mode is to get the higher FPS by fully utilizing all available devices. - - "Min latency" mode, which uses only one Infer Request. The purpose of this mode is to get the lowest latency. - -## How It Works - -On the start-up, the application reads command line parameters and loads a network to the Inference -Engine. Upon getting a frame from the OpenCV VideoCapture it performs inference and displays the results. - -> **NOTE**: By default, Open Model Zoo demos expect input with BGR channels order. If you trained your model to work with RGB order, you need to manually rearrange the default channels order in the demo application or reconvert your model using the Model Optimizer tool with `--reverse_input_channels` argument specified. For more information about the argument, refer to **When to Reverse Input Channels** section of [Converting a Model Using General Conversion Parameters](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_convert_model_Converting_Model_General.html). - -New "Async API" operates with new notion of the "Infer Request" that encapsulates the inputs/outputs and separates *scheduling and waiting for result*, -next section. - -The pipeline is the same for both modes. The difference is in the number of Infer Requests used. -```cpp - while (true) { - if (Infer Request containing the next video frame has completed) { - get inference results - process inference results - display the frame - } else if (one of the Infer Requests is idle and it is not the end of the input video) { - capture frame - populate empty InferRequest - set completion callback - start InferRequest - } - } -``` - -### Async API - -The Inference Engine also offers new API based on the notion of Infer Requests. One specific usability upside -is that the requests encapsulate the inputs and outputs allocation, so you just need to access the blob with `GetBlob` method. - -More importantly, you can execute a request asynchronously (in the background) and wait until ready, when the result is actually needed. -In a mean time your app can continue : - -```cpp -// load network -InferenceEngine::Core ie; -auto network = ie.ReadNetwork("Model.xml"); -// populate inputs etc -auto input = async_infer_request.GetBlob(input_name); -... -// start the async Infer Request (puts the request to the queue and immediately returns) -async_infer_request->StartAsync(); -// here you can continue execution on the host until results of the current request are really needed -//... -async_infer_request.Wait(IInferRequest::WaitMode::RESULT_READY); -auto output = async_infer_request.GetBlob(output_name); -``` -Notice that there is no direct way to measure execution time of the Infer Request that is running asynchronously, unless -you measure the Wait executed immediately after the StartAsync. But this essentially would mean the serialization and synchronous -execution. -That is why the inference speed is not reported. It is recommended to use the [Benchmark App](https://docs.openvinotoolkit.org/latest/_inference_engine_samples_benchmark_app_README.html) for measuring inference speed of different models. - - -For more details on the requests-based Inference Engine API, including the Async execution, refer to [Integrate the Inference Engine New Request API with Your Application](https://docs.openvinotoolkit.org/latest/_docs_IE_DG_Integrate_with_customer_application_new_API.html). - - -## Running - -Running the application with the `-h` option yields the following usage message: -``` -./object_detection_demo_ssd_async -h -InferenceEngine: - API version ............ - Build .................. - -object_detection_demo_ssd_async [OPTION] -Options: - - -h Print a usage message. - -i "" Required. Path to a video file (specify "cam" to work with camera). - -m "" Required. Path to an .xml file with a trained model. - -l "" Required for CPU custom layers. Absolute path to a shared library with the kernel implementations. - Or - -c "" Required for GPU custom kernels. Absolute path to the .xml file with the kernel descriptions. - -d "" Optional. Specify the target device to infer on (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. - -labels "" Optional. Path to a file with labels mapping. - -pc Optional. Enables per-layer performance report. - -r Optional. Inference results as raw values. - -t Optional. Probability threshold for detections. - -auto_resize Optional. Enables resizable input with support of ROI crop & auto resize. - -nireq "" Optional. Number of Infer Requests. - -nthreads "" Optional. Number of threads. - -nstreams Optional. Number of streams to use for inference on the CPU or/and GPU in throughput mode (for HETERO and MULTI device cases use format :,: or just ) - -loop Optional. Enable reading the input in a loop. - -no_show Optional. Do not show processed video. - -u Optional. List of monitors to show initially. -``` - -Running the application with the empty list of options yields the usage message given above and an error message. - -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). - -> **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). - -You can use the following command to do inference on GPU with a pre-trained object detection model: -```sh -./object_detection_demo_ssd_async -i /inputVideo.mp4 -m /ssd.xml -d GPU -``` - -The only GUI knob is using **Tab** to switch between "User specified" mode and "Min latency" mode. - -## Demo Output - -The demo uses OpenCV to display the resulting frame with detections (rendered as bounding boxes and labels, if provided). -The demo reports -* **FPS**: average rate of video frame processing (frames per second) -* **Latency**: average time required to process one frame (from reading the frame to displaying the results) -You can use both of these metrics to measure application-level performance. - - -## See Also -* [Using Open Model Zoo demos](../README.md) -* [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) -* [Model Downloader](../../tools/downloader/README.md) diff --git a/demos/object_detection_demo_ssd_async/main.cpp b/demos/object_detection_demo_ssd_async/main.cpp deleted file mode 100644 index b68d2c6f378..00000000000 --- a/demos/object_detection_demo_ssd_async/main.cpp +++ /dev/null @@ -1,582 +0,0 @@ -// Copyright (C) 2018-2020 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** -* \brief The entry point for the Inference Engine object_detection demo application -* \file object_detection_demo_ssd_async/main.cpp -* \example object_detection_demo_ssd_async/main.cpp -*/ - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include "object_detection_demo_ssd_async.hpp" - -using namespace InferenceEngine; - -bool ParseAndCheckCommandLine(int argc, char *argv[]) { - // ---------------------------Parsing and validation of input args-------------------------------------- - gflags::ParseCommandLineNonHelpFlags(&argc, &argv, true); - if (FLAGS_h) { - showUsage(); - showAvailableDevices(); - return false; - } - slog::info << "Parsing input parameters" << slog::endl; - - if (FLAGS_i.empty()) { - throw std::logic_error("Parameter -i is not set"); - } - - if (FLAGS_m.empty()) { - throw std::logic_error("Parameter -m is not set"); - } - - return true; -} - -void frameToBlob(const cv::Mat& frame, - InferRequest::Ptr& inferRequest, - const std::string& inputName) { - if (FLAGS_auto_resize) { - /* Just set input blob containing read image. Resize and layout conversion will be done automatically */ - inferRequest->SetBlob(inputName, wrapMat2Blob(frame)); - } else { - /* Resize and copy data from the image to the input blob */ - Blob::Ptr frameBlob = inferRequest->GetBlob(inputName); - matU8ToBlob(frame, frameBlob); - } -} - -enum class ExecutionMode {USER_SPECIFIED, MIN_LATENCY}; - -ExecutionMode getOtherMode(ExecutionMode mode) { - return mode == ExecutionMode::USER_SPECIFIED ? ExecutionMode::MIN_LATENCY : ExecutionMode::USER_SPECIFIED; -} - -void switchMode(ExecutionMode& mode) { - mode = getOtherMode(mode); -} - -int main(int argc, char *argv[]) { - try { - /** This demo covers certain topology and cannot be generalized for any object detection **/ - std::cout << "InferenceEngine: " << printable(*GetInferenceEngineVersion()) << std::endl; - - // ------------------------------ Parsing and validation of input args --------------------------------- - if (!ParseAndCheckCommandLine(argc, argv)) { - return 0; - } - - slog::info << "Reading input" << slog::endl; - cv::VideoCapture cap; - if (!((FLAGS_i == "cam") ? cap.open(0) : cap.open(FLAGS_i.c_str()))) { - throw std::logic_error("Cannot open input file or camera: " + FLAGS_i); - } - const size_t width = (size_t)cap.get(cv::CAP_PROP_FRAME_WIDTH); - const size_t height = (size_t)cap.get(cv::CAP_PROP_FRAME_HEIGHT); - - // read input (video) frame - cv::Mat curr_frame; cap >> curr_frame; - cv::Mat next_frame; - - if (!cap.grab()) { - throw std::logic_error("This demo supports only video (or camera) inputs !!! " - "Failed getting next frame from the " + FLAGS_i); - } - // ----------------------------------------------------------------------------------------------------- - - // --------------------------- 1. Load inference engine ------------------------------------------------ - slog::info << "Loading Inference Engine" << slog::endl; - Core ie; - - slog::info << "Device info: " << slog::endl; - slog::info << printable(ie.GetVersions(FLAGS_d)) << slog::endl; - - /** Load extensions for the plugin **/ - if (!FLAGS_l.empty()) { - // CPU(MKLDNN) extensions are loaded as a shared library and passed as a pointer to base extension - IExtensionPtr extension_ptr = make_so_pointer(FLAGS_l.c_str()); - ie.AddExtension(extension_ptr, "CPU"); - } - if (!FLAGS_c.empty()) { - // clDNN Extensions are loaded from an .xml description and OpenCL kernel files - ie.SetConfig({{PluginConfigParams::KEY_CONFIG_FILE, FLAGS_c}}, "GPU"); - } - - /** Per layer metrics **/ - if (FLAGS_pc) { - ie.SetConfig({ { PluginConfigParams::KEY_PERF_COUNT, PluginConfigParams::YES } }); - } - - std::map userSpecifiedConfig; - std::map minLatencyConfig; - - std::set devices; - for (const std::string& device : parseDevices(FLAGS_d)) { - devices.insert(device); - } - std::map deviceNstreams = parseValuePerDevice(devices, FLAGS_nstreams); - for (auto& device : devices) { - if (device == "CPU") { // CPU supports a few special performance-oriented keys - // limit threading for CPU portion of inference - if (FLAGS_nthreads != 0) - userSpecifiedConfig.insert({ CONFIG_KEY(CPU_THREADS_NUM), std::to_string(FLAGS_nthreads) }); - - if (FLAGS_d.find("MULTI") != std::string::npos - && devices.find("GPU") != devices.end()) { - userSpecifiedConfig.insert({ CONFIG_KEY(CPU_BIND_THREAD), CONFIG_VALUE(NO) }); - } else { - // pin threads for CPU portion of inference - userSpecifiedConfig.insert({ CONFIG_KEY(CPU_BIND_THREAD), CONFIG_VALUE(YES) }); - } - - // for CPU execution, more throughput-oriented execution via streams - userSpecifiedConfig.insert({ CONFIG_KEY(CPU_THROUGHPUT_STREAMS), - (deviceNstreams.count(device) > 0 ? std::to_string(deviceNstreams.at(device)) - : CONFIG_VALUE(CPU_THROUGHPUT_AUTO)) }); - - minLatencyConfig.insert({ CONFIG_KEY(CPU_THROUGHPUT_STREAMS), "1" }); - } else if (device == "GPU") { - userSpecifiedConfig.insert({ CONFIG_KEY(GPU_THROUGHPUT_STREAMS), - (deviceNstreams.count(device) > 0 ? std::to_string(deviceNstreams.at(device)) - : CONFIG_VALUE(GPU_THROUGHPUT_AUTO)) }); - - minLatencyConfig.insert({ CONFIG_KEY(GPU_THROUGHPUT_STREAMS), "1" }); - - if (FLAGS_d.find("MULTI") != std::string::npos - && devices.find("CPU") != devices.end()) { - // multi-device execution with the CPU + GPU performs best with GPU throttling hint, - // which releases another CPU thread (that is otherwise used by the GPU driver for active polling) - userSpecifiedConfig.insert({ CLDNN_CONFIG_KEY(PLUGIN_THROTTLE), "1" }); - } - } - } - // ----------------------------------------------------------------------------------------------------- - - // --------------------------- 2. Read IR Generated by ModelOptimizer (.xml and .bin files) ------------ - slog::info << "Loading network files" << slog::endl; - /** Read network model **/ - auto cnnNetwork = ie.ReadNetwork(FLAGS_m); - /** Set batch size to 1 **/ - slog::info << "Batch size is forced to 1." << slog::endl; - cnnNetwork.setBatchSize(1); - /** Read labels (if any)**/ - std::vector labels; - if (!FLAGS_labels.empty()) { - std::ifstream inputFile(FLAGS_labels); - std::string label; - while (std::getline(inputFile, label)) { - labels.push_back(label); - } - if (labels.empty()) - throw std::logic_error("File empty or not found: " + FLAGS_labels); - } - // ----------------------------------------------------------------------------------------------------- - - // --------------------------- 3. Configure input & output --------------------------------------------- - // --------------------------- Prepare input blobs ----------------------------------------------------- - slog::info << "Checking that the inputs are as the demo expects" << slog::endl; - InputsDataMap inputInfo(cnnNetwork.getInputsInfo()); - - std::string imageInputName, imageInfoInputName; - size_t netInputHeight, netInputWidth; - - for (const auto& inputInfoItem : inputInfo) { - if (inputInfoItem.second->getTensorDesc().getDims().size() == 4) { // 1st input contains images - imageInputName = inputInfoItem.first; - inputInfoItem.second->setPrecision(Precision::U8); - if (FLAGS_auto_resize) { - inputInfoItem.second->getPreProcess().setResizeAlgorithm(ResizeAlgorithm::RESIZE_BILINEAR); - inputInfoItem.second->getInputData()->setLayout(Layout::NHWC); - } else { - inputInfoItem.second->getInputData()->setLayout(Layout::NCHW); - } - const TensorDesc& inputDesc = inputInfoItem.second->getTensorDesc(); - netInputHeight = getTensorHeight(inputDesc); - netInputWidth = getTensorWidth(inputDesc); - } else if (inputInfoItem.second->getTensorDesc().getDims().size() == 2) { // 2nd input contains image info - imageInfoInputName = inputInfoItem.first; - inputInfoItem.second->setPrecision(Precision::FP32); - } else { - throw std::logic_error("Unsupported " + - std::to_string(inputInfoItem.second->getTensorDesc().getDims().size()) + "D " - "input layer '" + inputInfoItem.first + "'. " - "Only 2D and 4D input layers are supported"); - } - } - - // --------------------------- Prepare output blobs ----------------------------------------------------- - slog::info << "Checking that the outputs are as the demo expects" << slog::endl; - OutputsDataMap outputInfo(cnnNetwork.getOutputsInfo()); - if (outputInfo.size() != 1) { - throw std::logic_error("This demo accepts networks having only one output"); - } - DataPtr& output = outputInfo.begin()->second; - auto outputName = outputInfo.begin()->first; - - int num_classes = 0; - - if (auto ngraphFunction = cnnNetwork.getFunction()) { - for (const auto op : ngraphFunction->get_ops()) { - if (op->get_friendly_name() == outputName) { - auto detOutput = std::dynamic_pointer_cast(op); - if (!detOutput) { - THROW_IE_EXCEPTION << "Object Detection network output layer(" + op->get_friendly_name() + - ") should be DetectionOutput, but was " + op->get_type_info().name; - } - - num_classes = detOutput->get_attrs().num_classes; - break; - } - } - } else if (!labels.empty()) { - throw std::logic_error("Class labels are not supported with IR version older than 10"); - } - - if (!labels.empty() && static_cast(labels.size()) != num_classes) { - if (static_cast(labels.size()) == (num_classes - 1)) // if network assumes default "background" class, having no label - labels.insert(labels.begin(), "fake"); - else { - throw std::logic_error("The number of labels is different from numbers of model classes"); - } - } - const SizeVector outputDims = output->getTensorDesc().getDims(); - const size_t maxProposalCount = outputDims[2]; - const size_t objectSize = outputDims[3]; - if (objectSize != 7) { - throw std::logic_error("Output should have 7 as a last dimension"); - } - if (outputDims.size() != 4) { - throw std::logic_error("Incorrect output dimensions for SSD"); - } - output->setPrecision(Precision::FP32); - output->setLayout(Layout::NCHW); - // ----------------------------------------------------------------------------------------------------- - - // --------------------------- 4. Loading model to the device ------------------------------------------ - slog::info << "Loading model to the device" << slog::endl; - ExecutableNetwork userSpecifiedExecNetwork = ie.LoadNetwork(cnnNetwork, FLAGS_d, userSpecifiedConfig); - ExecutableNetwork minLatencyExecNetwork = ie.LoadNetwork(cnnNetwork, FLAGS_d, minLatencyConfig); - // ----------------------------------------------------------------------------------------------------- - - // --------------------------- 5. Create infer requests ------------------------------------------------ - std::vector userSpecifiedInferRequests; - for (unsigned infReqId = 0; infReqId < FLAGS_nireq; ++infReqId) { - userSpecifiedInferRequests.push_back(userSpecifiedExecNetwork.CreateInferRequestPtr()); - } - - InferRequest::Ptr minLatencyInferRequest = minLatencyExecNetwork.CreateInferRequestPtr(); - - /* it's enough just to set image info input (if used in the model) only once */ - if (!imageInfoInputName.empty()) { - auto setImgInfoBlob = [&](const InferRequest::Ptr &inferReq) { - auto blob = inferReq->GetBlob(imageInfoInputName); - LockedMemory blobMapped = as(blob)->wmap(); - auto data = blobMapped.as(); - data[0] = static_cast(netInputHeight); // height - data[1] = static_cast(netInputWidth); // width - data[2] = 1; - }; - - for (const InferRequest::Ptr &requestPtr : userSpecifiedInferRequests) { - setImgInfoBlob(requestPtr); - } - setImgInfoBlob(minLatencyInferRequest); - } - // ----------------------------------------------------------------------------------------------------- - - // --------------------------- 6. Init variables ------------------------------------------------------- - struct RequestResult { - cv::Mat frame; - Blob::Ptr output; - std::chrono::steady_clock::time_point startTime; - ExecutionMode frameMode; - }; - - ExecutionMode currentMode = ExecutionMode::USER_SPECIFIED; - const std::string imshowWindowTitle = "Detection Results"; - std::deque emptyRequests; - if (currentMode == ExecutionMode::USER_SPECIFIED) { - emptyRequests.assign(userSpecifiedInferRequests.begin(), userSpecifiedInferRequests.end()); - } else emptyRequests = {minLatencyInferRequest}; - - std::unordered_map completedRequestResults; - int nextFrameId = 0; - int nextFrameIdToShow = 0; - std::exception_ptr callbackException = nullptr; - std::mutex mutex; - std::condition_variable condVar; - std::map modeMetrics = {{currentMode, PerformanceMetrics()}}; - int prevModeActiveRequestCount = 0; - - cv::Size graphSize{static_cast(cap.get(cv::CAP_PROP_FRAME_WIDTH) / 4), 60}; - Presenter presenter(FLAGS_u, static_cast(cap.get(cv::CAP_PROP_FRAME_HEIGHT)) - graphSize.height - 10, - graphSize); - // ----------------------------------------------------------------------------------------------------- - - // --------------------------- 7. Do inference --------------------------------------------------------- - std::cout << "To close the application, press 'CTRL+C' here or switch to the output window and " - "press ESC or 'q' key" << std::endl; - std::cout << "To switch between min_latency/user_specified modes, press TAB key in the output window" - << std::endl; - - while (true) { - { - std::lock_guard lock(mutex); - - if (callbackException) std::rethrow_exception(callbackException); - if (!cap.isOpened() - && completedRequestResults.empty() - && ((currentMode == ExecutionMode::USER_SPECIFIED && emptyRequests.size() == FLAGS_nireq) - || (currentMode == ExecutionMode::MIN_LATENCY && emptyRequests.size() == 1))) break; - } - - RequestResult requestResult; - { - std::lock_guard lock(mutex); - - auto requestResultItr = completedRequestResults.find(nextFrameIdToShow); - if (requestResultItr != completedRequestResults.end()) { - requestResult = std::move(requestResultItr->second); - completedRequestResults.erase(requestResultItr); - }; - } - - if (requestResult.output) { - LockedMemory outputMapped = as(requestResult.output)->rmap(); - const float *detections = outputMapped.as(); - - nextFrameIdToShow++; - - for (size_t i = 0; i < maxProposalCount; i++) { - float image_id = detections[i * objectSize + 0]; - if (image_id < 0) { - break; - } - - float confidence = detections[i * objectSize + 2]; - auto label = static_cast(detections[i * objectSize + 1]); - float xmin = detections[i * objectSize + 3] * width; - float ymin = detections[i * objectSize + 4] * height; - float xmax = detections[i * objectSize + 5] * width; - float ymax = detections[i * objectSize + 6] * height; - - if (FLAGS_r) { - std::cout << "[" << i << "," << label << "] element, prob = " << confidence << - " (" << xmin << "," << ymin << ")-(" << xmax << "," << ymax << ")" - << ((confidence > FLAGS_t) ? " WILL BE RENDERED!" : "") << std::endl; - } - - if (confidence > FLAGS_t) { - /** Drawing only objects when > confidence_threshold probability **/ - std::ostringstream conf; - conf << ":" << std::fixed << std::setprecision(3) << confidence; - cv::putText(requestResult.frame, - (!labels.empty() ? labels[label] : std::string("label #") + std::to_string(label)) + conf.str(), - cv::Point2f(xmin, ymin - 5), cv::FONT_HERSHEY_COMPLEX_SMALL, 1, - cv::Scalar(0, 0, 255)); - cv::rectangle(requestResult.frame, cv::Point2f(xmin, ymin), cv::Point2f(xmax, ymax), - cv::Scalar(0, 0, 255)); - } - } - - presenter.drawGraphs(requestResult.frame); - - std::ostringstream out; - out << (currentMode == ExecutionMode::USER_SPECIFIED ? "USER SPECIFIED" : "MIN LATENCY") - << " mode (press Tab to switch)"; - putHighlightedText(requestResult.frame, out.str(), cv::Point2f(10, requestResult.frame.rows - 30), - cv::FONT_HERSHEY_TRIPLEX, 0.75, cv::Scalar(10, 10, 200), 2); - - if (requestResult.frameMode == currentMode && prevModeActiveRequestCount == 0) { - modeMetrics[currentMode].update(requestResult.startTime, requestResult.frame); - } else { - modeMetrics[getOtherMode(currentMode)].update(requestResult.startTime, requestResult.frame); - prevModeActiveRequestCount--; - } - - if (!FLAGS_no_show) { - cv::imshow(imshowWindowTitle, requestResult.frame); - - const int key = cv::waitKey(1); - - if (27 == key || 'q' == key || 'Q' == key) { // Esc - break; - } else if (9 == key) { // Tab - if (prevModeActiveRequestCount != 0) continue; - - ExecutionMode prevMode = currentMode; - switchMode(currentMode); - - { - std::lock_guard lock(mutex); - - prevModeActiveRequestCount = prevMode == ExecutionMode::USER_SPECIFIED - ? userSpecifiedInferRequests.size() - emptyRequests.size() - : 1 - emptyRequests.size(); - } - - putHighlightedText(requestResult.frame, "Switching modes, please wait...", - cv::Point2f(10, requestResult.frame.rows - 60), - cv::FONT_HERSHEY_TRIPLEX, 0.75, cv::Scalar(10, 200, 10), 2); - cv::imshow(imshowWindowTitle, requestResult.frame); - cv::waitKey(1); - - if (prevMode == ExecutionMode::USER_SPECIFIED) { - for (const auto& request : userSpecifiedInferRequests) { - request->Wait(IInferRequest::WaitMode::RESULT_READY); - } - } else minLatencyInferRequest->Wait(IInferRequest::WaitMode::RESULT_READY); - - { - std::lock_guard lock(mutex); - - if (currentMode == ExecutionMode::USER_SPECIFIED) { - emptyRequests.assign(userSpecifiedInferRequests.begin(), - userSpecifiedInferRequests.end()); - } else emptyRequests = {minLatencyInferRequest}; - } - - if (modeMetrics.find(currentMode) == modeMetrics.end()) { - modeMetrics.insert({currentMode, PerformanceMetrics()}); - } else modeMetrics[currentMode] = PerformanceMetrics(); - } else { - presenter.handleKey(key); - } - } - - continue; - } - - { - std::unique_lock lock(mutex); - - if (emptyRequests.empty() || prevModeActiveRequestCount != 0 || !cap.isOpened()) { - while (callbackException == nullptr && emptyRequests.empty() && completedRequestResults.empty()) { - condVar.wait(lock); - } - - continue; - } - } - - auto startTime = std::chrono::steady_clock::now(); - - cv::Mat frame; - if (!cap.read(frame)) { - if (frame.empty()) { - if (FLAGS_loop) { - cap.open((FLAGS_i == "cam") ? 0 : FLAGS_i.c_str()); - } else cap.release(); - continue; - } else { - throw std::logic_error("Failed to get frame from cv::VideoCapture"); - } - } - - InferRequest::Ptr request; - { - std::lock_guard lock(mutex); - - request = std::move(emptyRequests.front()); - emptyRequests.pop_front(); - } - frameToBlob(frame, request, imageInputName); - - ExecutionMode frameMode = currentMode; - request->SetCompletionCallback([&mutex, - &completedRequestResults, - nextFrameId, - frame, - request, - &outputName, - startTime, - frameMode, - &emptyRequests, - &callbackException, - &condVar] { - { - std::lock_guard callbackLock(mutex); - - try { - completedRequestResults.insert( - std::pair(nextFrameId, RequestResult{ - frame, - std::make_shared>(*as>(request->GetBlob(outputName))), - startTime, - frameMode - })); - - emptyRequests.push_back(std::move(request)); - } - catch (...) { - if (!callbackException) { - callbackException = std::current_exception(); - } - } - } - condVar.notify_one(); - }); - - request->StartAsync(); - nextFrameId++; - } - // ----------------------------------------------------------------------------------------------------- - - // --------------------------- 8. Report metrics ------------------------------------------------------- - slog::info << slog::endl << "Metric reports:" << slog::endl; - - /** Show performance results **/ - if (FLAGS_pc) { - if (currentMode == ExecutionMode::USER_SPECIFIED) { - for (const auto& request: userSpecifiedInferRequests) { - printPerformanceCounts(*request, std::cout, getFullDeviceName(ie, FLAGS_d)); - } - } else printPerformanceCounts(*minLatencyInferRequest, std::cout, getFullDeviceName(ie, FLAGS_d)); - } - - for (auto& mode : modeMetrics) { - std::cout << std::endl << "Mode: " - << (mode.first == ExecutionMode::USER_SPECIFIED ? "USER_SPECIFIED" : "MIN_LATENCY") << std::endl; - mode.second.printTotal(); - } - - std::cout << std::endl << presenter.reportMeans() << '\n'; - // ----------------------------------------------------------------------------------------------------- - - // --------------------------- 9. Wait for running Infer Requests -------------------------------------- - if (currentMode == ExecutionMode::USER_SPECIFIED) { - for (const auto& request: userSpecifiedInferRequests) { - request->Wait(IInferRequest::WaitMode::RESULT_READY); - } - } else minLatencyInferRequest->Wait(IInferRequest::WaitMode::RESULT_READY); - // ----------------------------------------------------------------------------------------------------- - } - catch (const std::exception& error) { - std::cerr << "[ ERROR ] " << error.what() << std::endl; - return 1; - } - catch (...) { - std::cerr << "[ ERROR ] Unknown/internal exception happened." << std::endl; - return 1; - } - - slog::info << slog::endl << "The execution has completed successfully" << slog::endl; - return 0; -} diff --git a/demos/object_detection_demo_ssd_async/models.lst b/demos/object_detection_demo_ssd_async/models.lst deleted file mode 100644 index e8cef80843b..00000000000 --- a/demos/object_detection_demo_ssd_async/models.lst +++ /dev/null @@ -1,10 +0,0 @@ -# This file can be used with the --list option of the model downloader. -face-detection-adas-???? -face-detection-retail-???? -pedestrian-and-vehicle-detector-adas-???? -pedestrian-detection-adas-???? -pelee-coco -person-detection-retail-???? -retinanet-tf -vehicle-detection-adas-???? -vehicle-license-plate-detection-barrier-???? diff --git a/demos/object_detection_demo_ssd_async/object_detection_demo_ssd_async.hpp b/demos/object_detection_demo_ssd_async/object_detection_demo_ssd_async.hpp deleted file mode 100644 index aa02e8c1923..00000000000 --- a/demos/object_detection_demo_ssd_async/object_detection_demo_ssd_async.hpp +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (C) 2018-2020 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/////////////////////////////////////////////////////////////////////////////////////////////////// -#pragma once - -#include -#include -#include -#include - -#include - -static const char help_message[] = "Print a usage message."; -static const char video_message[] = "Required. Path to a video file (specify \"cam\" to work with camera)."; -static const char model_message[] = "Required. Path to an .xml file with a trained model."; -static const char target_device_message[] = "Optional. Specify the target device to infer on (the list of available devices is shown below). " - "Default value is CPU. Use \"-d HETERO:\" format to specify HETERO plugin. " - "The demo will look for a suitable plugin for a specified device."; -static const char labels_message[] = "Optional. Path to a file with labels mapping."; -static const char performance_counter_message[] = "Optional. Enables per-layer performance report."; -static const char custom_cldnn_message[] = "Required for GPU custom kernels. " - "Absolute path to the .xml file with the kernel descriptions."; -static const char custom_cpu_library_message[] = "Required for CPU custom layers. " - "Absolute path to a shared library with the kernel implementations."; -static const char thresh_output_message[] = "Optional. Probability threshold for detections."; -static const char raw_output_message[] = "Optional. Inference results as raw values."; -static const char input_resizable_message[] = "Optional. Enables resizable input with support of ROI crop & auto resize."; -static const char num_inf_req_message[] = "Optional. Number of infer requests."; -static const char num_threads_message[] = "Optional. Number of threads."; -static const char num_streams_message[] = "Optional. Number of streams to use for inference on the CPU or/and GPU in " - "throughput mode (for HETERO and MULTI device cases use format " - ":,: or just )"; -static const char no_show_processed_video[] = "Optional. Do not show processed video."; -static const char utilization_monitors_message[] = "Optional. List of monitors to show initially."; - -DEFINE_bool(h, false, help_message); -DEFINE_string(i, "", video_message); -DEFINE_string(m, "", model_message); -DEFINE_string(d, "CPU", target_device_message); -DEFINE_string(labels, "", labels_message); -DEFINE_bool(pc, false, performance_counter_message); -DEFINE_string(c, "", custom_cldnn_message); -DEFINE_string(l, "", custom_cpu_library_message); -DEFINE_bool(r, false, raw_output_message); -DEFINE_double(t, 0.5, thresh_output_message); -DEFINE_bool(auto_resize, false, input_resizable_message); -DEFINE_uint32(nireq, 2, num_inf_req_message); -DEFINE_uint32(nthreads, 0, num_threads_message); -DEFINE_string(nstreams, "", num_streams_message); -DEFINE_bool(loop, false, loop_message); -DEFINE_bool(no_show, false, no_show_processed_video); -DEFINE_string(u, "", utilization_monitors_message); - -/** -* \brief This function shows a help message -*/ -static void showUsage() { - std::cout << std::endl; - std::cout << "object_detection_demo_ssd_async [OPTION]" << std::endl; - std::cout << "Options:" << std::endl; - std::cout << std::endl; - std::cout << " -h " << help_message << std::endl; - std::cout << " -i \"\" " << video_message << std::endl; - std::cout << " -m \"\" " << model_message << std::endl; - std::cout << " -l \"\" " << custom_cpu_library_message << std::endl; - std::cout << " Or" << std::endl; - std::cout << " -c \"\" " << custom_cldnn_message << std::endl; - std::cout << " -d \"\" " << target_device_message << std::endl; - std::cout << " -labels \"\" " << labels_message << std::endl; - std::cout << " -pc " << performance_counter_message << std::endl; - std::cout << " -r " << raw_output_message << std::endl; - std::cout << " -t " << thresh_output_message << std::endl; - std::cout << " -auto_resize " << input_resizable_message << std::endl; - std::cout << " -nireq \"\" " << num_inf_req_message << std::endl; - std::cout << " -nthreads \"\" " << num_threads_message << std::endl; - std::cout << " -nstreams " << num_streams_message << std::endl; - std::cout << " -loop " << loop_message << std::endl; - std::cout << " -no_show " << no_show_processed_video << std::endl; - std::cout << " -u " << utilization_monitors_message << std::endl; -} diff --git a/demos/object_detection_demo_yolov3_async/CMakeLists.txt b/demos/object_detection_demo_yolov3_async/CMakeLists.txt deleted file mode 100644 index eb320d7471f..00000000000 --- a/demos/object_detection_demo_yolov3_async/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (C) 2018-2019 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 -# - -ie_add_sample(NAME object_detection_demo_yolov3_async - SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp" - HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/object_detection_demo_yolov3_async.hpp" - DEPENDENCIES monitors - OPENCV_DEPENDENCIES highgui) - -target_link_libraries(object_detection_demo_yolov3_async PRIVATE ngraph::ngraph) diff --git a/demos/object_detection_demo_yolov3_async/README.md b/demos/object_detection_demo_yolov3_async/README.md deleted file mode 100644 index aa810a74a23..00000000000 --- a/demos/object_detection_demo_yolov3_async/README.md +++ /dev/null @@ -1,79 +0,0 @@ -# Object Detection YOLO* V3 C++ Demo, Async API Performance Showcase - -This demo showcases Object Detection with YOLO* V3 and Async API. - -> **NOTE:** This topic describes usage of C++ implementation of the Object Detection YOLO* V3 Demo Async API . For the Python* implementation, refer to [Object Detection YOLO* V3 Python* Demo, Async API Performance Showcase](../python_demos/object_detection_demo_yolov3_async/README.md). - -To learn more about Async API features, please refer to [Object Detection for SSD Demo, Async API Performance Showcase](../object_detection_demo_ssd_async/README.md). - -Other demo objectives are: -* Video as input support via OpenCV* -* Visualization of the resulting bounding boxes and text labels (from the labels file, see `-labels` option) or class number (if no file is provided) -* OpenCV provides resulting bounding boxes, labels, and other information. -You can copy and paste this code without pulling Open Model Zoo demos helpers into your application -* Demonstration of the Async API in action. For this, the demo features two modes toggled by the **Tab** key: - - Old-style "Sync" way, where the frame captured with OpenCV executes back-to-back with the Detection - - Truly "Async" way, where the detection is performed on a current frame, while OpenCV captures the next frame - -## How It Works - -On the start-up, the application reads command-line parameters and loads a network to the Inference -Engine. Upon getting a frame from the OpenCV VideoCapture, it performs inference and displays the results. - -> **NOTE**: By default, Open Model Zoo demos expect input with BGR channels order. If you trained your model to work with RGB order, you need to manually rearrange the default channels order in the demo application or reconvert your model using the Model Optimizer tool with `--reverse_input_channels` argument specified. For more information about the argument, refer to **When to Reverse Input Channels** section of [Converting a Model Using General Conversion Parameters](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_convert_model_Converting_Model_General.html). - -## Running - -Running the application with the -h option yields the following usage message: -``` -./object_detection_demo_yolov3_async -h -InferenceEngine: - API version ............ - Build .................. - -object_detection_demo_yolov3_async [OPTION] -Options: - - -h Print a usage message. - -i Required. An input to process. The input must be a single image, a folder of images or anything that cv::VideoCapture can process. - -loop Optional. Enable reading the input in a loop. - -m "" Required. Path to an .xml file with a trained model. - -l "" Optional. Required for CPU custom layers. Absolute path to a shared library with the layers implementation. - Or - -c "" Optional. Required for GPU custom kernels. Absolute path to the .xml file with the kernels description. - -d "" Optional. Specify a target device to infer on (the list of available devices is shown below). Default value is CPU. The demo will look for a suitable plugin for the specified device - -labels "" Optional. Path to a file with labels mapping. - -pc Optional. Enable per-layer performance report. - -r Optional. Output inference results raw values showing. - -t Optional. Probability threshold for detections. - -iou_t Optional. Filtering intersection over union threshold for overlapping boxes. - -auto_resize Optional. Enable resizable input with support of ROI crop and auto resize. - -no_show Optional. Do not show processed video. - -u Optional. List of monitors to show initially. -``` - -Running the application with the empty list of options yields the usage message given above and an error message. - -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). - -> **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). - -You can use the following command to do inference on GPU with a pre-trained object detection model: -```sh -./object_detection_demo_yolov3_async -i /inputVideo.mp4 -m /yolo_v3.xml -d GPU -``` - -The only GUI knob is to use **Tab** to switch between the synchronized execution and the true Async mode. - -## Demo Output - -The demo uses OpenCV to display the resulting frame with detections (rendered as bounding boxes and labels, if provided). -In the default mode, the demo reports: -* **OpenCV time**: frame decoding + time to render the bounding boxes, labels, and to display the results. -* **Detection time**: inference time for the object detection network. It is reported in the Sync mode only. -* **Wallclock time**, which is combined application-level performance. - -## See Also -* [Using Open Model Zoo demos](../README.md) -* [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) -* [Model Downloader](../../tools/downloader/README.md) diff --git a/demos/object_detection_demo_yolov3_async/main.cpp b/demos/object_detection_demo_yolov3_async/main.cpp deleted file mode 100644 index 207e8c43d36..00000000000 --- a/demos/object_detection_demo_yolov3_async/main.cpp +++ /dev/null @@ -1,472 +0,0 @@ -// Copyright (C) 2018-2020 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** -* \brief The entry point for the Inference Engine object_detection demo application -* \file object_detection_demo_yolov3_async/main.cpp -* \example object_detection_demo_yolov3_async/main.cpp -*/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include "object_detection_demo_yolov3_async.hpp" - -using namespace InferenceEngine; - -bool ParseAndCheckCommandLine(int argc, char *argv[]) { - // ---------------------------Parsing and validating the input arguments-------------------------------------- - gflags::ParseCommandLineNonHelpFlags(&argc, &argv, true); - if (FLAGS_h) { - showUsage(); - showAvailableDevices(); - return false; - } - slog::info << "Parsing input parameters" << slog::endl; - - if (FLAGS_i.empty()) { - throw std::logic_error("Parameter -i is not set"); - } - - if (FLAGS_m.empty()) { - throw std::logic_error("Parameter -m is not set"); - } - return true; -} - -void FrameToBlob(const cv::Mat &frame, InferRequest::Ptr &inferRequest, const std::string &inputName) { - if (FLAGS_auto_resize) { - /* Just set input blob containing read image. Resize and layout conversion will be done automatically */ - inferRequest->SetBlob(inputName, wrapMat2Blob(frame)); - } else { - /* Resize and copy data from the image to the input blob */ - Blob::Ptr frameBlob = inferRequest->GetBlob(inputName); - matU8ToBlob(frame, frameBlob); - } -} - -static int EntryIndex(int side, int lcoords, int lclasses, int location, int entry) { - int n = location / (side * side); - int loc = location % (side * side); - return n * side * side * (lcoords + lclasses + 1) + entry * side * side + loc; -} - -struct DetectionObject { - int xmin, ymin, xmax, ymax, class_id; - float confidence; - - DetectionObject(double x, double y, double h, double w, int class_id, float confidence, float h_scale, float w_scale) { - this->xmin = static_cast((x - w / 2) * w_scale); - this->ymin = static_cast((y - h / 2) * h_scale); - this->xmax = static_cast(this->xmin + w * w_scale); - this->ymax = static_cast(this->ymin + h * h_scale); - this->class_id = class_id; - this->confidence = confidence; - } - - bool operator <(const DetectionObject &s2) const { - return this->confidence < s2.confidence; - } - bool operator >(const DetectionObject &s2) const { - return this->confidence > s2.confidence; - } -}; - -double IntersectionOverUnion(const DetectionObject &box_1, const DetectionObject &box_2) { - double width_of_overlap_area = fmin(box_1.xmax, box_2.xmax) - fmax(box_1.xmin, box_2.xmin); - double height_of_overlap_area = fmin(box_1.ymax, box_2.ymax) - fmax(box_1.ymin, box_2.ymin); - double area_of_overlap; - if (width_of_overlap_area < 0 || height_of_overlap_area < 0) - area_of_overlap = 0; - else - area_of_overlap = width_of_overlap_area * height_of_overlap_area; - double box_1_area = (box_1.ymax - box_1.ymin) * (box_1.xmax - box_1.xmin); - double box_2_area = (box_2.ymax - box_2.ymin) * (box_2.xmax - box_2.xmin); - double area_of_union = box_1_area + box_2_area - area_of_overlap; - return area_of_overlap / area_of_union; -} - -class YoloParams { - template - void computeAnchors(const std::vector & mask) { - std::vector maskedAnchors(num * 2); - for (int i = 0; i < num; ++i) { - maskedAnchors[i * 2] = anchors[mask[i] * 2]; - maskedAnchors[i * 2 + 1] = anchors[mask[i] * 2 + 1]; - } - anchors = maskedAnchors; - } - -public: - int num = 0, classes = 0, coords = 0; - std::vector anchors = {10.0, 13.0, 16.0, 30.0, 33.0, 23.0, 30.0, 61.0, 62.0, 45.0, 59.0, 119.0, 116.0, 90.0, - 156.0, 198.0, 373.0, 326.0}; - - YoloParams() {} - - YoloParams(const std::shared_ptr regionYolo) { - coords = regionYolo->get_num_coords(); - classes = regionYolo->get_num_classes(); - anchors = regionYolo->get_anchors(); - auto mask = regionYolo->get_mask(); - num = mask.size(); - - computeAnchors(mask); - } -}; - -void ParseYOLOV3Output(const YoloParams ¶ms, const std::string & output_name, - const Blob::Ptr &blob, const unsigned long resized_im_h, - const unsigned long resized_im_w, const unsigned long original_im_h, - const unsigned long original_im_w, - const double threshold, std::vector &objects) { - - const int out_blob_h = static_cast(blob->getTensorDesc().getDims()[2]); - const int out_blob_w = static_cast(blob->getTensorDesc().getDims()[3]); - if (out_blob_h != out_blob_w) - throw std::runtime_error("Invalid size of output " + output_name + - " It should be in NCHW layout and H should be equal to W. Current H = " + std::to_string(out_blob_h) + - ", current W = " + std::to_string(out_blob_h)); - - auto side = out_blob_h; - auto side_square = side * side; - LockedMemory blobMapped = as(blob)->rmap(); - const float *output_blob = blobMapped.as(); - // --------------------------- Parsing YOLO Region output ------------------------------------- - for (int i = 0; i < side_square; ++i) { - int row = i / side; - int col = i % side; - for (int n = 0; n < params.num; ++n) { - int obj_index = EntryIndex(side, params.coords, params.classes, n * side * side + i, params.coords); - int box_index = EntryIndex(side, params.coords, params.classes, n * side * side + i, 0); - float scale = output_blob[obj_index]; - if (scale < threshold) - continue; - double x = (col + output_blob[box_index + 0 * side_square]) / side * resized_im_w; - double y = (row + output_blob[box_index + 1 * side_square]) / side * resized_im_h; - double height = std::exp(output_blob[box_index + 3 * side_square]) * params.anchors[2 * n + 1]; - double width = std::exp(output_blob[box_index + 2 * side_square]) * params.anchors[2 * n]; - for (int j = 0; j < params.classes; ++j) { - int class_index = EntryIndex(side, params.coords, params.classes, n * side_square + i, params.coords + 1 + j); - float prob = scale * output_blob[class_index]; - if (prob < threshold) - continue; - DetectionObject obj(x, y, height, width, j, prob, - static_cast(original_im_h) / static_cast(resized_im_h), - static_cast(original_im_w) / static_cast(resized_im_w)); - objects.push_back(obj); - } - } - } -} - - -int main(int argc, char *argv[]) { - try { - /** This demo covers a certain topology and cannot be generalized for any object detection **/ - std::cout << "InferenceEngine: " << printable(*GetInferenceEngineVersion()) << std::endl; - - // ------------------------------ Parsing and validating the input arguments --------------------------------- - if (!ParseAndCheckCommandLine(argc, argv)) { - return 0; - } - - // --------------------------- 1. Load inference engine ------------------------------------- - slog::info << "Loading Inference Engine" << slog::endl; - Core ie; - - slog::info << "Device info: " << slog::endl; - slog::info << printable(ie.GetVersions(FLAGS_d)) << slog::endl; - - /**Loading extensions to the devices **/ - - if (!FLAGS_l.empty()) { - // CPU extensions are loaded as a shared library and passed as a pointer to the base extension - IExtensionPtr extension_ptr = make_so_pointer(FLAGS_l.c_str()); - ie.AddExtension(extension_ptr, "CPU"); - } - if (!FLAGS_c.empty()) { - // GPU extensions are loaded from an .xml description and OpenCL kernel files - ie.SetConfig({{PluginConfigParams::KEY_CONFIG_FILE, FLAGS_c}}, "GPU"); - } - - /** Per-layer metrics **/ - if (FLAGS_pc) { - ie.SetConfig({ { PluginConfigParams::KEY_PERF_COUNT, PluginConfigParams::YES } }); - } - // ----------------------------------------------------------------------------------------------------- - - // --------------- 2. Reading the IR generated by the Model Optimizer (.xml and .bin files) ------------ - slog::info << "Loading network files" << slog::endl; - /** Reading network model **/ - auto cnnNetwork = ie.ReadNetwork(FLAGS_m); - /** Reading labels (if specified) **/ - std::vector labels; - if (!FLAGS_labels.empty()) { - std::ifstream inputFile(FLAGS_labels); - std::string label; - while (std::getline(inputFile, label)) { - labels.push_back(label); - } - if (labels.empty()) - throw std::logic_error("File empty or not found: " + FLAGS_labels); - } - // ----------------------------------------------------------------------------------------------------- - - /** YOLOV3-based network should have one input and three output **/ - // --------------------------- 3. Configuring input and output ----------------------------------------- - // --------------------------------- Preparing input blobs --------------------------------------------- - slog::info << "Checking that the inputs are as the demo expects" << slog::endl; - InputsDataMap inputInfo(cnnNetwork.getInputsInfo()); - if (inputInfo.size() != 1) { - throw std::logic_error("This demo accepts networks that have only one input"); - } - InputInfo::Ptr& input = inputInfo.begin()->second; - auto inputName = inputInfo.begin()->first; - input->setPrecision(Precision::U8); - if (FLAGS_auto_resize) { - input->getPreProcess().setResizeAlgorithm(ResizeAlgorithm::RESIZE_BILINEAR); - input->getInputData()->setLayout(Layout::NHWC); - } else { - input->getInputData()->setLayout(Layout::NCHW); - } - - ICNNNetwork::InputShapes inputShapes = cnnNetwork.getInputShapes(); - SizeVector& inSizeVector = inputShapes.begin()->second; - inSizeVector[0] = 1; // set batch to 1 - cnnNetwork.reshape(inputShapes); - // --------------------------------- Preparing output blobs ------------------------------------------- - slog::info << "Checking that the outputs are as the demo expects" << slog::endl; - OutputsDataMap outputInfo(cnnNetwork.getOutputsInfo()); - for (auto &output : outputInfo) { - output.second->setPrecision(Precision::FP32); - output.second->setLayout(Layout::NCHW); - } - - std::map yoloParams; - if (auto ngraphFunction = cnnNetwork.getFunction()) { - for (const auto op : ngraphFunction->get_ops()) { - auto outputLayer = outputInfo.find(op->get_friendly_name()); - if (outputLayer != outputInfo.end()) { - auto regionYolo = std::dynamic_pointer_cast(op); - if (!regionYolo) { - throw std::runtime_error("Invalid output type: " + - std::string(regionYolo->get_type_info().name) + ". RegionYolo expected"); - } - yoloParams[outputLayer->first] = YoloParams(regionYolo); - } - } - } - else { - throw std::runtime_error("Can't get ngraph::Function. Make sure the provided model is in IR version 10 or greater."); - } - - if (!labels.empty() && static_cast(labels.size()) != yoloParams.begin()->second.classes) { - throw std::runtime_error("The number of labels is different from numbers of model classes"); - } - // ----------------------------------------------------------------------------------------------------- - - // --------------------------- 4. Loading model to the device ------------------------------------------ - slog::info << "Loading model to the device" << slog::endl; - ExecutableNetwork network = ie.LoadNetwork(cnnNetwork, FLAGS_d); - // ----------------------------------------------------------------------------------------------------- - - // --------------------------- 5. Creating infer request ----------------------------------------------- - InferRequest::Ptr async_infer_request_next = network.CreateInferRequestPtr(); - InferRequest::Ptr async_infer_request_curr = network.CreateInferRequestPtr(); - // ----------------------------------------------------------------------------------------------------- - - // --------------------------- 6. Doing inference ------------------------------------------------------ - std::unique_ptr cap = openImagesCapture(FLAGS_i, FLAGS_loop); - cv::Mat frame = cap->read(); - if (!frame.data) throw std::runtime_error("Can't read an image from the input"); - - cv::Size graphSize{frame.cols / 4, 60}; - Presenter presenter(FLAGS_u, frame.rows - graphSize.height - 10, graphSize); - - std::cout << "To close the application, press 'CTRL+C' here or switch to the output window and press ESC key" << std::endl; - std::cout << "To switch between sync/async modes, press TAB key in the output window" << std::endl; - - bool isAsyncMode = false; // execution is always started using SYNC mode - bool isModeChanged = false; // set to TRUE when execution mode is changed (SYNC<->ASYNC) - - typedef std::chrono::duration> ms; - auto total_t0 = std::chrono::high_resolution_clock::now(); - auto wallclock = std::chrono::high_resolution_clock::now(); - double ocv_render_time = 0; - do { - auto t0 = std::chrono::high_resolution_clock::now(); - // Here is the first asynchronous point: - // in the Async mode, we capture frame to populate the NEXT infer request - // in the regular mode, we capture frame to the CURRENT infer request - cv::Mat next_frame = cap->read(); - if (isAsyncMode) { - if (isModeChanged) { - FrameToBlob(frame, async_infer_request_curr, inputName); - } - if (next_frame.data) { - FrameToBlob(next_frame, async_infer_request_next, inputName); - } - } else if (!isModeChanged) { - FrameToBlob(frame, async_infer_request_curr, inputName); - } - auto t1 = std::chrono::high_resolution_clock::now(); - double ocv_decode_time = std::chrono::duration_cast(t1 - t0).count(); - - t0 = std::chrono::high_resolution_clock::now(); - // Main sync point: - // in the true Async mode, we start the NEXT infer request while waiting for the CURRENT to complete - // in the regular mode, we start the CURRENT request and wait for its completion - if (isAsyncMode) { - if (isModeChanged) { - async_infer_request_curr->StartAsync(); - } - if (next_frame.data) { - async_infer_request_next->StartAsync(); - } - } else if (!isModeChanged) { - async_infer_request_curr->StartAsync(); - } - - if (OK != async_infer_request_curr->Wait(IInferRequest::WaitMode::RESULT_READY)) { - throw std::runtime_error("Waiting for inference results error"); - } - t1 = std::chrono::high_resolution_clock::now(); - ms detection = std::chrono::duration_cast(t1 - t0); - - t0 = std::chrono::high_resolution_clock::now(); - ms wall = std::chrono::duration_cast(t0 - wallclock); - wallclock = t0; - - t0 = std::chrono::high_resolution_clock::now(); - presenter.drawGraphs(frame); - std::ostringstream out; - out << "OpenCV cap/render time: " << std::fixed << std::setprecision(1) - << (ocv_decode_time + ocv_render_time) << " ms"; - cv::putText(frame, out.str(), cv::Point2f(0, 25), cv::FONT_HERSHEY_TRIPLEX, 0.6, cv::Scalar(0, 255, 0)); - out.str(""); - out << "Wallclock time " << (isAsyncMode ? "(TRUE ASYNC): " : "(SYNC, press Tab): "); - out << std::fixed << std::setprecision(1) << wall.count() << " ms (" << 1000.0 / wall.count() << " fps)"; - cv::putText(frame, out.str(), cv::Point2f(0, 50), cv::FONT_HERSHEY_TRIPLEX, 0.6, cv::Scalar(0, 0, 255)); - if (!isAsyncMode) { // In the true async mode, there is no way to measure detection time directly - out.str(""); - out << "Detection time : " << std::fixed << std::setprecision(1) << detection.count() - << " ms (" - << 1000.0 / detection.count() << " fps)"; - cv::putText(frame, out.str(), cv::Point2f(0, 75), cv::FONT_HERSHEY_TRIPLEX, 0.6, - cv::Scalar(255, 0, 0)); - } - - // ---------------------------Processing output blobs-------------------------------------------------- - // Processing results of the CURRENT request - const TensorDesc& inputDesc = inputInfo.begin()->second.get()->getTensorDesc(); - unsigned long resized_im_h = getTensorHeight(inputDesc); - unsigned long resized_im_w = getTensorWidth(inputDesc); - std::vector objects; - // Parsing outputs - for (auto &output : outputInfo) { - auto output_name = output.first; - Blob::Ptr blob = async_infer_request_curr->GetBlob(output_name); - ParseYOLOV3Output(yoloParams[output_name], output_name, blob, resized_im_h, resized_im_w, frame.rows, frame.cols, FLAGS_t, objects); - } - // Filtering overlapping boxes - std::sort(objects.begin(), objects.end(), std::greater()); - for (size_t i = 0; i < objects.size(); ++i) { - if (objects[i].confidence == 0) - continue; - for (size_t j = i + 1; j < objects.size(); ++j) - if (IntersectionOverUnion(objects[i], objects[j]) >= FLAGS_iou_t) - objects[j].confidence = 0; - } - // Drawing boxes - for (auto &object : objects) { - if (object.confidence < FLAGS_t) - continue; - auto label = object.class_id; - float confidence = object.confidence; - if (FLAGS_r) { - std::cout << "[" << label << "] element, prob = " << confidence << - " (" << object.xmin << "," << object.ymin << ")-(" << object.xmax << "," << object.ymax << ")" - << ((confidence > FLAGS_t) ? " WILL BE RENDERED!" : "") << std::endl; - } - if (confidence > FLAGS_t) { - /** Drawing only objects when >confidence_threshold probability **/ - std::ostringstream conf; - conf << ":" << std::fixed << std::setprecision(3) << confidence; - cv::putText(frame, - (!labels.empty() ? labels[label] : std::string("label #") + std::to_string(label)) + conf.str(), - cv::Point2f(static_cast(object.xmin), static_cast(object.ymin - 5)), cv::FONT_HERSHEY_COMPLEX_SMALL, 1, - cv::Scalar(0, 0, 255)); - cv::rectangle(frame, cv::Point2f(static_cast(object.xmin), static_cast(object.ymin)), - cv::Point2f(static_cast(object.xmax), static_cast(object.ymax)), cv::Scalar(0, 0, 255)); - } - } - if (!FLAGS_no_show) { - cv::imshow("Detection results", frame); - } - - t1 = std::chrono::high_resolution_clock::now(); - ocv_render_time = std::chrono::duration_cast(t1 - t0).count(); - - if (isModeChanged) { - isModeChanged = false; - } - - // Final point: - // in the truly Async mode, we swap the NEXT and CURRENT requests for the next iteration - frame = std::move(next_frame); - if (isAsyncMode) { - async_infer_request_curr.swap(async_infer_request_next); - } - - const int key = cv::waitKey(1); - if (27 == key) // Esc - break; - if (9 == key) { // Tab - isAsyncMode = !isAsyncMode; - isModeChanged = true; - } else { - presenter.handleKey(key); - } - } while (frame.data); - // ----------------------------------------------------------------------------------------------------- - auto total_t1 = std::chrono::high_resolution_clock::now(); - ms total = std::chrono::duration_cast(total_t1 - total_t0); - std::cout << "Total Inference time: " << total.count() << std::endl; - - /** Showing performance results **/ - if (FLAGS_pc) { - printPerformanceCounts(*async_infer_request_curr, std::cout, getFullDeviceName(ie, FLAGS_d)); - } - - std::cout << presenter.reportMeans() << '\n'; - } - catch (const std::exception& error) { - std::cerr << "[ ERROR ] " << error.what() << std::endl; - return 1; - } - catch (...) { - std::cerr << "[ ERROR ] Unknown/internal exception happened." << std::endl; - return 1; - } - - slog::info << "Execution successful" << slog::endl; - return 0; -} diff --git a/demos/object_detection_demo_yolov3_async/object_detection_demo_yolov3_async.hpp b/demos/object_detection_demo_yolov3_async/object_detection_demo_yolov3_async.hpp deleted file mode 100644 index 173ebd98586..00000000000 --- a/demos/object_detection_demo_yolov3_async/object_detection_demo_yolov3_async.hpp +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (C) 2018-2020 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/////////////////////////////////////////////////////////////////////////////////////////////////// -#pragma once - -#include -#include -#include -#include - -#include - -DEFINE_INPUT_FLAGS - -static const char help_message[] = "Print a usage message."; -static const char model_message[] = "Required. Path to an .xml file with a trained model."; -static const char target_device_message[] = "Optional. Specify a target device to infer on (the list of available devices is shown below). " - "Default value is CPU. The demo will look for a suitable plugin for the specified device"; -static const char labels_message[] = "Optional. Path to a file with labels mapping."; -static const char performance_counter_message[] = "Optional. Enable per-layer performance report."; -static const char custom_cldnn_message[] = "Optional. Required for GPU custom kernels. " - "Absolute path to the .xml file with the kernels description."; -static const char custom_cpu_library_message[] = "Optional. Required for CPU custom layers. " - "Absolute path to a shared library with the layers implementation."; -static const char thresh_output_message[] = "Optional. Probability threshold for detections."; -static const char iou_thresh_output_message[] = "Optional. Filtering intersection over union threshold for overlapping boxes."; -static const char raw_output_message[] = "Optional. Output inference results raw values showing."; -static const char input_resizable_message[] = "Optional. Enable resizable input with support of ROI crop and auto resize."; -static const char no_show_processed_video[] = "Optional. Do not show processed video."; -static const char utilization_monitors_message[] = "Optional. List of monitors to show initially."; - -DEFINE_bool(h, false, help_message); -DEFINE_string(m, "", model_message); -DEFINE_string(d, "CPU", target_device_message); -DEFINE_string(labels, "", labels_message); -DEFINE_bool(pc, false, performance_counter_message); -DEFINE_string(c, "", custom_cldnn_message); -DEFINE_string(l, "", custom_cpu_library_message); -DEFINE_bool(r, false, raw_output_message); -DEFINE_double(t, 0.5, thresh_output_message); -DEFINE_double(iou_t, 0.4, iou_thresh_output_message); -DEFINE_bool(auto_resize, false, input_resizable_message); -DEFINE_bool(no_show, false, no_show_processed_video); -DEFINE_string(u, "", utilization_monitors_message); - -/** -* \brief This function shows a help message -*/ -static void showUsage() { - std::cout << std::endl; - std::cout << "object_detection_demo_yolov3_async [OPTION]" << std::endl; - std::cout << "Options:" << std::endl; - std::cout << std::endl; - std::cout << " -h " << help_message << std::endl; - std::cout << " -i " << input_message << std::endl; - std::cout << " -loop " << loop_message << std::endl; - std::cout << " -m \"\" " << model_message << std::endl; - std::cout << " -l \"\" " << custom_cpu_library_message << std::endl; - std::cout << " Or" << std::endl; - std::cout << " -c \"\" " << custom_cldnn_message << std::endl; - std::cout << " -d \"\" " << target_device_message << std::endl; - std::cout << " -labels \"\" " << labels_message << std::endl; - std::cout << " -pc " << performance_counter_message << std::endl; - std::cout << " -r " << raw_output_message << std::endl; - std::cout << " -t " << thresh_output_message << std::endl; - std::cout << " -iou_t " << iou_thresh_output_message << std::endl; - std::cout << " -auto_resize " << input_resizable_message << std::endl; - std::cout << " -no_show " << no_show_processed_video << std::endl; - std::cout << " -u " << utilization_monitors_message << std::endl; -} diff --git a/demos/pedestrian_tracker_demo/CMakeLists.txt b/demos/pedestrian_tracker_demo/cpp/CMakeLists.txt similarity index 77% rename from demos/pedestrian_tracker_demo/CMakeLists.txt rename to demos/pedestrian_tracker_demo/cpp/CMakeLists.txt index 8e5aaa3bf73..99693e2354e 100644 --- a/demos/pedestrian_tracker_demo/CMakeLists.txt +++ b/demos/pedestrian_tracker_demo/cpp/CMakeLists.txt @@ -2,8 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 # -file (GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) -file (GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) +file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +file(GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) ie_add_sample(NAME pedestrian_tracker_demo SOURCES ${SOURCES} diff --git a/demos/pedestrian_tracker_demo/README.md b/demos/pedestrian_tracker_demo/cpp/README.md similarity index 95% rename from demos/pedestrian_tracker_demo/README.md rename to demos/pedestrian_tracker_demo/cpp/README.md index 38e378f8d9a..7d3a185d846 100644 --- a/demos/pedestrian_tracker_demo/README.md +++ b/demos/pedestrian_tracker_demo/cpp/README.md @@ -1,12 +1,14 @@ # Pedestrian Tracker C++ Demo +![](./pedestrian_tracker.gif) + This demo showcases Pedestrian Tracking scenario: it reads frames from an input video sequence, detects pedestrians in the frames, and builds trajectories of movement of the pedestrians in a frame-by-frame manner. You can use a set of the following pre-trained models with the demo: * _person-detection-retail-0013_, which is the primary detection network for finding pedestrians * _person-reidentification-retail-0031_, which is the network that is executed on top of the results from inference of the first network and makes reidentification of the pedestrians -For more information about the pre-trained models, refer to the [model documentation](../../models/intel/index.md). +For more information about the pre-trained models, refer to the [model documentation](../../../models/intel/index.md). ## How It Works @@ -56,7 +58,7 @@ Options: -u Optional. List of monitors to show initially. ``` -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). +To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). @@ -78,6 +80,6 @@ The demo uses OpenCV to display the resulting frame with detections rendered as >* `person-reidentification-retail-0031` > Other models may produce unexpected results on these devices. ## See Also -* [Using Open Model Zoo demos](../README.md) +* [Using Open Model Zoo demos](../../README.md) * [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) -* [Model Downloader](../../tools/downloader/README.md) +* [Model Downloader](../../../tools/downloader/README.md) diff --git a/demos/pedestrian_tracker_demo/include/cnn.hpp b/demos/pedestrian_tracker_demo/cpp/include/cnn.hpp similarity index 98% rename from demos/pedestrian_tracker_demo/include/cnn.hpp rename to demos/pedestrian_tracker_demo/cpp/include/cnn.hpp index 970ffa6d5e4..082325181df 100644 --- a/demos/pedestrian_tracker_demo/include/cnn.hpp +++ b/demos/pedestrian_tracker_demo/cpp/include/cnn.hpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include diff --git a/demos/pedestrian_tracker_demo/include/core.hpp b/demos/pedestrian_tracker_demo/cpp/include/core.hpp similarity index 100% rename from demos/pedestrian_tracker_demo/include/core.hpp rename to demos/pedestrian_tracker_demo/cpp/include/core.hpp diff --git a/demos/pedestrian_tracker_demo/include/descriptor.hpp b/demos/pedestrian_tracker_demo/cpp/include/descriptor.hpp similarity index 100% rename from demos/pedestrian_tracker_demo/include/descriptor.hpp rename to demos/pedestrian_tracker_demo/cpp/include/descriptor.hpp diff --git a/demos/pedestrian_tracker_demo/include/detector.hpp b/demos/pedestrian_tracker_demo/cpp/include/detector.hpp similarity index 100% rename from demos/pedestrian_tracker_demo/include/detector.hpp rename to demos/pedestrian_tracker_demo/cpp/include/detector.hpp diff --git a/demos/pedestrian_tracker_demo/include/distance.hpp b/demos/pedestrian_tracker_demo/cpp/include/distance.hpp similarity index 100% rename from demos/pedestrian_tracker_demo/include/distance.hpp rename to demos/pedestrian_tracker_demo/cpp/include/distance.hpp diff --git a/demos/pedestrian_tracker_demo/include/kuhn_munkres.hpp b/demos/pedestrian_tracker_demo/cpp/include/kuhn_munkres.hpp similarity index 100% rename from demos/pedestrian_tracker_demo/include/kuhn_munkres.hpp rename to demos/pedestrian_tracker_demo/cpp/include/kuhn_munkres.hpp diff --git a/demos/pedestrian_tracker_demo/include/logging.hpp b/demos/pedestrian_tracker_demo/cpp/include/logging.hpp similarity index 100% rename from demos/pedestrian_tracker_demo/include/logging.hpp rename to demos/pedestrian_tracker_demo/cpp/include/logging.hpp diff --git a/demos/pedestrian_tracker_demo/include/pedestrian_tracker_demo.hpp b/demos/pedestrian_tracker_demo/cpp/include/pedestrian_tracker_demo.hpp similarity index 99% rename from demos/pedestrian_tracker_demo/include/pedestrian_tracker_demo.hpp rename to demos/pedestrian_tracker_demo/cpp/include/pedestrian_tracker_demo.hpp index 4cd7c505015..3a0b2c17b69 100644 --- a/demos/pedestrian_tracker_demo/include/pedestrian_tracker_demo.hpp +++ b/demos/pedestrian_tracker_demo/cpp/include/pedestrian_tracker_demo.hpp @@ -9,7 +9,7 @@ #include #include -#include +#include DEFINE_INPUT_FLAGS diff --git a/demos/pedestrian_tracker_demo/include/tracker.hpp b/demos/pedestrian_tracker_demo/cpp/include/tracker.hpp similarity index 100% rename from demos/pedestrian_tracker_demo/include/tracker.hpp rename to demos/pedestrian_tracker_demo/cpp/include/tracker.hpp diff --git a/demos/pedestrian_tracker_demo/include/utils.hpp b/demos/pedestrian_tracker_demo/cpp/include/utils.hpp similarity index 99% rename from demos/pedestrian_tracker_demo/include/utils.hpp rename to demos/pedestrian_tracker_demo/cpp/include/utils.hpp index bfde882569a..926de5b17ec 100644 --- a/demos/pedestrian_tracker_demo/include/utils.hpp +++ b/demos/pedestrian_tracker_demo/cpp/include/utils.hpp @@ -15,7 +15,7 @@ #include #include -#include +#include /// /// \brief The DetectionLogEntry struct diff --git a/demos/pedestrian_tracker_demo/main.cpp b/demos/pedestrian_tracker_demo/cpp/main.cpp similarity index 99% rename from demos/pedestrian_tracker_demo/main.cpp rename to demos/pedestrian_tracker_demo/cpp/main.cpp index 90bda777403..c84daed32f0 100644 --- a/demos/pedestrian_tracker_demo/main.cpp +++ b/demos/pedestrian_tracker_demo/cpp/main.cpp @@ -11,7 +11,7 @@ #include "pedestrian_tracker_demo.hpp" #include -#include +#include #include diff --git a/demos/pedestrian_tracker_demo/models.lst b/demos/pedestrian_tracker_demo/cpp/models.lst similarity index 100% rename from demos/pedestrian_tracker_demo/models.lst rename to demos/pedestrian_tracker_demo/cpp/models.lst diff --git a/demos/pedestrian_tracker_demo/cpp/pedestrian_tracker.gif b/demos/pedestrian_tracker_demo/cpp/pedestrian_tracker.gif new file mode 100644 index 00000000000..001050bc89a Binary files /dev/null and b/demos/pedestrian_tracker_demo/cpp/pedestrian_tracker.gif differ diff --git a/demos/pedestrian_tracker_demo/src/cnn.cpp b/demos/pedestrian_tracker_demo/cpp/src/cnn.cpp similarity index 100% rename from demos/pedestrian_tracker_demo/src/cnn.cpp rename to demos/pedestrian_tracker_demo/cpp/src/cnn.cpp diff --git a/demos/pedestrian_tracker_demo/src/detector.cpp b/demos/pedestrian_tracker_demo/cpp/src/detector.cpp similarity index 100% rename from demos/pedestrian_tracker_demo/src/detector.cpp rename to demos/pedestrian_tracker_demo/cpp/src/detector.cpp diff --git a/demos/pedestrian_tracker_demo/src/distance.cpp b/demos/pedestrian_tracker_demo/cpp/src/distance.cpp similarity index 100% rename from demos/pedestrian_tracker_demo/src/distance.cpp rename to demos/pedestrian_tracker_demo/cpp/src/distance.cpp diff --git a/demos/pedestrian_tracker_demo/src/kuhn_munkres.cpp b/demos/pedestrian_tracker_demo/cpp/src/kuhn_munkres.cpp similarity index 100% rename from demos/pedestrian_tracker_demo/src/kuhn_munkres.cpp rename to demos/pedestrian_tracker_demo/cpp/src/kuhn_munkres.cpp diff --git a/demos/pedestrian_tracker_demo/src/tracker.cpp b/demos/pedestrian_tracker_demo/cpp/src/tracker.cpp similarity index 100% rename from demos/pedestrian_tracker_demo/src/tracker.cpp rename to demos/pedestrian_tracker_demo/cpp/src/tracker.cpp diff --git a/demos/pedestrian_tracker_demo/src/utils.cpp b/demos/pedestrian_tracker_demo/cpp/src/utils.cpp similarity index 100% rename from demos/pedestrian_tracker_demo/src/utils.cpp rename to demos/pedestrian_tracker_demo/cpp/src/utils.cpp diff --git a/demos/python_demos/formula_recognition_demo/models.lst b/demos/python_demos/formula_recognition_demo/models.lst deleted file mode 100644 index 58bf56e073b..00000000000 --- a/demos/python_demos/formula_recognition_demo/models.lst +++ /dev/null @@ -1,5 +0,0 @@ -# This file can be used with the --list option of the model downloader. -formula-recognition-medium-scan-????-im2latex-decoder -formula-recognition-medium-scan-????-im2latex-encoder -# formula-recognition-polynomials-handwritten-????-im2latex-decoder # TODO: reenable this after the model is added -# formula-recognition-polynomials-handwritten-????-im2latex-encoder # TODO: reenable this after the model is added diff --git a/demos/python_demos/human_pose_estimation_3d_demo/data/human_pose_estimation_3d_demo.jpg b/demos/python_demos/human_pose_estimation_3d_demo/data/human_pose_estimation_3d_demo.jpg deleted file mode 100644 index b151c7a8284..00000000000 Binary files a/demos/python_demos/human_pose_estimation_3d_demo/data/human_pose_estimation_3d_demo.jpg and /dev/null differ diff --git a/demos/python_demos/human_pose_estimation_3d_demo/modules/input_reader.py b/demos/python_demos/human_pose_estimation_3d_demo/modules/input_reader.py deleted file mode 100644 index c7fbd6fb8f3..00000000000 --- a/demos/python_demos/human_pose_estimation_3d_demo/modules/input_reader.py +++ /dev/null @@ -1,72 +0,0 @@ -""" - Copyright (c) 2019 Intel Corporation - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - -import cv2 - - -class InputReader: - def __init__(self, file_names): - self.is_video = False - self._input_reader = ImageReader(file_names) - # check if video - img = cv2.imread(file_names[0], cv2.IMREAD_COLOR) - if img is None: - self.is_video = True - self._input_reader = VideoReader(file_names[0]) - - def __iter__(self): - return self._input_reader.__iter__() - - def __next__(self): - return self._input_reader.__next__() - - -class ImageReader: - def __init__(self, file_names): - self.file_names = file_names - self.max_idx = len(file_names) - - def __iter__(self): - self.idx = 0 - return self - - def __next__(self): - if self.idx == self.max_idx: - raise StopIteration - img = cv2.imread(self.file_names[self.idx], cv2.IMREAD_COLOR) - if img.size == 0: - raise IOError('Image {} cannot be read'.format(self.file_names[self.idx])) - self.idx = self.idx + 1 - return img - - -class VideoReader: - def __init__(self, file_name): - try: # OpenCV needs int to read from webcam - self.file_name = int(file_name) - except ValueError: - self.file_name = file_name - - def __iter__(self): - self.cap = cv2.VideoCapture(self.file_name) - self.cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1920) - self.cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 1080) - if not self.cap.isOpened(): - raise IOError('Video {} cannot be opened'.format(self.file_name)) - return self - - def __next__(self): - was_read, img = self.cap.read() - if not was_read: - raise StopIteration - return img diff --git a/demos/python_demos/image_retrieval_demo/image_retrieval_demo.jpg b/demos/python_demos/image_retrieval_demo/image_retrieval_demo.jpg deleted file mode 100644 index 43faa57e972..00000000000 Binary files a/demos/python_demos/image_retrieval_demo/image_retrieval_demo.jpg and /dev/null differ diff --git a/demos/python_demos/object_detection_demo_centernet/README.md b/demos/python_demos/object_detection_demo_centernet/README.md deleted file mode 100644 index 07fb8cb499f..00000000000 --- a/demos/python_demos/object_detection_demo_centernet/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# Object Detection CenterNet Demo - -This demo showcases Object Detection with CenterNet. The task is to identify objects as axis-aligned boxes in an image. -CenterNet models an object as a single point - the center point of its bounding box and uses keypoint estimation to find center points and regresses to object size. The same approach is used to estimate 3D bounding box and pose. - -## How It Works - -On the start-up, the application reads command-line parameters and loads a network to the Inference -Engine. Upon getting a frame from the OpenCV VideoCapture, it performs inference and displays the results. - -## Running - -Running the application with the -h option yields the following usage message: - -``` -usage: object_detection_demo_centernet.py [-h] -m MODEL [-i INPUT [INPUT ...]] - [-d DEVICE] [--labels LABELS] - [-pt PROB_THRESHOLD] [--no_show] - [-u UTILIZATION_MONITORS] - -Options: - -h, --help Show this help message and exit. - -m MODEL, --model MODEL - Required. Path to an .xml file with a trained model. - -i INPUT [INPUT ...], --input INPUT [INPUT ...] - path to video or image/images - -d DEVICE, --device DEVICE - Optional. Specify the target device to infer on; CPU, - GPU, FPGA, HDDL or MYRIAD is acceptable. The demo will - look for a suitable plugin for device specified. - Default value is CPU - --labels LABELS Optional. Path to labels mapping file - -pt PROB_THRESHOLD, --prob_threshold PROB_THRESHOLD - Optional. Probability threshold for detections - filtering - --no_show Optional. Don't show output - -u UTILIZATION_MONITORS, --utilization_monitors UTILIZATION_MONITORS - Optional. List of monitors to show initially. -``` - -To run the demo, you can use public or pre-trained models. You can download the pre-trained models with the OpenVINO [Model Downloader](../../../tools/downloader/README.md) or from [https://download.01.org/opencv/](https://download.01.org/opencv/). - -> **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). - -## Demo Output - -The demo uses OpenCV to display the resulting frame with detections (rendered as bounding boxes and labels, if provided) and reports performance in the following format: summary inference FPS. - -## See Also -* [Using Open Model Zoo demos](../../README.md) -* [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) -* [Model Downloader](../../../tools/downloader/README.md) diff --git a/demos/python_demos/object_detection_demo_centernet/models.lst b/demos/python_demos/object_detection_demo_centernet/models.lst deleted file mode 100644 index 4d8bbdb7af6..00000000000 --- a/demos/python_demos/object_detection_demo_centernet/models.lst +++ /dev/null @@ -1,3 +0,0 @@ -# This file can be used with the --list option of the model downloader. -ctdet_coco_dlav0_384 -ctdet_coco_dlav0_512 diff --git a/demos/python_demos/object_detection_demo_centernet/object_detection_demo_centernet.py b/demos/python_demos/object_detection_demo_centernet/object_detection_demo_centernet.py deleted file mode 100755 index 54161afeda0..00000000000 --- a/demos/python_demos/object_detection_demo_centernet/object_detection_demo_centernet.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python3 - -""" - Copyright (c) 2019 Intel Corporation - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" -import os -import sys -import cv2 -import numpy as np -from argparse import ArgumentParser, SUPPRESS - -from openvino.inference_engine import IECore - -from detector import Detector - -sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'common')) -import monitors - - -def build_argparser(): - parser = ArgumentParser(add_help=False) - args = parser.add_argument_group('Options') - args.add_argument('-h', '--help', action='help', default=SUPPRESS, help='Show this help message and exit.') - args.add_argument("-m", "--model", help="Required. Path to an .xml file with a trained model.", - required=True, type=str) - args.add_argument("-i", "--input", type=str, nargs='+', default='', help="path to video or image/images") - args.add_argument("-d", "--device", - help="Optional. Specify the target device to infer on; CPU, GPU, FPGA, HDDL or MYRIAD is " - "acceptable. The demo will look for a suitable plugin for device specified. " - "Default value is CPU", default="CPU", type=str) - args.add_argument("--labels", help="Optional. Path to labels mapping file", default=None, type=str) - args.add_argument("-pt", "--prob_threshold", help="Optional. Probability threshold for detections filtering", - default=0.3, type=float) - args.add_argument("--no_show", help="Optional. Don't show output", action='store_true') - args.add_argument("-u", "--utilization_monitors", default="", type=str, - help="Optional. List of monitors to show initially.") - - return parser - -class ImageReader(object): - def __init__(self, file_names): - self.file_names = file_names - self.max_idx = len(file_names) - - def __iter__(self): - self.idx = 0 - return self - - def __next__(self): - if self.idx == self.max_idx: - raise StopIteration - img = cv2.imread(self.file_names[self.idx], cv2.IMREAD_COLOR) - if img.size == 0: - raise IOError('Image {} cannot be read'.format(self.file_names[self.idx])) - self.idx += 1 - return img - - -class VideoReader(object): - def __init__(self, file_name): - try: - self.file_name = int(file_name[0]) - except: - self.file_name = file_name[0] - - - def __iter__(self): - self.cap = cv2.VideoCapture(self.file_name) - if not self.cap.isOpened(): - raise IOError('Video {} cannot be opened'.format(self.file_name)) - return self - - def __next__(self): - was_read, img = self.cap.read() - if not was_read: - raise StopIteration - return img - -def main(): - args = build_argparser().parse_args() - - ie = IECore() - detector = Detector(ie, args.model, args.prob_threshold, args.device) - - img = cv2.imread(args.input[0], cv2.IMREAD_COLOR) - frames_reader, delay = (VideoReader(args.input), 1) if img is None else (ImageReader(args.input), 0) - - if args.labels: - with open(args.labels, 'r') as f: - labels_map = [x.strip() for x in f] - else: - labels_map = None - - presenter = monitors.Presenter(args.utilization_monitors, 25) - for frame in frames_reader: - detections = detector.detect(frame) - presenter.drawGraphs(frame) - for det in detections: - xmin, ymin, xmax, ymax = det[:4].astype(np.int) - xmin = max(0, xmin) - ymin = max(0, ymin) - xmax = min(frame.shape[1], xmax) - ymax = min(frame.shape[0], ymax) - class_id = det[5] - det_label = labels_map[int(class_id)] if labels_map else str(int(class_id)) - color = (min(class_id * 12.5, 255), min(class_id * 7, 255), min(class_id * 3, 255)) - cv2.rectangle(frame, (xmin, ymin), (xmax, ymax), color, 2) - cv2.putText(frame, det_label + ' ' + str(round(det[4] * 100, 1)) + ' %', (xmin, ymin - 7), - cv2.FONT_HERSHEY_COMPLEX, 0.6, color, 1) - - cv2.putText(frame, 'summary: {:.1f} FPS'.format( - 1.0 / detector.infer_time), (5, 15), cv2.FONT_HERSHEY_COMPLEX, 0.5, (0, 0, 200)) - if args.no_show: - continue - cv2.imshow('CenterNet Detection Demo', frame) - key = cv2.waitKey(delay) - if key == 27: - break - presenter.handleKey(key) - print(presenter.reportMeans()) - -if __name__ == "__main__": - sys.exit(main() or 0) diff --git a/demos/python_demos/object_detection_demo_faceboxes/README.md b/demos/python_demos/object_detection_demo_faceboxes/README.md deleted file mode 100644 index 7cac00166e3..00000000000 --- a/demos/python_demos/object_detection_demo_faceboxes/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# Object Detection FaceBoxes Demo - -This demo showcases Face Detection with FaceBoxes. The task is to identify faces as axis-aligned boxes in an image. - -## How It Works - -On the start-up, the application reads command-line parameters and loads a network to the Inference -Engine. Upon getting a frame from the OpenCV VideoCapture, it performs inference and displays the results. - -## Running - -Running the application with the -h option yields the following usage message: - -``` -usage: object_detection_demo_faceboxes.py [-h] -m MODEL [-i INPUT [INPUT ...]] - [-d DEVICE] [-pt PROB_THRESHOLD] - [--no_show] - [-u UTILIZATION_MONITORS] - -Options: - -h, --help Show this help message and exit. - -m MODEL, --model MODEL - Required. Path to an .xml file with a trained model. - -i INPUT [INPUT ...], --input INPUT [INPUT ...] - path to video or image/images - -d DEVICE, --device DEVICE - Optional. Specify the target device to infer on; CPU, - GPU, FPGA, HDDL or MYRIAD is acceptable. The demo will - look for a suitable plugin for device specified. - Default value is CPU - -pt PROB_THRESHOLD, --prob_threshold PROB_THRESHOLD - Optional. Probability threshold for detections - filtering - --no_show Optional. Don't show output - -u UTILIZATION_MONITORS, --utilization_monitors UTILIZATION_MONITORS - Optional. List of monitors to show initially. -``` - -To run the demo, you can use public or pre-trained models. You can download the pre-trained models with the OpenVINO [Model Downloader](../../../tools/downloader/README.md) or from [https://download.01.org/opencv/](https://download.01.org/opencv/). - -> **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). - -## Demo Output - -The demo uses OpenCV to display the resulting frame with detections (rendered as bounding boxes and labels, if provided) and reports performance in the following format: summary inference FPS. - -## See Also -* [Using Open Model Zoo demos](../../README.md) -* [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) -* [Model Downloader](../../../tools/downloader/README.md) diff --git a/demos/python_demos/object_detection_demo_faceboxes/object_detection_demo_faceboxes.py b/demos/python_demos/object_detection_demo_faceboxes/object_detection_demo_faceboxes.py deleted file mode 100755 index a910489ed20..00000000000 --- a/demos/python_demos/object_detection_demo_faceboxes/object_detection_demo_faceboxes.py +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/env python3 - -""" - Copyright (c) 2020 Intel Corporation - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - -import os -import sys -import cv2 -import numpy as np -from argparse import ArgumentParser, SUPPRESS - -from openvino.inference_engine import IECore - -from detector import Detector - -sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'common')) -import monitors - - -def build_argparser(): - parser = ArgumentParser(add_help=False) - args = parser.add_argument_group('Options') - args.add_argument('-h', '--help', action='help', default=SUPPRESS, help='Show this help message and exit.') - args.add_argument("-m", "--model", help="Required. Path to an .xml file with a trained model.", - required=True, type=str) - args.add_argument("-i", "--input", type=str, nargs='+', default='', help="path to video or image/images") - args.add_argument("-d", "--device", - help="Optional. Specify the target device to infer on; CPU, GPU, FPGA, HDDL or MYRIAD is " - "acceptable. The demo will look for a suitable plugin for device specified. " - "Default value is CPU", default="CPU", type=str) - args.add_argument("-pt", "--prob_threshold", help="Optional. Probability threshold for detections filtering", - default=0.5, type=float) - args.add_argument("--no_show", help="Optional. Don't show output", action='store_true') - args.add_argument("-u", "--utilization_monitors", default="", type=str, - help="Optional. List of monitors to show initially.") - - return parser - -class ImageReader(object): - def __init__(self, file_names): - self.file_names = file_names - self.max_idx = len(file_names) - - def __iter__(self): - self.idx = 0 - return self - - def __next__(self): - if self.idx == self.max_idx: - raise StopIteration - img = cv2.imread(self.file_names[self.idx], cv2.IMREAD_COLOR) - if img.size == 0: - raise IOError('Image {} cannot be read'.format(self.file_names[self.idx])) - self.idx += 1 - return img - - -class VideoReader(object): - def __init__(self, file_name): - try: - self.file_name = int(file_name[0]) - except: - self.file_name = file_name[0] - - - def __iter__(self): - self.cap = cv2.VideoCapture(self.file_name) - if not self.cap.isOpened(): - raise IOError('Video {} cannot be opened'.format(self.file_name)) - return self - - def __next__(self): - was_read, img = self.cap.read() - if not was_read: - raise StopIteration - return img - -def main(): - args = build_argparser().parse_args() - - ie = IECore() - detector = Detector(ie, args.model, args.device, args.prob_threshold) - - img = cv2.imread(args.input[0], cv2.IMREAD_COLOR) - frames_reader, delay = (VideoReader(args.input), 1) if img is None else (ImageReader(args.input), 0) - - presenter = monitors.Presenter(args.utilization_monitors, 25) - for frame in frames_reader: - detections = detector.detect(frame) - presenter.drawGraphs(frame) - for score, x_min, y_min, x_max, y_max in detections: - x_min = int(max(0, x_min)) - y_min = int(max(0, y_min)) - x_max = int(min(frame.shape[1], x_max)) - y_max = int(min(frame.shape[0], y_max)) - color = (12.5, 7.0, 3.0) - cv2.rectangle(frame, (x_min, y_min), (x_max, y_max), color, 2) - cv2.putText(frame, str(round(score * 100, 1)) + ' %', (x_min, y_min - 7), - cv2.FONT_HERSHEY_COMPLEX, 0.6, color, 1) - - cv2.putText(frame, 'summary: {:.1f} FPS'.format( - 1.0 / detector.infer_time), (5, 15), cv2.FONT_HERSHEY_COMPLEX, 0.5, (0, 0, 200)) - if args.no_show: - continue - cv2.imshow('FaceBoxes Detection Demo', frame) - key = cv2.waitKey(delay) - if key == 27: - break - presenter.handleKey(key) - print(presenter.reportMeans()) - -if __name__ == "__main__": - sys.exit(main() or 0) diff --git a/demos/python_demos/object_detection_demo_retinaface/README.md b/demos/python_demos/object_detection_demo_retinaface/README.md deleted file mode 100644 index 89092766e34..00000000000 --- a/demos/python_demos/object_detection_demo_retinaface/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# Object Detection RetinaFace Demo - -This demo showcases Face Detection with RetinaFace. The task is to identify faces as axis-aligned boxes -and their keypoints (facial landmarks) in an image. - -## How It Works - -On the start-up, the application reads command-line parameters and loads a network to the Inference -Engine. Upon getting a frame from the OpenCV VideoCapture, it performs inference and displays the results. - -## Running - -Running the application with the -h option yields the following usage message: - -``` -usage: object_detection_demo_retinaface.py [-h] -m MODEL - [-i INPUT [INPUT ...]] [-d DEVICE] - [-pt_f FACE_PROB_THRESHOLD] - [-pt_m MASK_PROB_THRESHOLD] - [--no_show] - [-u UTILIZATION_MONITORS] - -Options: - -h, --help Show this help message and exit. - -m MODEL, --model MODEL - Required. Path to an .xml file with a trained model. - -i INPUT [INPUT ...], --input INPUT [INPUT ...] - path to video or image/images - -d DEVICE, --device DEVICE - Optional. Specify the target device to infer on; CPU, - GPU, FPGA, HDDL or MYRIAD is acceptable. The demo will - look for a suitable plugin for device specified. - Default value is CPU - -pt_f FACE_PROB_THRESHOLD, --face_prob_threshold FACE_PROB_THRESHOLD - Optional. Probability threshold for face detections - filtering - -pt_m MASK_PROB_THRESHOLD, --mask_prob_threshold MASK_PROB_THRESHOLD - Optional. Probability threshold for mask detections - filtering - --no_show Optional. Don't show output - -u UTILIZATION_MONITORS, --utilization_monitors UTILIZATION_MONITORS - Optional. List of monitors to show initially. -``` - -To run the demo, you can use public or pre-trained models. You can download the pre-trained models with the OpenVINO [Model Downloader](../../../tools/downloader/README.md) or from [https://download.01.org/opencv/](https://download.01.org/opencv/). - -> **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). - -## Demo Output - -The demo uses OpenCV to display the resulting frame with detections and reports performance in the following format: summary inference FPS. - -## See Also -* [Using Open Model Zoo demos](../../README.md) -* [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) -* [Model Downloader](../../../tools/downloader/README.md) diff --git a/demos/python_demos/object_detection_demo_retinaface/detector.py b/demos/python_demos/object_detection_demo_retinaface/detector.py deleted file mode 100644 index deb56ccefad..00000000000 --- a/demos/python_demos/object_detection_demo_retinaface/detector.py +++ /dev/null @@ -1,59 +0,0 @@ -""" - Copyright (c) 2020 Intel Corporation - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - -import cv2 -import os -import numpy as np - -from postprocessor import RetinaFacePostprocessor - -class Detector(object): - def __init__(self, ie, model_path, face_prob_threshold, device='CPU'): - model = ie.read_network(model_path, os.path.splitext(model_path)[0] + '.bin') - - assert len(model.input_info) == 1, "Expected 1 input blob" - assert len(model.outputs) == 12 or len(model.outputs) == 9, "Expected 12 or 9 output blobs" - - self._input_layer_name = next(iter(model.input_info)) - self._output_layer_names = model.outputs - _, channels, self.input_height, self.input_width = model.input_info[self._input_layer_name].input_data.shape - assert channels == 3, "Expected 3-channel input" - - self._detect_masks = len(model.outputs) == 12 - self.face_prob_threshold = face_prob_threshold - - self._ie = ie - self._exec_model = self._ie.load_network(model, device) - - self.infer_time = -1 - - def infer(self, image): - t0 = cv2.getTickCount() - output = self._exec_model.infer(inputs={self._input_layer_name: image}) - self.infer_time = (cv2.getTickCount() - t0) / cv2.getTickFrequency() - return output - - def detect(self, image): - height, width = image.shape[:2] - image = cv2.resize(image, (self.input_width, self.input_height)) - image = np.transpose(image, (2, 0, 1)) - image = np.expand_dims(image, axis=0) - output = self.infer(image) - scale_x = self.input_width/width - scale_y = self.input_height/height - postprocessor = RetinaFacePostprocessor(self._detect_masks) - detections = postprocessor.process_output(output, scale_x, scale_y, self.face_prob_threshold) - return detections, self._detect_masks diff --git a/demos/python_demos/object_detection_demo_retinaface/models.lst b/demos/python_demos/object_detection_demo_retinaface/models.lst deleted file mode 100644 index 089ab893b87..00000000000 --- a/demos/python_demos/object_detection_demo_retinaface/models.lst +++ /dev/null @@ -1,3 +0,0 @@ -# This file can be used with the --list option of the model downloader. -retinaface-anti-cov -retinaface-resnet50 diff --git a/demos/python_demos/object_detection_demo_retinaface/object_detection_demo_retinaface.py b/demos/python_demos/object_detection_demo_retinaface/object_detection_demo_retinaface.py deleted file mode 100755 index ac293261389..00000000000 --- a/demos/python_demos/object_detection_demo_retinaface/object_detection_demo_retinaface.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 - -""" - Copyright (c) 2020 Intel Corporation - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - -import os -import sys -import cv2 -import numpy as np -from argparse import ArgumentParser, SUPPRESS - -from openvino.inference_engine import IECore - -from detector import Detector - -sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'common')) -import monitors - -def build_argparser(): - parser = ArgumentParser(add_help=False) - args = parser.add_argument_group('Options') - args.add_argument('-h', '--help', action='help', default=SUPPRESS, help='Show this help message and exit.') - args.add_argument("-m", "--model", help="Required. Path to an .xml file with a trained model.", - required=True, type=str) - args.add_argument("-i", "--input", type=str, nargs='+', default='', help="path to video or image/images") - args.add_argument("-d", "--device", - help="Optional. Specify the target device to infer on; CPU, GPU, FPGA, HDDL or MYRIAD is " - "acceptable. The demo will look for a suitable plugin for device specified. " - "Default value is CPU", default="CPU", type=str) - args.add_argument("-pt_f", "--face_prob_threshold", help="Optional. Probability threshold for face detections filtering", - default=0.8, type=float) - args.add_argument("-pt_m", "--mask_prob_threshold", help="Optional. Probability threshold for mask detections filtering", - default=0.2, type=float) - args.add_argument("--no_show", help="Optional. Don't show output", action='store_true') - args.add_argument("-u", "--utilization_monitors", default="", type=str, - help="Optional. List of monitors to show initially.") - - return parser - -class ImageReader(object): - def __init__(self, file_names): - self.file_names = file_names - self.max_idx = len(file_names) - - def __iter__(self): - self.idx = 0 - return self - - def __next__(self): - if self.idx == self.max_idx: - raise StopIteration - img = cv2.imread(self.file_names[self.idx], cv2.IMREAD_COLOR) - if img.size == 0: - raise IOError('Image {} cannot be read'.format(self.file_names[self.idx])) - self.idx += 1 - return img - -class VideoReader(object): - def __init__(self, file_name): - try: - self.file_name = int(file_name[0]) - except: - self.file_name = file_name[0] - - def __iter__(self): - self.cap = cv2.VideoCapture(self.file_name) - if not self.cap.isOpened(): - raise IOError('Video {} cannot be opened'.format(self.file_name)) - return self - - def __next__(self): - was_read, img = self.cap.read() - if not was_read: - raise StopIteration - return img - -def main(): - args = build_argparser().parse_args() - - ie = IECore() - detector = Detector(ie, args.model, args.face_prob_threshold, args.device) - - img = cv2.imread(args.input[0], cv2.IMREAD_COLOR) - frames_reader, delay = (VideoReader(args.input), 1) if img is None else (ImageReader(args.input), 0) - presenter = monitors.Presenter(args.utilization_monitors, 25) - for frame in frames_reader: - detection, detect_masks = detector.detect(frame) - presenter.drawGraphs(frame) - for i, (score, xmin, ymin, xmax, ymax) in enumerate(zip(*detection.face_detection)): - xmin = int(max(0, xmin)) - ymin = int(max(0, ymin)) - xmax = int(min(frame.shape[1], xmax)) - ymax = int(min(frame.shape[0], ymax)) - color = (255, 0, 0) - if detect_masks: - if detection.mask_detection[i] >= args.mask_prob_threshold: - color = (0, 255, 0) - else: - color = (0, 0, 255) - cv2.rectangle(frame, (xmin, ymin), (xmax, ymax), color, 2) - cv2.putText(frame, str(round(score * 100, 1)) + ' %', (xmin, ymin - 7), - cv2.FONT_HERSHEY_COMPLEX, 0.6, color, 1) - for j in range(5): - x = detection.landmarks_regression[0][i, j].astype(np.int) - y = detection.landmarks_regression[1][i, j].astype(np.int) - cv2.circle(frame, (x, y), 2, (0, 255, 255), 2) - - cv2.putText(frame, 'summary: {:.1f} FPS'.format( - 1.0 / detector.infer_time), (5, 15), cv2.FONT_HERSHEY_COMPLEX, 0.5, (0, 0, 200)) - if args.no_show: - continue - cv2.imshow('Facial Landmarks Demo', frame) - key = cv2.waitKey(delay) - if key == 27: - break - presenter.handleKey(key) - print(presenter.reportMeans()) - - -if __name__ == '__main__': - main() diff --git a/demos/python_demos/object_detection_demo_ssd_async/models.lst b/demos/python_demos/object_detection_demo_ssd_async/models.lst deleted file mode 100644 index cc758fa966c..00000000000 --- a/demos/python_demos/object_detection_demo_ssd_async/models.lst +++ /dev/null @@ -1,14 +0,0 @@ -# This file can be used with the --list option of the model downloader. -face-detection-???? -face-detection-adas-???? -face-detection-retail-???? -pedestrian-and-vehicle-detector-adas-???? -pedestrian-detection-adas-???? -pelee-coco -person-detection-???? -person-detection-asl-???? -person-detection-retail-0013 -retinanet-tf -vehicle-detection-adas-???? -vehicle-license-plate-detection-barrier-???? -ssd-resnet34-1200-onnx diff --git a/demos/python_demos/object_detection_demo_ssd_async/object_detection_demo_ssd_async.py b/demos/python_demos/object_detection_demo_ssd_async/object_detection_demo_ssd_async.py deleted file mode 100755 index c56ad19321b..00000000000 --- a/demos/python_demos/object_detection_demo_ssd_async/object_detection_demo_ssd_async.py +++ /dev/null @@ -1,582 +0,0 @@ -#!/usr/bin/env python3 -""" - Copyright (C) 2018-2020 Intel Corporation - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - -import colorsys -import logging -import threading -import os.path as osp -import random -import sys -from argparse import ArgumentParser, SUPPRESS -from collections import deque, namedtuple -from itertools import cycle -from enum import Enum -from time import perf_counter - -import cv2 -import numpy as np -from openvino.inference_engine import IECore - -sys.path.append(osp.join(osp.dirname(osp.dirname(osp.abspath(__file__))), 'common')) -import monitors - - -logging.basicConfig(format='[ %(levelname)s ] %(message)s', level=logging.INFO, stream=sys.stdout) -log = logging.getLogger() - -def build_argparser(): - parser = ArgumentParser(add_help=False) - args = parser.add_argument_group('Options') - args.add_argument('-h', '--help', action='help', default=SUPPRESS, help='Show this help message and exit.') - args.add_argument('-m', '--model', help='Required. Path to an .xml file with a trained model.', - required=True, type=str) - args.add_argument('-i', '--input', help='Required. Path to an image, video file or a numeric camera ID.', - required=True, type=str) - args.add_argument('-d', '--device', - help='Optional. Specify the target device to infer on; CPU, GPU, FPGA, HDDL or MYRIAD is ' - 'acceptable. The sample will look for a suitable plugin for device specified. ' - 'Default value is CPU.', default='CPU', type=str) - args.add_argument('--labels', help='Optional. Labels mapping file.', default=None, type=str) - args.add_argument('-t', '--prob_threshold', help='Optional. Probability threshold for detections filtering.', - default=0.5, type=float) - args.add_argument('-r', '--raw_output_message', help='Optional. Output inference results raw values showing.', - default=False, action='store_true') - args.add_argument('-nireq', '--num_infer_requests', help='Optional. Number of infer requests', - default=1, type=int) - args.add_argument('-nstreams', '--num_streams', - help='Optional. Number of streams to use for inference on the CPU or/and GPU in throughput mode ' - '(for HETERO and MULTI device cases use format :,: ' - 'or just )', - default='', type=str) - args.add_argument('-nthreads', '--num_threads', - help='Optional. Number of threads to use for inference on CPU (including HETERO cases)', - default=None, type=int) - args.add_argument('-loop', '--loop', help='Optional. Number of times to repeat the input.', type=int, default=0) - args.add_argument('-no_show', '--no_show', help="Optional. Don't show output", action='store_true') - args.add_argument('-u', '--utilization_monitors', default='', type=str, - help='Optional. List of monitors to show initially.') - args.add_argument('--keep_aspect_ratio', action='store_true', default=False, - help='Optional. Keeps aspect ratio on resize.') - return parser - - -class ColorPalette: - def __init__(self, n, rng=None): - assert n > 0 - - if rng is None: - rng = random.Random(0xACE) - - candidates_num = 100 - hsv_colors = [(1.0, 1.0, 1.0)] - for _ in range(1, n): - colors_candidates = [(rng.random(), rng.uniform(0.8, 1.0), rng.uniform(0.5, 1.0)) - for _ in range(candidates_num)] - min_distances = [self.min_distance(hsv_colors, c) for c in colors_candidates] - arg_max = np.argmax(min_distances) - hsv_colors.append(colors_candidates[arg_max]) - - self.palette = [self.hsv2rgb(*hsv) for hsv in hsv_colors] - - @staticmethod - def dist(c1, c2): - dh = min(abs(c1[0] - c2[0]), 1 - abs(c1[0] - c2[0])) * 2 - ds = abs(c1[1] - c2[1]) - dv = abs(c1[2] - c2[2]) - return dh * dh + ds * ds + dv * dv - - @staticmethod - def min_distance(colors_set, color_candidate): - distances = [__class__.dist(o, color_candidate) for o in colors_set] - return np.min(distances) - - @staticmethod - def hsv2rgb(h, s, v): - return tuple(round(c * 255) for c in colorsys.hsv_to_rgb(h, s, v)) - - def __getitem__(self, n): - return self.palette[n % len(self.palette)] - - def __len__(self): - return len(self.palette) - - -class Model: - def __init__(self, ie, xml_file_path, bin_file_path=None, - device='CPU', plugin_config={}, max_num_requests=1, - results=None, caught_exceptions=None): - self.ie = ie - log.info('Reading network from IR...') - if bin_file_path is None: - bin_file_path = osp.splitext(xml_file_path)[0] + '.bin' - self.net = ie.read_network(model=xml_file_path, weights=bin_file_path) - - log.info('Loading network to plugin...') - self.max_num_requests = max_num_requests - self.exec_net = ie.load_network(network=self.net, device_name=device, config=plugin_config, num_requests=max_num_requests) - - self.requests = self.exec_net.requests - self.empty_requests = deque(self.requests) - self.completed_request_results = results if results is not None else [] - self.callback_exceptions = caught_exceptions if caught_exceptions is not None else {} - self.event = threading.Event() - - def unify_inputs(self, inputs): - if not isinstance(inputs, dict): - inputs_dict = {next(iter(self.net.input_info)): inputs} - else: - inputs_dict = inputs - return inputs_dict - - def preprocess(self, inputs): - meta = {} - return inputs, meta - - def postprocess(self, outputs, meta): - return outputs - - def inference_completion_callback(self, status, callback_args): - request, frame_id, frame_meta = callback_args - try: - if status != 0: - raise RuntimeError('Infer Request has returned status code {}'.format(status)) - raw_outputs = {key: blob.buffer for key, blob in request.output_blobs.items()} - self.completed_request_results[frame_id] = (frame_meta, raw_outputs) - self.empty_requests.append(request) - except Exception as e: - self.callback_exceptions.append(e) - self.event.set() - - def __call__(self, inputs, id, meta): - request = self.empty_requests.popleft() - inputs = self.unify_inputs(inputs) - inputs, preprocessing_meta = self.preprocess(inputs) - meta.update(preprocessing_meta) - request.set_completion_callback(py_callback=self.inference_completion_callback, - py_data=(request, id, meta)) - self.event.clear() - request.async_infer(inputs=inputs) - - def await_all(self): - for request in self.exec_net.requests: - request.wait() - - def await_any(self): - self.event.wait() - - -class Detector(Model): - - class Detection: - def __init__(self, xmin, ymin, xmax, ymax, score, class_id): - self.xmin = xmin - self.xmax = xmax - self.ymin = ymin - self.ymax = ymax - self.score = score - self.class_id = class_id - - def __init__(self, *args, labels_map=None, keep_aspect_ratio_resize=False, **kwargs): - super().__init__(*args, **kwargs) - self.keep_aspect_ratio_resize = keep_aspect_ratio_resize - self.labels_map = labels_map - - self.image_blob_name, self.image_info_blob_name = self._get_inputs(self.net) - self.n, self.c, self.h, self.w = self.net.input_info[self.image_blob_name].input_data.shape - assert self.n == 1, 'Only batch size == 1 is supported.' - - self.output_parser = self._get_output_parser(self.net, self.image_blob_name) - - def _get_inputs(self, net): - image_blob_name = None - image_info_blob_name = None - for blob_name, blob in net.input_info.items(): - if len(blob.input_data.shape) == 4: - image_blob_name = blob_name - elif len(blob.input_data.shape) == 2: - image_info_blob_name = blob_name - else: - raise RuntimeError('Unsupported {}D input layer "{}". Only 2D and 4D input layers are supported' - .format(len(blob.shape), blob_name)) - if image_blob_name is None: - raise RuntimeError('Failed to identify the input for the image.') - return image_blob_name, image_info_blob_name - - def _get_output_parser(self, net, image_blob_name, bboxes='bboxes', labels='labels', scores='scores'): - try: - parser = SingleOutputParser(net.outputs) - log.info('Use SingleOutputParser') - return parser - except ValueError: - pass - - try: - parser = MultipleOutputParser(net.outputs, bboxes, scores, labels) - log.info('Use MultipleOutputParser') - return parser - except ValueError: - pass - - try: - h, w = net.input_info[image_blob_name].input_data.shape[2:] - parser = BoxesLabelsParser([w, h], net.outputs) - log.info('Use BoxesLabelsParser') - return parser - except ValueError: - pass - raise RuntimeError('Unsupported model outputs') - - @staticmethod - def _resize_image(frame, size, keep_aspect_ratio=False): - if not keep_aspect_ratio: - resized_frame = cv2.resize(frame, size) - else: - h, w = frame.shape[:2] - scale = min(size[1] / h, size[0] / w) - resized_frame = cv2.resize(frame, None, fx=scale, fy=scale) - return resized_frame - - def preprocess(self, inputs): - img = self._resize_image(inputs[self.image_blob_name], (self.w, self.h), self.keep_aspect_ratio_resize) - h, w = img.shape[:2] - if self.image_info_blob_name is not None: - inputs[self.image_info_blob_name] = [h, w, 1] - meta = {'original_shape': inputs[self.image_blob_name].shape, - 'resized_shape': img.shape} - if h != self.h or w != self.w: - img = np.pad(img, ((0, self.h - h), (0, self.w - w), (0, 0)), - mode='constant', constant_values=0) - img = img.transpose((2, 0, 1)) # Change data layout from HWC to CHW - img = img.reshape((self.n, self.c, self.h, self.w)) - inputs[self.image_blob_name] = img - return inputs, meta - - def postprocess(self, outputs, meta): - detections = self.output_parser(outputs) - original_image_shape = meta['original_shape'] - resized_image_shape = meta['resized_shape'] - scale_x = self.w / resized_image_shape[1] * original_image_shape[1] - scale_y = self.h / resized_image_shape[0] * original_image_shape[0] - for detection in detections: - detection.xmin *= scale_x - detection.xmax *= scale_x - detection.ymin *= scale_y - detection.ymax *= scale_y - return detections - - -class SingleOutputParser: - def __init__(self, all_outputs): - if len(all_outputs) != 1: - raise ValueError('Network must have only one output.') - self.output_name, output_data = next(iter(all_outputs.items())) - last_dim = np.shape(output_data)[-1] - if last_dim != 7: - raise ValueError('The last dimension of the output blob must be equal to 7, ' - 'got {} instead.'.format(last_dim)) - - def __call__(self, outputs): - return [Detector.Detection(xmin, ymin, xmax, ymax, score, label) - for _, label, score, xmin, ymin, xmax, ymax in outputs[self.output_name][0][0]] - - -def find_layer_by_name(name, all_outputs): - suitable_layers = [layer_name for layer_name in all_outputs if name in layer_name] - if not suitable_layers: - raise ValueError('Suitable layer for "{}" output is not found'.format(name)) - - if len(suitable_layers) > 1: - raise ValueError('More than 1 layer matched to "{}" output'.format(name)) - - return suitable_layers[0] - - -class MultipleOutputParser: - def __init__(self, all_outputs, bboxes_layer='bboxes', scores_layer='scores', labels_layer='labels'): - self.labels_layer = find_layer_by_name(labels_layer, all_outputs) - self.scores_layer = find_layer_by_name(scores_layer, all_outputs) - self.bboxes_layer = find_layer_by_name(bboxes_layer, all_outputs) - - def __call__(self, outputs): - bboxes = outputs[self.bboxes_layer][0] - scores = outputs[self.scores_layer][0] - labels = outputs[self.labels_layer][0] - return [Detector.Detection(*bbox, score, label) for label, score, bbox in zip(labels, scores, bboxes)] - - -class BoxesLabelsParser: - def __init__(self, input_size, all_outputs, labels_layer='labels', default_label=1): - try: - self.labels_layer = find_layer_by_name(labels_layer, all_outputs) - log.info('Use output "{}" as the one containing labels of detected objects.' - .format(self.labels_layer)) - except ValueError: - log.warning('Suitable layer for "{}" output is not found. ' - 'Treating detector as class agnostic with output label {}' - .format(labels_layer, default_label)) - self.labels_layer = None - self.default_label = default_label - - self.input_size = input_size - self.bboxes_layer = self.find_layer_bboxes_output(all_outputs) - log.info('Use auto-detected output "{}" as the one containing detected bounding boxes.' - .format(self.bboxes_layer)) - - @staticmethod - def find_layer_bboxes_output(all_outputs): - filter_outputs = [ - output_name for output_name, out_data in all_outputs.items() - if len(np.shape(out_data)) == 2 and np.shape(out_data)[-1] == 5 - ] - if not filter_outputs: - raise ValueError('Suitable output with bounding boxes is not found') - if len(filter_outputs) > 1: - raise ValueError('More than 1 candidate for output with bounding boxes.') - return filter_outputs[0] - - def __call__(self, outputs): - bboxes = outputs[self.bboxes_layer] - scores = bboxes[:, 4] - bboxes = bboxes[:, :4] - bboxes[:, 0::2] /= self.input_size[0] - bboxes[:, 1::2] /= self.input_size[1] - if self.labels_layer: - labels = outputs[self.labels_layer] + 1 - else: - labels = np.full(len(bboxes), self.default_label, dtype=bboxes.dtype) - - detections = [Detector.Detection(*bbox, score, label) for label, score, bbox in zip(labels, scores, bboxes)] - return detections - - -class Modes(Enum): - USER_SPECIFIED = 0 - MIN_LATENCY = 1 - - -class ModeInfo: - def __init__(self): - self.last_start_time = perf_counter() - self.last_end_time = None - self.frames_count = 0 - self.latency_sum = 0 - - -def put_highlighted_text(frame, message, position, font_face, font_scale, color, thickness): - cv2.putText(frame, message, position, font_face, font_scale, (255, 255, 255), thickness + 1) # white border - cv2.putText(frame, message, position, font_face, font_scale, color, thickness) - - -def get_plugin_configs(device, num_streams, num_threads): - config_user_specified = {} - config_min_latency = {} - - devices_nstreams = {} - if num_streams: - devices_nstreams = {device: num_streams for device in ['CPU', 'GPU'] if device in device} \ - if num_streams.isdigit() \ - else dict(device.split(':', 1) for device in num_streams.split(',')) - - if 'CPU' in device: - if num_threads is not None: - config_user_specified['CPU_THREADS_NUM'] = str(num_threads) - if 'CPU' in devices_nstreams: - config_user_specified['CPU_THROUGHPUT_STREAMS'] = devices_nstreams['CPU'] \ - if int(devices_nstreams['CPU']) > 0 \ - else 'CPU_THROUGHPUT_AUTO' - - config_min_latency['CPU_THROUGHPUT_STREAMS'] = '1' - - if 'GPU' in device: - if 'GPU' in devices_nstreams: - config_user_specified['GPU_THROUGHPUT_STREAMS'] = devices_nstreams['GPU'] \ - if int(devices_nstreams['GPU']) > 0 \ - else 'GPU_THROUGHPUT_AUTO' - - config_min_latency['GPU_THROUGHPUT_STREAMS'] = '1' - - return config_user_specified, config_min_latency - - -def main(): - args = build_argparser().parse_args() - - log.info('Initializing Inference Engine...') - ie = IECore() - - config_user_specified, config_min_latency = get_plugin_configs(args.device, args.num_streams, args.num_threads) - - labels_map = None - if args.labels: - with open(args.labels, 'r') as f: - labels_map = [x.strip() for x in f] - - log.info('Loading network...') - completed_request_results = {} - modes = cycle(Modes) - prev_mode = mode = next(modes) - log.info('Using {} mode'.format(mode.name)) - mode_info = {mode: ModeInfo()} - exceptions = [] - - detectors = { - Modes.USER_SPECIFIED: - Detector(ie, args.model, device=args.device, plugin_config=config_user_specified, - results=completed_request_results, max_num_requests=args.num_infer_requests, - labels_map=labels_map, keep_aspect_ratio_resize=args.keep_aspect_ratio, - caught_exceptions=exceptions), - Modes.MIN_LATENCY: - Detector(ie, args.model, device=args.device.split(':')[-1].split(',')[0], plugin_config=config_min_latency, - results=completed_request_results, max_num_requests=1, - labels_map=labels_map, keep_aspect_ratio_resize=args.keep_aspect_ratio, - caught_exceptions=exceptions) - } - - try: - input_stream = int(args.input) - except ValueError: - input_stream = args.input - cap = cv2.VideoCapture(input_stream) - wait_key_time = 1 - - next_frame_id = 0 - next_frame_id_to_show = 0 - input_repeats = 0 - - log.info('Starting inference...') - print("To close the application, press 'CTRL+C' here or switch to the output window and press ESC key") - print("To switch between min_latency/user_specified modes, press TAB key in the output window") - - palette = ColorPalette(len(labels_map) if labels_map is not None else 100) - presenter = monitors.Presenter(args.utilization_monitors, 55, - (round(cap.get(cv2.CAP_PROP_FRAME_WIDTH) / 4), round(cap.get(cv2.CAP_PROP_FRAME_HEIGHT) / 8))) - - while (cap.isOpened() \ - or completed_request_results \ - or len(detectors[mode].empty_requests) < len(detectors[mode].requests)) \ - and not exceptions: - if next_frame_id_to_show in completed_request_results: - frame_meta, raw_outputs = completed_request_results.pop(next_frame_id_to_show) - objects = detectors[mode].postprocess(raw_outputs, frame_meta) - - frame = frame_meta['frame'] - start_time = frame_meta['start_time'] - - if len(objects) and args.raw_output_message: - log.info(' Class ID | Confidence | XMIN | YMIN | XMAX | YMAX ') - - origin_im_size = frame.shape[:-1] - presenter.drawGraphs(frame) - for obj in objects: - if obj.score > args.prob_threshold: - xmin = max(int(obj.xmin), 0) - ymin = max(int(obj.ymin), 0) - xmax = min(int(obj.xmax), origin_im_size[1]) - ymax = min(int(obj.ymax), origin_im_size[0]) - class_id = int(obj.class_id) - color = palette[class_id] - det_label = labels_map[class_id] if labels_map and len(labels_map) >= class_id else str(class_id) - - if args.raw_output_message: - log.info( - '{:^9} | {:10f} | {:4} | {:4} | {:4} | {:4} '.format(det_label, obj.score, - xmin, ymin, xmax, ymax)) - - cv2.rectangle(frame, (xmin, ymin), (xmax, ymax), color, 2) - cv2.putText(frame, '#{} {:.1%}'.format(det_label, obj.score), - (xmin, ymin - 7), cv2.FONT_HERSHEY_COMPLEX, 0.6, color, 1) - - mode_message = '{} mode'.format(mode.name) - put_highlighted_text(frame, mode_message, (10, int(origin_im_size[0] - 20)), - cv2.FONT_HERSHEY_COMPLEX, 0.75, (10, 10, 200), 2) - - next_frame_id_to_show += 1 - if prev_mode == mode: - mode_info[mode].frames_count += 1 - elif len(completed_request_results) == 0: - mode_info[prev_mode].last_end_time = perf_counter() - prev_mode = mode - - # Frames count is always zero if mode has just been switched (i.e. prev_mode != mode). - if mode_info[mode].frames_count != 0: - fps_message = 'FPS: {:.1f}'.format(mode_info[mode].frames_count / \ - (perf_counter() - mode_info[mode].last_start_time)) - mode_info[mode].latency_sum += perf_counter() - start_time - latency_message = 'Latency: {:.1f} ms'.format((mode_info[mode].latency_sum / \ - mode_info[mode].frames_count) * 1e3) - # Draw performance stats over frame. - put_highlighted_text(frame, fps_message, (15, 20), cv2.FONT_HERSHEY_COMPLEX, 0.75, (200, 10, 10), 2) - put_highlighted_text(frame, latency_message, (15, 50), cv2.FONT_HERSHEY_COMPLEX, 0.75, (200, 10, 10), 2) - - if not args.no_show: - cv2.imshow('Detection Results', frame) - key = cv2.waitKey(wait_key_time) - - ESC_KEY = 27 - TAB_KEY = 9 - # Quit. - if key in {ord('q'), ord('Q'), ESC_KEY}: - break - # Switch mode. - # Disable mode switch if the previous switch has not been finished yet. - if key == TAB_KEY and mode_info[mode].frames_count > 0: - mode = next(modes) - detectors[prev_mode].await_all() - mode_info[prev_mode].last_end_time = perf_counter() - mode_info[mode] = ModeInfo() - log.info('Using {} mode'.format(mode.name)) - else: - presenter.handleKey(key) - - elif detectors[mode].empty_requests and cap.isOpened(): - start_time = perf_counter() - ret, frame = cap.read() - if not ret: - if input_repeats < args.loop or args.loop < 0: - cap.open(input_stream) - input_repeats += 1 - else: - cap.release() - continue - - detectors[mode](frame, next_frame_id, {'frame': frame, 'start_time': start_time}) - next_frame_id += 1 - - else: - detectors[mode].await_any() - - if exceptions: - raise exceptions[0] - - for exec_net in detectors.values(): - exec_net.await_all() - - for mode_value, mode_stats in mode_info.items(): - log.info('') - log.info('Mode: {}'.format(mode_value.name)) - - end_time = mode_stats.last_end_time if mode_stats.last_end_time is not None \ - else perf_counter() - log.info('FPS: {:.1f}'.format(mode_stats.frames_count / \ - (end_time - mode_stats.last_start_time))) - log.info('Latency: {:.1f} ms'.format((mode_stats.latency_sum / \ - mode_stats.frames_count) * 1e3)) - print(presenter.reportMeans()) - - -if __name__ == '__main__': - sys.exit(main() or 0) diff --git a/demos/python_demos/object_detection_demo_yolov3_async/README.md b/demos/python_demos/object_detection_demo_yolov3_async/README.md deleted file mode 100644 index 90cd8c06061..00000000000 --- a/demos/python_demos/object_detection_demo_yolov3_async/README.md +++ /dev/null @@ -1,116 +0,0 @@ -# Object Detection YOLO\* V3 Python\* Demo, Async API Performance Showcase - -This demo showcases Object Detection with Async API and one of YOLO\* V2, Tiny YOLO\* V2, or YOLO\* V3 model. - -To learn more about Async API features, please refer to [Object Detection for SSD Demo, Async API Performance Showcase](../../object_detection_demo_ssd_async/README.md). - -Other demo objectives are: -* Video as input support via OpenCV\* -* Visualization of the resulting bounding boxes and text labels (from the `.labels` file) or class number (if no file is provided) -* OpenCV provides resulting bounding boxes, labels, and other information. -You can copy and paste this code without pulling Open Model Zoo demos helpers into your application -* Demonstration of the Async API in action. For this, the demo features two modes toggled by the **Tab** key: - - Old-style "Sync" way, where the frame captured with OpenCV executes back-to-back with the Detection - - Truly "Async" way, where the detection is performed on a current frame, while OpenCV captures the next frame - -## How It Works - -On the start-up, the application reads command-line parameters and loads a network to the Inference -Engine. Upon getting a frame from the OpenCV VideoCapture, it performs inference and displays the results. - -> **NOTE**: By default, Open Model Zoo demos expect input with BGR channels order. If you trained your model to work with RGB order, you need to manually rearrange the default channels order in the demo application or reconvert your model using the Model Optimizer tool with `--reverse_input_channels` argument specified. For more information about the argument, refer to **When to Reverse Input Channels** section of [Converting a Model Using General Conversion Parameters](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_convert_model_Converting_Model_General.html). - -## Running - -Running the application with the -h option yields the following usage message: -``` -python3 object_detection_demo_yolov3_async.py -h -``` -The command yields the following usage message: -``` -usage: object_detection_demo_yolov3_async.py [-h] -m MODEL -i INPUT - [-l CPU_EXTENSION] [-d DEVICE] - [--labels LABELS] - [-t PROB_THRESHOLD] - [-iout IOU_THRESHOLD] [-r] - [-nireq NUM_INFER_REQUESTS] - [-nstreams NUM_STREAMS] - [-nthreads NUMBER_THREADS] - [-loop] [-no_show] - [-u UTILIZATION_MONITORS] - -Options: - -h, --help Show this help message and exit. - -m MODEL, --model MODEL - Required. Path to an .xml file with a trained model. - -i INPUT, --input INPUT - Required. Path to an image/video file. (Specify 'cam' - to work with camera) - -l CPU_EXTENSION, --cpu_extension CPU_EXTENSION - Optional. Required for CPU custom layers. Absolute - path to a shared library with the kernels - implementations. - -d DEVICE, --device DEVICE - Optional. Specify the target device to infer on; CPU, - GPU, FPGA, HDDL or MYRIAD is acceptable. The sample - will look for a suitable plugin for device specified. - Default value is CPU - --labels LABELS Optional. Labels mapping file - -t PROB_THRESHOLD, --prob_threshold PROB_THRESHOLD - Optional. Probability threshold for detections - filtering - -iout IOU_THRESHOLD, --iou_threshold IOU_THRESHOLD - Optional. Intersection over union threshold for - overlapping detections filtering - -r, --raw_output_message - Optional. Output inference results raw values showing - -nireq NUM_INFER_REQUESTS, --num_infer_requests NUM_INFER_REQUESTS - Optional. Number of infer requests - -nstreams NUM_STREAMS, --num_streams NUM_STREAMS - Optional. Number of streams to use for inference on - the CPU or/and GPU in throughput mode (for HETERO and - MULTI device cases use format - :,: or just - ) - -nthreads NUMBER_THREADS, --number_threads NUMBER_THREADS - Optional. Number of threads to use for inference on - CPU (including HETERO cases) - -loop, --loop - Optional. Enable reading the input in a loop - -no_show, --no_show Optional. Don't show output - -u UTILIZATION_MONITORS, --utilization_monitors UTILIZATION_MONITORS - Optional. List of monitors to show initially. - --keep_aspect_ratio Optional. Keeps aspect ratio on resize. -``` - -The number of InferRequests is specified by -nireq flag. An increase of this number usually leads to an increase of performance, since in this case several InferRequests can be processed simultaneously if the device supports parallelization. However, a large number of InferRequests increases the latency because each frame still has to wait before being sent for inference. - -For higher FPS, it is recommended that you set -nireq to slightly exceed the -nstreams value, summed across all devices used. - -> **NOTE**: This demo is based on the callback functionality from the Inference Engine Python API. The selected approach makes the execution in multi-device mode optimal by preventing wait delays caused by the differences in device performance. However, the internal organization of the callback mechanism in Python API leads to FPS decrease. Please, keep it in mind and use the C++ version of this demo for performance-critical cases. - -Running the application with the empty list of options yields the usage message given above and an error message. -You can use the following command to do inference on GPU with a pre-trained object detection model: -``` - python3 object_detection_demo_yolov3_async.py -i /inputVideo.mp4 -m /yolo_v3.xml -d GPU -``` - -To run the demo, you can use public or pre-trained models. You can download the pre-trained models with the OpenVINO [Model Downloader](../../../tools/downloader/README.md) or from [https://download.01.org/opencv/](https://download.01.org/opencv/). - -> **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). - -The only GUI knob is to use **Tab** to switch between the synchronized execution and the true Async mode. - -## Demo Output - -The demo uses OpenCV to display the resulting frame with detections (rendered as bounding boxes and labels, if provided). -In the default mode, the demo reports: -* **OpenCV time**: frame decoding + time to render the bounding boxes, labels, and to display the results. -* **Detection time**: inference time for the object detection network. It is reported in the Sync mode only. -* **Wallclock time**, which is combined application-level performance. - -## See Also -* [Using Open Model Zoo demos](../../README.md) -* [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) -* [Model Downloader](../../../tools/downloader/README.md) -* [YOLOv3 COCO labels](https://github.com/opencv/opencv/blob/master/samples/data/dnn/object_detection_classes_yolov3.txt), [VOC labels](https://github.com/opencv/opencv/blob/master/samples/data/dnn/object_detection_classes_pascal_voc.txt) diff --git a/demos/python_demos/object_detection_demo_yolov3_async/models.lst b/demos/python_demos/object_detection_demo_yolov3_async/models.lst deleted file mode 100644 index 33b52c06128..00000000000 --- a/demos/python_demos/object_detection_demo_yolov3_async/models.lst +++ /dev/null @@ -1,8 +0,0 @@ -# This file can be used with the --list option of the model downloader. -yolo-v1-tiny-tf -yolo-v2-tiny-tf -yolo-v2-tf -yolo-v3-tf -yolo-v3-tiny-tf -mobilefacedet-v1-mxnet -yolo-v2-tiny-vehicle-detection-0001 diff --git a/demos/python_demos/object_detection_demo_yolov3_async/object_detection_demo_yolov3_async.py b/demos/python_demos/object_detection_demo_yolov3_async/object_detection_demo_yolov3_async.py deleted file mode 100755 index 4766603bcdd..00000000000 --- a/demos/python_demos/object_detection_demo_yolov3_async/object_detection_demo_yolov3_async.py +++ /dev/null @@ -1,509 +0,0 @@ -#!/usr/bin/env python3 -""" - Copyright (C) 2018-2020 Intel Corporation - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - -import logging -import threading -import os -import sys -from collections import deque -from argparse import ArgumentParser, SUPPRESS -from math import exp as exp -from time import perf_counter -from enum import Enum - -import cv2 -import numpy as np -from openvino.inference_engine import IECore -import ngraph as ng - -sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'common')) -import helpers -import monitors -from performance_metrics import PerformanceMetrics - - -logging.basicConfig(format="[ %(levelname)s ] %(message)s", level=logging.INFO, stream=sys.stdout) -log = logging.getLogger() - -def build_argparser(): - parser = ArgumentParser(add_help=False) - args = parser.add_argument_group('Options') - args.add_argument('-h', '--help', action='help', default=SUPPRESS, help='Show this help message and exit.') - args.add_argument("-m", "--model", help="Required. Path to an .xml file with a trained model.", - required=True, type=str) - args.add_argument("-i", "--input", help="Required. Path to an image/video file. (Specify 'cam' to work with " - "camera)", required=True, type=str) - args.add_argument("-l", "--cpu_extension", - help="Optional. Required for CPU custom layers. Absolute path to a shared library with " - "the kernels implementations.", type=str, default=None) - args.add_argument("-d", "--device", - help="Optional. Specify the target device to infer on; CPU, GPU, FPGA, HDDL or MYRIAD is" - " acceptable. The sample will look for a suitable plugin for device specified. " - "Default value is CPU", default="CPU", type=str) - args.add_argument("--labels", help="Optional. Labels mapping file", default=None, type=str) - args.add_argument("-t", "--prob_threshold", help="Optional. Probability threshold for detections filtering", - default=0.5, type=float) - args.add_argument("-iout", "--iou_threshold", help="Optional. Intersection over union threshold for overlapping " - "detections filtering", default=0.4, type=float) - args.add_argument("-r", "--raw_output_message", help="Optional. Output inference results raw values showing", - default=False, action="store_true") - args.add_argument("-nireq", "--num_infer_requests", help="Optional. Number of infer requests", - default=1, type=int) - args.add_argument("-nstreams", "--num_streams", - help="Optional. Number of streams to use for inference on the CPU or/and GPU in throughput mode " - "(for HETERO and MULTI device cases use format :,: " - "or just )", - default="", type=str) - args.add_argument("-nthreads", "--number_threads", - help="Optional. Number of threads to use for inference on CPU (including HETERO cases)", - default=None, type=int) - args.add_argument("-loop", "--loop", help="Optional. Enable reading the input in a loop", - action='store_true') - args.add_argument("-no_show", "--no_show", help="Optional. Don't show output", action='store_true') - args.add_argument('-u', '--utilization_monitors', default='', type=str, - help='Optional. List of monitors to show initially.') - args.add_argument("--keep_aspect_ratio", action="store_true", default=False, - help='Optional. Keeps aspect ratio on resize.') - return parser - - -class YoloParams: - # ------------------------------------------- Extracting layer parameters ------------------------------------------ - # Magic numbers are copied from yolo samples - def __init__(self, param, side): - self.num = int(param.get('num', 3)) - self.coords = int(param.get('coords', 4)) - self.classes = int(param.get('classes', 80)) - self.side = side - self.anchors = param.get( - 'anchors', - [10.0, 13.0, 16.0, 30.0, 33.0, 23.0, 30.0, 61.0, 62.0, 45.0, 59.0, 119.0, 116.0, 90.0, 156.0, - 198.0, 373.0, 326.0] - ) - - self.is_yolo_v3 = False - - if 'mask' in param: - mask = [int(idx) for idx in param['mask']] - self.num = len(mask) - - masked_anchors = [] - for idx in mask: - masked_anchors += [self.anchors[idx * 2], self.anchors[idx * 2 + 1]] - self.anchors = masked_anchors - - self.is_yolo_v3 = True # Weak way to determine but the only one. - - -class Modes(Enum): - USER_SPECIFIED = 0 - MIN_LATENCY = 1 - - -class Mode(): - def __init__(self, value): - self.current = value - - def get_other(self): - return Modes.MIN_LATENCY if self.current == Modes.USER_SPECIFIED \ - else Modes.USER_SPECIFIED - - def switch(self): - self.current = self.get_other() - - -def scale_bbox(x, y, height, width, class_id, confidence, im_h, im_w, is_proportional): - if is_proportional: - scale = np.array([min(im_w/im_h, 1), min(im_h/im_w, 1)]) - offset = 0.5*(np.ones(2) - scale) - x, y = (np.array([x, y]) - offset) / scale - width, height = np.array([width, height]) / scale - xmin = int((x - width / 2) * im_w) - ymin = int((y - height / 2) * im_h) - xmax = int(xmin + width * im_w) - ymax = int(ymin + height * im_h) - # Method item() used here to convert NumPy types to native types for compatibility with functions, which don't - # support Numpy types (e.g., cv2.rectangle doesn't support int64 in color parameter) - return dict(xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, class_id=class_id.item(), confidence=confidence.item()) - - -def parse_yolo_region(predictions, resized_image_shape, original_im_shape, params, threshold, is_proportional): - # ------------------------------------------ Validating output parameters ------------------------------------------ - _, _, out_blob_h, out_blob_w = predictions.shape - assert out_blob_w == out_blob_h, "Invalid size of output blob. It should be in NCHW layout and height should " \ - "be equal to width. Current height = {}, current width = {}" \ - "".format(out_blob_h, out_blob_w) - - # ------------------------------------------ Extracting layer parameters ------------------------------------------- - orig_im_h, orig_im_w = original_im_shape - resized_image_h, resized_image_w = resized_image_shape - objects = list() - size_normalizer = (resized_image_w, resized_image_h) if params.is_yolo_v3 else (params.side, params.side) - bbox_size = params.coords + 1 + params.classes - # ------------------------------------------- Parsing YOLO Region output ------------------------------------------- - for row, col, n in np.ndindex(params.side, params.side, params.num): - # Getting raw values for each detection bounding box - bbox = predictions[0, n*bbox_size:(n+1)*bbox_size, row, col] - x, y, width, height, object_probability = bbox[:5] - class_probabilities = bbox[5:] - if object_probability < threshold: - continue - # Process raw value - x = (col + x) / params.side - y = (row + y) / params.side - # Value for exp is very big number in some cases so following construction is using here - try: - width = exp(width) - height = exp(height) - except OverflowError: - continue - # Depends on topology we need to normalize sizes by feature maps (up to YOLOv3) or by input shape (YOLOv3) - width = width * params.anchors[2 * n] / size_normalizer[0] - height = height * params.anchors[2 * n + 1] / size_normalizer[1] - - class_id = np.argmax(class_probabilities) - confidence = class_probabilities[class_id]*object_probability - if confidence < threshold: - continue - objects.append(scale_bbox(x=x, y=y, height=height, width=width, class_id=class_id, confidence=confidence, - im_h=orig_im_h, im_w=orig_im_w, is_proportional=is_proportional)) - return objects - - -def intersection_over_union(box_1, box_2): - width_of_overlap_area = min(box_1['xmax'], box_2['xmax']) - max(box_1['xmin'], box_2['xmin']) - height_of_overlap_area = min(box_1['ymax'], box_2['ymax']) - max(box_1['ymin'], box_2['ymin']) - if width_of_overlap_area < 0 or height_of_overlap_area < 0: - area_of_overlap = 0 - else: - area_of_overlap = width_of_overlap_area * height_of_overlap_area - box_1_area = (box_1['ymax'] - box_1['ymin']) * (box_1['xmax'] - box_1['xmin']) - box_2_area = (box_2['ymax'] - box_2['ymin']) * (box_2['xmax'] - box_2['xmin']) - area_of_union = box_1_area + box_2_area - area_of_overlap - if area_of_union == 0: - return 0 - return area_of_overlap / area_of_union - - -def resize(image, size, keep_aspect_ratio, interpolation=cv2.INTER_LINEAR): - if not keep_aspect_ratio: - return cv2.resize(image, size, interpolation=interpolation) - - iw, ih = image.shape[0:2][::-1] - w, h = size - scale = min(w/iw, h/ih) - nw = int(iw*scale) - nh = int(ih*scale) - image = cv2.resize(image, (nw, nh), interpolation=interpolation) - new_image = np.full((size[1], size[0], 3), 128, dtype=np.uint8) - dx = (w-nw)//2 - dy = (h-nh)//2 - new_image[dy:dy+nh, dx:dx+nw, :] = image - return new_image - - -def preprocess_frame(frame, input_height, input_width, nchw_shape, keep_aspect_ratio): - in_frame = resize(frame, (input_width, input_height), keep_aspect_ratio) - if nchw_shape: - in_frame = in_frame.transpose((2, 0, 1)) # Change data layout from HWC to CHW - in_frame = np.expand_dims(in_frame, axis=0) - return in_frame - - -def get_output_info(net): - def get_parent(node): - return node.inputs()[0].get_source_output().get_node() - ng_func = ng.function_from_cnn(net) - output_info = {} - for node in ng_func.get_ordered_ops(): - layer_name = node.get_friendly_name() - if layer_name not in net.outputs: - continue - shape = list(get_parent(node).shape) - yolo_params = YoloParams(node._get_attributes(), shape[2]) - output_info[layer_name] = (shape, yolo_params) - - return output_info - -def get_objects(output, output_info, new_frame_height_width, source_height_width, prob_threshold, is_proportional): - objects = list() - - for layer_name, out_blob in output.items(): - output_shape, layer_params = output_info[layer_name] - out_blob = out_blob.buffer.reshape(output_shape) - objects += parse_yolo_region(out_blob, new_frame_height_width, source_height_width, layer_params, - prob_threshold, is_proportional) - - return objects - - -def filter_objects(objects, iou_threshold, prob_threshold): - # Filtering overlapping boxes with respect to the --iou_threshold CLI parameter - objects = sorted(objects, key=lambda obj : obj['confidence'], reverse=True) - for i in range(len(objects)): - if objects[i]['confidence'] == 0: - continue - for j in range(i + 1, len(objects)): - # We perform IOU only on objects of same class - if objects[i]['class_id'] != objects[j]['class_id']: - continue - - if intersection_over_union(objects[i], objects[j]) > iou_threshold: - objects[j]['confidence'] = 0 - - return tuple(obj for obj in objects if obj['confidence'] >= prob_threshold) - - -def async_callback(status, callback_args): - request, frame_id, frame_mode, frame, start_time, completed_request_results, empty_requests, \ - mode, event, callback_exceptions = callback_args - - try: - if status != 0: - raise RuntimeError('Infer Request has returned status code {}'.format(status)) - - completed_request_results[frame_id] = (frame, request.output_blobs, start_time, frame_mode == mode.current) - - if mode.current == frame_mode: - empty_requests.append(request) - except Exception as e: - callback_exceptions.append(e) - - event.set() - - -def await_requests_completion(requests): - for request in requests: - request.wait() - - -def main(): - args = build_argparser().parse_args() - - # ------------- 1. Plugin initialization for specified device and load extensions library if specified ------------- - log.info("Creating Inference Engine...") - ie = IECore() - - config_user_specified = {} - config_min_latency = {} - - devices_nstreams = {} - if args.num_streams: - devices_nstreams = {device: args.num_streams for device in ['CPU', 'GPU'] if device in args.device} \ - if args.num_streams.isdigit() \ - else dict([device.split(':') for device in args.num_streams.split(',')]) - - if 'CPU' in args.device: - if args.cpu_extension: - ie.add_extension(args.cpu_extension, 'CPU') - if args.number_threads is not None: - config_user_specified['CPU_THREADS_NUM'] = str(args.number_threads) - if 'CPU' in devices_nstreams: - config_user_specified['CPU_THROUGHPUT_STREAMS'] = devices_nstreams['CPU'] \ - if int(devices_nstreams['CPU']) > 0 \ - else 'CPU_THROUGHPUT_AUTO' - - config_min_latency['CPU_THROUGHPUT_STREAMS'] = '1' - - if 'GPU' in args.device: - if 'GPU' in devices_nstreams: - config_user_specified['GPU_THROUGHPUT_STREAMS'] = devices_nstreams['GPU'] \ - if int(devices_nstreams['GPU']) > 0 \ - else 'GPU_THROUGHPUT_AUTO' - - config_min_latency['GPU_THROUGHPUT_STREAMS'] = '1' - - # -------------------- 2. Reading the IR generated by the Model Optimizer (.xml and .bin files) -------------------- - log.info("Loading network") - net = ie.read_network(args.model, os.path.splitext(args.model)[0] + ".bin") - output_info = get_output_info(net) - - assert len(net.input_info) == 1, "Sample supports only YOLO V3 based single input topologies" - - # ---------------------------------------------- 3. Preparing inputs ----------------------------------------------- - log.info("Preparing inputs") - input_blob = next(iter(net.input_info)) - - # Read and pre-process input images - if net.input_info[input_blob].input_data.shape[1] == 3: - input_height, input_width = net.input_info[input_blob].input_data.shape[2:] - nchw_shape = True - else: - input_height, input_width = net.input_info[input_blob].input_data.shape[1:3] - nchw_shape = False - - if args.labels: - with open(args.labels, 'r') as f: - labels_map = [x.strip() for x in f] - else: - labels_map = None - - input_stream = 0 if args.input == "cam" else args.input - - mode = Mode(Modes.USER_SPECIFIED) - cap = cv2.VideoCapture(input_stream) - wait_key_time = 1 - - # ----------------------------------------- 4. Loading model to the plugin ----------------------------------------- - log.info("Loading model to the plugin") - exec_nets = {} - - exec_nets[Modes.USER_SPECIFIED] = ie.load_network(network=net, device_name=args.device, - config=config_user_specified, - num_requests=args.num_infer_requests) - exec_nets[Modes.MIN_LATENCY] = ie.load_network(network=net, device_name=args.device.split(":")[-1].split(",")[0], - config=config_min_latency, - num_requests=1) - - empty_requests = deque(exec_nets[mode.current].requests) - completed_request_results = {} - next_frame_id = 0 - next_frame_id_to_show = 0 - mode_metrics = {mode.current: PerformanceMetrics()} - prev_mode_active_request_count = 0 - event = threading.Event() - callback_exceptions = [] - - # ----------------------------------------------- 5. Doing inference ----------------------------------------------- - log.info("Starting inference...") - print("To close the application, press 'CTRL+C' here or switch to the output window and press ESC key") - print("To switch between min_latency/user_specified modes, press TAB key in the output window") - - presenter = monitors.Presenter(args.utilization_monitors, 55, - (round(cap.get(cv2.CAP_PROP_FRAME_WIDTH) / 4), round(cap.get(cv2.CAP_PROP_FRAME_HEIGHT) / 8))) - - while (cap.isOpened() \ - or completed_request_results \ - or len(empty_requests) < len(exec_nets[mode.current].requests)) \ - and not callback_exceptions: - if next_frame_id_to_show in completed_request_results: - frame, output, start_time, is_same_mode = completed_request_results.pop(next_frame_id_to_show) - - next_frame_id_to_show += 1 - - objects = get_objects(output, output_info, (input_height, input_width), frame.shape[:-1], args.prob_threshold, - args.keep_aspect_ratio) - objects = filter_objects(objects, args.iou_threshold, args.prob_threshold) - - if len(objects) and args.raw_output_message: - log.info(" Class ID | Confidence | XMIN | YMIN | XMAX | YMAX | COLOR ") - - origin_im_size = frame.shape[:-1] - presenter.drawGraphs(frame) - for obj in objects: - # Validation bbox of detected object - obj['xmax'] = min(obj['xmax'], origin_im_size[1]) - obj['ymax'] = min(obj['ymax'], origin_im_size[0]) - obj['xmin'] = max(obj['xmin'], 0) - obj['ymin'] = max(obj['ymin'], 0) - color = (min(obj['class_id'] * 12.5, 255), - min(obj['class_id'] * 7, 255), - min(obj['class_id'] * 5, 255)) - det_label = labels_map[obj['class_id']] if labels_map and len(labels_map) >= obj['class_id'] else \ - str(obj['class_id']) - - if args.raw_output_message: - log.info( - "{:^9} | {:10f} | {:4} | {:4} | {:4} | {:4} | {} ".format(det_label, obj['confidence'], - obj['xmin'], obj['ymin'], obj['xmax'], - obj['ymax'], - color)) - - cv2.rectangle(frame, (obj['xmin'], obj['ymin']), (obj['xmax'], obj['ymax']), color, 2) - cv2.putText(frame, - "#" + det_label + ' ' + str(round(obj['confidence'] * 100, 1)) + ' %', - (obj['xmin'], obj['ymin'] - 7), cv2.FONT_HERSHEY_COMPLEX, 0.6, color, 1) - - helpers.put_highlighted_text(frame, "{} mode".format(mode.current.name), (10, int(origin_im_size[0] - 20)), - cv2.FONT_HERSHEY_COMPLEX, 0.75, (10, 10, 200), 2) - - if is_same_mode and prev_mode_active_request_count == 0: - mode_metrics[mode.current].update(start_time, frame) - else: - mode_metrics[mode.get_other()].update(start_time, frame) - prev_mode_active_request_count -= 1 - helpers.put_highlighted_text(frame, "Switching modes, please wait...", - (10, int(origin_im_size[0] - 50)), cv2.FONT_HERSHEY_COMPLEX, 0.75, - (10, 200, 10), 2) - - if not args.no_show: - cv2.imshow("Detection Results", frame) - key = cv2.waitKey(wait_key_time) - - if key in {ord("q"), ord("Q"), 27}: # ESC key - break - if key == 9: # Tab key - if prev_mode_active_request_count == 0: - prev_mode = mode.current - mode.switch() - - prev_mode_active_request_count = len(exec_nets[prev_mode].requests) - len(empty_requests) - empty_requests.clear() - empty_requests.extend(exec_nets[mode.current].requests) - - mode_metrics[mode.current] = PerformanceMetrics() - else: - presenter.handleKey(key) - - elif empty_requests and prev_mode_active_request_count == 0 and cap.isOpened(): - start_time = perf_counter() - ret, frame = cap.read() - if not ret: - if args.loop: - cap.open(input_stream) - else: - cap.release() - continue - - request = empty_requests.popleft() - - # resize input_frame to network size - in_frame = preprocess_frame(frame, input_height, input_width, nchw_shape, args.keep_aspect_ratio) - - # Start inference - request.set_completion_callback(py_callback=async_callback, - py_data=(request, - next_frame_id, - mode.current, - frame, - start_time, - completed_request_results, - empty_requests, - mode, - event, - callback_exceptions)) - request.async_infer(inputs={input_blob: in_frame}) - next_frame_id += 1 - - else: - event.wait() - event.clear() - - if callback_exceptions: - raise callback_exceptions[0] - - for mode, metrics in mode_metrics.items(): - print("\nMode: {}".format(mode.name)) - metrics.print_total() - print(presenter.reportMeans()) - - for exec_net in exec_nets.values(): - await_requests_completion(exec_net.requests) - - -if __name__ == '__main__': - sys.exit(main() or 0) diff --git a/demos/python_demos/segmentation_demo/README.md b/demos/python_demos/segmentation_demo/README.md deleted file mode 100644 index 4f501d60507..00000000000 --- a/demos/python_demos/segmentation_demo/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# Image Segmentation Python* Demo - -This topic demonstrates how to run the Image Segmentation demo application, which does inference using image -segmentation networks like FCN8. - -## How It Works - -Upon the start-up the demo application reads command line parameters and loads a network and an image to the -Inference Engine plugin. When inference is done, the application creates an output image. - -> **NOTE**: By default, Open Model Zoo demos expect input with BGR channels order. If you trained your model to work with RGB order, you need to manually rearrange the default channels order in the demo application or reconvert your model using the Model Optimizer tool with `--reverse_input_channels` argument specified. For more information about the argument, refer to **When to Reverse Input Channels** section of [Converting a Model Using General Conversion Parameters](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_convert_model_Converting_Model_General.html). - -## Running - -Running the application with the `-h` option yields the following usage message: -``` -python3 segmentation_demo.py -h -``` -The command yields the following usage message: -``` -usage: segmentation_demo.py [-h] -m MODEL -i INPUT [INPUT ...] - [-l CPU_EXTENSION] [-d DEVICE] - [-nt NUMBER_TOP] [-ni NUMBER_ITER] [-pc] - -Options: - -h, --help Show this help message and exit. - -m MODEL, --model MODEL - Required. Path to an .xml file with a trained model. - -i INPUT [INPUT ...], --input INPUT [INPUT ...] - Required. Path to a folder with images or path to an - image files - -l CPU_EXTENSION, --cpu_extension CPU_EXTENSION - Optional. Required for CPU custom layers. Absolute - MKLDNN (CPU)-targeted custom layers. Absolute path to - a shared library with the kernels implementations - -d DEVICE, --device DEVICE - Optional. Required for CPU custom layers Specify the target device to infer on; CPU, - GPU, FPGA, HDDL or MYRIAD is acceptable. Sample will - look for a suitable plugin for device specified (CPU - by default) - -nt NUMBER_TOP, --number_top NUMBER_TOP - Optional. Number of top results -``` - -Running the application with the empty list of options yields the usage message given above and an error message. - -To run the demo, you can use public or pre-trained models. You can download the pre-trained models with the OpenVINO [Model Downloader](../../../tools/downloader/README.md) or from [https://download.01.org/opencv/](https://download.01.org/opencv/). - -> **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). - - -You can use the following command do inference on Intel® CPU; Processors on an image using a trained FCN8 network: -``` - python3 segmentation_demo.py -i /inputImage.bmp -m /fcn8.xml -``` - -## Demo Output - -The application outputs are a segmented image (`out.bmp`). - - -## See Also -* [Using Open Model Zoo demos](../../README.md) -* [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) -* [Model Downloader](../../../tools/downloader/README.md) diff --git a/demos/python_demos/segmentation_demo/segmentation_demo.py b/demos/python_demos/segmentation_demo/segmentation_demo.py deleted file mode 100755 index c87c707abd3..00000000000 --- a/demos/python_demos/segmentation_demo/segmentation_demo.py +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env python3 -""" - Copyright (C) 2018-2019 Intel Corporation - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - -import sys -import os -from argparse import ArgumentParser, SUPPRESS -import cv2 -import numpy as np -import logging as log -from time import time -from openvino.inference_engine import IECore - -classes_color_map = [ - (150, 150, 150), - (58, 55, 169), - (211, 51, 17), - (157, 80, 44), - (23, 95, 189), - (210, 133, 34), - (76, 226, 202), - (101, 138, 127), - (223, 91, 182), - (80, 128, 113), - (235, 155, 55), - (44, 151, 243), - (159, 80, 170), - (239, 208, 44), - (128, 50, 51), - (82, 141, 193), - (9, 107, 10), - (223, 90, 142), - (50, 248, 83), - (178, 101, 130), - (71, 30, 204) -] - - -def build_argparser(): - parser = ArgumentParser(add_help=False) - args = parser.add_argument_group('Options') - args.add_argument('-h', '--help', action='help', default=SUPPRESS, help='Show this help message and exit.') - args.add_argument("-m", "--model", help="Required. Path to an .xml file with a trained model", - required=True, type=str) - args.add_argument("-i", "--input", help="Required. Path to a folder with images or path to an image files", - required=True, type=str, nargs="+") - args.add_argument("-l", "--cpu_extension", - help="Optional. Required for CPU custom layers. " - "Absolute MKLDNN (CPU)-targeted custom layers. Absolute path to a shared library with the " - "kernels implementations", type=str, default=None) - args.add_argument("-d", "--device", - help="Optional. Specify the target device to infer on; CPU, GPU, FPGA, HDDL or MYRIAD is " - "acceptable. Sample will look for a suitable plugin for device specified. Default value is CPU", - default="CPU", type=str) - args.add_argument("-nt", "--number_top", help="Optional. Number of top results", default=10, type=int) - return parser - - -def main(): - log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout) - args = build_argparser().parse_args() - - log.info("Creating Inference Engine") - ie = IECore() - if args.cpu_extension and 'CPU' in args.device: - ie.add_extension(args.cpu_extension, "CPU") - # Read IR - log.info("Loading network") - net = ie.read_network(args.model, os.path.splitext(args.model)[0] + ".bin") - - assert len(net.input_info) == 1, "Sample supports only single input topologies" - assert len(net.outputs) == 1, "Sample supports only single output topologies" - - log.info("Preparing input blobs") - input_blob = next(iter(net.input_info)) - out_blob = next(iter(net.outputs)) - net.batch_size = len(args.input) - - # NB: This is required to load the image as uint8 np.array - # Without this step the input blob is loaded in FP32 precision, - # this requires additional operation and more memory. - net.input_info[input_blob].precision = "U8" - - # Read and pre-process input images - n, c, h, w = net.input_info[input_blob].input_data.shape - images = np.ndarray(shape=(n, c, h, w)) - for i in range(n): - image = cv2.imread(args.input[i]) - assert image.dtype == np.uint8 - if image.shape[:-1] != (h, w): - log.warning("Image {} is resized from {} to {}".format(args.input[i], image.shape[:-1], (h, w))) - image = cv2.resize(image, (w, h)) - image = image.transpose((2, 0, 1)) # Change data layout from HWC to CHW - images[i] = image - log.info("Batch size is {}".format(n)) - - # Loading model to the plugin - log.info("Loading model to the plugin") - exec_net = ie.load_network(network=net, device_name=args.device) - - # Start sync inference - log.info("Starting inference") - res = exec_net.infer(inputs={input_blob: images}) - - # Processing output blob - log.info("Processing output blob") - res = res[out_blob] - if len(res.shape) == 3: - res = np.expand_dims(res, axis=1) - if len(res.shape) == 4: - _, _, out_h, out_w = res.shape - else: - raise Exception("Unexpected output blob shape {}. Only 4D and 3D output blobs are supported".format(res.shape)) - for batch, data in enumerate(res): - classes_map = np.zeros(shape=(out_h, out_w, 3), dtype=np.int) - for i in range(out_h): - for j in range(out_w): - if len(data[:, i, j]) == 1: - pixel_class = int(data[:, i, j]) - else: - pixel_class = np.argmax(data[:, i, j]) - classes_map[i, j, :] = classes_color_map[min(pixel_class, 20)] - out_img = "out_{}.bmp".format(batch) - cv2.imwrite(out_img, classes_map) - log.info("Result image was saved to {}".format(out_img)) - log.info("This demo is an API example, for any performance measurements please use the dedicated benchmark_app tool " - "from the openVINO toolkit\n") - - -if __name__ == '__main__': - sys.exit(main() or 0) diff --git a/demos/python_demos/speech_recognition_demo/README.md b/demos/python_demos/speech_recognition_demo/README.md deleted file mode 100644 index c78e6056c17..00000000000 --- a/demos/python_demos/speech_recognition_demo/README.md +++ /dev/null @@ -1,103 +0,0 @@ -# Speech Recognition Demo - -This demo demonstrates Automatic Speech Recognition (ASR) with a pretrained Mozilla\* DeepSpeech 0.6.1 model. - -## How It Works - -The application accepts - - * Mozilla\* DeepSpeech 0.6.1 neural network in Intermediate Representation (IR) format, - * n-gram language model file in kenlm quantized binary format, and - * an audio file in PCM WAV 16 kHz mono format. - -After computing audio features, running a neural network to get per-frame character probabilities, and CTC decoding, the demo prints the decoded text together with the timings of the processing stages. - -The app depends on `ctcdecode_numpy` Python\* module, its installation is described below. - -## Model preparation - -You can download and convert a pre-trained Mozilla\* DeepSpeech 0.6.1 model with -OpenVINO [Model Downloader](../../../tools/downloader/README.md). -This essentially boils down to the following commands: -```shell -source /bin/setupvars.sh -/deployment_tools/open_model_zoo/tools/downloader/downloader.py --name mozilla-deepspeech-0.6.1 -/deployment_tools/open_model_zoo/tools/downloader/converter.py --name mozilla-deepspeech-0.6.1 -``` - -Please pay attention to the model license, **Mozilla Public License 2.0**. - - -## Installing CTC decoder module - -ASR performance depends heavily on beam width (a.k.a. beam size), which is the number of candidate strings maintained by beam search on each iteration. -Using larger beam results in better recognition, but is slower. -The demo depends on `ctcdecode_numpy` Python module: it implements CTC decoding in C++ for faster decoding. - -To install `ctcdecode_numpy` Python module either follow ["Build the Native Python* Extension Modules"](../../README.md#build_python_extensions), -or install it with pip: - -1. Create and activate a virtualenv, it you haven't already: - - ```shell - virtualenv -p python3 --system-site-packages deepspeech-venv - . deepspeech-venv/bin/activate - ``` - -1. Build and install `ctcdecode_numpy` Python module: - - ```shell - cd ctcdecode-numpy/ - python -m pip install . - ``` - - -## Running Demo - -Run the application with `-h` option to see help message. -Here are the essential options: - -``` -usage: speech_recognition_demo.py [-h] -i FILENAME [-d DEVICE] -m FILENAME - [-b N] [-L FILENAME] [-a FILENAME] - [--alpha X] [--beta X] [-l FILENAME] - -Speech recognition example - -optional arguments: - -h, --help show this help message and exit - -i FILENAME, --input FILENAME - Path to an audio file in WAV PCM 16 kHz mono format - -d DEVICE, --device DEVICE - Optional. Specify the target device to infer on, for - example: CPU, GPU, FPGA, HDDL, MYRIAD or HETERO. The - sample will look for a suitable IE plugin for this - device. (default is CPU) - -m FILENAME, --model FILENAME - Path to an .xml file with a trained model (required) - -b N, --beam-width N Beam width for beam search in CTC decoder (default - 500) - -L FILENAME, --lm FILENAME - path to language model file (optional) -[...] -``` - -The typical command line is: - -```shell -pip install -r requirements.txt -source /bin/setupvars.sh - -python speech_recognition_demo.py \ - -m /mozilla_deepspeech_0.6.1.xml \ - -L /lm.binary \ - /audio.wav -``` - -**Only 16-bit, 16 kHz, mono-channel WAVE audio files are supported.** - -An example audio file can be taken from `/deployment_tools/demo/how_are_you_doing.wav`. - -## Demo Output - -The application shows the time taken by initialization and processing stages, and the decoded text for the audio file. diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/CMakeLists.txt b/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/CMakeLists.txt deleted file mode 100644 index 4b9ae3bb219..00000000000 --- a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (C) 2020 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 -# - -execute_process( -COMMAND "${PYTHON_EXECUTABLE}" -m pip install . -WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/python_demos/speech_recognition_demo/ctcdecode-numpy -RESULT_VARIABLE CTCDECODE_NUMPY_INSTALL_FAILED) -if(CTCDECODE_NUMPY_INSTALL_FAILED) - message(FATAL_ERROR "Failed to pip-install ctcdecode_numpy package") -endif() diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/third_party/ThreadPool/example.cpp b/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/third_party/ThreadPool/example.cpp deleted file mode 100644 index 837277b99dc..00000000000 --- a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/third_party/ThreadPool/example.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include -#include - -#include "ThreadPool.h" - -int main() -{ - - ThreadPool pool(4); - std::vector< std::future > results; - - for(int i = 0; i < 8; ++i) { - results.emplace_back( - pool.enqueue([i] { - std::cout << "hello " << i << std::endl; - std::this_thread::sleep_for(std::chrono::seconds(1)); - std::cout << "world " << i << std::endl; - return i*i; - }) - ); - } - - for(auto && result: results) - std::cout << result.get() << ' '; - std::cout << std::endl; - - return 0; -} diff --git a/demos/python_demos/speech_recognition_demo/requirements.txt b/demos/python_demos/speech_recognition_demo/requirements.txt deleted file mode 100644 index 4fd953dbd65..00000000000 --- a/demos/python_demos/speech_recognition_demo/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -numpy -tqdm diff --git a/demos/python_demos/speech_recognition_demo/utils/audio_features.py b/demos/python_demos/speech_recognition_demo/utils/audio_features.py deleted file mode 100644 index d97024b3bb9..00000000000 --- a/demos/python_demos/speech_recognition_demo/utils/audio_features.py +++ /dev/null @@ -1,210 +0,0 @@ -# -# Copyright (C) 2019-2020 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 -# -# This file is based in its major part on speech_features.py by Feng Yen-Chang at -# https://github.com/openvinotoolkit/open_model_zoo/pull/419, commit 529805d011d9b405f142b2b40f4d202bd403a4f1 on Sep 19, 2019. -# - -################################################## -# -# John Feng, 2019/09/06 -# -################################################## -import numpy as np - - -def audio_spectrogram(samples, window_size, stride, magnitude_squared): - if len(samples.shape) != 2: - raise ValueError("samples must be 2-dimensional") - - window_size = int(window_size) - stride = int(stride) - - sample_count = samples.shape[0] - channel_count = samples.shape[1] # == 1 - - def output_frequency_channels(n): - _log = np.floor(np.log2(n)) - _log = _log if ((n == (n & ~(n - 1)))) else _log + 1 - - fft_length = 1 << _log.astype(np.int32) - - return 1 + fft_length / 2, fft_length.astype(np.int32) - - output_width, fft_length = output_frequency_channels(window_size) - output_width = output_width.astype(np.int32) - - length_minus_windows = sample_count - window_size - - output_height = 0 if length_minus_windows < 0 else (1 + (length_minus_windows / stride)) - output_height = int(output_height) - output_slices = channel_count - - __output = np.zeros((output_slices, output_height, output_width)) - hann_window = np.hanning(window_size) - - for i in range(channel_count): - input_for_channel = samples[:, i] - - input_for_compute = np.zeros(stride) - spectrogram = np.zeros((output_height, output_width)) - - fft_input_output = np.zeros(fft_length) - - for j in range(output_height): - start = j * stride - end = start + window_size - if (end < sample_count): - input_for_compute = input_for_channel[start:end] - - fft_input_output[0:window_size] = input_for_compute * hann_window - fft_input_output[window_size:] = 0 - - _f = np.fft.rfft(fft_input_output.astype(np.float32), n=fft_length) - - spectrogram[j] = np.real(_f) ** 2 + np.imag(_f) ** 2 - - __output = spectrogram if (magnitude_squared) else np.sqrt(spectrogram) - - return __output - - -################################################## -# -# John Feng, 2019/09/11 -# -################################################## - -def mfcc_mel_filterbank_init(sample_rate, input_length): - # init - filterbank_channel_count_ = 40 - lower_frequency_limit_ = 20 - upper_frequency_limit_ = 4000 - - def freq2mel(freq): - return 1127.0 * np.log1p(freq / 700) - - center_frequencies = np.zeros(filterbank_channel_count_ + 1) - mel_low = freq2mel(lower_frequency_limit_) - mel_hi = freq2mel(upper_frequency_limit_) - mel_span = mel_hi - mel_low - mel_sapcing = mel_span / (filterbank_channel_count_ + 1) - - for i in range((filterbank_channel_count_ + 1)): - center_frequencies[i] = mel_low + mel_sapcing * (1 + i) - - hz_per_sbin = 0.5 * sample_rate / (input_length - 1) - start_index = int(1.5 + (lower_frequency_limit_ / hz_per_sbin)) - end_index = int(upper_frequency_limit_ / hz_per_sbin) - - band_mapper = np.zeros(input_length) - channel = 0 - - for i in range(input_length): - melf = freq2mel(i * hz_per_sbin) - - if i < start_index or i > end_index: - band_mapper[i] = -2 - else: - while center_frequencies[int(channel)] < melf and channel < filterbank_channel_count_: - channel += 1 - band_mapper[i] = channel - 1 - - weights = np.zeros(input_length) - for i in range(input_length): - channel = band_mapper[i] - if i < start_index or i > end_index: - weights[i] = 0.0 - else: - if channel >= 0: - weights[i] = ((center_frequencies[int(channel) + 1] - freq2mel(i * hz_per_sbin)) / - (center_frequencies[int(channel) + 1] - center_frequencies[int(channel)])) - else: - weights[i] = ((center_frequencies[0] - freq2mel(i * hz_per_sbin)) / - (center_frequencies[0] - mel_low)) - - return start_index, end_index, weights, band_mapper - - -def mfcc_mel_filterbank_compute(mfcc_input, input_length, start_index, end_index, weights, band_mapper): - filterbank_channel_count_ = 40 - # Compute - output_channels = np.zeros(filterbank_channel_count_) - for i in range(start_index, end_index + 1): - spec_val = np.sqrt(mfcc_input[i]) - weighted = spec_val * weights[i] - channel = band_mapper[i] - if (channel >= 0): - output_channels[int(channel)] += weighted - channel += 1 - if (channel < filterbank_channel_count_): - output_channels[int(channel)] += (spec_val - weighted) - - return output_channels - - -def dct_init(input_length, dct_coefficient_count): - # init - if input_length < dct_coefficient_count: - raise ValueError("Error input_length need to larger than dct_coefficient_count") - - cosine = np.zeros((dct_coefficient_count, input_length)) - fnorm = np.sqrt(2.0 / input_length) - arg = np.pi / input_length - for i in range(dct_coefficient_count): - for j in range (input_length): - cosine[i][j] = fnorm * np.cos(i * arg * (j + 0.5)) - - return cosine - - -def dct_compute(worked_filter, input_length, dct_coefficient_count, cosine): - # compute - output_dct = np.zeros(dct_coefficient_count) - worked_length = worked_filter.shape[0] - - if worked_length > input_length: - worked_length = input_length - - for i in range(dct_coefficient_count): - _sum = 0.0 - for j in range(worked_length): - _sum += cosine[i][j] * worked_filter[j] - output_dct[i] = _sum - - return output_dct - - -def mfcc(spectrogram, sample_rate, dct_coefficient_count): - audio_channels, spectrogram_samples, spectrogram_channels = spectrogram.shape - filterbank_floor = 1e-12 - filterbank_channel_count = 40 - - mfcc_output = np.zeros((spectrogram_samples, dct_coefficient_count)) - for i in range(audio_channels): - start_index, end_index, weights, band_mapper = mfcc_mel_filterbank_init(sample_rate, spectrogram_channels) - cosine = dct_init(filterbank_channel_count, dct_coefficient_count) - for j in range(spectrogram_samples): - mfcc_input = spectrogram[i, j, :] - - mel_filter = mfcc_mel_filterbank_compute( - mfcc_input, spectrogram_channels, - start_index, end_index, - weights, band_mapper, - ) - for k in range(mel_filter.shape[0]): - val = mel_filter[k] - if val < filterbank_floor: - val = filterbank_floor - - mel_filter[k] = np.log(val) - - mfcc_output[j, :] = dct_compute( - mel_filter, - filterbank_channel_count, - dct_coefficient_count, - cosine, - ) - - return mfcc_output diff --git a/demos/python_demos/whiteboard_inpainting_demo/utils/capture.py b/demos/python_demos/whiteboard_inpainting_demo/utils/capture.py deleted file mode 100644 index 1badd0675c1..00000000000 --- a/demos/python_demos/whiteboard_inpainting_demo/utils/capture.py +++ /dev/null @@ -1,40 +0,0 @@ -""" - Copyright (c) 2020 Intel Corporation - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - -import cv2 -import logging as log - - -class VideoCapture: - def __init__(self, source): - try: - cam_id = int(source) - log.info('Connection to cam#{}'.format(cam_id)) - self.capture = cv2.VideoCapture(cam_id) - self.capture.set(cv2.CAP_PROP_FRAME_WIDTH, 1280) - self.capture.set(cv2.CAP_PROP_FRAME_HEIGHT, 720) - self.capture.set(cv2.CAP_PROP_FPS, 30) - self.capture.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc(*'MJPG')) - except ValueError: - log.info('Open video file {}'.format(source)) - self.capture = cv2.VideoCapture(source) - assert self.capture.isOpened() - - def get_frame(self): - return self.capture.read() - - def get_source_parameters(self): - frame_size = (int(self.capture.get(cv2.CAP_PROP_FRAME_WIDTH)), - int(self.capture.get(cv2.CAP_PROP_FRAME_HEIGHT))) - fps = self.capture.get(cv2.CAP_PROP_FPS) - return frame_size, fps diff --git a/demos/python_demos/requirements.txt b/demos/requirements.txt similarity index 88% rename from demos/python_demos/requirements.txt rename to demos/requirements.txt index b9dff7365ed..0e5ddeb4677 100644 --- a/demos/python_demos/requirements.txt +++ b/demos/requirements.txt @@ -4,6 +4,7 @@ nibabel numpy scikit-learn scipy +tokenizers tensorboard tensorboardX tqdm diff --git a/demos/security_barrier_camera_demo/CMakeLists.txt b/demos/security_barrier_camera_demo/cpp/CMakeLists.txt similarity index 73% rename from demos/security_barrier_camera_demo/CMakeLists.txt rename to demos/security_barrier_camera_demo/cpp/CMakeLists.txt index ebfab186404..c9dec8be684 100644 --- a/demos/security_barrier_camera_demo/CMakeLists.txt +++ b/demos/security_barrier_camera_demo/cpp/CMakeLists.txt @@ -2,8 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 # -file (GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) -file (GLOB HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) +file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +file(GLOB HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) ie_add_sample(NAME security_barrier_camera_demo SOURCES ${SOURCES} diff --git a/demos/security_barrier_camera_demo/README.md b/demos/security_barrier_camera_demo/cpp/README.md similarity index 96% rename from demos/security_barrier_camera_demo/README.md rename to demos/security_barrier_camera_demo/cpp/README.md index 7c3d7933ced..fce3d808623 100644 --- a/demos/security_barrier_camera_demo/README.md +++ b/demos/security_barrier_camera_demo/cpp/README.md @@ -1,5 +1,7 @@ # Security Barrier Camera C++ Demo +![](./security_barrier_camera.gif) + This demo showcases Vehicle and License Plate Detection network followed by the Vehicle Attributes Recognition and License Plate Recognition networks applied on top of the detection results. You can use a set of the following pre-trained models with the demo: * `vehicle-license-plate-detection-barrier-0106` or `vehicle-license-plate-detection-barrier-0123`, which is primary detection network to find the vehicles and license plates @@ -8,7 +10,7 @@ reports general vehicle attributes, for example, vehicle type (car/van/bus/track * `license-plate-recognition-barrier-0001` or `license-plate-recognition-barrier-0007`, which is executed on top of the results from the first network and reports a string per recognized license plate -For more information about the pre-trained models, refer to the [model documentation](../../models/intel/index.md). +For more information about the pre-trained models, refer to the [model documentation](../../../models/intel/index.md). Other demo objectives are: * Video/Camera as inputs, via OpenCV\* @@ -41,7 +43,7 @@ At the end of the sequence, the `VideoFrame` is destroyed and the sequence start ## Running -Running the application with the -h option yields the following usage message: +Running the application with the `-h` option yields the following usage message: ``` [ INFO ] InferenceEngine: @@ -81,7 +83,7 @@ Options: Running the application with an empty list of options yields an error message. -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). +To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). @@ -139,6 +141,6 @@ The demo uses OpenCV to display the resulting frame with detections rendered as > Other models may produce unexpected results on these devices. ## See Also -* [Using Open Model Zoo demos](../README.md) +* [Using Open Model Zoo demos](../../README.md) * [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) -* [Model Downloader](../../tools/downloader/README.md) +* [Model Downloader](../../../tools/downloader/README.md) diff --git a/demos/security_barrier_camera_demo/common.hpp b/demos/security_barrier_camera_demo/cpp/common.hpp similarity index 100% rename from demos/security_barrier_camera_demo/common.hpp rename to demos/security_barrier_camera_demo/cpp/common.hpp diff --git a/demos/security_barrier_camera_demo/grid_mat.hpp b/demos/security_barrier_camera_demo/cpp/grid_mat.hpp similarity index 100% rename from demos/security_barrier_camera_demo/grid_mat.hpp rename to demos/security_barrier_camera_demo/cpp/grid_mat.hpp diff --git a/demos/security_barrier_camera_demo/input_wrappers.hpp b/demos/security_barrier_camera_demo/cpp/input_wrappers.hpp similarity index 100% rename from demos/security_barrier_camera_demo/input_wrappers.hpp rename to demos/security_barrier_camera_demo/cpp/input_wrappers.hpp diff --git a/demos/security_barrier_camera_demo/main.cpp b/demos/security_barrier_camera_demo/cpp/main.cpp similarity index 99% rename from demos/security_barrier_camera_demo/main.cpp rename to demos/security_barrier_camera_demo/cpp/main.cpp index 23a6e80572b..4c03c8edfef 100644 --- a/demos/security_barrier_camera_demo/main.cpp +++ b/demos/security_barrier_camera_demo/cpp/main.cpp @@ -18,9 +18,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include "common.hpp" #include "grid_mat.hpp" diff --git a/demos/security_barrier_camera_demo/models.lst b/demos/security_barrier_camera_demo/cpp/models.lst similarity index 100% rename from demos/security_barrier_camera_demo/models.lst rename to demos/security_barrier_camera_demo/cpp/models.lst diff --git a/demos/security_barrier_camera_demo/net_wrappers.hpp b/demos/security_barrier_camera_demo/cpp/net_wrappers.hpp similarity index 99% rename from demos/security_barrier_camera_demo/net_wrappers.hpp rename to demos/security_barrier_camera_demo/cpp/net_wrappers.hpp index d5f2fcd4f57..7f5a1507fd2 100644 --- a/demos/security_barrier_camera_demo/net_wrappers.hpp +++ b/demos/security_barrier_camera_demo/cpp/net_wrappers.hpp @@ -11,8 +11,8 @@ #include #include -#include -#include +#include +#include class Detector { public: diff --git a/demos/security_barrier_camera_demo/cpp/security_barrier_camera.gif b/demos/security_barrier_camera_demo/cpp/security_barrier_camera.gif new file mode 100644 index 00000000000..42a6b024f8b Binary files /dev/null and b/demos/security_barrier_camera_demo/cpp/security_barrier_camera.gif differ diff --git a/demos/security_barrier_camera_demo/security_barrier_camera_demo.hpp b/demos/security_barrier_camera_demo/cpp/security_barrier_camera_demo.hpp similarity index 100% rename from demos/security_barrier_camera_demo/security_barrier_camera_demo.hpp rename to demos/security_barrier_camera_demo/cpp/security_barrier_camera_demo.hpp diff --git a/demos/segmentation_demo/CMakeLists.txt b/demos/segmentation_demo/CMakeLists.txt deleted file mode 100644 index 96593288855..00000000000 --- a/demos/segmentation_demo/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (C) 2018-2019 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 -# - -ie_add_sample(NAME segmentation_demo - SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp" - HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/segmentation_demo.h" - DEPENDENCIES monitors - OPENCV_DEPENDENCIES highgui videoio imgproc core) diff --git a/demos/segmentation_demo/README.md b/demos/segmentation_demo/README.md deleted file mode 100644 index 0a437c2925f..00000000000 --- a/demos/segmentation_demo/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# Image Segmentation C++ Demo - -This topic demonstrates how to run the Image Segmentation demo application, which does inference using semantic segmentation networks. - -> **NOTE:** This topic describes usage of C++ implementation of the Image Segmentation Demo. For the Python* implementation, refer to [Image Segmentation Python* Demo](../python_demos/segmentation_demo/README.md). - -## How It Works - -Upon the start-up the demo application reads command line parameters and loads a network. The demo runs inference and shows results for each image captured from an input. The demo's pipeline is latency oriented. The pipeline minimizes the tame required to process each single image. - -> **NOTE**: By default, Open Model Zoo demos expect input with BGR channels order. If you trained your model to work with RGB order, you need to manually rearrange the default channels order in the demo application or reconvert your model using the Model Optimizer tool with `--reverse_input_channels` argument specified. For more information about the argument, refer to **When to Reverse Input Channels** section of [Converting a Model Using General Conversion Parameters](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_convert_model_Converting_Model_General.html). - -## Running - -Running the application with the `-h` option yields the following usage message: -``` -./segmentation_demo -h -[ INFO ] InferenceEngine: -[ INFO ] Parsing input parameters - -segmentation_demo [OPTION] -Options: - - -h Print a usage message. - -i Required. An input to process. The input must be a single image, a folder of images or anything that cv::VideoCapture can process. - -loop Optional. Enable reading the input in a loop. - -m "" Required. Path to an .xml file with a trained model. - -l "" Required for CPU custom layers. Absolute path to a shared library with the kernels implementations. - Or - -c "" Required for GPU custom kernels. Absolute path to the .xml file with the kernels descriptions. - -d "" Optional. Specify the target device to infer on (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. - -delay Optional. Default is 1. Interval in milliseconds of waiting for a key to be pressed. For a negative value the demo loads a model, opens an input and exits. - -no_show Optional. Do not visualize inference results. - -u Optional. List of monitors to show initially. -``` - -Running the application with the empty list of options yields an error message. - -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). The list of models supported by the demo is in [models.lst](./models.lst). - -> **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). - -You can use the following command to do inference on CPU on images captured by a camera using a pre-trained semantic-segmentation-adas-0001 network: -```sh -./segmentation_demo -i 0 -m semantic-segmentation-adas-0001.xml -``` - -## Demo Output - -The demo uses OpenCV to display the resulting images with blended segmentation mask. - -> **NOTE**: On VPU devices (Intel® Movidius™ Neural Compute Stick, Intel® Neural Compute Stick 2, and Intel® Vision Accelerator Design with Intel® Movidius™ VPUs) this demo is not supported with any of the Model Downloader available topologies. Other models may produce unexpected results on these devices as well. - -## See Also -* [Using Open Model Zoo demos](../README.md) -* [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) -* [Model Downloader](../../tools/downloader/README.md) diff --git a/demos/segmentation_demo_async/CMakeLists.txt b/demos/segmentation_demo/cpp/CMakeLists.txt similarity index 73% rename from demos/segmentation_demo_async/CMakeLists.txt rename to demos/segmentation_demo/cpp/CMakeLists.txt index bf12f32c2b4..8dc0009232c 100644 --- a/demos/segmentation_demo_async/CMakeLists.txt +++ b/demos/segmentation_demo/cpp/CMakeLists.txt @@ -2,10 +2,10 @@ # SPDX-License-Identifier: Apache-2.0 # -FILE(GLOB SRC_FILES ./*.cpp) -FILE(GLOB H_FILES ./*.h) +file(GLOB SRC_FILES ./*.cpp) +file(GLOB H_FILES ./*.h) -ie_add_sample(NAME segmentation_demo_async +ie_add_sample(NAME segmentation_demo SOURCES ${SRC_FILES} HEADERS ${H_FILES} DEPENDENCIES monitors models pipelines diff --git a/demos/segmentation_demo_async/README.md b/demos/segmentation_demo/cpp/README.md similarity index 78% rename from demos/segmentation_demo_async/README.md rename to demos/segmentation_demo/cpp/README.md index 9c39b7cd70b..4ba35356501 100644 --- a/demos/segmentation_demo_async/README.md +++ b/demos/segmentation_demo/cpp/README.md @@ -1,12 +1,14 @@ -# Image Segmentation (asynchronous) C++ Demo +# Image Segmentation C++ Demo -This topic demonstrates how to run the Image Segmentation demo application, which does inference using semantic segmentation networks asynchronously. +![](../segmentation.gif) -> **NOTE:** This topic describes usage of C++ implementation of the Image Segmentation Demo. For the Python* implementation, refer to [Image Segmentation Python* Demo](../python_demos/segmentation_demo/README.md). +This topic demonstrates how to run the Image Segmentation demo application, which does inference using semantic segmentation networks. + +> **NOTE:** This topic describes usage of C++ implementation of the Image Segmentation Demo. For the Python* implementation, refer to [Image Segmentation Python\* Demo](../python/README.md). ## How It Works -Upon the start-up the demo application reads command line parameters and loads a network. The demo runs inference and shows results for each image captured from an input. Depending on number of inference reuests processing simultaneously (-nireq parameter) the pipeline might minimize the time required to process each single image (for nireq 1) or maximizes utilization of the device and overall processing performance. +Upon the start-up the demo application reads command line parameters and loads a network. The demo runs inference and shows results for each image captured from an input. Depending on number of inference requests processing simultaneously (-nireq parameter) the pipeline might minimize the time required to process each single image (for nireq 1) or maximizes utilization of the device and overall processing performance. > **NOTE**: By default, Open Model Zoo demos expect input with BGR channels order. If you trained your model to work with RGB order, you need to manually rearrange the default channels order in the demo application or reconvert your model using the Model Optimizer tool with `--reverse_input_channels` argument specified. For more information about the argument, refer to **When to Reverse Input Channels** section of [Converting a Model Using General Conversion Parameters](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_convert_model_Converting_Model_General.html). @@ -14,22 +16,23 @@ Upon the start-up the demo application reads command line parameters and loads a Running the application with the `-h` option yields the following usage message: ``` -./segmentation_demo_async -h +./segmentation_demo -h [ INFO ] InferenceEngine: [ INFO ] Parsing input parameters -segmentation_demo_async [OPTION] +segmentation_demo [OPTION] Options: -h Print a usage message. - -i "" Required. Path to a video file (specify "cam" to work with camera). + -i "" Required. An input to process. The input must be a single image, a folder of images or anything that cv::VideoCapture can process. -m "" Required. Path to an .xml file with a trained model. -l "" Required for CPU custom layers. Absolute path to a shared library with the kernel implementations. Or -c "" Required for GPU custom kernels. Absolute path to the .xml file with the kernel descriptions. -d "" Optional. Specify the target device to infer on (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. -pc Optional. Enables per-layer performance report. - -nireq "" Optional. Number of infer requests. + -nireq "" Optional. Number of infer requests. If this option is omitted, number of infer requests is determined automatically. + -auto_resize Optional. Enables resizable input with support of ROI crop & auto resize. -nthreads "" Optional. Number of threads. -nstreams Optional. Number of streams to use for inference on the CPU or/and GPU in throughput mode (for HETERO and MULTI device cases use format :,: or just ) -loop Optional. Enable reading the input in a loop. @@ -39,13 +42,13 @@ Options: Running the application with the empty list of options yields an error message. -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). The list of models supported by the demo is in [models.lst](./models.lst). +To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). You can use the following command to do inference on CPU on images captured by a camera using a pre-trained semantic-segmentation-adas-0001 network: ```sh -./segmentation_demo_async -i 0 -m semantic-segmentation-adas-0001.xml +./segmentation_demo -i 0 -m semantic-segmentation-adas-0001.xml ``` ## Demo Output @@ -55,6 +58,6 @@ The demo uses OpenCV to display the resulting images with blended segmentation m > **NOTE**: On VPU devices (Intel® Movidius™ Neural Compute Stick, Intel® Neural Compute Stick 2, and Intel® Vision Accelerator Design with Intel® Movidius™ VPUs) this demo is not supported with any of the Model Downloader available topologies. Other models may produce unexpected results on these devices as well. ## See Also -* [Using Open Model Zoo demos](../README.md) +* [Using Open Model Zoo demos](../../README.md) * [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) -* [Model Downloader](../../tools/downloader/README.md) +* [Model Downloader](../../../tools/downloader/README.md) diff --git a/demos/segmentation_demo_async/main.cpp b/demos/segmentation_demo/cpp/main.cpp similarity index 75% rename from demos/segmentation_demo_async/main.cpp rename to demos/segmentation_demo/cpp/main.cpp index f4642a6afb8..397e529d42f 100644 --- a/demos/segmentation_demo_async/main.cpp +++ b/demos/segmentation_demo/cpp/main.cpp @@ -21,28 +21,25 @@ */ #include -#include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include #include -#include "pipelines/async_pipeline.h" -#include "models/segmentation_model.h" -#include "pipelines/config_factory.h" -#include "pipelines/metadata.h" +#include +#include +#include +#include static const char help_message[] = "Print a usage message."; -static const char video_message[] = "Required. Path to a video file (specify \"cam\" to work with camera)."; static const char model_message[] = "Required. Path to an .xml file with a trained model."; static const char target_device_message[] = "Optional. Specify the target device to infer on (the list of available devices is shown below). " "Default value is CPU. Use \"-d HETERO:\" format to specify HETERO plugin. " @@ -52,7 +49,8 @@ static const char custom_cldnn_message[] = "Required for GPU custom kernels. " "Absolute path to the .xml file with the kernel descriptions."; static const char custom_cpu_library_message[] = "Required for CPU custom layers. " "Absolute path to a shared library with the kernel implementations."; -static const char num_inf_req_message[] = "Optional. Number of infer requests."; +static const char nireq_message[] = "Optional. Number of infer requests. If this option is omitted, number of infer requests is determined automatically."; +static const char input_resizable_message[] = "Optional. Enables resizable input with support of ROI crop & auto resize."; static const char num_threads_message[] = "Optional. Number of threads."; static const char num_streams_message[] = "Optional. Number of streams to use for inference on the CPU or/and GPU in " "throughput mode (for HETERO and MULTI device cases use format " @@ -61,13 +59,14 @@ static const char no_show_processed_video[] = "Optional. Do not show processed v static const char utilization_monitors_message[] = "Optional. List of monitors to show initially."; DEFINE_bool(h, false, help_message); -DEFINE_string(i, "", video_message); +DEFINE_string(i, "", input_message); DEFINE_string(m, "", model_message); DEFINE_string(d, "CPU", target_device_message); DEFINE_bool(pc, false, performance_counter_message); DEFINE_string(c, "", custom_cldnn_message); DEFINE_string(l, "", custom_cpu_library_message); -DEFINE_uint32(nireq, 2, num_inf_req_message); +DEFINE_uint32(nireq, 0, nireq_message); +DEFINE_bool(auto_resize, false, input_resizable_message); DEFINE_uint32(nthreads, 0, num_threads_message); DEFINE_string(nstreams, "", num_streams_message); DEFINE_bool(loop, false, loop_message); @@ -79,18 +78,19 @@ DEFINE_string(u, "", utilization_monitors_message); */ static void showUsage() { std::cout << std::endl; - std::cout << "object_detection_demo_ssd_async [OPTION]" << std::endl; + std::cout << "segmentation_demo_async [OPTION]" << std::endl; std::cout << "Options:" << std::endl; std::cout << std::endl; std::cout << " -h " << help_message << std::endl; - std::cout << " -i \"\" " << video_message << std::endl; + std::cout << " -i \"\" " << input_message << std::endl; std::cout << " -m \"\" " << model_message << std::endl; std::cout << " -l \"\" " << custom_cpu_library_message << std::endl; std::cout << " Or" << std::endl; std::cout << " -c \"\" " << custom_cldnn_message << std::endl; std::cout << " -d \"\" " << target_device_message << std::endl; std::cout << " -pc " << performance_counter_message << std::endl; - std::cout << " -nireq \"\" " << num_inf_req_message << std::endl; + std::cout << " -nireq \"\" " << nireq_message << std::endl; + std::cout << " -auto_resize " << input_resizable_message << std::endl; std::cout << " -nthreads \"\" " << num_threads_message << std::endl; std::cout << " -nstreams " << num_streams_message << std::endl; std::cout << " -loop " << loop_message << std::endl; @@ -120,6 +120,30 @@ bool ParseAndCheckCommandLine(int argc, char *argv[]) { return true; } +static const Color PASCAL_VOC_COLORS[] = { + { 0, 0, 0 }, + { 128, 0, 0 }, + { 0, 128, 0 }, + { 128, 128, 0 }, + { 0, 0, 128 }, + { 128, 0, 128 }, + { 0, 128, 128 }, + { 128, 128, 128 }, + { 64, 0, 0 }, + { 192, 0, 0 }, + { 64, 128, 0 }, + { 192, 128, 0 }, + { 64, 0, 128 }, + { 192, 0, 128 }, + { 64, 128, 128 }, + { 192, 128, 128 }, + { 0, 64, 0 }, + { 128, 64, 0 }, + { 0, 192, 0 }, + { 128, 192, 0 }, + { 0, 64, 128 } +}; + cv::Mat applyColorMap(cv::Mat input) { // Initializing colors array if needed static cv::Mat colors; @@ -129,8 +153,8 @@ cv::Mat applyColorMap(cv::Mat input) { if (colors.empty()) { colors = cv::Mat(256, 1, CV_8UC3); std::size_t i = 0; - for (; i < arraySize(CITYSCAPES_COLORS); ++i) { - colors.at(i, 0) = { CITYSCAPES_COLORS[i].blue(), CITYSCAPES_COLORS[i].green(), CITYSCAPES_COLORS[i].red() }; + for (; i < arraySize(PASCAL_VOC_COLORS); ++i) { + colors.at(i, 0) = { PASCAL_VOC_COLORS[i].blue(), PASCAL_VOC_COLORS[i].green(), PASCAL_VOC_COLORS[i].red() }; } for (; i < (std::size_t)colors.cols; ++i) { colors.at(i, 0) = cv::Vec3b(distr(rng), distr(rng), distr(rng)); @@ -177,20 +201,22 @@ int main(int argc, char *argv[]) { //------------------------------ Running Segmentation routines ---------------------------------------------- InferenceEngine::Core core; - AsyncPipeline pipeline(std::unique_ptr(new SegmentationModel(FLAGS_m)), + AsyncPipeline pipeline(std::unique_ptr(new SegmentationModel(FLAGS_m, FLAGS_auto_resize)), ConfigFactory::getUserConfig(FLAGS_d,FLAGS_l,FLAGS_c,FLAGS_pc,FLAGS_nireq,FLAGS_nstreams,FLAGS_nthreads), core); - Presenter presenter; + Presenter presenter(FLAGS_u); bool keepRunning = true; - int64_t frameNum = 0; + int64_t frameNum = -1; + std::unique_ptr result; + while (keepRunning) { if (pipeline.isReadyToProcess()) { - //--- Capturing frame. If previous frame hasn't been inferred yet, reuse it instead of capturing new one + //--- Capturing frame auto startTime = std::chrono::steady_clock::now(); curr_frame = cap->read(); if (curr_frame.empty()) { - if (!frameNum) { + if (frameNum == -1) { throw std::logic_error("Can't read an image from the input"); } else { @@ -209,13 +235,12 @@ int main(int argc, char *argv[]) { //--- Checking for results and rendering data if it's ready //--- If you need just plain data without rendering - cast result's underlying pointer to SegmentationResult* // and use your own processing instead of calling renderSegmentationData(). - std::unique_ptr result; while ((result = pipeline.getResult()) && keepRunning) { cv::Mat outFrame = renderSegmentationData(result->asRef()); //--- Showing results and device information presenter.drawGraphs(outFrame); metrics.update(result->metaData->asRef().timeStamp, - outFrame, { 10, 22 }, 0.65); + outFrame, { 10, 22 }, cv::FONT_HERSHEY_COMPLEX, 0.65); if (!FLAGS_no_show) { cv::imshow("Segmentation Results", outFrame); @@ -230,6 +255,21 @@ int main(int argc, char *argv[]) { } } + //// ------------ Waiting for completion of data processing and rendering the rest of results --------- + pipeline.waitForTotalCompletion(); + while (result = pipeline.getResult()) { + cv::Mat outFrame = renderSegmentationData(result->asRef()); + //--- Showing results and device information + presenter.drawGraphs(outFrame); + metrics.update(result->metaData->asRef().timeStamp, + outFrame, { 10, 22 }, cv::FONT_HERSHEY_COMPLEX, 0.65); + if (!FLAGS_no_show) { + cv::imshow("Segmentation Results", outFrame); + //--- Updating output window + cv::waitKey(1); + } + } + //// --------------------------- Report metrics ------------------------------------------------------- slog::info << slog::endl << "Metric reports:" << slog::endl; metrics.printTotal(); @@ -237,11 +277,11 @@ int main(int argc, char *argv[]) { slog::info << presenter.reportMeans() << slog::endl; } catch (const std::exception& error) { - slog::err << "[ ERROR ] " << error.what() << slog::endl; + slog::err << error.what() << slog::endl; return 1; } catch (...) { - slog::err << "[ ERROR ] Unknown/internal exception happened." << slog::endl; + slog::err << "Unknown/internal exception happened." << slog::endl; return 1; } diff --git a/demos/python_demos/segmentation_demo/models.lst b/demos/segmentation_demo/cpp/models.lst similarity index 58% rename from demos/python_demos/segmentation_demo/models.lst rename to demos/segmentation_demo/cpp/models.lst index b695bc84a77..a581e99b8a4 100644 --- a/demos/python_demos/segmentation_demo/models.lst +++ b/demos/segmentation_demo/cpp/models.lst @@ -1,4 +1,8 @@ # This file can be used with the --list option of the model downloader. deeplabv3 +hrnet-v2-c1-segmentation +icnet-camvid-ava-???? +icnet-camvid-ava-sparse-??-???? road-segmentation-adas-???? semantic-segmentation-adas-???? +unet-camvid-onnx-???? diff --git a/demos/segmentation_demo/main.cpp b/demos/segmentation_demo/main.cpp deleted file mode 100644 index bb9f6589824..00000000000 --- a/demos/segmentation_demo/main.cpp +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright (C) 2018-2019 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include -#include -#include - -#include - -#include - -#include - -#include -#include -#include -#include -#include - -#include "segmentation_demo.h" - -using namespace InferenceEngine; -typedef std::chrono::duration Ms; - -bool ParseAndCheckCommandLine(int argc, char *argv[]) { - // ---------------------------Parsing and validation of input args-------------------------------------- - slog::info << "Parsing input parameters" << slog::endl; - - gflags::ParseCommandLineNonHelpFlags(&argc, &argv, true); - if (FLAGS_h) { - showUsage(); - showAvailableDevices(); - return false; - } - - if (FLAGS_i.empty()) { - throw std::logic_error("Parameter -i is not set"); - } - - if (FLAGS_m.empty()) { - throw std::logic_error("Parameter -m is not set"); - } - - return true; -} - -int main(int argc, char *argv[]) { - try { - slog::info << "InferenceEngine: " << printable(*GetInferenceEngineVersion()) << slog::endl; - if (!ParseAndCheckCommandLine(argc, argv)) { - return 0; - } - - Core ie; - - if (!FLAGS_l.empty()) { - // CPU(MKLDNN) extensions are loaded as a shared library and passed as a pointer to base extension - IExtensionPtr extension_ptr = make_so_pointer(FLAGS_l); - ie.AddExtension(extension_ptr, "CPU"); - slog::info << "CPU Extension loaded: " << FLAGS_l << slog::endl; - } - if (!FLAGS_c.empty()) { - // clDNN Extensions are loaded from an .xml description and OpenCL kernel files - ie.SetConfig({{PluginConfigParams::KEY_CONFIG_FILE, FLAGS_c}}, "GPU"); - slog::info << "GPU Extension loaded: " << FLAGS_c << slog::endl; - } - - slog::info << "Device info" << slog::endl; - slog::info << printable(ie.GetVersions(FLAGS_d)) << slog::endl; - - CNNNetwork network = ie.ReadNetwork(FLAGS_m); - - ICNNNetwork::InputShapes inputShapes = network.getInputShapes(); - if (inputShapes.size() != 1) - throw std::runtime_error("Demo supports topologies only with 1 input"); - const std::string& inName = inputShapes.begin()->first; - SizeVector& inSizeVector = inputShapes.begin()->second; - if (inSizeVector.size() != 4 || inSizeVector[1] != 3) - throw std::runtime_error("3-channel 4-dimensional model's input is expected"); - inSizeVector[0] = 1; // set batch size to 1 - network.reshape(inputShapes); - - InputInfo& inputInfo = *network.getInputsInfo().begin()->second; - inputInfo.getPreProcess().setResizeAlgorithm(ResizeAlgorithm::RESIZE_BILINEAR); - inputInfo.setLayout(Layout::NHWC); - inputInfo.setPrecision(Precision::U8); - - const OutputsDataMap& outputsDataMap = network.getOutputsInfo(); - if (outputsDataMap.size() != 1) throw std::runtime_error("Demo supports topologies only with 1 output"); - const std::string& outName = outputsDataMap.begin()->first; - Data& data = *outputsDataMap.begin()->second; - // if the model performs ArgMax, its output type can be I32 but for models that return heatmaps for each - // class the output is usually FP32. Reset the precision to avoid handling different types with switch in - // postprocessing - data.setPrecision(Precision::FP32); - const SizeVector& outSizeVector = data.getTensorDesc().getDims(); - int outChannels, outHeight, outWidth; - switch(outSizeVector.size()) { - case 3: - outChannels = 0; - outHeight = outSizeVector[1]; - outWidth = outSizeVector[2]; - break; - case 4: - outChannels = outSizeVector[1]; - outHeight = outSizeVector[2]; - outWidth = outSizeVector[3]; - break; - default: - throw std::runtime_error("Unexpected output blob shape. Only 4D and 3D output blobs are" - "supported."); - } - - ExecutableNetwork executableNetwork = ie.LoadNetwork(network, FLAGS_d); - InferRequest inferRequest = executableNetwork.CreateInferRequest(); - - std::unique_ptr cap = openImagesCapture(FLAGS_i, FLAGS_loop); - cv::Mat inImg = cap->read(); - if (!inImg.data) { - throw std::runtime_error("Can't read an image from the input"); - } - - float blending = 0.3f; - constexpr char WIN_NAME[] = "segmentation"; - if (!FLAGS_no_show) { - cv::namedWindow(WIN_NAME); - int initValue = static_cast(blending * 100); - cv::createTrackbar("blending", WIN_NAME, &initValue, 100, - [](int position, void* blendingPtr){*static_cast(blendingPtr) = position * 0.01f;}, - &blending); - } - - cv::Mat resImg, maskImg(outHeight, outWidth, CV_8UC3); - std::vector colors(arraySize(CITYSCAPES_COLORS)); - for (std::size_t i = 0; i < colors.size(); ++i) - colors[i] = {CITYSCAPES_COLORS[i].blue(), CITYSCAPES_COLORS[i].green(), CITYSCAPES_COLORS[i].red()}; - std::mt19937 rng; - std::uniform_int_distribution distr(0, 255); - int delay = FLAGS_delay; - Presenter presenter(FLAGS_u, 10, {inImg.cols / 4, 60}); - - std::chrono::steady_clock::duration latencySum{0}; - unsigned latencySamplesNum = 0; - std::ostringstream latencyStream; - - std::chrono::steady_clock::time_point t0 = std::chrono::steady_clock::now(); - while (inImg.data && delay >= 0) { - if (CV_8UC3 != inImg.type()) - throw std::runtime_error("BGR (or RGB) image expected to come from input"); - inferRequest.SetBlob(inName, wrapMat2Blob(inImg)); - inferRequest.Infer(); - - LockedMemory outMapped = as(inferRequest.GetBlob(outName))->rmap(); - const float * const predictions = outMapped.as(); - for (int rowId = 0; rowId < outHeight; ++rowId) { - for (int colId = 0; colId < outWidth; ++colId) { - std::size_t classId = 0; - if (outChannels < 2) { // assume the output is already ArgMax'ed - classId = static_cast(predictions[rowId * outWidth + colId]); - } else { - float maxProb = -1.0f; - for (int chId = 0; chId < outChannels; ++chId) { - float prob = predictions[chId * outHeight * outWidth + rowId * outWidth + colId]; - if (prob > maxProb) { - classId = chId; - maxProb = prob; - } - } - } - while (classId >= colors.size()) { - cv::Vec3b color(distr(rng), distr(rng), distr(rng)); - colors.push_back(color); - } - maskImg.at(rowId, colId) = colors[classId]; - } - } - cv::resize(maskImg, resImg, inImg.size()); - resImg = inImg * blending + resImg * (1 - blending); - presenter.drawGraphs(resImg); - - latencySum += std::chrono::steady_clock::now() - t0; - ++latencySamplesNum; - latencyStream.str(""); - latencyStream << std::fixed << std::setprecision(1) - << (std::chrono::duration_cast(latencySum) / latencySamplesNum).count() << " ms"; - constexpr int FONT_FACE = cv::FONT_HERSHEY_SIMPLEX; - constexpr double FONT_SCALE = 2; - constexpr int THICKNESS = 2; - int baseLine; - cv::getTextSize(latencyStream.str(), FONT_FACE, FONT_SCALE, THICKNESS, &baseLine); - cv::putText(resImg, latencyStream.str(), cv::Size{0, resImg.rows - baseLine}, FONT_FACE, FONT_SCALE, - cv::Scalar{255, 0, 0}, THICKNESS); - - if (!FLAGS_no_show) { - cv::imshow(WIN_NAME, resImg); - int key = cv::waitKey(delay); - switch(key) { - case 'q': - case 'Q': - case 27: // Esc - delay = -1; - break; - case 'p': - case 'P': - case ' ': - delay = !delay * (FLAGS_delay + !FLAGS_delay); - break; - default: - presenter.handleKey(key); - } - } - t0 = std::chrono::steady_clock::now(); - inImg = cap->read(); - } - std::cout << "Mean pipeline latency: " << latencyStream.str() << '\n'; - std::cout << presenter.reportMeans() << '\n'; - } - catch (const std::exception& error) { - slog::err << error.what() << slog::endl; - return 1; - } - catch (...) { - slog::err << "Unknown/internal exception happened." << slog::endl; - return 1; - } - - slog::info << "Execution successful" << slog::endl; - return 0; -} diff --git a/demos/segmentation_demo/python/README.md b/demos/segmentation_demo/python/README.md new file mode 100644 index 00000000000..880474e2751 --- /dev/null +++ b/demos/segmentation_demo/python/README.md @@ -0,0 +1,97 @@ +# Image Segmentation Python\* Demo + +![](../segmentation.gif) + +This topic demonstrates how to run the Image Segmentation demo application, which does inference using semantic segmentation networks. + +> **NOTE:** This topic describes usage of Python\* implementation of the Image Segmentation Demo. For the C++ implementation, refer to [Image Segmentation C++ Demo](../cpp/README.md). + +## How It Works + +Upon the start-up the demo application reads command line parameters and loads a network. The demo runs inference and shows results for each image captured from an input. Depending on number of inference requests processing simultaneously (-nireq parameter) the pipeline might minimize the time required to process each single image (for nireq 1) or maximize utilization of the device and overall processing performance. + +> **NOTE**: By default, Open Model Zoo demos expect input with BGR channels order. If you trained your model to work with RGB order, you need to manually rearrange the default channels order in the demo application or reconvert your model using the Model Optimizer tool with `--reverse_input_channels` argument specified. For more information about the argument, refer to **When to Reverse Input Channels** section of [Converting a Model Using General Conversion Parameters](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_convert_model_Converting_Model_General.html). + +## Running + +Running the application with the `-h` option yields the following usage message: + +``` +python3 segmentation_demo.py -h +``` + +The command yields the following usage message: + +``` +usage: segmentation_demo.py [-h] -m MODEL -i INPUT + [-d DEVICE] [-c COLORS] + [-nireq NUM_INFER_REQUESTS] + [-nstreams NUM_STREAMS] + [-nthreads NUM_THREADS] + [--loop] [-o OUTPUT] + [-limit OUTPUT_LIMIT] [--no_show] + [-u UTILIZATION_MONITORS] +Options: + -h, --help Show this help message and exit. + -m MODEL, --model MODEL + Required. Path to an .xml file with a trained model. + -i INPUT, --input INPUT + Required. An input to process. The input must be a + single image, a folder of images, video file or camera id. + -d DEVICE, --device DEVICE + Optional. Specify the target device to infer on; CPU, + GPU, FPGA, HDDL or MYRIAD is acceptable. The demo + will look for a suitable plugin for device specified. + Default value is CPU. + +Common model options: + -c COLORS, --colors COLORS + Optional. Path to a text file containing colors for + classes. + +Inference options: + -nireq NUM_INFER_REQUESTS, --num_infer_requests NUM_INFER_REQUESTS + Optional. Number of infer requests. + -nstreams NUM_STREAMS, --num_streams NUM_STREAMS + Optional. Number of streams to use for inference on + the CPU or/and GPU in throughput mode (for HETERO and + MULTI device cases use format + :,: or just + ). + -nthreads NUM_THREADS, --num_threads NUM_THREADS + Optional. Number of threads to use for inference on + CPU (including HETERO cases). + +Input/output options: + --loop Optional. Enable reading the input in a loop. + -o OUTPUT, --output OUTPUT + Optional. Name of output to save. + -limit OUTPUT_LIMIT, --output_limit OUTPUT_LIMIT + Optional. Number of frames to store in output. + If -1 is set, all frames are stored. + --no_show Optional. Don't show output. + -u UTILIZATION_MONITORS, --utilization_monitors UTILIZATION_MONITORS + Optional. List of monitors to show initially. +``` + +Running the application with the empty list of options yields the usage message given above and an error message. + +To run the demo, you can use public or pre-trained models. You can download the pre-trained models with the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). + +> **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). + + +You can use the following command to do inference on CPU on images captured by a camera using a pre-trained semantic-segmentation-adas-0001 network: +``` + python3 segmentation_demo.py -i 0 -m /semantic-segmentation-adas-0001.xml +``` + +## Demo Output + +The demo uses OpenCV to display the resulting images with blended segmentation mask. + + +## See Also +* [Using Open Model Zoo demos](../../README.md) +* [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) +* [Model Downloader](../../../tools/downloader/README.md) diff --git a/demos/segmentation_demo/models.lst b/demos/segmentation_demo/python/models.lst similarity index 58% rename from demos/segmentation_demo/models.lst rename to demos/segmentation_demo/python/models.lst index b695bc84a77..a581e99b8a4 100644 --- a/demos/segmentation_demo/models.lst +++ b/demos/segmentation_demo/python/models.lst @@ -1,4 +1,8 @@ # This file can be used with the --list option of the model downloader. deeplabv3 +hrnet-v2-c1-segmentation +icnet-camvid-ava-???? +icnet-camvid-ava-sparse-??-???? road-segmentation-adas-???? semantic-segmentation-adas-???? +unet-camvid-onnx-???? diff --git a/demos/segmentation_demo/python/segmentation_demo.py b/demos/segmentation_demo/python/segmentation_demo.py new file mode 100755 index 00000000000..d3f492021c1 --- /dev/null +++ b/demos/segmentation_demo/python/segmentation_demo.py @@ -0,0 +1,265 @@ +#!/usr/bin/env python3 +""" + Copyright (C) 2018-2020 Intel Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + +import logging +import sys +from argparse import ArgumentParser, SUPPRESS +from pathlib import Path +from time import perf_counter + +import cv2 +import numpy as np +from openvino.inference_engine import IECore + +sys.path.append(str(Path(__file__).resolve().parents[2] / 'common/python')) + +from models import SegmentationModel +import monitors +from pipelines import AsyncPipeline +from images_capture import open_images_capture +from performance_metrics import PerformanceMetrics + +logging.basicConfig(format='[ %(levelname)s ] %(message)s', level=logging.INFO, stream=sys.stdout) +log = logging.getLogger() + + +class Visualizer(object): + pascal_voc_palette = [ + (0, 0, 0), + (128, 0, 0), + (0, 128, 0), + (128, 128, 0), + (0, 0, 128), + (128, 0, 128), + (0, 128, 128), + (128, 128, 128), + (64, 0, 0), + (192, 0, 0), + (64, 128, 0), + (192, 128, 0), + (64, 0, 128), + (192, 0, 128), + (64, 128, 128), + (192, 128, 128), + (0, 64, 0), + (128, 64, 0), + (0, 192, 0), + (128, 192, 0), + (0, 64, 128) + ] + + def __init__(self, colors_path=None): + if colors_path: + self.color_palette = self.get_palette_from_file(colors_path) + else: + self.color_palette = self.pascal_voc_palette + self.color_map = self.create_color_map() + + def get_palette_from_file(self, colors_path): + with open(colors_path, 'r') as file: + return [eval(line.strip()) for line in file.readlines()] + + def create_color_map(self): + classes = np.array(self.color_palette, dtype=np.uint8)[:, ::-1] # BGR to RGB + color_map = np.zeros((256, 1, 3), dtype=np.uint8) + classes_num = len(classes) + color_map[:classes_num, 0, :] = classes + color_map[classes_num:, 0, :] = np.random.uniform(0, 255, size=(256-classes_num, 3)) + return color_map + + def apply_color_map(self, input): + input_3d = cv2.merge([input, input, input]) + return cv2.LUT(input_3d, self.color_map) + + def overlay_masks(self, frame, objects): + # Visualizing result data over source image + return np.floor_divide(frame, 2) + np.floor_divide(self.apply_color_map(objects), 2) + + +def build_argparser(): + parser = ArgumentParser(add_help=False) + args = parser.add_argument_group('Options') + args.add_argument('-h', '--help', action='help', default=SUPPRESS, help='Show this help message and exit.') + args.add_argument('-m', '--model', help='Required. Path to an .xml file with a trained model.', + required=True, type=Path) + args.add_argument('-i', '--input', required=True, + help='Required. An input to process. The input must be a single image, ' + 'a folder of images, video file or camera id.') + args.add_argument('-d', '--device', default='CPU', type=str, + help='Optional. Specify the target device to infer on; CPU, GPU, FPGA, HDDL or MYRIAD is ' + 'acceptable. The demo will look for a suitable plugin for device specified. ' + 'Default value is CPU.') + + common_model_args = parser.add_argument_group('Common model options') + common_model_args.add_argument('-c', '--colors', type=Path, + help='Optional. Path to a text file containing colors for classes.') + + infer_args = parser.add_argument_group('Inference options') + infer_args.add_argument('-nireq', '--num_infer_requests', help='Optional. Number of infer requests.', + default=1, type=int) + infer_args.add_argument('-nstreams', '--num_streams', + help='Optional. Number of streams to use for inference on the CPU or/and GPU in throughput ' + 'mode (for HETERO and MULTI device cases use format ' + ':,: or just ).', + default='', type=str) + infer_args.add_argument('-nthreads', '--num_threads', default=None, type=int, + help='Optional. Number of threads to use for inference on CPU (including HETERO cases).') + + io_args = parser.add_argument_group('Input/output options') + io_args.add_argument('--loop', default=False, action='store_true', + help='Optional. Enable reading the input in a loop.') + io_args.add_argument('-o', '--output', required=False, + help='Optional. Name of output to save.') + io_args.add_argument('-limit', '--output_limit', required=False, default=1000, type=int, + help='Optional. Number of frames to store in output. ' + 'If -1 is set, all frames are stored.') + io_args.add_argument('--no_show', help="Optional. Don't show output.", action='store_true') + io_args.add_argument('-u', '--utilization_monitors', default='', type=str, + help='Optional. List of monitors to show initially.') + return parser + + +def get_plugin_configs(device, num_streams, num_threads): + config_user_specified = {} + + devices_nstreams = {} + if num_streams: + devices_nstreams = {device: num_streams for device in ['CPU', 'GPU'] if device in device} \ + if num_streams.isdigit() \ + else dict(device.split(':', 1) for device in num_streams.split(',')) + + if 'CPU' in device: + if num_threads is not None: + config_user_specified['CPU_THREADS_NUM'] = str(num_threads) + if 'CPU' in devices_nstreams: + config_user_specified['CPU_THROUGHPUT_STREAMS'] = devices_nstreams['CPU'] \ + if int(devices_nstreams['CPU']) > 0 \ + else 'CPU_THROUGHPUT_AUTO' + + if 'GPU' in device: + if 'GPU' in devices_nstreams: + config_user_specified['GPU_THROUGHPUT_STREAMS'] = devices_nstreams['GPU'] \ + if int(devices_nstreams['GPU']) > 0 \ + else 'GPU_THROUGHPUT_AUTO' + + return config_user_specified + + +def main(): + metrics = PerformanceMetrics() + args = build_argparser().parse_args() + + log.info('Initializing Inference Engine...') + ie = IECore() + + plugin_config = get_plugin_configs(args.device, args.num_streams, args.num_threads) + + log.info('Loading network...') + + model = SegmentationModel(ie, args.model) + + pipeline = AsyncPipeline(ie, model, plugin_config, device=args.device, max_num_requests=args.num_infer_requests) + + cap = open_images_capture(args.input, args.loop) + + next_frame_id = 0 + next_frame_id_to_show = 0 + + log.info('Starting inference...') + print("To close the application, press 'CTRL+C' here or switch to the output window and press ESC key") + + visualizer = Visualizer(args.colors) + presenter = None + video_writer = cv2.VideoWriter() + + while True: + if pipeline.is_ready(): + # Get new image/frame + start_time = perf_counter() + frame = cap.read() + if frame is None: + if next_frame_id == 0: + raise ValueError("Can't read an image from the input") + break + if next_frame_id == 0: + presenter = monitors.Presenter(args.utilization_monitors, 55, + (round(frame.shape[1] / 4), round(frame.shape[0] / 8))) + if args.output: + video_writer = cv2.VideoWriter(args.output, cv2.VideoWriter_fourcc(*'MJPG'), cap.fps(), + (frame.shape[1], frame.shape[0])) + if not video_writer.isOpened(): + raise RuntimeError("Can't open video writer") + # Submit for inference + pipeline.submit_data(frame, next_frame_id, {'frame': frame, 'start_time': start_time}) + next_frame_id += 1 + else: + # Wait for empty request + pipeline.await_any() + + if pipeline.callback_exceptions: + raise pipeline.callback_exceptions[0] + # Process all completed requests + results = pipeline.get_result(next_frame_id_to_show) + if results: + objects, frame_meta = results + frame = frame_meta['frame'] + start_time = frame_meta['start_time'] + + frame = visualizer.overlay_masks(frame, objects) + presenter.drawGraphs(frame) + metrics.update(start_time, frame) + + if video_writer.isOpened() and (args.output_limit == -1 or next_frame_id_to_show <= args.output_limit-1): + video_writer.write(frame) + + if not args.no_show: + cv2.imshow('Segmentation Results', frame) + key = cv2.waitKey(1) + if key == 27 or key == 'q' or key == 'Q': + break + presenter.handleKey(key) + next_frame_id_to_show += 1 + + pipeline.await_all() + # Process completed requests + while pipeline.has_completed_request(): + results = pipeline.get_result(next_frame_id_to_show) + if results: + objects, frame_meta = results + frame = frame_meta['frame'] + start_time = frame_meta['start_time'] + + frame = visualizer.overlay_masks(frame, objects) + presenter.drawGraphs(frame) + metrics.update(start_time, frame) + + if video_writer.isOpened(): + video_writer.write(frame) + + if not args.no_show: + cv2.imshow('Segmentation Results', frame) + key = cv2.waitKey(1) + next_frame_id_to_show += 1 + else: + break + + metrics.print_total() + print(presenter.reportMeans()) + + +if __name__ == '__main__': + sys.exit(main() or 0) diff --git a/demos/segmentation_demo/segmentation.gif b/demos/segmentation_demo/segmentation.gif new file mode 100644 index 00000000000..86e33924811 Binary files /dev/null and b/demos/segmentation_demo/segmentation.gif differ diff --git a/demos/segmentation_demo/segmentation_demo.h b/demos/segmentation_demo/segmentation_demo.h deleted file mode 100644 index d0b75c058bd..00000000000 --- a/demos/segmentation_demo/segmentation_demo.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (C) 2018-2019 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include -#include -#include -#include - -#include - -DEFINE_INPUT_FLAGS - -static const char help_message[] = "Print a usage message."; -static const char model_message[] = "Required. Path to an .xml file with a trained model."; -static const char target_device_message[] = "Optional. Specify the target device to infer on (the list of available devices is shown below). " - "Default value is CPU. Use \"-d HETERO:\" format to specify HETERO plugin. " - "The demo will look for a suitable plugin for a specified device."; -static const char custom_cldnn_message[] = "Required for GPU custom kernels. " - "Absolute path to the .xml file with the kernels descriptions."; -static const char custom_cpu_library_message[] = "Required for CPU custom layers. " - "Absolute path to a shared library with the kernels implementations."; -static const char config_message[] = "Path to the configuration file. Default vaelue: \"config\"."; -static const char delay_message[] = "Optional. Default is 1. Interval in milliseconds of waiting for a key to be " - "pressed. For a negative value the demo loads a model, opens an input and " - "exits."; -static const char no_show_message[] = "Optional. Do not visualize inference results."; -static const char utilization_monitors_message[] = "Optional. List of monitors to show initially."; - -DEFINE_string(c, "", custom_cldnn_message); -DEFINE_string(l, "", custom_cpu_library_message); -DEFINE_bool(h, false, help_message); -DEFINE_string(m, "", model_message); -DEFINE_string(d, "CPU", target_device_message); -DEFINE_string(config, "", config_message); -DEFINE_int32(delay, 1, delay_message); -DEFINE_bool(no_show, false, no_show_message); -DEFINE_string(u, "", utilization_monitors_message); - -static void showUsage() { - std::cout << std::endl; - std::cout << "segmentation_demo [OPTION]" << std::endl; - std::cout << "Options:" << std::endl; - std::cout << std::endl; - std::cout << " -h " << help_message << std::endl; - std::cout << " -i " << input_message << std::endl; - std::cout << " -loop " << loop_message << std::endl; - std::cout << " -m \"\" " << model_message << std::endl; - std::cout << " -l \"\" " << custom_cpu_library_message << std::endl; - std::cout << " Or" << std::endl; - std::cout << " -c \"\" " << custom_cldnn_message << std::endl; - std::cout << " -d \"\" " << target_device_message << std::endl; - std::cout << " -delay " << delay_message << std::endl; - std::cout << " -no_show " << no_show_message << std::endl; - std::cout << " -u " << utilization_monitors_message << std::endl; -} diff --git a/demos/segmentation_demo_async/models.lst b/demos/segmentation_demo_async/models.lst deleted file mode 100644 index b695bc84a77..00000000000 --- a/demos/segmentation_demo_async/models.lst +++ /dev/null @@ -1,4 +0,0 @@ -# This file can be used with the --list option of the model downloader. -deeplabv3 -road-segmentation-adas-???? -semantic-segmentation-adas-???? diff --git a/demos/python_demos/single_human_pose_estimation_demo/README.md b/demos/single_human_pose_estimation_demo/python/README.md similarity index 62% rename from demos/python_demos/single_human_pose_estimation_demo/README.md rename to demos/single_human_pose_estimation_demo/python/README.md index 753bb334a74..c547f3b7d64 100644 --- a/demos/python_demos/single_human_pose_estimation_demo/README.md +++ b/demos/single_human_pose_estimation_demo/python/README.md @@ -1,5 +1,7 @@ # Single Human Pose Estimation Demo (top-down pipeline) +![](./single_human_pose_estimation.gif) + This demo showcases top-down pipeline for human pose estimation on video or image. The task is to predict bboxes for every person on frame and then to predict a pose for every detected person. The pose may contain up to 17 keypoints: ears, eyes, nose, shoulders, elbows, wrists, hips, knees, and ankles. # How It Works @@ -10,30 +12,37 @@ On the start-up, the application reads command line parameters and loads detecti Running the application with the `-h` option yields the following usage message: ``` -usage: single_human_pose_estimation_demo.py [-h] -m_od MODEL_OD -m_hpe - MODEL_HPE [-i INPUT [INPUT ...]] - [-d DEVICE] +usage: single_human_pose_estimation_demo.py [-h] -m_od MODEL_OD -m_hpe MODEL_HPE + -i INPUT [--loop] [-o OUTPUT] + [-limit OUTPUT_LIMIT] [-d DEVICE] [--person_label PERSON_LABEL] [--no_show] [-u UTILIZATION_MONITORS] optional arguments: - -h, --help show this help message and exit + -h, --help Show this help message and exit. -m_od MODEL_OD, --model_od MODEL_OD - path to model of object detector in xml format + Required. Path to model of object detector in .xml format. -m_hpe MODEL_HPE, --model_hpe MODEL_HPE - path to model of human pose estimator in xml format - -i INPUT [INPUT ...], --input INPUT [INPUT ...] - path to video or image/images + Required. Path to model of human pose estimator in .xml format. + -i INPUT, --input INPUT + Required. An input to process. The input must be a single image, + a folder of images, video file or camera id. + --loop Optional. Enable reading the input in a loop. + -o OUTPUT, --output OUTPUT + Optional. Name of output to save. + -limit OUTPUT_LIMIT, --output_limit OUTPUT_LIMIT + Optional. Number of frames to store in output. + If -1 is set, all frames are stored. -d DEVICE, --device DEVICE - Specify the target to infer on CPU or GPU + Optional. Specify the target to infer on CPU or GPU. --person_label PERSON_LABEL - Label of class person for detector + Optional. Label of class person for detector. --no_show Optional. Do not display output. -u UTILIZATION_MONITORS, --utilization_monitors UTILIZATION_MONITORS Optional. List of monitors to show initially. ``` -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO Model Downloader or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). +To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). For example, to do inference on a CPU, run the following command: diff --git a/demos/python_demos/single_human_pose_estimation_demo/detector.py b/demos/single_human_pose_estimation_demo/python/detector.py similarity index 100% rename from demos/python_demos/single_human_pose_estimation_demo/detector.py rename to demos/single_human_pose_estimation_demo/python/detector.py diff --git a/demos/python_demos/single_human_pose_estimation_demo/estimator.py b/demos/single_human_pose_estimation_demo/python/estimator.py similarity index 98% rename from demos/python_demos/single_human_pose_estimation_demo/estimator.py rename to demos/single_human_pose_estimation_demo/python/estimator.py index f1510222b13..4213b098f6e 100644 --- a/demos/python_demos/single_human_pose_estimation_demo/estimator.py +++ b/demos/single_human_pose_estimation_demo/python/estimator.py @@ -37,8 +37,8 @@ def extract_keypoints(heatmap, min_confidence=-100): def affine_transform(pt, t): - transformed_point = np.dot(t, [pt[0], pt[1], 1.])[:2] - return transformed_point + transformed_point = np.dot(t, [pt[0], pt[1], 1.])[:2] + return transformed_point class TransformedCrop(object): diff --git a/demos/python_demos/single_human_pose_estimation_demo/models.lst b/demos/single_human_pose_estimation_demo/python/models.lst similarity index 79% rename from demos/python_demos/single_human_pose_estimation_demo/models.lst rename to demos/single_human_pose_estimation_demo/python/models.lst index 0c1bd99fafb..eda9f04215d 100644 --- a/demos/python_demos/single_human_pose_estimation_demo/models.lst +++ b/demos/single_human_pose_estimation_demo/python/models.lst @@ -1,10 +1,12 @@ # This file can be used with the --list option of the model downloader. +# The detector models for --model_od mobilenet-ssd pedestrian-and-vehicle-detector-adas-???? pedestrian-detection-adas-???? person-detection-retail-0013 person-vehicle-bike-detection-crossroad-???? -single-human-pose-estimation-???? ssd??? ssd_mobilenet_v?_* ssdlite_mobilenet_v2 +# The pose estimation models for --model_hpe +single-human-pose-estimation-???? diff --git a/demos/single_human_pose_estimation_demo/python/single_human_pose_estimation.gif b/demos/single_human_pose_estimation_demo/python/single_human_pose_estimation.gif new file mode 100644 index 00000000000..37181127d5b Binary files /dev/null and b/demos/single_human_pose_estimation_demo/python/single_human_pose_estimation.gif differ diff --git a/demos/python_demos/single_human_pose_estimation_demo/single_human_pose_estimation_demo.py b/demos/single_human_pose_estimation_demo/python/single_human_pose_estimation_demo.py similarity index 54% rename from demos/python_demos/single_human_pose_estimation_demo/single_human_pose_estimation_demo.py rename to demos/single_human_pose_estimation_demo/python/single_human_pose_estimation_demo.py index 11c3bbeebd4..e14c4741329 100755 --- a/demos/python_demos/single_human_pose_estimation_demo/single_human_pose_estimation_demo.py +++ b/demos/single_human_pose_estimation_demo/python/single_human_pose_estimation_demo.py @@ -10,66 +10,35 @@ from detector import Detector from estimator import HumanPoseEstimator -sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'common')) +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), 'common/python')) import monitors +from images_capture import open_images_capture def build_argparser(): parser = argparse.ArgumentParser() parser.add_argument("-m_od", "--model_od", type=str, required=True, - help="path to model of object detector in xml format") - + help="Required. Path to model of object detector in .xml format.") parser.add_argument("-m_hpe", "--model_hpe", type=str, required=True, - help="path to model of human pose estimator in xml format") - - parser.add_argument("-i", "--input", type=str, nargs='+', default='', help="path to video or image/images") + help="Required. Path to model of human pose estimator in .xml format.") + parser.add_argument("-i", "--input", required=True, + help="Required. An input to process. The input must be a single image, " + "a folder of images, video file or camera id.") + parser.add_argument("--loop", default=False, action="store_true", + help="Optional. Enable reading the input in a loop.") + parser.add_argument("-o", "--output", required=False, + help="Optional. Name of output to save.") + parser.add_argument("-limit", "--output_limit", required=False, default=1000, type=int, + help="Optional. Number of frames to store in output. " + "If -1 is set, all frames are stored.") parser.add_argument("-d", "--device", type=str, default='CPU', required=False, - help="Specify the target to infer on CPU or GPU") - parser.add_argument("--person_label", type=int, required=False, default=15, help="Label of class person for detector") + help="Optional. Specify the target to infer on CPU or GPU.") + parser.add_argument("--person_label", type=int, required=False, default=15, help="Optional. Label of class person for detector.") parser.add_argument("--no_show", help='Optional. Do not display output.', action='store_true') parser.add_argument("-u", "--utilization_monitors", default="", type=str, help="Optional. List of monitors to show initially.") return parser -class ImageReader(object): - def __init__(self, file_names): - self.file_names = file_names - self.max_idx = len(file_names) - - def __iter__(self): - self.idx = 0 - return self - - def __next__(self): - if self.idx == self.max_idx: - raise StopIteration - img = cv2.imread(self.file_names[self.idx], cv2.IMREAD_COLOR) - if img.size == 0: - raise IOError('Image {} cannot be read'.format(self.file_names[self.idx])) - self.idx += 1 - return img - - -class VideoReader(object): - def __init__(self, file_name): - try: - self.file_name = int(file_name[0]) - except: - self.file_name = file_name[0] - - - def __iter__(self): - self.cap = cv2.VideoCapture(self.file_name) - if not self.cap.isOpened(): - raise IOError('Video {} cannot be opened'.format(self.file_name)) - return self - - def __next__(self): - was_read, img = self.cap.read() - if not was_read: - raise StopIteration - return img - def run_demo(args): ie = IECore() @@ -79,14 +48,22 @@ def run_demo(args): single_human_pose_estimator = HumanPoseEstimator(ie, path_to_model_xml=args.model_hpe, device=args.device) - if args.input != '': - img = cv2.imread(args.input[0], cv2.IMREAD_COLOR) - frames_reader, delay = (VideoReader(args.input), 1) if img is None else (ImageReader(args.input), 0) - else: - raise ValueError('--input has to be set') - + cap = open_images_capture(args.input, args.loop) + frame = cap.read() + if frame is None: + raise RuntimeError("Can't read an image from the input") + delay = int(cap.get_type() in ('VIDEO', 'CAMERA')) + + video_writer = cv2.VideoWriter() + if args.output: + video_writer = cv2.VideoWriter(args.output, cv2.VideoWriter_fourcc(*'MJPG'), cap.fps(), + (frame.shape[1], frame.shape[0])) + if not video_writer.isOpened(): + raise RuntimeError("Can't open video writer") + + frames_processed = 0 presenter = monitors.Presenter(args.utilization_monitors, 25) - for frame in frames_reader: + while frame is not None: bboxes = detector_person.detect(frame) human_poses = [single_human_pose_estimator.estimate(frame, bbox) for bbox in bboxes] @@ -107,15 +84,21 @@ def run_demo(args): float(1 / (detector_person.infer_time + single_human_pose_estimator.infer_time * len(human_poses))), float(1 / single_human_pose_estimator.infer_time), float(1 / detector_person.infer_time)), (5, 15), cv2.FONT_HERSHEY_COMPLEX, 0.5, (0, 0, 200)) - if args.no_show: - continue - cv2.imshow('Human Pose Estimation Demo', frame) - key = cv2.waitKey(delay) - if key == 27: - break - presenter.handleKey(key) + + frames_processed += 1 + if video_writer.isOpened() and (args.output_limit == -1 or frames_processed <= args.output_limit): + video_writer.write(frame) + + if not args.no_show: + cv2.imshow('Human Pose Estimation Demo', frame) + key = cv2.waitKey(delay) + if key == 27: + break + presenter.handleKey(key) + frame = cap.read() print(presenter.reportMeans()) + if __name__ == "__main__": args = build_argparser().parse_args() run_demo(args) diff --git a/demos/smart_classroom_demo/CMakeLists.txt b/demos/smart_classroom_demo/cpp/CMakeLists.txt similarity index 76% rename from demos/smart_classroom_demo/CMakeLists.txt rename to demos/smart_classroom_demo/cpp/CMakeLists.txt index 877194d3fc6..2ea752f90e6 100644 --- a/demos/smart_classroom_demo/CMakeLists.txt +++ b/demos/smart_classroom_demo/cpp/CMakeLists.txt @@ -2,8 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 # -file (GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) -file (GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) +file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +file(GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) ie_add_sample(NAME smart_classroom_demo SOURCES ${SOURCES} diff --git a/demos/smart_classroom_demo/README.md b/demos/smart_classroom_demo/cpp/README.md similarity index 97% rename from demos/smart_classroom_demo/README.md rename to demos/smart_classroom_demo/cpp/README.md index 159f6d7a9de..51acb8ae7af 100644 --- a/demos/smart_classroom_demo/README.md +++ b/demos/smart_classroom_demo/cpp/README.md @@ -1,5 +1,7 @@ # Smart Classroom C++ Demo +![](./smart_classroom.gif) + The demo shows an example of joint usage of several neural networks to detect student actions (sitting, standing, raising hand for the `person-detection-action-recognition-0005` model and sitting, writing, raising hand, standing, turned around, lie on the desk for the `person-detection-action-recognition-0006` model) and recognize people by faces in the classroom environment. The demo uses Async API for action and face detection networks. It allows to parallelize execution of face recognition and detection: while face recognition is running on one accelerator, face and action detection could be performed on another. You can use a set of the following pre-trained models with the demo: * `face-detection-adas-0001`, which is a primary detection network for finding faces. @@ -10,7 +12,7 @@ a vector of facial landmarks for each detected face. * `person-detection-raisinghand-recognition-0001`, which is a detection network for finding students and simultaneously predicting their current actions (in contrast with the previous model, predicts only if a student raising hand or not). * `person-detection-action-recognition-teacher-0002`, which is a detection network for finding persons and simultaneously predicting their current actions. -For more information about the pre-trained models, refer to the [model documentation](../../models/intel/index.md). +For more information about the pre-trained models, refer to the [model documentation](../../../models/intel/index.md). ## How It Works @@ -83,7 +85,7 @@ Options: Running the application with the empty list of options yields an error message. -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). +To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). @@ -114,6 +116,6 @@ The demo uses OpenCV to display the resulting frame with labeled actions and fac > Other models may produce unexpected results on these devices. ## See Also -* [Using Open Model Zoo demos](../README.md) +* [Using Open Model Zoo demos](../../README.md) * [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) -* [Model Downloader](../../tools/downloader/README.md) +* [Model Downloader](../../../tools/downloader/README.md) diff --git a/demos/smart_classroom_demo/action_event_metrics.py b/demos/smart_classroom_demo/cpp/action_event_metrics.py similarity index 99% rename from demos/smart_classroom_demo/action_event_metrics.py rename to demos/smart_classroom_demo/cpp/action_event_metrics.py index 1af9d7f6367..746fe59e0a4 100644 --- a/demos/smart_classroom_demo/action_event_metrics.py +++ b/demos/smart_classroom_demo/cpp/action_event_metrics.py @@ -16,7 +16,6 @@ from collections import namedtuple from os.path import exists -import json import numpy as np from builtins import range from lxml import etree diff --git a/demos/smart_classroom_demo/create_list.py b/demos/smart_classroom_demo/cpp/create_list.py similarity index 100% rename from demos/smart_classroom_demo/create_list.py rename to demos/smart_classroom_demo/cpp/create_list.py diff --git a/demos/smart_classroom_demo/include/action_detector.hpp b/demos/smart_classroom_demo/cpp/include/action_detector.hpp similarity index 100% rename from demos/smart_classroom_demo/include/action_detector.hpp rename to demos/smart_classroom_demo/cpp/include/action_detector.hpp diff --git a/demos/smart_classroom_demo/include/actions.hpp b/demos/smart_classroom_demo/cpp/include/actions.hpp similarity index 100% rename from demos/smart_classroom_demo/include/actions.hpp rename to demos/smart_classroom_demo/cpp/include/actions.hpp diff --git a/demos/smart_classroom_demo/include/cnn.hpp b/demos/smart_classroom_demo/cpp/include/cnn.hpp similarity index 99% rename from demos/smart_classroom_demo/include/cnn.hpp rename to demos/smart_classroom_demo/cpp/include/cnn.hpp index 8d563f355e8..488dce5a6e8 100644 --- a/demos/smart_classroom_demo/include/cnn.hpp +++ b/demos/smart_classroom_demo/cpp/include/cnn.hpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include diff --git a/demos/smart_classroom_demo/include/detector.hpp b/demos/smart_classroom_demo/cpp/include/detector.hpp similarity index 100% rename from demos/smart_classroom_demo/include/detector.hpp rename to demos/smart_classroom_demo/cpp/include/detector.hpp diff --git a/demos/smart_classroom_demo/include/face_reid.hpp b/demos/smart_classroom_demo/cpp/include/face_reid.hpp similarity index 100% rename from demos/smart_classroom_demo/include/face_reid.hpp rename to demos/smart_classroom_demo/cpp/include/face_reid.hpp diff --git a/demos/smart_classroom_demo/include/logger.hpp b/demos/smart_classroom_demo/cpp/include/logger.hpp similarity index 100% rename from demos/smart_classroom_demo/include/logger.hpp rename to demos/smart_classroom_demo/cpp/include/logger.hpp diff --git a/demos/smart_classroom_demo/include/smart_classroom_demo.hpp b/demos/smart_classroom_demo/cpp/include/smart_classroom_demo.hpp similarity index 99% rename from demos/smart_classroom_demo/include/smart_classroom_demo.hpp rename to demos/smart_classroom_demo/cpp/include/smart_classroom_demo.hpp index b27e030f23c..a478d92cc02 100644 --- a/demos/smart_classroom_demo/include/smart_classroom_demo.hpp +++ b/demos/smart_classroom_demo/cpp/include/smart_classroom_demo.hpp @@ -9,7 +9,7 @@ #include #include -#include +#include DEFINE_INPUT_FLAGS diff --git a/demos/smart_classroom_demo/include/tracker.hpp b/demos/smart_classroom_demo/cpp/include/tracker.hpp similarity index 100% rename from demos/smart_classroom_demo/include/tracker.hpp rename to demos/smart_classroom_demo/cpp/include/tracker.hpp diff --git a/demos/smart_classroom_demo/main.cpp b/demos/smart_classroom_demo/cpp/main.cpp similarity index 99% rename from demos/smart_classroom_demo/main.cpp rename to demos/smart_classroom_demo/cpp/main.cpp index 82961769692..e97fc90fbf2 100644 --- a/demos/smart_classroom_demo/main.cpp +++ b/demos/smart_classroom_demo/cpp/main.cpp @@ -6,10 +6,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include diff --git a/demos/smart_classroom_demo/models.lst b/demos/smart_classroom_demo/cpp/models.lst similarity index 100% rename from demos/smart_classroom_demo/models.lst rename to demos/smart_classroom_demo/cpp/models.lst diff --git a/demos/smart_classroom_demo/cpp/smart_classroom.gif b/demos/smart_classroom_demo/cpp/smart_classroom.gif new file mode 100644 index 00000000000..30b17cf645d Binary files /dev/null and b/demos/smart_classroom_demo/cpp/smart_classroom.gif differ diff --git a/demos/smart_classroom_demo/src/action_detector.cpp b/demos/smart_classroom_demo/cpp/src/action_detector.cpp similarity index 100% rename from demos/smart_classroom_demo/src/action_detector.cpp rename to demos/smart_classroom_demo/cpp/src/action_detector.cpp diff --git a/demos/smart_classroom_demo/src/align_transform.cpp b/demos/smart_classroom_demo/cpp/src/align_transform.cpp similarity index 100% rename from demos/smart_classroom_demo/src/align_transform.cpp rename to demos/smart_classroom_demo/cpp/src/align_transform.cpp diff --git a/demos/smart_classroom_demo/src/cnn.cpp b/demos/smart_classroom_demo/cpp/src/cnn.cpp similarity index 100% rename from demos/smart_classroom_demo/src/cnn.cpp rename to demos/smart_classroom_demo/cpp/src/cnn.cpp diff --git a/demos/smart_classroom_demo/src/detector.cpp b/demos/smart_classroom_demo/cpp/src/detector.cpp similarity index 100% rename from demos/smart_classroom_demo/src/detector.cpp rename to demos/smart_classroom_demo/cpp/src/detector.cpp diff --git a/demos/smart_classroom_demo/src/logger.cpp b/demos/smart_classroom_demo/cpp/src/logger.cpp similarity index 100% rename from demos/smart_classroom_demo/src/logger.cpp rename to demos/smart_classroom_demo/cpp/src/logger.cpp diff --git a/demos/smart_classroom_demo/src/reid_gallery.cpp b/demos/smart_classroom_demo/cpp/src/reid_gallery.cpp similarity index 100% rename from demos/smart_classroom_demo/src/reid_gallery.cpp rename to demos/smart_classroom_demo/cpp/src/reid_gallery.cpp diff --git a/demos/smart_classroom_demo/src/tracker.cpp b/demos/smart_classroom_demo/cpp/src/tracker.cpp similarity index 100% rename from demos/smart_classroom_demo/src/tracker.cpp rename to demos/smart_classroom_demo/cpp/src/tracker.cpp diff --git a/demos/python_demos/sound_classification_demo/README.md b/demos/sound_classification_demo/python/README.md similarity index 76% rename from demos/python_demos/sound_classification_demo/README.md rename to demos/sound_classification_demo/python/README.md index 9a87968b002..87126c564ec 100644 --- a/demos/python_demos/sound_classification_demo/README.md +++ b/demos/sound_classification_demo/python/README.md @@ -4,19 +4,19 @@ Demo application for sound classification algorithm. ## How It Works -Upon the start-up the demo application reads command line parameters and loads a network to Inference engine. It uses only audiofiles in `wav` format. Audio should be converted to model's sample rate using `-sr/--samplerate` option, if sample rate of audio differs from sample rate of model (e.g. [AclNet](../../../models/public/aclnet/aclnet.md) expected 16kHz audio). After reading the audio, it is sliced into clips to fit model input (clips are allowed to overlap with `-ol/--overlap` option) and each clip is processed separately with its own prediction. +Upon the start-up the demo application reads command line parameters and loads a network to Inference engine. It uses only audio files in `wav` format. Audio should be converted to model's sample rate using `-sr/--samplerate` option, if sample rate of audio differs from sample rate of model (e.g. [AclNet](../../../models/public/aclnet/aclnet.md) expected 16kHz audio). After reading the audio, it is sliced into clips to fit model input (clips are allowed to overlap with `-ol/--overlap` option) and each clip is processed separately with its own prediction. ## Running Run the application with the `-h` option to see the usage message: ``` -python3 audio_classification_demo.py -h +python3 sound_classification_demo.py -h ``` The command yields the following usage message: ``` -usage: audio_classification_demo.py [-h] -i INPUT -m MODEL [-l CPU_EXTENSION] +usage: sound_classification_demo.py [-h] -i INPUT -m MODEL [-l CPU_EXTENSION] [-d DEVICE] [--labels LABELS] - [-sr SAMPLERATE] [-ol OVERLAP] + [-sr SAMPLE_RATE] [-ol OVERLAP] Options: -h, --help Show this help message and exit. @@ -34,7 +34,7 @@ Options: will look for a suitable plugin for device specified. Default value is CPU --labels LABELS Optional. Labels mapping file - -sr SAMPLERATE, --sample_rate SAMPLERATE + -sr SAMPLE_RATE, --sample_rate SAMPLE_RATE Optional. Set sample rate for audio input -ol OVERLAP, --overlap OVERLAP Optional. Set the overlapping between audio clip in @@ -43,10 +43,10 @@ Options: Running the application with the empty list of options yields the usage message given above and an error message. You can use the following command to do inference on GPU with a pre-trained sound classification model and conversion of input audio to samplerate of 16000: ``` -python3 audio_classification_demo.py -i /input_audio.wav -m /aclnet.xml -d GPU --samplerate 16000 +python3 sound_classification_demo.py -i /input_audio.wav -m /aclnet.xml -d GPU --samplerate 16000 ``` -To run the demo, you can use public or pre-trained models. You can download the pre-trained models with the OpenVINO [Model Downloader](../../../tools/downloader/README.md) or from [https://download.01.org/opencv/](https://download.01.org/opencv/). +To run the demo, you can use public or pre-trained models. You can download the pre-trained models with the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). diff --git a/demos/python_demos/sound_classification_demo/models.lst b/demos/sound_classification_demo/python/models.lst similarity index 100% rename from demos/python_demos/sound_classification_demo/models.lst rename to demos/sound_classification_demo/python/models.lst diff --git a/demos/python_demos/sound_classification_demo/sound_classification_demo.py b/demos/sound_classification_demo/python/sound_classification_demo.py similarity index 96% rename from demos/python_demos/sound_classification_demo/sound_classification_demo.py rename to demos/sound_classification_demo/python/sound_classification_demo.py index 5474dd9723e..d6e3dbf3cd7 100755 --- a/demos/python_demos/sound_classification_demo/sound_classification_demo.py +++ b/demos/sound_classification_demo/python/sound_classification_demo.py @@ -115,11 +115,7 @@ def read_wav(file, as_float=False): 2: np.int16, 4: np.int32 } - sampwidth_max = { - 1: 255, - 2: 2**15, - 4: 2**31 - } + with wave.open(file, "rb") as wav: params = wav.getparams() data = wav.readframes(params.nframes) @@ -130,10 +126,7 @@ def read_wav(file, as_float=False): .format(file, params.sampwidth)) data = np.reshape(data, (params.nframes, params.nchannels)) if as_float: - data = data / sampwidth_max[params.sampwidth] - if params.sampwidth == 1: - data -= 0.5 - data *= 2 + data = (data - np.mean(data)) / (np.std(data) + 1e-15) return params.framerate, data @@ -171,7 +164,7 @@ def main(): labels = [] if args.labels: with open(args.labels, "r") as file: - labels = [l.rstrip() for l in file.readlines()] + labels = [line.rstrip() for line in file.readlines()] batch_size, channels, one, length = input_shape if one != 1: diff --git a/demos/python_demos/speech_recognition_demo/.gitattributes b/demos/speech_recognition_demo/python/.gitattributes similarity index 100% rename from demos/python_demos/speech_recognition_demo/.gitattributes rename to demos/speech_recognition_demo/python/.gitattributes diff --git a/demos/speech_recognition_demo/python/README.md b/demos/speech_recognition_demo/python/README.md new file mode 100644 index 00000000000..854e33131e0 --- /dev/null +++ b/demos/speech_recognition_demo/python/README.md @@ -0,0 +1,112 @@ +# Speech Recognition Demo + +This demo demonstrates Automatic Speech Recognition (ASR) with a pretrained Mozilla\* DeepSpeech 0.8.2 model. + +It works with version 0.6.1 as well, and should also work with other models trained with Mozilla DeepSpeech 0.6.x/0.7.x/0.8.x with ASCII alphabets. + +## How It Works + +The application accepts + + * Mozilla\* DeepSpeech 0.8.2 neural network in Intermediate Representation (IR) format, + * n-gram language model file in kenlm quantized binary format, and + * an audio file in PCM WAV 16 kHz mono format. + +After computing audio features, running a neural network to get per-frame character probabilities, and CTC decoding, the demo prints the decoded text together with the timings of the processing stages. + +## Prerequisites + +The demo depends on the `ctcdecode_numpy` Python extension module, +which implements CTC decoding in C++ for faster decoding. +Please refer to [Open Model Zoo demos](../../README.md) for instructions +on how to build the extension module and prepare the environment for running the demo. +Alternatively, instead of using `cmake` you can run `python -m pip install .` inside `ctcdecode-numpy` directory to build and install `ctcdecode-numpy`. + +## Model preparation + +You can download and convert a pre-trained Mozilla\* DeepSpeech 0.8.2 or 0.6.1 model with +OpenVINO [Model Downloader](../../../tools/downloader/README.md) and the provided conversion scripts. +This is done with the following commands: +```shell +source /bin/setupvars.sh +/deployment_tools/open_model_zoo/tools/downloader/downloader.py --name mozilla-deepspeech-0.8.2 +/deployment_tools/open_model_zoo/tools/downloader/converter.py --name mozilla-deepspeech-0.8.2 +``` +or +```shell +source /bin/setupvars.sh +/deployment_tools/open_model_zoo/tools/downloader/downloader.py --name mozilla-deepspeech-0.6.1 +/deployment_tools/open_model_zoo/tools/downloader/converter.py --name mozilla-deepspeech-0.6.1 +``` +Please pay attention to the model license, **Mozilla Public License 2.0**. + +## Running Demo + +Run the application with `-h` option to see help message. +Here are the available command line options: + +``` +usage: speech_recognition_demo.py [-h] -i FILENAME [-d DEVICE] -m FILENAME + [-L FILENAME] -p NAME [-b N] [-c N] + [-l FILENAME] + +Speech recognition demo + +optional arguments: + -h, --help show this help message and exit + -i FILENAME, --input FILENAME + Path to an audio file in WAV PCM 16 kHz mono format + -d DEVICE, --device DEVICE + Optional. Specify the target device to infer on, for + example: CPU, GPU, FPGA, HDDL, MYRIAD or HETERO. The + sample will look for a suitable IE plugin for this + device. (default is CPU) + -m FILENAME, --model FILENAME + Path to an .xml file with a trained model (required) + -L FILENAME, --lm FILENAME + path to language model file (optional) + -p NAME, --profile NAME + Choose pre/post-processing profile: mds06x_en for + Mozilla DeepSpeech v0.6.x, mds07x_en or mds08x_en for + Mozilla DeepSpeech v0.7.x/x0.8.x, other: filename of a + YAML file (required) + -b N, --beam-width N Beam width for beam search in CTC decoder (default + 500) + -c N, --max-candidates N + Show top N (or less) candidates (default 1) + -l FILENAME, --cpu_extension FILENAME + Optional. Required for CPU custom layers. MKLDNN + (CPU)-targeted custom layers. Absolute path to a + shared library with the kernels implementations. +``` + +The typical command line is: + +```shell +pip install -r requirements.txt +source /bin/setupvars.sh + +python speech_recognition_demo.py \ + -p mds08x_en \ + -m /FP32/mozilla_deepspeech_0.8.2.xml \ + -L /deepspeech-0.8.2-models.kenlm \ + -i /audio.wav +``` + +For version 0.6.1 it is: + +```shell +python speech_recognition_demo.py \ + -p mds06x_en \ + -m /FP32/mozilla_deepspeech_0.6.1.xml \ + -L /lm.binary \ + -i /audio.wav +``` + +**Only 16-bit, 16 kHz, mono-channel WAVE audio files are supported.** + +An example audio file can be taken from `/deployment_tools/demo/how_are_you_doing.wav`. + +## Demo Output + +The application shows time taken by the initialization and processing stages, and the decoded text for the audio file. diff --git a/demos/speech_recognition_demo/python/ctcdecode-numpy/CMakeLists.txt b/demos/speech_recognition_demo/python/ctcdecode-numpy/CMakeLists.txt new file mode 100644 index 00000000000..4c0aa6cf19c --- /dev/null +++ b/demos/speech_recognition_demo/python/ctcdecode-numpy/CMakeLists.txt @@ -0,0 +1,59 @@ +# Copyright (C) 2020 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +# + +set(target_name ctcdecode_numpy_impl) + +file(GLOB_RECURSE HEADERS + "${CMAKE_CURRENT_SOURCE_DIR}/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp") +file(GLOB_RECURSE SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") + +source_group("include" FILES ${HEADERS}) +source_group("src" FILES ${SOURCES}) + +add_library(${target_name} MODULE ${HEADERS} ${SOURCES}) + +target_include_directories(${target_name} PRIVATE + ${PYTHON_INCLUDE_DIRS} ${NUMPY_INCLUDE_DIR} third_party/ThreadPool) +target_link_libraries(${target_name} ${PYTHON_LIBRARIES}) + +set_target_properties(${target_name} PROPERTIES + PREFIX "" + OUTPUT_NAME _impl +) + +if(WIN32) + set_target_properties(${target_name} PROPERTIES SUFFIX ".pyd") +endif() + +foreach(artifact IN ITEMS ARCHIVE LIBRARY PDB RUNTIME) + set_property(TARGET ${target_name} APPEND_STRING + PROPERTY "${artifact}_OUTPUT_DIRECTORY" "/ctcdecode_numpy") +endforeach() + +# SWIG-generated code causes some warnings; disable them. +if(COMPILER_IS_GCC_LIKE) + target_compile_options(${target_name} PRIVATE -Wno-narrowing) +elseif(MSVC) + target_compile_options(${target_name} PRIVATE + /wd4244 # Disable conversion warning = + /wd4838 # Disable conversion warning in aggregate or list initialization + ) +endif() + +# The Python files have to be in the same directory as the native module, +# because a non-namespace package (i.e., a package with an __init__.py file) +# has to have all of its modules in the same directory. +# So copy the Python files over. +# It would be preferable to use add_custom_command so that we don't try +# to copy files that are already up-to-date, but the output path depends +# on the current configuration, and add_custom_command doesn't support that. +add_custom_target(ctcdecode_numpy ALL + COMMAND "${CMAKE_COMMAND}" -E copy_if_different + "${CMAKE_CURRENT_SOURCE_DIR}/ctcdecode_numpy/__init__.py" + "${CMAKE_CURRENT_SOURCE_DIR}/ctcdecode_numpy/impl.py" + "$" + VERBATIM +) + +add_dependencies(ctcdecode_numpy ${target_name}) diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/LICENSE b/demos/speech_recognition_demo/python/ctcdecode-numpy/LICENSE similarity index 100% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/LICENSE rename to demos/speech_recognition_demo/python/ctcdecode-numpy/LICENSE diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/README.md b/demos/speech_recognition_demo/python/ctcdecode-numpy/README.md similarity index 68% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/README.md rename to demos/speech_recognition_demo/python/ctcdecode-numpy/README.md index 8f3e4718952..c3f191e27be 100644 --- a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/README.md +++ b/demos/speech_recognition_demo/python/ctcdecode-numpy/README.md @@ -8,10 +8,6 @@ KenLM dependency was removed due to licensing concerns, but can be restored manu yoklm subcomponent is a library for reading KenLM binary format. It supports KenLM binary format version 5, with quantization and trie with Bhiksha array representation. ## Installation -To build and install ctcdecode-numpy, go inside `ctcdecode-numpy/` directory and run: - -```shell -python -m pip install . -``` - -We recommended to activate a virtualenv environment before installation. +To build ctcdecode-numpy, please refer to [Open Model Zoo demos](../../../README.md#build-the-demo-applications) for instructions +on how to build the extension module and prepare the environment for running the demo. +Alternatively, instead of using `cmake` you can run `python -m pip install .` inside `ctcdecode-numpy` directory to build and install ctcdecode-numpy. diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/__init__.py b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/__init__.py similarity index 79% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/__init__.py rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/__init__.py index 689d4501cd4..49634e2fd92 100644 --- a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/__init__.py +++ b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/__init__.py @@ -12,9 +12,10 @@ class CTCBeamDecoder(object): def __init__(self, labels, model_path=None, alpha=0, beta=0, cutoff_top_n=40, cutoff_prob=1.0, beam_width=100, - num_processes=4, blank_id=0, log_probs_input=False, loader='yoklm'): + max_candidates_per_batch=None, num_processes=4, blank_id=0, log_probs_input=False, loader='yoklm'): self.cutoff_top_n = cutoff_top_n self._beam_width = beam_width + self._max_candidates_per_batch = max_candidates_per_batch self._scorer = None self._num_processes = num_processes self._labels = list(labels) @@ -32,12 +33,16 @@ def decode(self, probs, seq_lens=None): batch_size, max_seq_len = probs.shape[0], probs.shape[1] if seq_lens is None: seq_lens = np.full(batch_size, max_seq_len, dtype=np.int32) + max_candidates_per_batch = self._max_candidates_per_batch + if max_candidates_per_batch is None or max_candidates_per_batch > self._beam_width: + max_candidates_per_batch = self._beam_width if self._scorer is not None: output, timesteps, scores, out_seq_len = ctc_decode.numpy_beam_decode( probs, # batch_size x max_seq_lens x vocab_size seq_lens, # batch_size self._labels, # list(str) self._beam_width, + max_candidates_per_batch, self._num_processes, self._cutoff_prob, self.cutoff_top_n, @@ -51,16 +56,17 @@ def decode(self, probs, seq_lens=None): seq_lens, # batch_size self._labels, # list(str) self._beam_width, + max_candidates_per_batch, self._num_processes, self._cutoff_prob, self.cutoff_top_n, self._blank_id, self._log_probs, # log_input, bool ) - output.shape = (batch_size, self._beam_width, -1) - timesteps.shape = (batch_size, self._beam_width, -1) - scores.shape = (batch_size, self._beam_width) - out_seq_len.shape = (batch_size, self._beam_width) + output.shape = (batch_size, max_candidates_per_batch, -1) + timesteps.shape = (batch_size, max_candidates_per_batch, -1) + scores.shape = (batch_size, max_candidates_per_batch) + out_seq_len.shape = (batch_size, max_candidates_per_batch) return output, scores, timesteps, out_seq_len diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/binding.cpp b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/binding.cpp similarity index 76% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/binding.cpp rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/binding.cpp index 0675c18bb0d..ea343ec49bf 100644 --- a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/binding.cpp +++ b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/binding.cpp @@ -7,12 +7,13 @@ **********************************************************************/ #include -#include +#include #include +#include +#include #include +#include #include -#include -#include #include "scorer_yoklm.h" #include "scorer_base.h" @@ -26,7 +27,8 @@ void numpy_beam_decode( const float * probs, size_t batch_size, size_t max_frames, size_t num_classes, const int * seq_lens, size_t seq_lens_dim_batch, const std::vector labels, - size_t beam_size, + size_t beam_size, // limits candidates maintained inside beam search + size_t max_candidates_per_batch, // limits candidates returned from beam search size_t num_processes, float cutoff_prob, size_t cutoff_top_n, @@ -34,10 +36,11 @@ void numpy_beam_decode( bool log_input, void *scorer, // Output arrays (SWIG memory managed argout, malloc() allocator): - int ** tokens, size_t * tokens_dim, // to be reshaped to (batch_size, beam_size, -1) - int ** timesteps, size_t * timesteps_dim, // to be reshaped to (batch_size, beam_size, -1) - float ** scores, size_t * scores_dim, // to be reshaped to (batch_size, beam_size) - int ** tokens_lengths, size_t * tokens_lengths_dim) // to be reshaped to (batch_size, beam_size) + // (here cand_size = max(beam_size, max_candidates_per_batch) ) + int ** tokens, size_t * tokens_dim, // to be reshaped to (batch_size, cand_size, -1) + int ** timesteps, size_t * timesteps_dim, // to be reshaped to (batch_size, cand_size, -1) + float ** scores, size_t * scores_dim, // to be reshaped to (batch_size, cand_size) + int ** tokens_lengths, size_t * tokens_lengths_dim) // to be reshaped to (batch_size, cand_size) { ScorerBase *ext_scorer = NULL; if (scorer != NULL) { @@ -46,6 +49,10 @@ void numpy_beam_decode( if (seq_lens_dim_batch != batch_size) throw std::runtime_error("beam_decode: probs and seq_lens batch sizes differ"); + if (max_candidates_per_batch > beam_size) + max_candidates_per_batch = beam_size; + if (max_candidates_per_batch < 1) + throw std::runtime_error("numpy_beam_decode: max_candidates_per_batch must be at least 1"); std::vector > > probs_vec; probs_vec.reserve(batch_size); @@ -69,22 +76,27 @@ void numpy_beam_decode( ctc_beam_search_decoder_batch(probs_vec, labels, beam_size, num_processes, cutoff_prob, cutoff_top_n, blank_id, log_input, ext_scorer); + if (batch_results.size() != batch_size) + throw std::runtime_error("numpy_beam_decode: internal error: output batch size differs from input batch size"); + size_t max_len = 1; for (auto&& result_batch_entry : batch_results) { + size_t candidate_idx = 0; for (auto&& result_candidate : result_batch_entry) { + if (candidate_idx++ >= max_candidates_per_batch) + break; size_t len = result_candidate.second.tokens.size(); if (max_len < len) max_len = len; } } - if ((size_t)-1 / sizeof(**tokens) / batch_size / beam_size / max_len == 0) + if ((size_t)-1 / sizeof(**tokens) / batch_size / max_candidates_per_batch / max_len == 0) throw std::runtime_error("numpy_beam_decode: dimension of output arg \"tokens\" exceeds size_t"); - if ((size_t)-1 / sizeof(**timesteps) / batch_size / beam_size / max_len == 0) + if ((size_t)-1 / sizeof(**timesteps) / batch_size / max_candidates_per_batch / max_len == 0) throw std::runtime_error("numpy_beam_decode: dimension of output arg \"timesteps\" exceeds size_t"); - // TODO: memory consumption not limited here - *tokens_dim = *timesteps_dim = batch_size * beam_size * max_len; + *tokens_dim = *timesteps_dim = batch_size * max_candidates_per_batch * max_len; *tokens = (int *)malloc(sizeof(**tokens) * *tokens_dim); if (*tokens == 0) throw std::runtime_error("numpy_beam_decode: cannot malloc() tokens"); @@ -93,7 +105,7 @@ void numpy_beam_decode( if (*timesteps == 0) throw std::runtime_error("numpy_beam_decode: cannot malloc() timesteps"); - *scores_dim = *tokens_lengths_dim = batch_size * beam_size; + *scores_dim = *tokens_lengths_dim = batch_size * max_candidates_per_batch; *scores = (float *)malloc(sizeof(**scores) * *scores_dim); if (*scores == 0) throw std::runtime_error("numpy_beam_decode: cannot malloc() scores"); @@ -104,17 +116,24 @@ void numpy_beam_decode( for (size_t b = 0; b < batch_results.size(); b++) { std::vector >& results = batch_results[b]; - for (size_t p = 0; p < results.size(); p++) { - const size_t index_bp = b * beam_size + p; + size_t p = 0; + for (; p < results.size() && p < max_candidates_per_batch; p++) { + const size_t index_bp = b * max_candidates_per_batch + p; std::pair& n_path_result = results[p]; Output& output = n_path_result.second; for (size_t t = 0; t < output.tokens.size(); t++) { (*tokens)[index_bp * max_len + t] = output.tokens[t]; // fill output tokens (*timesteps)[index_bp * max_len + t] = output.timesteps[t]; } - (*scores)[index_bp] = n_path_result.first; + (*scores)[index_bp] = n_path_result.first; // scores are -log(p), so lower = better (*tokens_lengths)[index_bp] = output.tokens.size(); } + for (; p < max_candidates_per_batch; p++) { + const size_t index_bp = b * max_candidates_per_batch + p; + // fill the absent candidates with infitite scores and no tokens + (*scores)[index_bp] = std::numeric_limits::infinity(); + (*tokens_lengths)[index_bp] = 0; + } } } @@ -122,7 +141,8 @@ void numpy_beam_decode_no_lm( const float * probs, size_t batch_size, size_t max_frames, size_t num_classes, const int * seq_lens, size_t seq_lens_dim_batch, const std::vector labels, - size_t beam_size, + size_t beam_size, // limits candidates maintained inside beam search + size_t max_candidates_per_batch, // limits candidates returned from beam search size_t num_processes, float cutoff_prob, size_t cutoff_top_n, @@ -139,6 +159,7 @@ void numpy_beam_decode_no_lm( seq_lens, seq_lens_dim_batch, labels, beam_size, + max_candidates_per_batch, num_processes, cutoff_prob, cutoff_top_n, diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/binding.h b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/binding.h similarity index 86% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/binding.h rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/binding.h index 93619da6a9c..56ccd1bd83b 100644 --- a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/binding.h +++ b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/binding.h @@ -10,7 +10,8 @@ void numpy_beam_decode( const float * probs, size_t batch_size, size_t max_frames, size_t num_classes, const int * seq_lens, size_t seq_lens_dim_batch, const std::vector labels, - size_t beam_size, + size_t beam_size, // limits candidates maintained inside beam search + size_t max_candidates_per_batch, // limits candidates returned from beam search size_t num_processes, float cutoff_prob, size_t cutoff_top_n, @@ -27,7 +28,8 @@ void numpy_beam_decode_no_lm( const float * probs, size_t batch_size, size_t max_frames, size_t num_classes, const int * seq_lens, size_t seq_lens_dim_batch, const std::vector labels, - size_t beam_size, + size_t beam_size, // limits candidates maintained inside beam search + size_t max_candidates_per_batch, // limits candidates returned from beam search size_t num_processes, float cutoff_prob, size_t cutoff_top_n, diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/ctc_beam_search_decoder.cpp b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/ctc_beam_search_decoder.cpp similarity index 96% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/ctc_beam_search_decoder.cpp rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/ctc_beam_search_decoder.cpp index 64c693a4480..c16b3883e3c 100644 --- a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/ctc_beam_search_decoder.cpp +++ b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/ctc_beam_search_decoder.cpp @@ -42,7 +42,7 @@ std::vector> ctc_beam_search_decoder( // assign space id auto it = std::find(vocabulary.begin(), vocabulary.end(), " "); - int space_id = it - vocabulary.begin(); + int space_id = int(it - vocabulary.begin()); // if no space in vocabulary if ((size_t)space_id >= vocabulary.size()) { space_id = -2; @@ -94,7 +94,7 @@ std::vector> ctc_beam_search_decoder( continue; } // repeated character - if (c == prefix->character) { + if (c == size_t(prefix->character)) { prefix->log_prob_nb_cur = log_sum_exp( prefix->log_prob_nb_cur, log_prob_c + prefix->log_prob_nb_prev); } @@ -104,16 +104,16 @@ std::vector> ctc_beam_search_decoder( if (prefix_new != nullptr) { float log_p = -NUM_FLT_INF; - if (c == prefix->character && + if (c == size_t(prefix->character) && prefix->log_prob_b_prev > -NUM_FLT_INF) { log_p = log_prob_c + prefix->log_prob_b_prev; - } else if (c != prefix->character) { + } else if (c != size_t(prefix->character)) { log_p = log_prob_c + prefix->score; } // language model scoring if (ext_scorer != nullptr && - (c == space_id || ext_scorer->is_character_based())) { + (c == size_t(space_id) || ext_scorer->is_character_based())) { PathTrie *prefix_to_score = nullptr; // skip scoring the space if (ext_scorer->is_character_based()) { @@ -177,7 +177,7 @@ std::vector> ctc_beam_search_decoder( std::vector output; std::vector timesteps; prefixes[i]->get_path_vec(output, timesteps); - auto prefix_length = output.size(); + //auto prefix_length = output.size(); auto words = ext_scorer->split_labels(output); // remove word insert //approx_ctc = approx_ctc - prefix_length * ext_scorer->beta; diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/ctc_beam_search_decoder.h b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/ctc_beam_search_decoder.h similarity index 100% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/ctc_beam_search_decoder.h rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/ctc_beam_search_decoder.h diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/decoder_utils.cpp b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/decoder_utils.cpp similarity index 100% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/decoder_utils.cpp rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/decoder_utils.cpp diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/decoder_utils.h b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/decoder_utils.h similarity index 98% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/decoder_utils.h rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/decoder_utils.h index e5317b69b61..4c9677bc1e4 100644 --- a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/decoder_utils.h +++ b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/decoder_utils.h @@ -24,7 +24,7 @@ const float NUM_FLT_INF = std::numeric_limits::max(); const float NUM_FLT_MIN = std::numeric_limits::min(); -const float NUM_FLT_LOGE = 0.4342944819; +const float NUM_FLT_LOGE = 0.4342944819f; // inline function for validation check inline void check( diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/decoders.i b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/decoders.i similarity index 90% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/decoders.i rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/decoders.i index 097d9950f13..f29c0564522 100644 --- a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/decoders.i +++ b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/decoders.i @@ -1,9 +1,6 @@ /********************************************************************* * Copyright (c) 2020 Intel Corporation * SPDX-License-Identifier: Apache-2.0 -* -* This file is based in part on decoders.i from https://github.com/PaddlePaddle/DeepSpeech, -* commit 766e96e600795cea4187123b9ed76dcd250f2d04 on Jan 20, 2020, 17:09:14 UTC+8 **********************************************************************/ // After updating this file or its dependencies, please run diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/decoders_wrap.cpp b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/decoders_wrap.cpp similarity index 99% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/decoders_wrap.cpp rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/decoders_wrap.cpp index f69a1fcedfc..9a6bfe7f859 100644 --- a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/decoders_wrap.cpp +++ b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/decoders_wrap.cpp @@ -11149,19 +11149,20 @@ SWIGINTERN PyObject *_wrap_numpy_beam_decode(PyObject *SWIGUNUSEDPARM(self), PyO std::vector< std::string,std::allocator< std::string > > arg7 ; size_t arg8 ; size_t arg9 ; - float arg10 ; - size_t arg11 ; + size_t arg10 ; + float arg11 ; size_t arg12 ; - bool arg13 ; - void *arg14 = (void *) 0 ; - int **arg15 = (int **) 0 ; - size_t *arg16 = (size_t *) 0 ; - int **arg17 = (int **) 0 ; - size_t *arg18 = (size_t *) 0 ; - float **arg19 = (float **) 0 ; - size_t *arg20 = (size_t *) 0 ; - int **arg21 = (int **) 0 ; - size_t *arg22 = (size_t *) 0 ; + size_t arg13 ; + bool arg14 ; + void *arg15 = (void *) 0 ; + int **arg16 = (int **) 0 ; + size_t *arg17 = (size_t *) 0 ; + int **arg18 = (int **) 0 ; + size_t *arg19 = (size_t *) 0 ; + float **arg20 = (float **) 0 ; + size_t *arg21 = (size_t *) 0 ; + int **arg22 = (int **) 0 ; + size_t *arg23 = (size_t *) 0 ; PyArrayObject *array1 = NULL ; int is_new_object1 = 0 ; PyArrayObject *array5 = NULL ; @@ -11170,23 +11171,25 @@ SWIGINTERN PyObject *_wrap_numpy_beam_decode(PyObject *SWIGUNUSEDPARM(self), PyO int ecode8 = 0 ; size_t val9 ; int ecode9 = 0 ; - float val10 ; + size_t val10 ; int ecode10 = 0 ; - size_t val11 ; + float val11 ; int ecode11 = 0 ; size_t val12 ; int ecode12 = 0 ; - bool val13 ; + size_t val13 ; int ecode13 = 0 ; - int res14 ; - int *data_temp15 = NULL ; - size_t dim_temp15 ; - int *data_temp17 = NULL ; - size_t dim_temp17 ; - float *data_temp19 = NULL ; - size_t dim_temp19 ; - int *data_temp21 = NULL ; - size_t dim_temp21 ; + bool val14 ; + int ecode14 = 0 ; + int res15 ; + int *data_temp16 = NULL ; + size_t dim_temp16 ; + int *data_temp18 = NULL ; + size_t dim_temp18 ; + float *data_temp20 = NULL ; + size_t dim_temp20 ; + int *data_temp22 = NULL ; + size_t dim_temp22 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; @@ -11197,24 +11200,25 @@ SWIGINTERN PyObject *_wrap_numpy_beam_decode(PyObject *SWIGUNUSEDPARM(self), PyO PyObject * obj7 = 0 ; PyObject * obj8 = 0 ; PyObject * obj9 = 0 ; + PyObject * obj10 = 0 ; { - arg15 = &data_temp15; - arg16 = &dim_temp15; + arg16 = &data_temp16; + arg17 = &dim_temp16; } { - arg17 = &data_temp17; - arg18 = &dim_temp17; + arg18 = &data_temp18; + arg19 = &dim_temp18; } { - arg19 = &data_temp19; - arg20 = &dim_temp19; + arg20 = &data_temp20; + arg21 = &dim_temp20; } { - arg21 = &data_temp21; - arg22 = &dim_temp21; + arg22 = &data_temp22; + arg23 = &dim_temp22; } - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:numpy_beam_decode",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOO:numpy_beam_decode",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10)) SWIG_fail; { npy_intp size[3] = { -1, -1, -1 @@ -11259,45 +11263,50 @@ SWIGINTERN PyObject *_wrap_numpy_beam_decode(PyObject *SWIGUNUSEDPARM(self), PyO SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "numpy_beam_decode" "', argument " "9"" of type '" "size_t""'"); } arg9 = static_cast< size_t >(val9); - ecode10 = SWIG_AsVal_float(obj5, &val10); + ecode10 = SWIG_AsVal_size_t(obj5, &val10); if (!SWIG_IsOK(ecode10)) { - SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "numpy_beam_decode" "', argument " "10"" of type '" "float""'"); + SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "numpy_beam_decode" "', argument " "10"" of type '" "size_t""'"); } - arg10 = static_cast< float >(val10); - ecode11 = SWIG_AsVal_size_t(obj6, &val11); + arg10 = static_cast< size_t >(val10); + ecode11 = SWIG_AsVal_float(obj6, &val11); if (!SWIG_IsOK(ecode11)) { - SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "numpy_beam_decode" "', argument " "11"" of type '" "size_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "numpy_beam_decode" "', argument " "11"" of type '" "float""'"); } - arg11 = static_cast< size_t >(val11); + arg11 = static_cast< float >(val11); ecode12 = SWIG_AsVal_size_t(obj7, &val12); if (!SWIG_IsOK(ecode12)) { SWIG_exception_fail(SWIG_ArgError(ecode12), "in method '" "numpy_beam_decode" "', argument " "12"" of type '" "size_t""'"); } arg12 = static_cast< size_t >(val12); - ecode13 = SWIG_AsVal_bool(obj8, &val13); + ecode13 = SWIG_AsVal_size_t(obj8, &val13); if (!SWIG_IsOK(ecode13)) { - SWIG_exception_fail(SWIG_ArgError(ecode13), "in method '" "numpy_beam_decode" "', argument " "13"" of type '" "bool""'"); + SWIG_exception_fail(SWIG_ArgError(ecode13), "in method '" "numpy_beam_decode" "', argument " "13"" of type '" "size_t""'"); } - arg13 = static_cast< bool >(val13); - res14 = SWIG_ConvertPtr(obj9,SWIG_as_voidptrptr(&arg14), 0, 0); - if (!SWIG_IsOK(res14)) { - SWIG_exception_fail(SWIG_ArgError(res14), "in method '" "numpy_beam_decode" "', argument " "14"" of type '" "void *""'"); + arg13 = static_cast< size_t >(val13); + ecode14 = SWIG_AsVal_bool(obj9, &val14); + if (!SWIG_IsOK(ecode14)) { + SWIG_exception_fail(SWIG_ArgError(ecode14), "in method '" "numpy_beam_decode" "', argument " "14"" of type '" "bool""'"); + } + arg14 = static_cast< bool >(val14); + res15 = SWIG_ConvertPtr(obj10,SWIG_as_voidptrptr(&arg15), 0, 0); + if (!SWIG_IsOK(res15)) { + SWIG_exception_fail(SWIG_ArgError(res15), "in method '" "numpy_beam_decode" "', argument " "15"" of type '" "void *""'"); } - numpy_beam_decode((float const *)arg1,arg2,arg3,arg4,(int const *)arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17,arg18,arg19,arg20,arg21,arg22); + numpy_beam_decode((float const *)arg1,arg2,arg3,arg4,(int const *)arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17,arg18,arg19,arg20,arg21,arg22,arg23); resultobj = SWIG_Py_Void(); { npy_intp dims[1] = { - *arg16 + *arg17 }; - PyObject* obj = PyArray_SimpleNewFromData(1, dims, NPY_INT, (void*)(*arg15)); + PyObject* obj = PyArray_SimpleNewFromData(1, dims, NPY_INT, (void*)(*arg16)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; #ifdef SWIGPY_USE_CAPSULE - PyObject* cap = PyCapsule_New((void*)(*arg15), SWIGPY_CAPSULE_NAME, free_cap); + PyObject* cap = PyCapsule_New((void*)(*arg16), SWIGPY_CAPSULE_NAME, free_cap); #else - PyObject* cap = PyCObject_FromVoidPtr((void*)(*arg15), free); + PyObject* cap = PyCObject_FromVoidPtr((void*)(*arg16), free); #endif #if NPY_API_VERSION < 0x00000007 @@ -11310,17 +11319,17 @@ SWIGINTERN PyObject *_wrap_numpy_beam_decode(PyObject *SWIGUNUSEDPARM(self), PyO } { npy_intp dims[1] = { - *arg18 + *arg19 }; - PyObject* obj = PyArray_SimpleNewFromData(1, dims, NPY_INT, (void*)(*arg17)); + PyObject* obj = PyArray_SimpleNewFromData(1, dims, NPY_INT, (void*)(*arg18)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; #ifdef SWIGPY_USE_CAPSULE - PyObject* cap = PyCapsule_New((void*)(*arg17), SWIGPY_CAPSULE_NAME, free_cap); + PyObject* cap = PyCapsule_New((void*)(*arg18), SWIGPY_CAPSULE_NAME, free_cap); #else - PyObject* cap = PyCObject_FromVoidPtr((void*)(*arg17), free); + PyObject* cap = PyCObject_FromVoidPtr((void*)(*arg18), free); #endif #if NPY_API_VERSION < 0x00000007 @@ -11333,17 +11342,17 @@ SWIGINTERN PyObject *_wrap_numpy_beam_decode(PyObject *SWIGUNUSEDPARM(self), PyO } { npy_intp dims[1] = { - *arg20 + *arg21 }; - PyObject* obj = PyArray_SimpleNewFromData(1, dims, NPY_FLOAT, (void*)(*arg19)); + PyObject* obj = PyArray_SimpleNewFromData(1, dims, NPY_FLOAT, (void*)(*arg20)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; #ifdef SWIGPY_USE_CAPSULE - PyObject* cap = PyCapsule_New((void*)(*arg19), SWIGPY_CAPSULE_NAME, free_cap); + PyObject* cap = PyCapsule_New((void*)(*arg20), SWIGPY_CAPSULE_NAME, free_cap); #else - PyObject* cap = PyCObject_FromVoidPtr((void*)(*arg19), free); + PyObject* cap = PyCObject_FromVoidPtr((void*)(*arg20), free); #endif #if NPY_API_VERSION < 0x00000007 @@ -11356,17 +11365,17 @@ SWIGINTERN PyObject *_wrap_numpy_beam_decode(PyObject *SWIGUNUSEDPARM(self), PyO } { npy_intp dims[1] = { - *arg22 + *arg23 }; - PyObject* obj = PyArray_SimpleNewFromData(1, dims, NPY_INT, (void*)(*arg21)); + PyObject* obj = PyArray_SimpleNewFromData(1, dims, NPY_INT, (void*)(*arg22)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; #ifdef SWIGPY_USE_CAPSULE - PyObject* cap = PyCapsule_New((void*)(*arg21), SWIGPY_CAPSULE_NAME, free_cap); + PyObject* cap = PyCapsule_New((void*)(*arg22), SWIGPY_CAPSULE_NAME, free_cap); #else - PyObject* cap = PyCObject_FromVoidPtr((void*)(*arg21), free); + PyObject* cap = PyCObject_FromVoidPtr((void*)(*arg22), free); #endif #if NPY_API_VERSION < 0x00000007 @@ -11418,18 +11427,19 @@ SWIGINTERN PyObject *_wrap_numpy_beam_decode_no_lm(PyObject *SWIGUNUSEDPARM(self std::vector< std::string,std::allocator< std::string > > arg7 ; size_t arg8 ; size_t arg9 ; - float arg10 ; - size_t arg11 ; + size_t arg10 ; + float arg11 ; size_t arg12 ; - bool arg13 ; - int **arg14 = (int **) 0 ; - size_t *arg15 = (size_t *) 0 ; - int **arg16 = (int **) 0 ; - size_t *arg17 = (size_t *) 0 ; - float **arg18 = (float **) 0 ; - size_t *arg19 = (size_t *) 0 ; - int **arg20 = (int **) 0 ; - size_t *arg21 = (size_t *) 0 ; + size_t arg13 ; + bool arg14 ; + int **arg15 = (int **) 0 ; + size_t *arg16 = (size_t *) 0 ; + int **arg17 = (int **) 0 ; + size_t *arg18 = (size_t *) 0 ; + float **arg19 = (float **) 0 ; + size_t *arg20 = (size_t *) 0 ; + int **arg21 = (int **) 0 ; + size_t *arg22 = (size_t *) 0 ; PyArrayObject *array1 = NULL ; int is_new_object1 = 0 ; PyArrayObject *array5 = NULL ; @@ -11438,22 +11448,24 @@ SWIGINTERN PyObject *_wrap_numpy_beam_decode_no_lm(PyObject *SWIGUNUSEDPARM(self int ecode8 = 0 ; size_t val9 ; int ecode9 = 0 ; - float val10 ; + size_t val10 ; int ecode10 = 0 ; - size_t val11 ; + float val11 ; int ecode11 = 0 ; size_t val12 ; int ecode12 = 0 ; - bool val13 ; + size_t val13 ; int ecode13 = 0 ; - int *data_temp14 = NULL ; - size_t dim_temp14 ; - int *data_temp16 = NULL ; - size_t dim_temp16 ; - float *data_temp18 = NULL ; - size_t dim_temp18 ; - int *data_temp20 = NULL ; - size_t dim_temp20 ; + bool val14 ; + int ecode14 = 0 ; + int *data_temp15 = NULL ; + size_t dim_temp15 ; + int *data_temp17 = NULL ; + size_t dim_temp17 ; + float *data_temp19 = NULL ; + size_t dim_temp19 ; + int *data_temp21 = NULL ; + size_t dim_temp21 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; @@ -11463,24 +11475,25 @@ SWIGINTERN PyObject *_wrap_numpy_beam_decode_no_lm(PyObject *SWIGUNUSEDPARM(self PyObject * obj6 = 0 ; PyObject * obj7 = 0 ; PyObject * obj8 = 0 ; + PyObject * obj9 = 0 ; { - arg14 = &data_temp14; - arg15 = &dim_temp14; + arg15 = &data_temp15; + arg16 = &dim_temp15; } { - arg16 = &data_temp16; - arg17 = &dim_temp16; + arg17 = &data_temp17; + arg18 = &dim_temp17; } { - arg18 = &data_temp18; - arg19 = &dim_temp18; + arg19 = &data_temp19; + arg20 = &dim_temp19; } { - arg20 = &data_temp20; - arg21 = &dim_temp20; + arg21 = &data_temp21; + arg22 = &dim_temp21; } - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:numpy_beam_decode_no_lm",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:numpy_beam_decode_no_lm",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; { npy_intp size[3] = { -1, -1, -1 @@ -11525,41 +11538,46 @@ SWIGINTERN PyObject *_wrap_numpy_beam_decode_no_lm(PyObject *SWIGUNUSEDPARM(self SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "numpy_beam_decode_no_lm" "', argument " "9"" of type '" "size_t""'"); } arg9 = static_cast< size_t >(val9); - ecode10 = SWIG_AsVal_float(obj5, &val10); + ecode10 = SWIG_AsVal_size_t(obj5, &val10); if (!SWIG_IsOK(ecode10)) { - SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "numpy_beam_decode_no_lm" "', argument " "10"" of type '" "float""'"); + SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "numpy_beam_decode_no_lm" "', argument " "10"" of type '" "size_t""'"); } - arg10 = static_cast< float >(val10); - ecode11 = SWIG_AsVal_size_t(obj6, &val11); + arg10 = static_cast< size_t >(val10); + ecode11 = SWIG_AsVal_float(obj6, &val11); if (!SWIG_IsOK(ecode11)) { - SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "numpy_beam_decode_no_lm" "', argument " "11"" of type '" "size_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "numpy_beam_decode_no_lm" "', argument " "11"" of type '" "float""'"); } - arg11 = static_cast< size_t >(val11); + arg11 = static_cast< float >(val11); ecode12 = SWIG_AsVal_size_t(obj7, &val12); if (!SWIG_IsOK(ecode12)) { SWIG_exception_fail(SWIG_ArgError(ecode12), "in method '" "numpy_beam_decode_no_lm" "', argument " "12"" of type '" "size_t""'"); } arg12 = static_cast< size_t >(val12); - ecode13 = SWIG_AsVal_bool(obj8, &val13); + ecode13 = SWIG_AsVal_size_t(obj8, &val13); if (!SWIG_IsOK(ecode13)) { - SWIG_exception_fail(SWIG_ArgError(ecode13), "in method '" "numpy_beam_decode_no_lm" "', argument " "13"" of type '" "bool""'"); + SWIG_exception_fail(SWIG_ArgError(ecode13), "in method '" "numpy_beam_decode_no_lm" "', argument " "13"" of type '" "size_t""'"); + } + arg13 = static_cast< size_t >(val13); + ecode14 = SWIG_AsVal_bool(obj9, &val14); + if (!SWIG_IsOK(ecode14)) { + SWIG_exception_fail(SWIG_ArgError(ecode14), "in method '" "numpy_beam_decode_no_lm" "', argument " "14"" of type '" "bool""'"); } - arg13 = static_cast< bool >(val13); - numpy_beam_decode_no_lm((float const *)arg1,arg2,arg3,arg4,(int const *)arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17,arg18,arg19,arg20,arg21); + arg14 = static_cast< bool >(val14); + numpy_beam_decode_no_lm((float const *)arg1,arg2,arg3,arg4,(int const *)arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17,arg18,arg19,arg20,arg21,arg22); resultobj = SWIG_Py_Void(); { npy_intp dims[1] = { - *arg15 + *arg16 }; - PyObject* obj = PyArray_SimpleNewFromData(1, dims, NPY_INT, (void*)(*arg14)); + PyObject* obj = PyArray_SimpleNewFromData(1, dims, NPY_INT, (void*)(*arg15)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; #ifdef SWIGPY_USE_CAPSULE - PyObject* cap = PyCapsule_New((void*)(*arg14), SWIGPY_CAPSULE_NAME, free_cap); + PyObject* cap = PyCapsule_New((void*)(*arg15), SWIGPY_CAPSULE_NAME, free_cap); #else - PyObject* cap = PyCObject_FromVoidPtr((void*)(*arg14), free); + PyObject* cap = PyCObject_FromVoidPtr((void*)(*arg15), free); #endif #if NPY_API_VERSION < 0x00000007 @@ -11572,17 +11590,17 @@ SWIGINTERN PyObject *_wrap_numpy_beam_decode_no_lm(PyObject *SWIGUNUSEDPARM(self } { npy_intp dims[1] = { - *arg17 + *arg18 }; - PyObject* obj = PyArray_SimpleNewFromData(1, dims, NPY_INT, (void*)(*arg16)); + PyObject* obj = PyArray_SimpleNewFromData(1, dims, NPY_INT, (void*)(*arg17)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; #ifdef SWIGPY_USE_CAPSULE - PyObject* cap = PyCapsule_New((void*)(*arg16), SWIGPY_CAPSULE_NAME, free_cap); + PyObject* cap = PyCapsule_New((void*)(*arg17), SWIGPY_CAPSULE_NAME, free_cap); #else - PyObject* cap = PyCObject_FromVoidPtr((void*)(*arg16), free); + PyObject* cap = PyCObject_FromVoidPtr((void*)(*arg17), free); #endif #if NPY_API_VERSION < 0x00000007 @@ -11595,17 +11613,17 @@ SWIGINTERN PyObject *_wrap_numpy_beam_decode_no_lm(PyObject *SWIGUNUSEDPARM(self } { npy_intp dims[1] = { - *arg19 + *arg20 }; - PyObject* obj = PyArray_SimpleNewFromData(1, dims, NPY_FLOAT, (void*)(*arg18)); + PyObject* obj = PyArray_SimpleNewFromData(1, dims, NPY_FLOAT, (void*)(*arg19)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; #ifdef SWIGPY_USE_CAPSULE - PyObject* cap = PyCapsule_New((void*)(*arg18), SWIGPY_CAPSULE_NAME, free_cap); + PyObject* cap = PyCapsule_New((void*)(*arg19), SWIGPY_CAPSULE_NAME, free_cap); #else - PyObject* cap = PyCObject_FromVoidPtr((void*)(*arg18), free); + PyObject* cap = PyCObject_FromVoidPtr((void*)(*arg19), free); #endif #if NPY_API_VERSION < 0x00000007 @@ -11618,17 +11636,17 @@ SWIGINTERN PyObject *_wrap_numpy_beam_decode_no_lm(PyObject *SWIGUNUSEDPARM(self } { npy_intp dims[1] = { - *arg21 + *arg22 }; - PyObject* obj = PyArray_SimpleNewFromData(1, dims, NPY_INT, (void*)(*arg20)); + PyObject* obj = PyArray_SimpleNewFromData(1, dims, NPY_INT, (void*)(*arg21)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; #ifdef SWIGPY_USE_CAPSULE - PyObject* cap = PyCapsule_New((void*)(*arg20), SWIGPY_CAPSULE_NAME, free_cap); + PyObject* cap = PyCapsule_New((void*)(*arg21), SWIGPY_CAPSULE_NAME, free_cap); #else - PyObject* cap = PyCObject_FromVoidPtr((void*)(*arg20), free); + PyObject* cap = PyCObject_FromVoidPtr((void*)(*arg21), free); #endif #if NPY_API_VERSION < 0x00000007 diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/impl.py b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/impl.py similarity index 97% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/impl.py rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/impl.py index c98fdebb6b7..9f4e1c0c23e 100644 --- a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/impl.py +++ b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/impl.py @@ -462,12 +462,12 @@ def get_log_cond_prob(self, words): ScorerYoklm_swigregister(ScorerYoklm) -def numpy_beam_decode(probs, seq_lens, labels, beam_size, num_processes, cutoff_prob, cutoff_top_n, blank_id, log_input, scorer): - return _impl.numpy_beam_decode(probs, seq_lens, labels, beam_size, num_processes, cutoff_prob, cutoff_top_n, blank_id, log_input, scorer) +def numpy_beam_decode(probs, seq_lens, labels, beam_size, max_candidates_per_batch, num_processes, cutoff_prob, cutoff_top_n, blank_id, log_input, scorer): + return _impl.numpy_beam_decode(probs, seq_lens, labels, beam_size, max_candidates_per_batch, num_processes, cutoff_prob, cutoff_top_n, blank_id, log_input, scorer) numpy_beam_decode = _impl.numpy_beam_decode -def numpy_beam_decode_no_lm(probs, seq_lens, labels, beam_size, num_processes, cutoff_prob, cutoff_top_n, blank_id, log_input): - return _impl.numpy_beam_decode_no_lm(probs, seq_lens, labels, beam_size, num_processes, cutoff_prob, cutoff_top_n, blank_id, log_input) +def numpy_beam_decode_no_lm(probs, seq_lens, labels, beam_size, max_candidates_per_batch, num_processes, cutoff_prob, cutoff_top_n, blank_id, log_input): + return _impl.numpy_beam_decode_no_lm(probs, seq_lens, labels, beam_size, max_candidates_per_batch, num_processes, cutoff_prob, cutoff_top_n, blank_id, log_input) numpy_beam_decode_no_lm = _impl.numpy_beam_decode_no_lm def create_scorer_yoklm(alpha, beta, lm_path, labels): diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/numpy.i b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/numpy.i similarity index 100% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/numpy.i rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/numpy.i diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/output.h b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/output.h similarity index 100% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/output.h rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/output.h diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/path_trie.cpp b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/path_trie.cpp similarity index 98% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/path_trie.cpp rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/path_trie.cpp index e1ae77b45b9..5585a54e0f9 100644 --- a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/path_trie.cpp +++ b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/path_trie.cpp @@ -23,6 +23,7 @@ PathTrie::PathTrie() { log_prob_nb_cur = -NUM_FLT_INF; log_prob_c = -NUM_FLT_INF; score = -NUM_FLT_INF; + approx_ctc = -NUM_FLT_INF; ROOT_ = -1; character = ROOT_; @@ -32,6 +33,7 @@ PathTrie::PathTrie() { dictionary_ = nullptr; has_dictionary_ = false; + dictionary_state_ = {}; } PathTrie::~PathTrie() { diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/path_trie.h b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/path_trie.h similarity index 100% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/path_trie.h rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/path_trie.h diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/scorer_base.cpp b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/scorer_base.cpp similarity index 97% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/scorer_base.cpp rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/scorer_base.cpp index 041fc101a37..468acf2b050 100644 --- a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/scorer_base.cpp +++ b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/scorer_base.cpp @@ -110,7 +110,7 @@ std::vector ScorerBase::make_ngram(PathTrie* prefix) { PathTrie* current_node = prefix; PathTrie* new_node = nullptr; - for (int order = 0; order < max_order_; order++) { + for (size_t order = 0; order < max_order_; order++) { std::vector prefix_vec; std::vector prefix_steps; @@ -128,7 +128,7 @@ std::vector ScorerBase::make_ngram(PathTrie* prefix) { if (new_node->character == -1) { // No more spaces, but still need order - for (int i = 0; i < max_order_ - order - 1; i++) { + for (size_t i = 0; i < max_order_ - order - 1; i++) { ngram.push_back(START_TOKEN); } break; diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/scorer_base.h b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/scorer_base.h similarity index 100% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/scorer_base.h rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/scorer_base.h diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/scorer_yoklm.cpp b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/scorer_yoklm.cpp similarity index 100% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/scorer_yoklm.cpp rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/scorer_yoklm.cpp diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/scorer_yoklm.h b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/scorer_yoklm.h similarity index 100% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/scorer_yoklm.h rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/scorer_yoklm.h diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/word_prefix_set.cpp b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/word_prefix_set.cpp similarity index 94% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/word_prefix_set.cpp rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/word_prefix_set.cpp index 1f6925fded3..06b4839bcb1 100644 --- a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/word_prefix_set.cpp +++ b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/word_prefix_set.cpp @@ -29,10 +29,12 @@ size_t WordPrefixSet::add_words(const std::vector >& words) { std::sort(word_ptrs.begin(), word_ptrs.end(), lex_less); // Deduplicate - std::unique(word_ptrs.begin(), word_ptrs.end(), int_word_equal); + auto last_it = std::unique(word_ptrs.begin(), word_ptrs.end(), int_word_equal); + word_ptrs.erase(last_it, word_ptrs.end()); - trie_chars_.empty(); - trie_starts_.empty(); + trie_chars_.clear(); + trie_starts_.clear(); + trie_weights_.clear(); // Go through the sorted list, and update children lists at every layer of trie. // The new child may only be the last child in each list. diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/word_prefix_set.h b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/word_prefix_set.h similarity index 100% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/word_prefix_set.h rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/word_prefix_set.h diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/kenlm_v5_loader.cpp b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/kenlm_v5_loader.cpp similarity index 98% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/kenlm_v5_loader.cpp rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/kenlm_v5_loader.cpp index 0f31d8eb432..a144ddf01d0 100644 --- a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/kenlm_v5_loader.cpp +++ b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/kenlm_v5_loader.cpp @@ -130,7 +130,7 @@ MemorySection KenlmV5Loader::_parse_lm_config(MemorySection mem) { size_t offset = 0; lm_config_.ngram_counts.resize(lm_config_.order); - for (int k = 0; k < lm_config_.order; k++, offset += sizeof(uint64_t)) { + for (size_t k = 0; k < lm_config_.order; k++, offset += sizeof(uint64_t)) { lm_config_.ngram_counts[k] = mem.at(offset); if (debug_print_sections_) std::cout << "count[" << k+1 << "]= " << lm_config_.ngram_counts[k] << std::endl; @@ -198,7 +198,7 @@ MemorySection KenlmV5Loader::_parse_lm_quant(MemorySection mem) { lm_config_.prob_quant_tables.resize(lm_config_.order - 1); lm_config_.backoff_quant_tables.resize(lm_config_.order - 2); - for (int order_minus_2 = 0; order_minus_2 < lm_config_.order - 2; order_minus_2++) { + for (size_t order_minus_2 = 0; order_minus_2 < lm_config_.order - 2; order_minus_2++) { lm_config_.prob_quant_tables[order_minus_2] = mem.get_and_drop_prefix(sizeof(float) * ((size_t)1 << lm_config_.prob_bits)); lm_config_.backoff_quant_tables[order_minus_2] = mem.get_and_drop_prefix(sizeof(float) * ((size_t)1 << lm_config_.backoff_bits)); } @@ -222,7 +222,7 @@ MemorySection KenlmV5Loader::_parse_trie_medium(MemorySection mem) { lm_config_.medium_layers.reserve(lm_config_.order - 1); lm_config_.medium_layers.resize(lm_config_.order - 2); - for (int k = 2; k <= lm_config_.order - 1; k++) { // trie layer index: k in k-gram + for (size_t k = 2; k <= lm_config_.order - 1; k++) { // trie layer index: k in k-gram mem = _parse_bhiksha_highs(mem, lm_config_.medium_layers[k-2], lm_config_.ngram_counts[k-1] + 1, lm_config_.ngram_counts[(k+1)-1]); mem = _parse_bitarray(mem, lm_config_.medium_layers[k-2], lm_config_.ngram_counts[k-1] + 1, lm_config_.backoff_bits); } diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/kenlm_v5_loader.hpp b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/kenlm_v5_loader.hpp similarity index 100% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/kenlm_v5_loader.hpp rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/kenlm_v5_loader.hpp diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/language_model.cpp b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/language_model.cpp similarity index 98% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/language_model.cpp rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/language_model.cpp index 80a049ff38f..2236e540c88 100644 --- a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/language_model.cpp +++ b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/language_model.cpp @@ -81,7 +81,7 @@ float LanguageModel::find_ngram(LmState& words_backoffs) const { // Medium trie layers: 2-gram .. (n-1)-gram, and including n-gram. const WordIndex not_found = (WordIndex)(-1); - for (int k = 2; k <= config_.order && k < words.size() + 1 && l < r; k++) { + for (size_t k = 2; k <= config_.order && k < words.size() + 1 && l < r; k++) { const WordIndex word = words[k-1]; const MediumLayer& layer = config_.medium_layers[k-2]; diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/language_model.hpp b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/language_model.hpp similarity index 96% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/language_model.hpp rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/language_model.hpp index 5066bd8598d..362c1fc71e3 100644 --- a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/language_model.hpp +++ b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/language_model.hpp @@ -38,7 +38,7 @@ struct MediumLayer { }; struct LmConfig { - int order; // the value of n in n-gram + size_t order; // the value of n in n-gram std::vector ngram_counts; // ngram_count[k-1] = number of k-grams, vector length = order int prob_bits; // size of quantized representation of log-probability values; guaranteed to be in [0,24] int backoff_bits; // size of quantized representation of log-backoff values; guaranteed to be in [0,24] @@ -70,7 +70,7 @@ class LanguageModel { //float log10_p_cond(const std::vector& words) const; float log10_p_cond(WordIndex new_word, LmState& state) const; - int order() const { return config_.order; }; + size_t order() const { return config_.order; }; uint64_t num_words() const { return config_.ngram_counts[0]; }; private: diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/memory_section.cpp b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/memory_section.cpp similarity index 97% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/memory_section.cpp rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/memory_section.cpp index 2278d4121e1..e7f90dbedd7 100644 --- a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/memory_section.cpp +++ b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/memory_section.cpp @@ -101,7 +101,7 @@ MemorySection load_file(const std::string& filename) { throw std::runtime_error("Cannot open file: " + filename); is.seekg(0, std::ios::end); - if (is.tellg() >= std::numeric_limits::max()) + if (uintmax_t(is.tellg()) >= std::numeric_limits::max()) throw std::range_error("File size exceeds size_t: " + filename); size_t file_length = is.tellg(); is.seekg(0, std::ios::beg); @@ -109,7 +109,7 @@ MemorySection load_file(const std::string& filename) { std::shared_ptr mm(std::make_shared(file_length)); is.read(reinterpret_cast(mm->ptr()), file_length); - if (is.gcount() != file_length) + if (size_t(is.gcount()) != file_length) throw std::runtime_error("Some problem while reading file: " + filename); return MemorySection(mm); diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/memory_section.hpp b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/memory_section.hpp similarity index 96% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/memory_section.hpp rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/memory_section.hpp index 0e9503e57eb..7a87373d37e 100644 --- a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/memory_section.hpp +++ b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/memory_section.hpp @@ -124,8 +124,9 @@ struct BitField { // Essentially this class template only overloads operator[] in MemorySection. class MemorySectionBitArray : public MemorySection { public: - MemorySectionBitArray() : stride_(0), index_limit_(0) {} - MemorySectionBitArray(const MemorySection& ms) : MemorySection(ms) {} + MemorySectionBitArray() : stride_(0), bit_field_{}, index_limit_(0) {} + MemorySectionBitArray(const MemorySection& ms) + : MemorySection(ms), stride_(0), bit_field_{}, index_limit_(0) {} // Inline for efficiency. // Expects index to be inside bound, and not cause segfault on the last element. diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/sorted_search.hpp b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/sorted_search.hpp similarity index 100% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/sorted_search.hpp rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/sorted_search.hpp diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/vocabulary.cpp b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/vocabulary.cpp similarity index 100% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/vocabulary.cpp rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/vocabulary.cpp diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/vocabulary.hpp b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/vocabulary.hpp similarity index 92% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/vocabulary.hpp rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/vocabulary.hpp index f97b0d248e7..e253e603e90 100644 --- a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/vocabulary.hpp +++ b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/vocabulary.hpp @@ -18,9 +18,9 @@ namespace yoklm { typedef uint64_t WordHash; struct VocabularyConfig { - int num_words; // the number of tokens in vocabulary, initialized with counts[0] + size_t num_words; // the number of tokens in vocabulary, initialized with counts[0] MemorySectionArray word_hashes; // sorted - int num_word_strings; // the number of tokens presented as strings. It can be 0 or num_words + size_t num_word_strings; // the number of tokens presented as strings. It can be 0 or num_words MemorySectionArray word_strings; }; diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/word_index.hpp b/demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/word_index.hpp similarity index 100% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/ctcdecode_numpy/yoklm/word_index.hpp rename to demos/speech_recognition_demo/python/ctcdecode-numpy/ctcdecode_numpy/yoklm/word_index.hpp diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/setup.py b/demos/speech_recognition_demo/python/ctcdecode-numpy/setup.py similarity index 98% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/setup.py rename to demos/speech_recognition_demo/python/ctcdecode-numpy/setup.py index 0351cb9d304..a7106d83f1d 100755 --- a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/setup.py +++ b/demos/speech_recognition_demo/python/ctcdecode-numpy/setup.py @@ -30,7 +30,7 @@ setuptools.setup( name='ctcdecode-numpy', - version='0.1', + version='0.2', description="CTC Decoder for NumPy based on implementation from PaddlePaddle-Deepspeech and Parlance ctcdecode", packages=['ctcdecode_numpy'], ext_modules=[extension], diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/third_party/ThreadPool/COPYING b/demos/speech_recognition_demo/python/ctcdecode-numpy/third_party/ThreadPool/COPYING similarity index 100% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/third_party/ThreadPool/COPYING rename to demos/speech_recognition_demo/python/ctcdecode-numpy/third_party/ThreadPool/COPYING diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/third_party/ThreadPool/README.md b/demos/speech_recognition_demo/python/ctcdecode-numpy/third_party/ThreadPool/README.md similarity index 100% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/third_party/ThreadPool/README.md rename to demos/speech_recognition_demo/python/ctcdecode-numpy/third_party/ThreadPool/README.md diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/third_party/ThreadPool/ThreadPool.h b/demos/speech_recognition_demo/python/ctcdecode-numpy/third_party/ThreadPool/ThreadPool.h similarity index 100% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/third_party/ThreadPool/ThreadPool.h rename to demos/speech_recognition_demo/python/ctcdecode-numpy/third_party/ThreadPool/ThreadPool.h diff --git a/demos/python_demos/speech_recognition_demo/ctcdecode-numpy/third_party/ThreadPool/commit.txt b/demos/speech_recognition_demo/python/ctcdecode-numpy/third_party/ThreadPool/commit.txt similarity index 100% rename from demos/python_demos/speech_recognition_demo/ctcdecode-numpy/third_party/ThreadPool/commit.txt rename to demos/speech_recognition_demo/python/ctcdecode-numpy/third_party/ThreadPool/commit.txt diff --git a/demos/python_demos/speech_recognition_demo/utils/default_alphabet_example.conf b/demos/speech_recognition_demo/python/default_alphabet_example.conf similarity index 100% rename from demos/python_demos/speech_recognition_demo/utils/default_alphabet_example.conf rename to demos/speech_recognition_demo/python/default_alphabet_example.conf diff --git a/demos/python_demos/speech_recognition_demo/models.lst b/demos/speech_recognition_demo/python/models.lst similarity index 86% rename from demos/python_demos/speech_recognition_demo/models.lst rename to demos/speech_recognition_demo/python/models.lst index a58c56f2958..66c73d8baae 100644 --- a/demos/python_demos/speech_recognition_demo/models.lst +++ b/demos/speech_recognition_demo/python/models.lst @@ -1,3 +1,4 @@ # This file can be used with the --list option of the model downloader. # Please pay attention to model license: Mozilla Public License 2.0. mozilla-deepspeech-0.6.1 +mozilla-deepspeech-0.8.2 diff --git a/demos/speech_recognition_demo/python/profile_example.yml b/demos/speech_recognition_demo/python/profile_example.yml new file mode 100644 index 00000000000..d0f68af4de9 --- /dev/null +++ b/demos/speech_recognition_demo/python/profile_example.yml @@ -0,0 +1,14 @@ +# Example profile with mds08x_en configuration + +# alphabet: null # use null for the default alphabet +alphabet: default_alphabet_example.conf # the same default alphabet; use absolute path if it's not in the current directory +alpha: 0.93128901720047 +beta: 1.1834137439727783 +model_sampling_rate: 16000 +frame_window_size_seconds: 0.032 +frame_stride_seconds: 0.020 +mel_num: 40 +mel_fmin: 20. +mel_fmax: 8000. +num_mfcc_dct_coefs: 26 +num_context_frames: 19 diff --git a/demos/speech_recognition_demo/python/requirements.txt b/demos/speech_recognition_demo/python/requirements.txt new file mode 100644 index 00000000000..f4a49127051 --- /dev/null +++ b/demos/speech_recognition_demo/python/requirements.txt @@ -0,0 +1,4 @@ +numpy +tqdm +librosa +pyyaml diff --git a/demos/python_demos/speech_recognition_demo/speech_recognition_demo.py b/demos/speech_recognition_demo/python/speech_recognition_demo.py similarity index 74% rename from demos/python_demos/speech_recognition_demo/speech_recognition_demo.py rename to demos/speech_recognition_demo/python/speech_recognition_demo.py index 6cc021d5b7a..2f12399ea21 100755 --- a/demos/python_demos/speech_recognition_demo/speech_recognition_demo.py +++ b/demos/speech_recognition_demo/python/speech_recognition_demo.py @@ -7,36 +7,37 @@ # https://github.com/openvinotoolkit/open_model_zoo/pull/419, commit 529805d011d9b405f142b2b40f4d202bd403a4f1 on Sep 19, 2019. # import wave -import numpy as np import timeit import argparse +import yaml +import numpy as np from tqdm import tqdm from utils.context_timer import Timer -from utils.deep_speech_pipeline import DeepSpeechPipeline +from utils.deep_speech_pipeline import DeepSpeechPipeline, PROFILES def build_argparser(): - parser = argparse.ArgumentParser(description="Speech recognition example") - parser.add_argument('-i', '--input', help="Path to an audio file in WAV PCM 16 kHz mono format", - type=str, metavar="FILENAME", required=True) + parser = argparse.ArgumentParser(description="Speech recognition demo") + parser.add_argument('-i', '--input', type=str, metavar="FILENAME", required=True, + help="Path to an audio file in WAV PCM 16 kHz mono format") parser.add_argument('-d', '--device', default='CPU', type=str, help="Optional. Specify the target device to infer on, for example: CPU, GPU, FPGA, HDDL, MYRIAD or HETERO. " "The sample will look for a suitable IE plugin for this device. (default is CPU)") - parser.add_argument('-m', '--model', type=str, metavar="FILENAME", - help="Path to an .xml file with a trained model (required)", required=True) - - parser.add_argument('-b', '--beam-width', type=int, default=500, metavar="N", - help="Beam width for beam search in CTC decoder (default 500)") + parser.add_argument('-m', '--model', type=str, metavar="FILENAME", required=True, + help="Path to an .xml file with a trained model (required)") parser.add_argument('-L', '--lm', type=str, metavar="FILENAME", help="path to language model file (optional)") - parser.add_argument('-a', '--alphabet', type=str, metavar="FILENAME", - help="path to alphabet file matching the model (defaults to the 28-symbol alphabet with English letters)") - parser.add_argument('--alpha', type=float, default=0.75, metavar="X", - help="Language model weight (default 0.75)") - parser.add_argument('--beta', type=float, default=1.85, metavar="X", - help="Word insertion bonus, ignored without LM (default 1.85)") + parser.add_argument('-p', '--profile', type=str, metavar="NAME", required=True, + help="Choose pre/post-processing profile: " + "mds06x_en for Mozilla DeepSpeech v0.6.x, " + "mds07x_en or mds08x_en for Mozilla DeepSpeech v0.7.x/x0.8.x, " + "other: filename of a YAML file (required)") + parser.add_argument('-b', '--beam-width', type=int, default=500, metavar="N", + help="Beam width for beam search in CTC decoder (default 500)") + parser.add_argument('-c', '--max-candidates', type=int, default=1, metavar="N", + help="Show top N (or less) candidates (default 1)") parser.add_argument('-l', '--cpu_extension', type=str, metavar="FILENAME", help="Optional. Required for CPU custom layers. " @@ -45,20 +46,28 @@ def build_argparser(): return parser +def get_profile(profile_name): + if profile_name in PROFILES: + return PROFILES[profile_name] + with open(profile_name, 'rt') as f: + profile = yaml.load(f) + return profile + + def main(): start_time = timeit.default_timer() with Timer() as timer: args = build_argparser().parse_args() + profile = get_profile(args.profile) stt = DeepSpeechPipeline( model = args.model, lm = args.lm, - alphabet = args.alphabet, beam_width = args.beam_width, - alpha = args.alpha, - beta = args.beta, + max_candidates = args.max_candidates, + profile = profile, device = args.device, - ie_extensions = [(args.device, args.cpu_extension)] if args.device=='CPU' else [], + ie_extensions = [(args.device, args.cpu_extension)] if args.device == 'CPU' else [], ) wave_read = wave.open(args.input, 'rb') @@ -89,8 +98,7 @@ def main(): print("Overall time: {} s".format(timeit.default_timer() - start_time)) print("\nTranscription and confidence score:") - max_candidates = 1 - for candidate in transcription[:max_candidates]: + for candidate in transcription: print( "{}\t{}".format( candidate['conf'], diff --git a/demos/python_demos/whiteboard_inpainting_demo/utils/__init__.py b/demos/speech_recognition_demo/python/utils/__init__.py similarity index 100% rename from demos/python_demos/whiteboard_inpainting_demo/utils/__init__.py rename to demos/speech_recognition_demo/python/utils/__init__.py diff --git a/demos/python_demos/speech_recognition_demo/utils/alphabet.py b/demos/speech_recognition_demo/python/utils/alphabet.py similarity index 100% rename from demos/python_demos/speech_recognition_demo/utils/alphabet.py rename to demos/speech_recognition_demo/python/utils/alphabet.py diff --git a/demos/speech_recognition_demo/python/utils/audio_features.py b/demos/speech_recognition_demo/python/utils/audio_features.py new file mode 100644 index 00000000000..d196af4f0c3 --- /dev/null +++ b/demos/speech_recognition_demo/python/utils/audio_features.py @@ -0,0 +1,44 @@ +# +# Copyright (C) 2020 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +# +import numpy as np +import librosa + + +def samples_to_melspectrum(samples, sampling_rate, window_size, stride, n_mels, fmin, fmax): + window_size, stride = round(window_size), round(stride) + + # window_size must be a power of 2 to match tf: + if not(window_size > 0 and (window_size - 1) & window_size == 0): + raise ValueError("window_size(ms)*sampling_rate(kHz) must be a power of two") + + spec = np.abs(librosa.core.spectrum.stft( + samples, + n_fft=window_size, hop_length=stride, win_length=window_size, + center=False, window='hann', pad_mode='reflect', + )) + # match tf: norm=None + mel_basis = librosa.filters.mel( + sampling_rate, window_size, + n_mels=n_mels, fmin=fmin, fmax=fmax, + norm=None, htk=True, + ) + # match tf: zero spectrum below fmin/sr*2*(n_fft-1) + freq_bin_fmin = round(fmin/sampling_rate*2*(window_size-1)) + spec[:freq_bin_fmin+1, :] = 0. + + melspectrum = np.dot(mel_basis, spec) + return melspectrum + + +def melspectrum_to_mfcc(melspectrum, dct_coefficient_count): + # match tf: use np.log() instead of power_to_db() to get correct normalization + mfcc = librosa.feature.mfcc( + S=np.log(melspectrum + 1e-30), + norm='ortho', + n_mfcc=dct_coefficient_count, + ) + # match tf: un-correct 0-th bin normalization + mfcc[0] *= 2**0.5 + return mfcc.T diff --git a/demos/python_demos/speech_recognition_demo/utils/context_timer.py b/demos/speech_recognition_demo/python/utils/context_timer.py similarity index 77% rename from demos/python_demos/speech_recognition_demo/utils/context_timer.py rename to demos/speech_recognition_demo/python/utils/context_timer.py index 4e36edc3371..2220cdb8d24 100644 --- a/demos/python_demos/speech_recognition_demo/utils/context_timer.py +++ b/demos/speech_recognition_demo/python/utils/context_timer.py @@ -1,3 +1,7 @@ +# +# Copyright (C) 2020 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +# import timeit diff --git a/demos/python_demos/speech_recognition_demo/utils/ctcnumpy_beam_search_decoder.py b/demos/speech_recognition_demo/python/utils/ctcnumpy_beam_search_decoder.py similarity index 73% rename from demos/python_demos/speech_recognition_demo/utils/ctcnumpy_beam_search_decoder.py rename to demos/speech_recognition_demo/python/utils/ctcnumpy_beam_search_decoder.py index 8265e170216..0f75ed8b826 100644 --- a/demos/python_demos/speech_recognition_demo/utils/ctcnumpy_beam_search_decoder.py +++ b/demos/speech_recognition_demo/python/utils/ctcnumpy_beam_search_decoder.py @@ -9,13 +9,15 @@ class CtcnumpyBeamSearchDecoder: - def __init__(self, alphabet, beam_size, cutoff_prob=1.0, cutoff_top_n=40, + def __init__(self, alphabet, beam_size, max_candidates=None, + cutoff_prob=1.0, cutoff_top_n=40, scorer_lm_fname=None, alpha=0.75, beta=1.85): if isinstance(alphabet, list): alphabet = CtcdecoderAlphabet(alphabet) self.alphabet = alphabet self.beam_size = beam_size + self.max_candidates = max_candidates self.cutoff_prob = cutoff_prob self.cutoff_top_n = cutoff_top_n @@ -27,6 +29,7 @@ def __init__(self, alphabet, beam_size, cutoff_prob=1.0, cutoff_top_n=40, cutoff_top_n = cutoff_top_n, cutoff_prob = cutoff_prob, beam_width = beam_size, + max_candidates_per_batch = max_candidates, blank_id = len(alphabet.characters), ) @@ -34,7 +37,11 @@ def decode(self, probs): output, scores, timesteps, out_seq_len = self.decoder_state.decode(probs[np.newaxis]) assert out_seq_len.shape[0] == 1 beam_results = [ - dict(conf=scores[0,res_idx], text=self.alphabet.decode(output[0,res_idx,:out_seq_len[0,res_idx]]), ts=list(timesteps[0,res_idx])) + dict( + conf=scores[0, res_idx], + text=self.alphabet.decode(output[0, res_idx, :out_seq_len[0, res_idx]]), + ts=list(timesteps[0, res_idx]), + ) for res_idx in range(out_seq_len.shape[1]) ] return beam_results diff --git a/demos/python_demos/speech_recognition_demo/utils/deep_speech_pipeline.py b/demos/speech_recognition_demo/python/utils/deep_speech_pipeline.py similarity index 64% rename from demos/python_demos/speech_recognition_demo/utils/deep_speech_pipeline.py rename to demos/speech_recognition_demo/python/utils/deep_speech_pipeline.py index aa63787b670..06c858dc7c9 100644 --- a/demos/python_demos/speech_recognition_demo/utils/deep_speech_pipeline.py +++ b/demos/speech_recognition_demo/python/utils/deep_speech_pipeline.py @@ -6,48 +6,89 @@ # https://github.com/openvinotoolkit/open_model_zoo/pull/419, commit 529805d011d9b405f142b2b40f4d202bd403a4f1 on Sep 19, 2019. # import os.path +from copy import deepcopy import numpy as np -from openvino.inference_engine import IENetwork, IECore +from openvino.inference_engine import IECore import utils.alphabet as alphabet_module -from utils.audio_features import audio_spectrogram, mfcc +from utils.audio_features import samples_to_melspectrum, melspectrum_to_mfcc from utils.ctcnumpy_beam_search_decoder import CtcnumpyBeamSearchDecoder +PROFILES = { + 'mds06x_en': dict( + alphabet = None, # the default alphabet + # alpha: Language model weight + alpha = 0.75, + # beta: Word insertion bonus (ignored without LM) + beta = 1.85, + model_sampling_rate = 16000, + frame_window_size_seconds = 32e-3, + frame_stride_seconds = 20e-3, + mel_num = 40, + mel_fmin = 20., + mel_fmax = 4000., + num_mfcc_dct_coefs = 26, + num_context_frames = 19, + ), + 'mds07x_en': dict( + alphabet = None, # the default alphabet + alpha = 0.93128901720047, + beta = 1.1834137439727783, + model_sampling_rate = 16000, + frame_window_size_seconds = 32e-3, + frame_stride_seconds = 20e-3, + mel_num = 40, + mel_fmin = 20., + mel_fmax = 8000., + num_mfcc_dct_coefs = 26, + num_context_frames = 19, + ), +} +PROFILES['mds08x_en'] = PROFILES['mds07x_en'] + + class DeepSpeechPipeline: - def __init__(self, model, model_bin=None, lm=None, alphabet=None, - beam_width=500, alpha=0.75, beta=1.85, - ie=None, device='CPU', ie_extensions=[]): + def __init__(self, model, model_bin=None, lm=None, beam_width=500, max_candidates=None, + profile=PROFILES['mds08x_en'], ie=None, device='CPU', ie_extensions=[]): """ Args: model (str), filename of IE IR .xml file of the network model_bin (str), filename of IE IR .xml file of the network (default (None) is the same as :model:, but with extension replaced with .bin) lm (str), filename of LM (language model) - alphabet (None or str or list(str)), alphabet matching the model (default None): - None = [' ', 26 English letters, apostrophe]; - str = filename of a text file with the alphabet (expluding separator=blank symbol) - list(str) = the alphabet itself (expluding separator=blank symbol) beam_width (int), the number of prefix candidates to retain during decoding in beam search (default 500) - alpha (float), LM weight relative to audio model (default 0.75) - beta (float), word insertion bonus to counteract LM's tendency to prefer fewer words (default 1.85) - ie (IECore or None), IECore object to run NN inference with. Default is to use ie_core_singleton module. + max_candidates (int), limit the number of returned candidates; None = do not limit (default None) + profile (dict): a dict with pre/post-processing parameters + alphabet (None or str or list(str)), alphabet matching the model (default None): + None = [' ', 26 English letters, apostrophe]; + str = filename of a text file with the alphabet (excluding separator=blank symbol) + list(str) = the alphabet itself (expluding separator=blank symbol) + alpha (float), LM weight relative to audio model (default 0.75) + beta (float), word insertion bonus to counteract LM's tendency to prefer fewer words (default 1.85) + model_sampling_rate (float, in Hz) + frame_window_size_seconds (float, in seconds) + frame_stride_seconds (float, in seconds) + mel_num (int) + mel_fmin (float, in Hz) + mel_fmax (float, in Hz) + num_mfcc_dct_coefs (int) + num_context_frames (int) + ie (IECore or None), IECore object to run NN inference with. Default is to use ie_core_singleton module. (default None) device (str), inference device for IE, passed here to 1. set default device, and 2. check supported node types in the model load; None = do not check (default 'CPU') ie_extensions (list(tuple(str,str))), list of IE extensions to load, each extension is defined by a pair (device, filename). Records with filename=None are ignored. (default []) """ + self.p = deepcopy(profile) # model parameters - self.num_mfcc_dct_coefs = 26 - self.num_context_frames = 19 self.num_batch_frames = 16 - self.model_sample_rate = 16000 - self.frame_window_size_seconds = 32e-3 - self.frame_stride_seconds = 20e-3 self.beam_width = beam_width + self.max_candidates = max_candidates + alphabet = self.p['alphabet'] if alphabet is None: self.alphabet = alphabet_module.get_default_alphabet() elif isinstance(alphabet, str): @@ -61,8 +102,8 @@ def __init__(self, model, model_bin=None, lm=None, alphabet=None, self.ie = ie if ie is not None else IECore() self._load_net(model, model_bin_fname=model_bin, device=device, ie_extensions=ie_extensions) - self.decoder = CtcnumpyBeamSearchDecoder(self.alphabet, self.beam_width, - scorer_lm_fname=lm, alpha=alpha, beta=beta) + self.decoder = CtcnumpyBeamSearchDecoder(self.alphabet, self.beam_width, max_candidates=max_candidates, + scorer_lm_fname=lm, alpha=self.p['alpha'], beta=self.p['beta']) if device is not None: self.activate_model(device) @@ -107,31 +148,33 @@ def recognize_audio(self, audio, sampling_rate): def extract_mfcc(self, audio, sampling_rate): # Audio feature extraction - if abs(sampling_rate - self.model_sample_rate) > self.model_sample_rate * 0.1 or (audio.shape + (1,))[1] != 1: - raise ValueError("Input audio file should be {} kHz mono".format(self.model_sample_rate/1e3)) + if abs(sampling_rate - self.p['model_sampling_rate']) > self.p['model_sampling_rate'] * 0.1 or (audio.shape + (1,))[1] != 1: + raise ValueError("Input audio file should be {} kHz mono".format(self.p['model_sampling_rate']/1e3)) if np.issubdtype(audio.dtype, np.integer): audio = audio/np.float32(32768) # normalize to -1 to 1, int16 to float32 - audio = audio.reshape(-1, 1) - spectrogram = audio_spectrogram( - audio, - sampling_rate * self.frame_window_size_seconds, - sampling_rate * self.frame_stride_seconds, - True, + melspectrum = samples_to_melspectrum( + audio.flatten(), + sampling_rate, + sampling_rate * self.p['frame_window_size_seconds'], + sampling_rate * self.p['frame_stride_seconds'], + n_mels = self.p['mel_num'], + fmin = self.p['mel_fmin'], + fmax = self.p['mel_fmax'], ) - features = mfcc(spectrogram.reshape(1, spectrogram.shape[0], -1), sampling_rate, self.num_mfcc_dct_coefs) + features = melspectrum_to_mfcc(melspectrum, self.p['num_mfcc_dct_coefs']) return features - def extract_per_frame_probs(self, mfcc_features, state=None, return_state=False, wrap_iterator=lambda x:x): + def extract_per_frame_probs(self, mfcc_features, state=None, return_state=False, wrap_iterator=lambda x: x): assert self.exec_net is not None, "Need to call mds.activate(device) method before mds.stt(...)" - padding = np.zeros((self.num_context_frames // 2, self.num_mfcc_dct_coefs), dtype=mfcc_features.dtype) + padding = np.zeros((self.p['num_context_frames'] // 2, self.p['num_mfcc_dct_coefs']), dtype=mfcc_features.dtype) mfcc_features = np.concatenate((padding, mfcc_features, padding)) # TODO: replace with np.pad - num_strides = len(mfcc_features) - self.num_context_frames + 1 + num_strides = len(mfcc_features) - self.p['num_context_frames'] + 1 # Create a view into the array with overlapping strides to simulate convolution with FC mfcc_features = np.lib.stride_tricks.as_strided( # TODO: replace with conv1d mfcc_features, - (num_strides, self.num_context_frames, self.num_mfcc_dct_coefs), + (num_strides, self.p['num_context_frames'], self.p['num_mfcc_dct_coefs']), (mfcc_features.strides[0], mfcc_features.strides[0], mfcc_features.strides[1]), writeable = False, ) diff --git a/demos/super_resolution_demo/CMakeLists.txt b/demos/super_resolution_demo/cpp/CMakeLists.txt similarity index 100% rename from demos/super_resolution_demo/CMakeLists.txt rename to demos/super_resolution_demo/cpp/CMakeLists.txt diff --git a/demos/super_resolution_demo/README.md b/demos/super_resolution_demo/cpp/README.md similarity index 92% rename from demos/super_resolution_demo/README.md rename to demos/super_resolution_demo/cpp/README.md index 275e10f7154..4ba47573e1a 100644 --- a/demos/super_resolution_demo/README.md +++ b/demos/super_resolution_demo/cpp/README.md @@ -8,7 +8,7 @@ You can use the following pre-trained model with the demo: * `single-image-super-resolution-1033`, which is the model that performs super resolution 3x upscale on a 360x640 image * `text-image-super-resolution-0001`, which is the model that performs super resolution 3x upscale on a 360x640 image -For more information about the pre-trained models, refer to the [model documentation](../../models/intel/index.md). +For more information about the pre-trained models, refer to the [model documentation](../../../models/intel/index.md). ## How It Works @@ -40,7 +40,7 @@ Options: Running the application with the empty list of options yields the usage message given above and an error message. -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). +To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). @@ -58,6 +58,6 @@ the current working directory as `*.bmp` file with `sr` prefix. > **NOTE**: On VPU devices (Intel® Movidius™ Neural Compute Stick, Intel® Neural Compute Stick 2, and Intel® Vision Accelerator Design with Intel® Movidius™ VPUs) this demo is not supported with any of the Model Downloader available topologies. Other models may produce unexpected results on these devices as well. ## See Also -* [Using Open Model Zoo demos](../README.md) +* [Using Open Model Zoo demos](../../README.md) * [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) -* [Model Downloader](../../tools/downloader/README.md) +* [Model Downloader](../../../tools/downloader/README.md) diff --git a/demos/super_resolution_demo/main.cpp b/demos/super_resolution_demo/cpp/main.cpp similarity index 99% rename from demos/super_resolution_demo/main.cpp rename to demos/super_resolution_demo/cpp/main.cpp index 25c7612682f..5becd4ab1dc 100644 --- a/demos/super_resolution_demo/main.cpp +++ b/demos/super_resolution_demo/cpp/main.cpp @@ -14,9 +14,9 @@ #include -#include -#include -#include +#include +#include +#include #include "super_resolution_demo.h" diff --git a/demos/super_resolution_demo/models.lst b/demos/super_resolution_demo/cpp/models.lst similarity index 100% rename from demos/super_resolution_demo/models.lst rename to demos/super_resolution_demo/cpp/models.lst diff --git a/demos/super_resolution_demo/super_resolution_demo.h b/demos/super_resolution_demo/cpp/super_resolution_demo.h similarity index 100% rename from demos/super_resolution_demo/super_resolution_demo.h rename to demos/super_resolution_demo/cpp/super_resolution_demo.h diff --git a/demos/tests/args.py b/demos/tests/args.py index f39280dd9ac..8031ec1eb9a 100644 --- a/demos/tests/args.py +++ b/demos/tests/args.py @@ -18,7 +18,9 @@ from pathlib import Path ArgContext = collections.namedtuple('ArgContext', - ['source_dir', 'test_data_dir', 'dl_dir', 'model_info', 'data_sequences', 'data_sequence_dir']) + ['test_data_dir', 'dl_dir', 'model_info', 'data_sequences', 'data_sequence_dir']) + +OMZ_DIR = Path(__file__).parents[2].resolve() class TestDataArg: @@ -98,11 +100,3 @@ def resolve(self, context): shutil.copyfile(seq_item, str(seq_dir / Path(seq_item).name)) return str(seq_dir) - - -class DemoFileArg: - def __init__(self, file_name): - self.file_name = file_name - - def resolve(self, context): - return str(context.source_dir / self.file_name) diff --git a/demos/tests/cases.py b/demos/tests/cases.py index 80db161f05c..f310a27e325 100644 --- a/demos/tests/cases.py +++ b/demos/tests/cases.py @@ -12,80 +12,79 @@ # See the License for the specific language governing permissions and # limitations under the License. +import collections import itertools import sys -from args import * +from args import ( + DataDirectoryArg, DataDirectoryOrigFileNamesArg, DataPatternArg, + ModelArg, OMZ_DIR, TestDataArg, image_net_arg, image_retrieval_arg, +) from data_sequences import DATA_SEQUENCES MONITORS = {'-u': 'cdm'} TestCase = collections.namedtuple('TestCase', ['options']) -class Demo: - def device_args(self, device_list): - if len(self.device_keys) == 0: - return {'CPU': []} - return {device: [arg for key in self.device_keys for arg in [key, device]] for device in device_list} - -class NativeDemo(Demo): - def __init__(self, subdirectory, device_keys, test_cases): - self.subdirectory = subdirectory +class Demo: + def __init__(self, name, implementation, device_keys=None, test_cases=None): + self.subdirectory = name + '/' + implementation self.device_keys = device_keys self.test_cases = test_cases - self._name = subdirectory.replace('/', '_') - - @property - def full_name(self): - return self._name + self._exec_name = self.subdirectory.replace('/', '_') def models_lst_path(self, source_dir): return source_dir / self.subdirectory / 'models.lst' - def fixed_args(self, source_dir, build_dir): - return [str(build_dir / self._name)] + def device_args(self, device_list): + if len(self.device_keys) == 0: + return {'CPU': []} + return {device: [arg for key in self.device_keys for arg in [key, device]] for device in device_list} -class PythonDemo(Demo): - def __init__(self, subdirectory, device_keys, test_cases): - self.subdirectory = 'python_demos/' + subdirectory - self.device_keys = device_keys +class CppDemo(Demo): + def __init__(self, name, implementation='cpp', device_keys=None, test_cases=None): + super().__init__(name, implementation, device_keys, test_cases) - self.test_cases = test_cases + self._exec_name = self._exec_name.replace('_cpp', '') - self._name = subdirectory.replace('/', '_') + def fixed_args(self, source_dir, build_dir): + return [str(build_dir / self._exec_name)] - @property - def full_name(self): - return 'py/' + self._name - def models_lst_path(self, source_dir): - return source_dir / self.subdirectory / 'models.lst' +class PythonDemo(Demo): + def __init__(self, name, implementation='python', device_keys=None, test_cases=None): + super().__init__(name, implementation, device_keys, test_cases) + + self._exec_name = self._exec_name.replace('_python', '') def fixed_args(self, source_dir, build_dir): cpu_extension_path = build_dir / 'lib/libcpu_extension.so' - return [sys.executable, str(source_dir / 'python_demos' / self._name / (self._name + '.py')), + return [sys.executable, str(source_dir / self.subdirectory / (self._exec_name + '.py')), *(['-l', str(cpu_extension_path)] if cpu_extension_path.exists() else [])] + def join_cases(*args): options = {} for case in args: options.update(case.options) return TestCase(options=options) + def combine_cases(*args): return [join_cases(*combination) for combination in itertools.product(*[[arg] if isinstance(arg, TestCase) else arg for arg in args])] + def single_option_cases(key, *args): return [TestCase(options={} if arg is None else {key: arg}) for arg in args] NATIVE_DEMOS = [ - NativeDemo(subdirectory='crossroad_camera_demo', + CppDemo(name='crossroad_camera_demo', device_keys=['-d', '-d_pa', '-d_reid'], test_cases=combine_cases( TestCase(options={'-no_show': None, @@ -101,7 +100,7 @@ def single_option_cases(key, *args): ModelArg('person-reidentification-retail-0288')), )), - NativeDemo(subdirectory='gaze_estimation_demo', + CppDemo(name='gaze_estimation_demo', device_keys=['-d', '-d_fd', '-d_hp', '-d_lm'], test_cases=combine_cases( TestCase(options={'-no_show': None, @@ -116,23 +115,22 @@ def single_option_cases(key, *args): }), )), - NativeDemo(subdirectory='human_pose_estimation_demo', device_keys=['-d'], test_cases=combine_cases( + CppDemo(name='human_pose_estimation_demo', device_keys=['-d'], test_cases=combine_cases( TestCase(options={'-no_show': None, **MONITORS, '-i': DataPatternArg('human-pose-estimation')}), - TestCase(options={'-m': ModelArg('human-pose-estimation-0001')}), + TestCase(options={'-at': 'openpose', '-m': ModelArg('human-pose-estimation-0001')}), )), - NativeDemo(subdirectory='classification_demo', + CppDemo(name='classification_demo', device_keys=['-d'], test_cases=combine_cases( TestCase(options={ '-no_show': None, '-time': '5', '-i': DataDirectoryOrigFileNamesArg('classification'), - '-labels': DemoFileArg('imagenet_2012_classes.txt'), - '-gt': TestDataArg("ILSVRC2012_img_val/ILSVRC2012_val.txt"), - '-b': '8'}), + '-labels': str(OMZ_DIR / 'data/dataset_classes/imagenet_2012.txt'), + '-gt': TestDataArg("ILSVRC2012_img_val/ILSVRC2012_val.txt")}), single_option_cases('-m', ModelArg('alexnet'), ModelArg('densenet-121-tf'), @@ -141,7 +139,29 @@ def single_option_cases(key, *args): ModelArg('resnet-50-caffe2')), )), - NativeDemo(subdirectory='interactive_face_detection_demo', + CppDemo(name='interactive_face_detection_demo', + device_keys=['-d', '-d_ag', '-d_em', '-d_lm', '-d_hp'], + test_cases=combine_cases( + TestCase(options={'-no_show': None, + **MONITORS, + '-i': DataPatternArg('375x500')}), + TestCase(options={'-m': ModelArg('face-detection-adas-0001')}), + [ + TestCase(options={}), + TestCase(options={'-m_ag': ModelArg('age-gender-recognition-retail-0013')}), + TestCase(options={'-m_em': ModelArg('emotions-recognition-retail-0003')}), + TestCase(options={'-m_lm': ModelArg('facial-landmarks-35-adas-0002')}), + TestCase(options={'-m_hp': ModelArg('head-pose-estimation-adas-0001')}), + TestCase(options={ + '-m_ag': ModelArg('age-gender-recognition-retail-0013'), + '-m_em': ModelArg('emotions-recognition-retail-0003'), + '-m_hp': ModelArg('head-pose-estimation-adas-0001'), + '-m_lm': ModelArg('facial-landmarks-35-adas-0002'), + }) + ], + )), + + CppDemo(name='interactive_face_detection_demo', implementation='cpp_gapi', device_keys=['-d', '-d_ag', '-d_em', '-d_lm', '-d_hp'], test_cases=combine_cases( TestCase(options={'-no_show': None, @@ -163,7 +183,7 @@ def single_option_cases(key, *args): ], )), - NativeDemo(subdirectory='mask_rcnn_demo', device_keys=['-d'], test_cases=combine_cases( + CppDemo(name='mask_rcnn_demo', device_keys=['-d'], test_cases=combine_cases( TestCase(options={'-i': DataDirectoryArg('semantic-segmentation-adas')}), single_option_cases('-m', ModelArg('mask_rcnn_inception_resnet_v2_atrous_coco'), @@ -172,7 +192,7 @@ def single_option_cases(key, *args): ModelArg('mask_rcnn_resnet50_atrous_coco')) )), - NativeDemo(subdirectory='multi_channel/face_detection_demo', + CppDemo(name='multi_channel_face_detection_demo', device_keys=['-d'], test_cases=combine_cases( TestCase(options={'-no_show': None, @@ -185,7 +205,7 @@ def single_option_cases(key, *args): ModelArg('face-detection-retail-0044')), )), - NativeDemo(subdirectory='multi_channel/human_pose_estimation_demo', device_keys=['-d'], + CppDemo(name='multi_channel_human_pose_estimation_demo', device_keys=['-d'], test_cases=combine_cases( TestCase(options={'-no_show': None, **MONITORS, @@ -193,32 +213,83 @@ def single_option_cases(key, *args): '-m': ModelArg('human-pose-estimation-0001')}), )), - NativeDemo(subdirectory='object_detection_demo_ssd_async', device_keys=[], test_cases=combine_cases( - TestCase(options={'-no_show': None, **MONITORS}), - [ - TestCase(options={ - '-m': ModelArg('face-detection-adas-0001'), - '-i': DataPatternArg('face-detection-adas'), - }), - TestCase(options={ - '-m': ModelArg('person-detection-retail-0002'), - '-i': DataPatternArg('person-detection-retail'), - }), - TestCase(options={ - '-m': ModelArg('person-detection-retail-0013'), - '-i': DataPatternArg('person-detection-retail'), - }), - ], + CppDemo(name='multi_channel_object_detection_demo_yolov3', + device_keys=['-d'], + test_cases=combine_cases( + TestCase(options={'-no_show': None, + **MONITORS, + '-i': DataPatternArg('object-detection-demo')}), + single_option_cases('-m', + ModelArg('person-vehicle-bike-detection-crossroad-yolov3-1020'), + ModelArg('yolo-v3-tf'), + ModelArg('yolo-v3-tiny-tf')), )), - NativeDemo(subdirectory='object_detection_demo_yolov3_async', device_keys=['-d'], test_cases=combine_cases( + CppDemo(name='object_detection_demo', device_keys=['-d'], test_cases=combine_cases( TestCase(options={'--no_show': None, **MONITORS, - '-i': DataPatternArg('object-detection-demo-ssd-async')}), - TestCase(options={'-m': ModelArg('yolo-v3-tf')}) + '-i': DataPatternArg('object-detection-demo')}), + [ + *combine_cases( + TestCase(options={'-at': 'centernet'}), + single_option_cases('-m', + ModelArg('ctdet_coco_dlav0_384'), + ModelArg('ctdet_coco_dlav0_512'))), + TestCase(options={'-at': 'faceboxes', + '-m': ModelArg('faceboxes-pytorch')} + ), + *combine_cases( + TestCase(options={'-at': 'retinaface'}), + single_option_cases('-m', + ModelArg('retinaface-anti-cov'), + ModelArg('retinaface-resnet50')) + ), + *combine_cases( + TestCase(options={'-at': 'ssd'}), + single_option_cases('-m', + ModelArg('efficientdet-d0-tf'), + ModelArg('efficientdet-d1-tf'), + ModelArg('face-detection-adas-0001'), + ModelArg('face-detection-retail-0004'), + ModelArg('face-detection-retail-0005'), + ModelArg('face-detection-retail-0044'), + ModelArg('faster-rcnn-resnet101-coco-sparse-60-0001'), + ModelArg('pedestrian-and-vehicle-detector-adas-0001'), + ModelArg('pedestrian-detection-adas-0002'), + ModelArg('pelee-coco'), + ModelArg('person-detection-0200'), + ModelArg('person-detection-0201'), + ModelArg('person-detection-0202'), + ModelArg('person-detection-retail-0013'), + ModelArg('person-vehicle-bike-detection-2000'), + ModelArg('person-vehicle-bike-detection-2001'), + ModelArg('person-vehicle-bike-detection-2002'), + ModelArg('product-detection-0001'), + ModelArg('rfcn-resnet101-coco-tf'), + ModelArg('retinanet-tf'), + ModelArg('ssd300'), + ModelArg('ssd512'), + ModelArg('ssd_mobilenet_v1_coco'), + ModelArg('ssd_mobilenet_v1_fpn_coco'), + ModelArg('ssd_mobilenet_v2_coco'), + ModelArg('ssd_resnet50_v1_fpn_coco'), + ModelArg('ssdlite_mobilenet_v2'), + ModelArg('vehicle-detection-0200'), + ModelArg('vehicle-detection-0201'), + ModelArg('vehicle-detection-0201'), + ModelArg('vehicle-detection-adas-0002'), + ModelArg('vehicle-license-plate-detection-barrier-0106'), + ModelArg('vehicle-license-plate-detection-barrier-0123'))), + *combine_cases( + TestCase(options={'-at': 'yolo'}), + single_option_cases('-m', + ModelArg('person-vehicle-bike-detection-crossroad-yolov3-1020'), + ModelArg('yolo-v3-tf'), + ModelArg('yolo-v3-tiny-tf'))), + ], )), - NativeDemo('pedestrian_tracker_demo', device_keys=['-d_det', '-d_reid'], test_cases=combine_cases( + CppDemo('pedestrian_tracker_demo', device_keys=['-d_det', '-d_reid'], test_cases=combine_cases( TestCase(options={'-no_show': None, **MONITORS, '-i': DataPatternArg('person-detection-retail')}), @@ -233,7 +304,7 @@ def single_option_cases(key, *args): ModelArg('person-reidentification-retail-0288')), )), - NativeDemo(subdirectory='security_barrier_camera_demo', + CppDemo(name='security_barrier_camera_demo', device_keys=['-d', '-d_lpr', '-d_va'], test_cases=combine_cases( TestCase(options={'-no_show': None, @@ -247,7 +318,7 @@ def single_option_cases(key, *args): single_option_cases('-m_va', None, ModelArg('vehicle-attributes-recognition-barrier-0039')), )), - NativeDemo(subdirectory='segmentation_demo', device_keys=['-d'], test_cases=combine_cases( + CppDemo(name='segmentation_demo', device_keys=['-d'], test_cases=combine_cases( TestCase(options={'-no_show': None, **MONITORS}), [ TestCase(options={ @@ -258,11 +329,12 @@ def single_option_cases(key, *args): TestCase(options={'-i': DataPatternArg('semantic-segmentation-adas')}), single_option_cases('-m', ModelArg('semantic-segmentation-adas-0001'), + ModelArg('hrnet-v2-c1-segmentation'), ModelArg('deeplabv3'))), ], )), - NativeDemo(subdirectory='smart_classroom_demo', + CppDemo(name='smart_classroom_demo', device_keys=['-d_act', '-d_fd', '-d_lm', '-d_reid'], test_cases=combine_cases( TestCase(options={'-no_show': None, @@ -292,14 +364,14 @@ def single_option_cases(key, *args): ], )), - NativeDemo(subdirectory='super_resolution_demo', device_keys=['-d'], test_cases=combine_cases( + CppDemo(name='super_resolution_demo', device_keys=['-d'], test_cases=combine_cases( TestCase(options={'-i': DataDirectoryArg('single-image-super-resolution')}), TestCase(options={ '-m': ModelArg('single-image-super-resolution-1033'), }), )), - NativeDemo(subdirectory='text_detection_demo', device_keys=['-d_td', '-d_tr'], test_cases=combine_cases( + CppDemo(name='text_detection_demo', device_keys=['-d_td', '-d_tr'], test_cases=combine_cases( TestCase(options={'-no_show': None, **MONITORS, '-i': DataPatternArg('text-detection')}), @@ -309,13 +381,13 @@ def single_option_cases(key, *args): ] PYTHON_DEMOS = [ - PythonDemo(subdirectory='3d_segmentation_demo', device_keys=['-d'], test_cases=combine_cases( + PythonDemo(name='3d_segmentation_demo', device_keys=['-d'], test_cases=combine_cases( TestCase(options={'-m': ModelArg('brain-tumor-segmentation-0001'), '-o': '.'}), single_option_cases('-i', *DATA_SEQUENCES['brain-tumor-nifti']), )), - PythonDemo(subdirectory='action_recognition', device_keys=['-d'], test_cases=combine_cases( + PythonDemo(name='action_recognition', device_keys=['-d'], test_cases=combine_cases( TestCase(options={'--no_show': None, **MONITORS, '-i': DataPatternArg('action-recognition')}), [ TestCase(options={ @@ -329,28 +401,94 @@ def single_option_cases(key, *args): ], )), - PythonDemo(subdirectory='human_pose_estimation_3d_demo', device_keys=['-d'], test_cases=combine_cases( + PythonDemo(name='bert_question_answering_demo', device_keys=['-d'], test_cases=combine_cases( + TestCase(options={'-i': 'https://en.wikipedia.org/wiki/OpenVINO', + '--questions': ['What frameworks does OpenVINO support?', 'Who are developers?']}), + [ + TestCase(options={ + '-m': ModelArg('bert-small-uncased-whole-word-masking-squad-0001'), + '--input_names': 'input_ids,attention_mask,token_type_ids', + '--output_names': 'output_s,output_e', + '--vocab': str(OMZ_DIR / 'models/intel/bert-small-uncased-whole-word-masking-squad-0001/vocab.txt'), + }), + TestCase(options={ + '-m': ModelArg('bert-small-uncased-whole-word-masking-squad-0002'), + '--input_names': 'input_ids,attention_mask,token_type_ids,position_ids', + '--output_names': 'output_s,output_e', + '--vocab': str(OMZ_DIR / 'models/intel/bert-small-uncased-whole-word-masking-squad-0002/vocab.txt'), + }), + ] + )), + + PythonDemo(name='bert_question_answering_embedding_demo', device_keys=['-d'], test_cases=combine_cases( + TestCase(options={'-i': 'https://en.wikipedia.org/wiki/OpenVINO', + '--questions': ['What frameworks does OpenVINO support?', 'Who are developers?']}), + [ + TestCase(options={ + '-m_emb': ModelArg('bert-large-uncased-whole-word-masking-squad-emb-0001'), + '--input_names_emb': 'input_ids,attention_mask,token_type_ids,position_ids', + '--vocab': str(OMZ_DIR / 'models/intel/bert-large-uncased-whole-word-masking-squad-emb-0001/vocab.txt'), + '-m_qa': ModelArg('bert-small-uncased-whole-word-masking-squad-0001'), + '--input_names_qa': 'input_ids,attention_mask,token_type_ids', + '--output_names_qa': 'output_s,output_e', + }), + TestCase(options={ + '-m_emb': ModelArg('bert-large-uncased-whole-word-masking-squad-emb-0001'), + '--input_names_emb': 'input_ids,attention_mask,token_type_ids,position_ids', + '--vocab': str(OMZ_DIR / 'models/intel/bert-large-uncased-whole-word-masking-squad-emb-0001/vocab.txt'), + }), + ] + )), + + PythonDemo(name='colorization_demo', device_keys=['-d'], test_cases=combine_cases( + TestCase(options={ + '--no_show': None, + **MONITORS, + '-i': DataPatternArg('classification'), + '-m': ModelArg('colorization-v2'), + }) + )), + + PythonDemo(name='gesture_recognition_demo', device_keys=['-d'], test_cases=combine_cases( + TestCase(options={'--no_show': None, + '-i': TestDataArg('msasl/global_crops/_nz_sivss20/clip_0017/img_%05d.jpg'), + '-m_d': ModelArg('person-detection-asl-0001')}), + [ + TestCase(options={'-m_a': ModelArg('asl-recognition-0004'), '-c': str(OMZ_DIR / 'data/dataset_classes/msasl100.json')}), + TestCase(options={'-m_a': ModelArg('common-sign-language-0001'), + '-c': str(OMZ_DIR / 'data/dataset_classes/jester27.json')}), + ], + )), + + PythonDemo(name='human_pose_estimation_3d_demo', device_keys=['-d'], test_cases=combine_cases( TestCase(options={'--no_show': None, **MONITORS, '-i': DataPatternArg('human-pose-estimation')}), TestCase(options={'-m': ModelArg('human-pose-estimation-3d-0001')}), )), - PythonDemo(subdirectory='image_retrieval_demo', device_keys=['-d'], test_cases=combine_cases( - TestCase(options={'--no_show':None, + PythonDemo(name='image_inpainting_demo', device_keys=['-d'], test_cases=combine_cases( + TestCase(options={'--no_show': None, + '-i': image_net_arg('00048311'), + '-m': ModelArg('gmcnn-places2-tf'), + '-ar': None}) + )), + + PythonDemo(name='image_retrieval_demo', device_keys=['-d'], test_cases=combine_cases( + TestCase(options={'--no_show': None, **MONITORS, '-m': ModelArg('image-retrieval-0001')}), single_option_cases('-i', *DATA_SEQUENCES['image-retrieval-video']), single_option_cases('-g', image_retrieval_arg('gallery.txt')), )), - PythonDemo(subdirectory='instance_segmentation_demo', device_keys=[], test_cases=combine_cases( + PythonDemo(name='instance_segmentation_demo', device_keys=[], test_cases=combine_cases( TestCase(options={'--no_show': None, **MONITORS, '-i': DataPatternArg('instance-segmentation'), '--delay': '1', '-d': 'CPU', # GPU is not supported - '--labels': DemoFileArg('coco_labels.txt')}), + '--labels': str(OMZ_DIR / 'data/dataset_classes/coco.txt')}), single_option_cases('-m', ModelArg('instance-segmentation-security-0010'), ModelArg('instance-segmentation-security-0050'), @@ -358,7 +496,39 @@ def single_option_cases(key, *args): ModelArg('instance-segmentation-security-1025')), )), - PythonDemo(subdirectory='multi_camera_multi_target_tracking', device_keys=['-d'], test_cases=combine_cases( + PythonDemo(name='machine_translation_demo', device_keys=[], test_cases=combine_cases( + [ + TestCase(options={ + '-m': ModelArg('machine-translation-nar-en-ru-0001'), + '--tokenizer-src': str(OMZ_DIR / 'models/intel/machine-translation-nar-en-ru-0001/tokenizer_src'), + '--tokenizer-tgt': str(OMZ_DIR / 'models/intel/machine-translation-nar-en-ru-0001/tokenizer_tgt'), + '--output-name': 'pred', + '-i': [ + 'The quick brown fox jumps over the lazy dog.', + 'The five boxing wizards jump quickly.', + 'Jackdaws love my big sphinx of quartz.' + ], + }), + TestCase(options={ + '-m': ModelArg('machine-translation-nar-ru-en-0001'), + '--tokenizer-src': str(OMZ_DIR / 'models/intel/machine-translation-nar-ru-en-0001/tokenizer_src'), + '--tokenizer-tgt': str(OMZ_DIR / 'models/intel/machine-translation-nar-ru-en-0001/tokenizer_tgt'), + '--output-name': 'pred', + '-i': [ + 'В чащах юга жил бы цитрус? Да, но фальшивый экземпляр!', + 'Широкая электрификация южных губерний даст мощный толчок подъёму сельского хозяйства.', + 'Съешь же ещё этих мягких французских булок да выпей чаю.' + ], + }), + ] + )), + + PythonDemo(name='monodepth_demo', device_keys=['-d'], test_cases=combine_cases( + TestCase(options={'-i': image_net_arg('00000002'), + '-m': ModelArg('midasnet')}) + )), + + PythonDemo(name='multi_camera_multi_target_tracking', device_keys=['-d'], test_cases=combine_cases( TestCase(options={'--no_show': None, **MONITORS, '-i': [DataPatternArg('multi-camera-multi-target-tracking'), @@ -371,48 +541,136 @@ def single_option_cases(key, *args): ModelArg('person-reidentification-retail-0288')), )), - PythonDemo(subdirectory='object_detection_demo_ssd_async', device_keys=['-d'], test_cases=combine_cases( - TestCase(options={'--no_show': None, - **MONITORS, - '-i': DataPatternArg('object-detection-demo-ssd-async')}), - single_option_cases('-m', - ModelArg('face-detection-adas-0001'), - ModelArg('face-detection-retail-0004'), - ModelArg('face-detection-retail-0005'), - ModelArg('face-detection-retail-0044'), - ModelArg('pedestrian-and-vehicle-detector-adas-0001'), - ModelArg('pedestrian-detection-adas-0002'), - ModelArg('person-detection-retail-0013'), - ModelArg('vehicle-detection-adas-0002'), - ModelArg('vehicle-license-plate-detection-barrier-0106'), - ModelArg('ssd-resnet34-1200-onnx')), - )), - - PythonDemo(subdirectory='object_detection_demo_yolov3_async', device_keys=['-d'], test_cases=combine_cases( - TestCase(options={'--no_show': None, - **MONITORS, - '-i': DataPatternArg('object-detection-demo-ssd-async')}), - single_option_cases('-m', - ModelArg('yolo-v1-tiny-tf'), - ModelArg('yolo-v2-tiny-tf'), - ModelArg('yolo-v2-tf'), - ModelArg('yolo-v3-tf'), - ModelArg('mobilefacedet-v1-mxnet')), + PythonDemo(name='object_detection_demo', device_keys=['-d'], test_cases=combine_cases( + TestCase(options={'--no_show': None, **MONITORS, '-i': DataPatternArg('object-detection-demo')}), + [ + *combine_cases( + TestCase(options={'--architecture_type': 'centernet'}), + single_option_cases('-m', + ModelArg('ctdet_coco_dlav0_384'), + ModelArg('ctdet_coco_dlav0_512')), + ), + TestCase(options={'--architecture_type': 'faceboxes', + '-m': ModelArg('faceboxes-pytorch')} + ), + *combine_cases( + TestCase(options={'--architecture_type': 'retina'}), + single_option_cases('-m', + ModelArg('retinaface-anti-cov'), + ModelArg('retinaface-resnet50')) + ), + *combine_cases( + TestCase(options={'--architecture_type': 'ssd'}), + [ + *single_option_cases('-m', + ModelArg('efficientdet-d0-tf'), + ModelArg('efficientdet-d1-tf'), + ModelArg('face-detection-0200'), + ModelArg('face-detection-0202'), + ModelArg('face-detection-0204'), + ModelArg('face-detection-0205'), + ModelArg('face-detection-0206'), + ModelArg('face-detection-adas-0001'), + ModelArg('face-detection-retail-0004'), + ModelArg('face-detection-retail-0005'), + ModelArg('face-detection-retail-0044'), + ModelArg('faster-rcnn-resnet101-coco-sparse-60-0001'), + ModelArg('pedestrian-and-vehicle-detector-adas-0001'), + ModelArg('pedestrian-detection-adas-0002'), + ModelArg('person-detection-0200'), + ModelArg('person-detection-0201'), + ModelArg('person-detection-0202'), + ModelArg('person-detection-retail-0013'), + ModelArg('person-vehicle-bike-detection-2000'), + ModelArg('person-vehicle-bike-detection-2001'), + ModelArg('person-vehicle-bike-detection-2002'), + ModelArg('pelee-coco'), + ModelArg('product-detection-0001'), + ModelArg('rfcn-resnet101-coco-tf'), + ModelArg('retinanet-tf'), + ModelArg('ssd300'), + ModelArg('ssd512'), + ModelArg('ssd_mobilenet_v1_coco'), + ModelArg('ssd_mobilenet_v1_fpn_coco'), + ModelArg('ssd_mobilenet_v2_coco'), + ModelArg('ssd_resnet50_v1_fpn_coco'), + ModelArg('ssd-resnet34-1200-onnx'), + ModelArg('ssdlite_mobilenet_v2'), + ModelArg('vehicle-detection-0200'), + ModelArg('vehicle-detection-0201'), + ModelArg('vehicle-detection-0201'), + ModelArg('vehicle-detection-adas-0002'), + ModelArg('vehicle-license-plate-detection-barrier-0106')), + TestCase(options={'-d': 'CPU', '-m': ModelArg('person-detection-0106')}), # GPU is not supported + ] + ), + *combine_cases( + TestCase(options={'--architecture_type': 'yolo'}), + single_option_cases('-m', + ModelArg('mobilefacedet-v1-mxnet'), + ModelArg('person-vehicle-bike-detection-crossroad-yolov3-1020'), + ModelArg('yolo-v1-tiny-tf'), + ModelArg('yolo-v2-ava-0001'), + ModelArg('yolo-v2-ava-sparse-35-0001'), + ModelArg('yolo-v2-ava-sparse-70-0001'), + ModelArg('yolo-v2-tf'), + ModelArg('yolo-v2-tiny-ava-0001'), + ModelArg('yolo-v2-tiny-ava-sparse-30-0001'), + ModelArg('yolo-v2-tiny-ava-sparse-60-0001'), + ModelArg('yolo-v2-tiny-tf'), + ModelArg('yolo-v2-tiny-vehicle-detection-0001'), + ModelArg('yolo-v3-tf')), + ), + ], )), - PythonDemo(subdirectory='segmentation_demo', device_keys=['-d'], test_cases=combine_cases( + PythonDemo(name='segmentation_demo', device_keys=['-d'], test_cases=combine_cases( + TestCase(options={'--no_show': None, **MONITORS}), [ TestCase(options={ '-m': ModelArg('road-segmentation-adas-0001'), - '-i': DATA_SEQUENCES['road-segmentation-adas'], + '-i': DataPatternArg('road-segmentation-adas'), }), *combine_cases( - TestCase(options={'-i': DATA_SEQUENCES['semantic-segmentation-adas']}), + TestCase(options={'-i': DataPatternArg('semantic-segmentation-adas')}), single_option_cases('-m', ModelArg('semantic-segmentation-adas-0001'), + ModelArg('hrnet-v2-c1-segmentation'), + ModelArg('icnet-camvid-ava-0001'), + ModelArg('icnet-camvid-ava-sparse-30-0001'), + ModelArg('icnet-camvid-ava-sparse-60-0001'), + ModelArg('unet-camvid-onnx-0001'), ModelArg('deeplabv3'))), ], )), + + PythonDemo(name='single_human_pose_estimation_demo', device_keys=['-d'], test_cases=combine_cases( + TestCase(options={'--no_show': None, **MONITORS, + '-i': DataPatternArg('human-pose-estimation'), + '--person_label': '1'}), + [ + *combine_cases( + TestCase(options={'-m_hpe': ModelArg('single-human-pose-estimation-0001')}), + single_option_cases('-m_od', + ModelArg('mobilenet-ssd'), + ModelArg('person-detection-retail-0013'), + ModelArg('ssd_mobilenet_v1_coco'))), + ] + )), + + PythonDemo(name='text_spotting_demo', device_keys=[], test_cases=combine_cases( + TestCase(options={'--no_show': None, '--delay': '1', **MONITORS, + '-d': 'CPU', # GPU is not supported + '-i': DataPatternArg('text-detection')}), + [ + TestCase(options={ + '-m_m': ModelArg('text-spotting-0003-detector'), + '-m_te': ModelArg('text-spotting-0003-recognizer-encoder'), + '-m_td': ModelArg('text-spotting-0003-recognizer-decoder'), + '--no_track': None + }), + ] + )), ] DEMOS = NATIVE_DEMOS + PYTHON_DEMOS diff --git a/demos/tests/data_sequences.py b/demos/tests/data_sequences.py index d79a13386e9..0f666684c44 100644 --- a/demos/tests/data_sequences.py +++ b/demos/tests/data_sequences.py @@ -88,7 +88,6 @@ ], 'human-pose-estimation': [ - image_net_arg('00000002'), image_net_arg('00000184'), image_net_arg('00000442'), image_net_arg('00017291'), @@ -144,7 +143,7 @@ 'multi-camera-multi-target-tracking/repeated': [image_net_arg('00000002')] * 11, - 'object-detection-demo-ssd-async': [ + 'object-detection-demo': [ image_net_arg('00000001'), image_net_arg('00000002'), image_net_arg('00000003'), diff --git a/demos/tests/run_tests.py b/demos/tests/run_tests.py index 9dd0508ab53..f83bda5f364 100755 --- a/demos/tests/run_tests.py +++ b/demos/tests/run_tests.py @@ -23,17 +23,15 @@ * a "ILSVRC2012_img_val" subdirectory with the ILSVRC2012 dataset; * a "Image_Retrieval" subdirectory with image retrieval dataset (images, videos) (see https://github.com/19900531/test) and list of images (see https://github.com/openvinotoolkit/training_extensions/blob/develop/tensorflow_toolkit/image_retrieval/data/gallery/gallery.txt) +* a "msasl" subdirectory with the MS-ASL dataset (https://www.microsoft.com/en-us/research/project/ms-asl/) """ import argparse -import collections import contextlib import csv -import itertools import json import os import shlex -import shutil import subprocess import sys import tempfile @@ -143,7 +141,7 @@ def main(): if args.demos is not None: names_of_demos_to_test = set(args.demos.split(',')) - demos_to_test = [demo for demo in DEMOS if demo.full_name in names_of_demos_to_test] + demos_to_test = [demo for demo in DEMOS if demo.subdirectory in names_of_demos_to_test] else: demos_to_test = DEMOS @@ -152,10 +150,13 @@ def main(): num_failures = 0 - os.putenv('PYTHONPATH', "{}:{}/lib".format(os.environ['PYTHONPATH'], args.demo_build_dir)) + demo_environment = {**os.environ, + 'PYTHONIOENCODING': 'utf-8', + 'PYTHONPATH': "{}:{}/lib".format(os.environ['PYTHONPATH'], args.demo_build_dir), + } for demo in demos_to_test: - print('Testing {}...'.format(demo.full_name)) + print('Testing {}...'.format(demo.subdirectory)) print() declared_model_names = {model['name'] @@ -166,7 +167,6 @@ def main(): with temp_dir_as_path() as temp_dir: arg_context = ArgContext( - source_dir=demos_dir / demo.subdirectory, dl_dir=dl_dir, data_sequence_dir=temp_dir / 'data_seq', data_sequences=DATA_SEQUENCES, @@ -212,7 +212,8 @@ def option_to_args(key, value): try: start_time = timeit.default_timer() subprocess.check_output(fixed_args + dev_arg + case_args, - stderr=subprocess.STDOUT, universal_newlines=True) + stderr=subprocess.STDOUT, universal_newlines=True, encoding='utf-8', + env=demo_environment) execution_time = timeit.default_timer() - start_time except subprocess.CalledProcessError as e: print(e.output) @@ -221,7 +222,7 @@ def option_to_args(key, value): execution_time = -1 if args.report_file: - collect_result(demo.full_name, device, case_model_names, execution_time, args.report_file) + collect_result(demo.subdirectory, device, case_model_names, execution_time, args.report_file) print() diff --git a/demos/text_detection_demo/CMakeLists.txt b/demos/text_detection_demo/cpp/CMakeLists.txt similarity index 73% rename from demos/text_detection_demo/CMakeLists.txt rename to demos/text_detection_demo/cpp/CMakeLists.txt index df1f6a367e6..61ab352e7e4 100644 --- a/demos/text_detection_demo/CMakeLists.txt +++ b/demos/text_detection_demo/cpp/CMakeLists.txt @@ -2,8 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 # -file (GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) -file (GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) +file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +file(GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) ie_add_sample(NAME text_detection_demo SOURCES ${SOURCES} diff --git a/demos/text_detection_demo/README.md b/demos/text_detection_demo/cpp/README.md similarity index 94% rename from demos/text_detection_demo/README.md rename to demos/text_detection_demo/cpp/README.md index ba5c4a69efb..6cbdebadc8f 100644 --- a/demos/text_detection_demo/README.md +++ b/demos/text_detection_demo/cpp/README.md @@ -8,7 +8,7 @@ The demo shows an example of using neural networks to detect and recognize print * `text-recognition-0012`, which is a recognition network for recognizing text. * `handwritten-score-recognition-0001`, which is a recognition network for recognizing handwritten score marks like `` or `.`. -For more information about the pre-trained models, refer to the [model documentation](../../models/intel/index.md). +For more information about the pre-trained models, refer to the [model documentation](../../../models/intel/index.md). ## How It Works @@ -20,7 +20,7 @@ If text recognition model is provided, the demo prints recognized text as well. ## Running -Running the application with the -h option yields the following usage message: +Running the application with the `-h` option yields the following usage message: ``` text_detection_demo [OPTION] Options: @@ -50,7 +50,7 @@ Options: Running the application with the empty list of options yields the usage message given above and an error message. -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). +To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). @@ -68,6 +68,6 @@ The demo uses OpenCV to display the resulting frame with detections rendered as > **NOTE**: On VPU devices (Intel® Movidius™ Neural Compute Stick, Intel® Neural Compute Stick 2, and Intel® Vision Accelerator Design with Intel® Movidius™ VPUs) this demo is not supported with any of the Model Downloader available topologies. Other models may work incorrectly on these devices as well. ## See Also -* [Using Open Model Zoo demos](../README.md) +* [Using Open Model Zoo demos](../../README.md) * [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) -* [Model Downloader](../../tools/downloader/README.md) +* [Model Downloader](../../../tools/downloader/README.md) diff --git a/demos/text_detection_demo/include/cnn.hpp b/demos/text_detection_demo/cpp/include/cnn.hpp similarity index 100% rename from demos/text_detection_demo/include/cnn.hpp rename to demos/text_detection_demo/cpp/include/cnn.hpp diff --git a/demos/text_detection_demo/include/text_detection.hpp b/demos/text_detection_demo/cpp/include/text_detection.hpp similarity index 100% rename from demos/text_detection_demo/include/text_detection.hpp rename to demos/text_detection_demo/cpp/include/text_detection.hpp diff --git a/demos/text_detection_demo/include/text_recognition.hpp b/demos/text_detection_demo/cpp/include/text_recognition.hpp similarity index 100% rename from demos/text_detection_demo/include/text_recognition.hpp rename to demos/text_detection_demo/cpp/include/text_recognition.hpp diff --git a/demos/text_detection_demo/main.cpp b/demos/text_detection_demo/cpp/main.cpp similarity index 99% rename from demos/text_detection_demo/main.cpp rename to demos/text_detection_demo/cpp/main.cpp index da9cbe2a073..df879050a83 100644 --- a/demos/text_detection_demo/main.cpp +++ b/demos/text_detection_demo/cpp/main.cpp @@ -21,9 +21,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "cnn.hpp" #include "text_detection.hpp" diff --git a/demos/text_detection_demo/models.lst b/demos/text_detection_demo/cpp/models.lst similarity index 100% rename from demos/text_detection_demo/models.lst rename to demos/text_detection_demo/cpp/models.lst diff --git a/demos/text_detection_demo/src/cnn.cpp b/demos/text_detection_demo/cpp/src/cnn.cpp similarity index 99% rename from demos/text_detection_demo/src/cnn.cpp rename to demos/text_detection_demo/cpp/src/cnn.cpp index cd236592d78..1e7e0ba2b45 100644 --- a/demos/text_detection_demo/src/cnn.cpp +++ b/demos/text_detection_demo/cpp/src/cnn.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include void Cnn::Init(const std::string &model_path, Core & ie, const std::string & deviceName, const cv::Size &new_input_resolution) { diff --git a/demos/text_detection_demo/src/text_detection.cpp b/demos/text_detection_demo/cpp/src/text_detection.cpp similarity index 100% rename from demos/text_detection_demo/src/text_detection.cpp rename to demos/text_detection_demo/cpp/src/text_detection.cpp diff --git a/demos/text_detection_demo/src/text_recognition.cpp b/demos/text_detection_demo/cpp/src/text_recognition.cpp similarity index 100% rename from demos/text_detection_demo/src/text_recognition.cpp rename to demos/text_detection_demo/cpp/src/text_recognition.cpp diff --git a/demos/text_detection_demo/text_detection_demo.hpp b/demos/text_detection_demo/cpp/text_detection_demo.hpp similarity index 99% rename from demos/text_detection_demo/text_detection_demo.hpp rename to demos/text_detection_demo/cpp/text_detection_demo.hpp index 41517c9c85e..e5c6132ab07 100644 --- a/demos/text_detection_demo/text_detection_demo.hpp +++ b/demos/text_detection_demo/cpp/text_detection_demo.hpp @@ -9,7 +9,7 @@ #include #include -#include +#include DEFINE_INPUT_FLAGS diff --git a/demos/python_demos/text_spotting_demo/README.md b/demos/text_spotting_demo/python/README.md similarity index 96% rename from demos/python_demos/text_spotting_demo/README.md rename to demos/text_spotting_demo/python/README.md index d1f16370122..3f7ba08944c 100644 --- a/demos/python_demos/text_spotting_demo/README.md +++ b/demos/text_spotting_demo/python/README.md @@ -1,4 +1,4 @@ -# Text Spotting Python* Demo +# Text Spotting Python\* Demo This demo shows how to run Text Spotting models. Text Spotting models allow us to simultaneously detect and recognize text. @@ -111,16 +111,16 @@ Options: Running the application with an empty list of options yields the short version of the usage message and an error message. -To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/). +To run the demo, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](../../../tools/downloader/README.md). The list of models supported by the demo is in [models.lst](./models.lst). > **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine format (`*.xml` + `*.bin`) using the [Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). To run the demo, please provide paths to the model in the IR format and to an input with images: ```bash python3 text_spotting_demo.py \ --m_m /text-spotting-0002-detector.xml \ --m_te /text-spotting-0002-recognizer-encoder.xml \ --m_td /text-spotting-0002-recognizer-decoder.xml \ +-m_m /text-spotting-0003-detector.xml \ +-m_te /text-spotting-0003-recognizer-encoder.xml \ +-m_td /text-spotting-0003-recognizer-decoder.xml \ -i 0 ``` diff --git a/demos/python_demos/text_spotting_demo/models.lst b/demos/text_spotting_demo/python/models.lst similarity index 100% rename from demos/python_demos/text_spotting_demo/models.lst rename to demos/text_spotting_demo/python/models.lst diff --git a/demos/python_demos/text_spotting_demo/text_spotting_demo.py b/demos/text_spotting_demo/python/text_spotting_demo.py similarity index 85% rename from demos/python_demos/text_spotting_demo/text_spotting_demo.py rename to demos/text_spotting_demo/python/text_spotting_demo.py index 161bfe9e0f1..b3f9dc8c950 100755 --- a/demos/python_demos/text_spotting_demo/text_spotting_demo.py +++ b/demos/text_spotting_demo/python/text_spotting_demo.py @@ -23,12 +23,14 @@ import cv2 import numpy as np +from scipy.special import softmax from openvino.inference_engine import IECore from text_spotting_demo.tracker import StaticIOUTracker from text_spotting_demo.visualizer import Visualizer -sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'common')) +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), + 'common/python')) import monitors @@ -99,7 +101,7 @@ def build_argparser(): default=0.5, type=float, metavar='""') args.add_argument('-a', '--alphabet', help='Optional. Alphabet that is used for decoding.', - default=' 0123456789abcdefghijklmnopqrstuvwxyz') + default=' abcdefghijklmnopqrstuvwxyz0123456789') args.add_argument('--trd_input_prev_symbol', help='Optional. Name of previous symbol input node to text recognition head decoder part.', default='prev_symbol') @@ -115,6 +117,9 @@ def build_argparser(): args.add_argument('--trd_output_cur_hidden', help='Optional. Name of current hidden output node from text recognition head decoder part.', default='hidden') + args.add_argument('-trt', '--tr_threshold', + help='Optional. Text recognition confidence threshold.', + default=0.5, type=float, metavar='""') args.add_argument('--keep_aspect_ratio', help='Optional. Force image resize to keep aspect ratio.', action='store_true') @@ -192,14 +197,26 @@ def main(): log.info('Loading decoder part of text recognition network') text_dec_net = ie.read_network(args.text_dec_model, os.path.splitext(args.text_dec_model)[0] + '.bin') - required_input_keys = {'im_data', 'im_info'} - assert required_input_keys == set(mask_rcnn_net.input_info), \ - 'Demo supports only topologies with the following input keys: {}'.format(', '.join(required_input_keys)) - required_output_keys = {'boxes', 'scores', 'classes', 'raw_masks', 'text_features'} + model_required_inputs = {'image'} + old_model_required_inputs = {'im_data', 'im_info'} + if set(mask_rcnn_net.input_info) == model_required_inputs: + old_model = False + required_output_keys = {'boxes', 'labels', 'masks', 'text_features.0'} + n, c, h, w = mask_rcnn_net.input_info['image'].input_data.shape + elif set(mask_rcnn_net.input_info) == old_model_required_inputs: + old_model = True + required_output_keys = {'boxes', 'scores', 'classes', 'raw_masks', 'text_features'} + n, c, h, w = mask_rcnn_net.input_info['im_data'].input_data.shape + args.alphabet = ' 0123456789abcdefghijklmnopqrstuvwxyz' + args.tr_threshold = 0 + else: + raise RuntimeError('Demo supports only topologies with the following input keys: ' + f'{model_required_inputs} or {old_model_required_inputs}.') + assert required_output_keys.issubset(mask_rcnn_net.outputs.keys()), \ - 'Demo supports only topologies with the following output keys: {}'.format(', '.join(required_output_keys)) + f'Demo supports only topologies with the following output keys: {required_output_keys}' \ + f'Found: {mask_rcnn_net.outputs.keys()}.' - n, c, h, w = mask_rcnn_net.input_info['im_data'].input_data.shape assert n == 1, 'Only batch 1 is supported by the demo application' log.info('Loading IR to the plugin...') @@ -266,14 +283,24 @@ def main(): # Run the net. inf_start = time.time() - outputs = mask_rcnn_exec_net.infer({'im_data': input_image, 'im_info': input_image_info}) + if old_model: + outputs = mask_rcnn_exec_net.infer({'im_data': input_image, 'im_info': input_image_info}) + else: + outputs = mask_rcnn_exec_net.infer({'image': input_image}) # Parse detection results of the current request - boxes = outputs['boxes'] - scores = outputs['scores'] - classes = outputs['classes'].astype(np.uint32) - raw_masks = outputs['raw_masks'] - text_features = outputs['text_features'] + if old_model: + boxes = outputs['boxes'] + scores = outputs['scores'] + classes = outputs['classes'].astype(np.uint32) + raw_masks = outputs['raw_masks'] + text_features = outputs['text_features'] + else: + boxes = outputs['boxes'][:, :4] + scores = outputs['boxes'][:, 4] + classes = outputs['labels'].astype(np.uint32) + raw_masks = outputs['masks'] + text_features = outputs['text_features.0'] # Filter out detections with low confidence. detections_filter = scores > args.prob_threshold @@ -287,8 +314,9 @@ def main(): boxes[:, 1::2] /= scale_y masks = [] for box, cls, raw_mask in zip(boxes, classes, raw_masks): - raw_cls_mask = raw_mask[cls, ...] - mask = segm_postprocess(box, raw_cls_mask, frame.shape[0], frame.shape[1]) + if old_model: + raw_mask = raw_mask[cls, ...] + mask = segm_postprocess(box, raw_mask, frame.shape[0], frame.shape[1]) masks.append(mask) texts = [] @@ -301,19 +329,22 @@ def main(): prev_symbol_index = np.ones((1,)) * SOS_INDEX text = '' + text_confidence = 1.0 for i in range(MAX_SEQ_LEN): decoder_output = text_dec_exec_net.infer({ args.trd_input_prev_symbol: prev_symbol_index, args.trd_input_prev_hidden: hidden, args.trd_input_encoder_outputs: feature}) symbols_distr = decoder_output[args.trd_output_symbols_distr] + symbols_distr_softmaxed = softmax(symbols_distr, axis=1)[0] prev_symbol_index = int(np.argmax(symbols_distr, axis=1)) + text_confidence *= symbols_distr_softmaxed[prev_symbol_index] if prev_symbol_index == EOS_INDEX: break text += args.alphabet[prev_symbol_index] hidden = decoder_output[args.trd_output_cur_hidden] - texts.append(text) + texts.append(text if text_confidence >= args.tr_threshold else '') inf_end = time.time() inf_time = inf_end - inf_start diff --git a/demos/text_spotting_demo/python/text_spotting_demo/__init__.py b/demos/text_spotting_demo/python/text_spotting_demo/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/demos/python_demos/text_spotting_demo/text_spotting_demo/tracker.py b/demos/text_spotting_demo/python/text_spotting_demo/tracker.py similarity index 100% rename from demos/python_demos/text_spotting_demo/text_spotting_demo/tracker.py rename to demos/text_spotting_demo/python/text_spotting_demo/tracker.py diff --git a/demos/python_demos/text_spotting_demo/text_spotting_demo/visualizer.py b/demos/text_spotting_demo/python/text_spotting_demo/visualizer.py similarity index 100% rename from demos/python_demos/text_spotting_demo/text_spotting_demo/visualizer.py rename to demos/text_spotting_demo/python/text_spotting_demo/visualizer.py diff --git a/demos/text_to_speech_demo/python/README.md b/demos/text_to_speech_demo/python/README.md new file mode 100644 index 00000000000..7dea8466ae3 --- /dev/null +++ b/demos/text_to_speech_demo/python/README.md @@ -0,0 +1,73 @@ +# Text-to-speech Python\* Demo + +## Description +The text to speech demo show how to run the ForwardTacotron and WaveRNN models to produce an audio file for a given input text file. +The demo is based on https://github.com/as-ideas/ForwardTacotron and https://github.com/fatchord/WaveRNN repositories. + +## How It Works + +Upon the start-up, the demo application reads command-line parameters and loads four networks to the +Inference Engine plugin. The demo pipeline reads text file by lines and divides every line to parts by punctuation marks. +The heuristic algorithm chooses punctuation near to the some threshold by sentence length. +When inference is done, the application outputs the audio to the WAV file with 22050 Hz sample rate. + +## Running + +Running the application with the `-h` option yields the following usage message: + +``` +usage: text_to_speech_demo.py [-h] -m_duration MODEL_DURATION -m_forward + MODEL_FORWARD -m_upsample MODEL_UPSAMPLE -m_rnn + MODEL_RNN -i INPUT [-o OUT] + [--upsampler_width UPSAMPLER_WIDTH] [-d DEVICE] + +Options: + -h, --help Show this help message and exit. + -m_duration MODEL_DURATION, --model_duration MODEL_DURATION + Required. Path to ForwardTacotron`s duration + prediction part (*.xml format). + -m_forward MODEL_FORWARD, --model_forward MODEL_FORWARD + Required. Path to ForwardTacotron`s mel-spectrogram + regression part (*.xml format). + -m_upsample MODEL_UPSAMPLE, --model_upsample MODEL_UPSAMPLE + Required. Path to WaveRNN`s part for mel-spectrogram + upsampling by time axis (*.xml format). + -m_rnn MODEL_RNN, --model_rnn MODEL_RNN + Required. Path to WaveRNN`s part for waveform + autoregression (*.xml format). + -i INPUT, --input INPUT + Text file with text. + -o OUT, --out OUT Required. Path to an output .wav file + --upsampler_width UPSAMPLER_WIDTH + Width for reshaping of the model_upsample. If -1 then + no reshape. Do not use with FP16 model. + -d DEVICE, --device DEVICE + Optional. Specify the target device to infer on; CPU, + GPU, FPGA, HDDL, MYRIAD or HETERO: is acceptable. The + sample will look for a suitable plugin for device + specified. Default value is CPU +``` + +Running the application with the empty list of options yields the usage message and an error message. + +## Example for running with arguments +``` +python3 text_to_speech_demo.py --model_upsample wavernn_upsampler.xml --model_rnn wavernn_rnn.xml --model_duration forward_tacotron_duration_prediction.xml --model_forward forward_tacotron_regression.xml --input +``` + +To run the demo, you can use public pre-trained models. You can download the pre-trained models with the OpenVINO +[Model Downloader](../../../tools/downloader/README.md). + +> **NOTE**: Before running the demo with a trained model, make sure the model is converted to the Inference Engine +format (\*.xml + \*.bin) using the +[Model Optimizer tool](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html). + +## Demo Output + +The application outputs is WAV file with generated audio. + +## See Also + +* [Using Open Model Zoo Demos](../../README.md) +* [Model Optimizer](https://docs.openvinotoolkit.org/latest/_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) +* [Model Downloader](../../../tools/downloader/README.md) diff --git a/demos/text_to_speech_demo/python/models.lst b/demos/text_to_speech_demo/python/models.lst new file mode 100644 index 00000000000..f65e4a91e53 --- /dev/null +++ b/demos/text_to_speech_demo/python/models.lst @@ -0,0 +1,5 @@ +# This file can be used with the --list option of the model downloader. +forward-tacotron-duration-prediction +forward-tacotron-regression +wavernn-rnn +wavernn-upsampler diff --git a/demos/text_to_speech_demo/python/models/__init__.py b/demos/text_to_speech_demo/python/models/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/demos/text_to_speech_demo/python/models/forward_tacotron_ie.py b/demos/text_to_speech_demo/python/models/forward_tacotron_ie.py new file mode 100644 index 00000000000..ab4e5ba5b4b --- /dev/null +++ b/demos/text_to_speech_demo/python/models/forward_tacotron_ie.py @@ -0,0 +1,184 @@ +""" + Copyright (c) 2020 Intel Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + +import os.path as osp + +import numpy as np + +from utils.text_preprocessing import text_to_sequence, _symbol_to_id + + +class ForwardTacotronIE: + def __init__(self, model_duration, model_forward, ie, device='CPU', verbose=False): + self.verbose = verbose + self.device = device + + self.ie = ie + + self.duration_predictor_net = self.load_network(model_duration) + self.duration_predictor_exec = self.create_exec_network(self.duration_predictor_net) + + self.forward_net = self.load_network(model_forward) + self.forward_exec = self.create_exec_network(self.forward_net) + + # fixed length of the sequence of symbols + self.duration_len = self.duration_predictor_net.input_info['input_seq'].input_data.shape[1] + # fixed length of the input embeddings for forward + self.forward_len = self.forward_net.input_info['data'].input_data.shape[1] + if self.verbose: + print('Forward limitations : {0} symbols and {1} embeddings'.format(self.duration_len, self.forward_len)) + + def seq_to_indexes(self, text): + res = text_to_sequence(text) + if self.verbose: + print(res) + return res + + @staticmethod + def build_index(duration, x): + duration[np.where(duration < 0)] = 0 + tot_duration = np.cumsum(duration, 1) + max_duration = int(tot_duration.max().item()) + index = np.zeros([x.shape[0], max_duration, x.shape[2]], dtype='long') + + for i in range(tot_duration.shape[0]): + pos = 0 + for j in range(tot_duration.shape[1]): + pos1 = tot_duration[i, j] + index[i, pos:pos1, :] = j + pos = pos1 + index[i, pos:, :] = j + return index + + @staticmethod + def gather(a, dim, index): + expanded_index = [index if dim==i else np.arange(a.shape[i]).reshape([-1 if i==j else 1 for j in range(a.ndim)]) for i in range(a.ndim)] + return a[tuple(expanded_index)] + + def load_network(self, model_xml): + model_bin_name = ".".join(osp.basename(model_xml).split('.')[:-1]) + ".bin" + model_bin = osp.join(osp.dirname(model_xml), model_bin_name) + print("Loading network files:\n\t{}\n\t{}".format(model_xml, model_bin)) + net = self.ie.read_network(model=model_xml, weights=model_bin) + return net + + def create_exec_network(self, net): + exec_net = self.ie.load_network(network=net, device_name=self.device) + return exec_net + + def infer_duration(self, sequence, alpha=1.0, non_empty_symbols=None): + out = self.duration_predictor_exec.infer(inputs={"input_seq": sequence}) + duration = out["duration"] * alpha + + duration = (duration + 0.5).astype('int').flatten() + duration = np.expand_dims(duration, axis=0) + preprocessed_embeddings = out["embeddings"] + + if non_empty_symbols is not None: + duration = duration[:, :non_empty_symbols] + preprocessed_embeddings = preprocessed_embeddings[:, :non_empty_symbols] + indexes = self.build_index(duration, preprocessed_embeddings) + if self.verbose: + print("Index: {0}, duration: {1}, embeddings: {2}, non_empty_symbols: {3}" + .format(indexes.shape, duration.shape, preprocessed_embeddings.shape, non_empty_symbols)) + + return self.gather(preprocessed_embeddings, 1, indexes) + + def infer_mel(self, aligned_emb): + out = self.forward_exec.infer(inputs={"data": aligned_emb}) + return out['mel'] + + def forward(self, text, alpha=1.0): + sequence = self.seq_to_indexes(text) + if len(sequence) <= self.duration_len: + non_empty_symbols = None + if len(sequence) < self.duration_len: + non_empty_symbols = len(sequence) + sequence += [_symbol_to_id[' ']] * (self.duration_len - len(sequence)) + sequence = np.array(sequence) + sequence = np.expand_dims(sequence, axis=0) + if self.verbose: + print("Seq shape: {0}".format(sequence.shape)) + aligned_emb = self.infer_duration(sequence, alpha, non_empty_symbols=non_empty_symbols) + if self.verbose: + print("AEmb shape: {0}".format(aligned_emb.shape)) + else: + punctuation = '!\'(),.:;? ' + delimiters = [_symbol_to_id[p] for p in punctuation] + # try to find optimal fragmentation for inference + ranges = [i+1 for i, val in enumerate(sequence) if val in delimiters] + if len(sequence) not in ranges: + ranges.append(len(sequence)) + optimal_ranges = [] + prev_begin = 0 + for i in range(len(ranges)-1): + if ranges[i] < 0: + continue + res1 = (ranges[i] - prev_begin) % self.duration_len + res2 = (ranges[i + 1] - prev_begin) % self.duration_len + if res1 > res2 or res1 == 0: + if res2 == 0: + optimal_ranges.append(ranges[i+1]) + ranges[i+1] = -1 + else: + optimal_ranges.append(ranges[i]) + prev_begin = optimal_ranges[-1] + if self.verbose: + print(optimal_ranges) + if len(sequence) not in optimal_ranges: + optimal_ranges.append(len(sequence)) + + outputs = [] + start_idx = 0 + for edge in optimal_ranges: + sub_sequence = sequence[start_idx:edge] + start_idx = edge + non_empty_symbols = None + if len(sub_sequence) < self.duration_len: + non_empty_symbols = len(sub_sequence) + sub_sequence += [_symbol_to_id[' ']] * (self.duration_len - len(sub_sequence)) + sub_sequence = np.array(sub_sequence) + sub_sequence = np.expand_dims(sub_sequence, axis=0) + if self.verbose: + print("Sub seq shape: {0}".format(sub_sequence.shape)) + outputs.append(self.infer_duration(sub_sequence, alpha, non_empty_symbols=non_empty_symbols)) + + if self.verbose: + print("Sub AEmb: {0}".format(outputs[-1].shape)) + + aligned_emb = np.concatenate(outputs, axis=1) + mels = [] + n_iters = aligned_emb.shape[1] // self.forward_len + 1 + for i in range(n_iters): + start_idx = i * self.forward_len + end_idx = min((i+1) * self.forward_len, aligned_emb.shape[1]) + if start_idx >= aligned_emb.shape[1]: + break + sub_aligned_emb = aligned_emb[:, start_idx:end_idx, :] + if sub_aligned_emb.shape[1] < self.forward_len: + sub_aligned_emb = np.pad(sub_aligned_emb, + ((0, 0), (0, self.forward_len - sub_aligned_emb.shape[1]), (0, 0)), + 'constant', constant_values=0) + if self.verbose: + print("SAEmb shape: {0}".format(sub_aligned_emb.shape)) + mel = self.infer_mel(sub_aligned_emb)[:, :end_idx - start_idx] + mels.append(mel) + + res = np.concatenate(mels, axis=1) + if self.verbose: + print("MEL shape :{0}".format(res.shape)) + + return res diff --git a/demos/text_to_speech_demo/python/models/mel2wave_ie.py b/demos/text_to_speech_demo/python/models/mel2wave_ie.py new file mode 100644 index 00000000000..46425e8fb68 --- /dev/null +++ b/demos/text_to_speech_demo/python/models/mel2wave_ie.py @@ -0,0 +1,180 @@ +""" + Copyright (c) 2020 Intel Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + +import os.path as osp + +import numpy as np + +from utils.wav_processing import ( + fold_with_overlap, infer_from_discretized_mix_logistic, pad_tensor, xfade_and_unfold, +) + + +class WaveRNNIE: + def __init__(self, model_upsample, model_rnn, ie, target=11000, overlap=550, hop_length=275, bits=9, device='CPU', + verbose=False, upsampler_width=-1): + """ + return class provided WaveRNN inference. + + :param model_upsample: path to xml with upsample model of WaveRNN + :param model_rnn: path to xml with rnn parameters of WaveRNN model + :param target: length of the processed fragments + :param overlap: overlap of the processed frames + :param hop_length: The number of samples between successive frames, e.g., the columns of a spectrogram. + :return: + """ + self.verbose = verbose + self.device = device + self.target = target + self.overlap = overlap + self.dynamic_overlap = overlap + self.hop_length = hop_length + self.bits = bits + self.indent = 550 + self.pad = 2 + self.batch_sizes = [1, 2, 4, 8, 16, 32, 64, 128, 256] + self.ie = ie + + self.upsample_net = self.load_network(model_upsample) + if upsampler_width > 0: + orig_shape = self.upsample_net.input_info['mels'].input_data.shape + self.upsample_net.reshape({"mels": (orig_shape[0], upsampler_width, orig_shape[2])}) + + self.upsample_exec = self.create_exec_network(self.upsample_net) + + self.rnn_net = self.load_network(model_rnn) + self.rnn_exec = self.create_exec_network(self.rnn_net, batch_sizes=self.batch_sizes) + + # fixed number of the mels in mel-spectrogramm + self.mel_len = self.upsample_net.input_info['mels'].input_data.shape[1] - 2 * self.pad + self.rnn_width = self.rnn_net.input_info['x'].input_data.shape[1] + + def load_network(self, model_xml): + model_bin_name = ".".join(osp.basename(model_xml).split('.')[:-1]) + ".bin" + model_bin = osp.join(osp.dirname(model_xml), model_bin_name) + print("Loading network files:\n\t{}\n\t{}".format(model_xml, model_bin)) + net = self.ie.read_network(model=model_xml, weights=model_bin) + return net + + def create_exec_network(self, net, batch_sizes=None): + if batch_sizes is not None: + exec_net = [] + for b_s in batch_sizes: + net.batch_size = b_s + exec_net.append(self.ie.load_network(network=net, device_name=self.device)) + else: + exec_net = self.ie.load_network(network=net, device_name=self.device) + return exec_net + + @staticmethod + def get_rnn_init_states(b_size=1, rnn_dims=328): + h1 = np.zeros((b_size, rnn_dims), dtype=float) + h2 = np.zeros((b_size, rnn_dims), dtype=float) + x = np.zeros((b_size, 1), dtype=float) + return h1, h2, x + + def forward(self, mels): + n_parts = mels.shape[1] // self.mel_len + 1 if mels.shape[1] % self.mel_len > 0 else mels.shape[ + 1] // self.mel_len + upsampled_mels = [] + aux = [] + last_padding = 0 + for i in range(n_parts): + i_start = i * self.mel_len + i_end = i_start + self.mel_len + if i_end > mels.shape[1]: + last_padding = i_end - mels.shape[1] + mel = np.pad(mels[:, i_start:mels.shape[1], :], ((0, 0), (0, last_padding), (0, 0)), 'constant', + constant_values=0) + else: + mel = mels[:, i_start:i_end, :] + + upsampled_mels_b, aux_b = self.forward_upsample(mel) + upsampled_mels.append(upsampled_mels_b) + aux.append(aux_b) + if len(aux) > 1: + upsampled_mels = np.concatenate(upsampled_mels, axis=1) + aux = np.concatenate(aux, axis=1) + else: + upsampled_mels = upsampled_mels[0] + aux = aux[0] + if last_padding > 0: + upsampled_mels = upsampled_mels[:, :-last_padding * self.hop_length, :] + aux = aux[:, :-last_padding * self.hop_length, :] + + upsampled_mels, (_, self.dynamic_overlap) = fold_with_overlap(upsampled_mels, self.target, self.overlap) + aux, _ = fold_with_overlap(aux, self.target, self.overlap) + + audio = self.forward_rnn(mels, upsampled_mels, aux) + + return audio + + def forward_upsample(self, mels): + mels = pad_tensor(mels, pad=self.pad) + + out = self.upsample_exec.infer(inputs={"mels": mels}) + upsample_mels, aux = out["upsample_mels"][:, self.indent:-self.indent, :], out["aux"] + return upsample_mels, aux + + def forward_rnn(self, mels, upsampled_mels, aux): + wave_len = (mels.shape[1] - 1) * self.hop_length + + d = aux.shape[2] // 4 + aux_split = [aux[:, :, d * i:d * (i + 1)] for i in range(4)] + + b_size, seq_len, _ = upsampled_mels.shape + seq_len = min(seq_len, aux_split[0].shape[1]) + + if b_size not in self.batch_sizes: + raise Exception('Incorrect batch size {0}. Correct should be 2 ** something'.format(b_size)) + + active_network = self.batch_sizes.index(b_size) + + h1, h2, x = self.get_rnn_init_states(b_size, self.rnn_width) + + output = [] + + for i in range(seq_len): + m_t = upsampled_mels[:, i, :] + + a1_t, a2_t, a3_t, a4_t = \ + (a[:, i, :] for a in aux_split) + + out = self.rnn_exec[active_network].infer(inputs={"m_t": m_t, "a1_t": a1_t, "a2_t": a2_t, "a3_t": a3_t, + "a4_t": a4_t, "h1.1": h1, "h2.1": h2, "x": x}) + + logits = out["logits"] + h1 = out["h1"] + h2 = out["h2"] + + sample = infer_from_discretized_mix_logistic(logits) + + x = sample[:] + x = np.expand_dims(x, axis=1) + output.append(sample) + + output = np.stack(output).transpose(1, 0) + output = output.astype(np.float64) + + if b_size > 1: + output = xfade_and_unfold(output, self.dynamic_overlap) + else: + output = output[0] + + fade_out = np.linspace(1, 0, 20 * self.hop_length) + output = output[:wave_len] + output[-20 * self.hop_length:] *= fade_out + return output diff --git a/demos/text_to_speech_demo/python/requirements.txt b/demos/text_to_speech_demo/python/requirements.txt new file mode 100644 index 00000000000..3643b31a7a8 --- /dev/null +++ b/demos/text_to_speech_demo/python/requirements.txt @@ -0,0 +1,4 @@ +numpy>=1.18.3 +inflect>=4.1.0 +Unidecode>=0.4.20 +tqdm>=4.46.1 diff --git a/demos/text_to_speech_demo/python/text_to_speech_demo.py b/demos/text_to_speech_demo/python/text_to_speech_demo.py new file mode 100755 index 00000000000..b8c8bbab706 --- /dev/null +++ b/demos/text_to_speech_demo/python/text_to_speech_demo.py @@ -0,0 +1,144 @@ +#!/usr/bin/env python3 + +""" + Copyright (c) 2020 Intel Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + +import sys +import time +from argparse import ArgumentParser, SUPPRESS + +from tqdm import tqdm +import numpy as np +import wave +from openvino.inference_engine import IECore + +from models.forward_tacotron_ie import ForwardTacotronIE +from models.mel2wave_ie import WaveRNNIE + + +def save_wav(x, path): + sr = 22050 + audio = (x * (2 ** 15 - 1)).astype(" len_th: + texts = [] + prev_begin = 0 + delimiters = '.!?;:' + for i, c in enumerate(line): + if (c in delimiters and i - prev_begin > len_th) or i == len(line) - 1: + texts.append(line[prev_begin:i+1]) + prev_begin = i + else: + texts = [line] + + for text in tqdm(texts): + time_s = time.perf_counter() + mel = forward_tacotron.forward(text) + time_e = time.perf_counter() + time_forward += (time_e - time_s) * 1000 + + mel = (mel + 4) / 8 + np.clip(mel, 0, 1, out=mel) + mel = np.transpose(mel) + mel = np.expand_dims(mel, axis=0) + + time_s = time.perf_counter() + audio = vocoder.forward(mel) + time_e = time.perf_counter() + time_wavernn += (time_e - time_s) * 1000 + + audio_res.extend(audio) + audio_res.extend(silent * min(audio)) + + if count % 5 == 0: + print('WaveRNN time: {:.3f}ms. ForwardTacotronTime {:.3f}ms'.format(time_wavernn, time_forward)) + time_e_all = time.perf_counter() + + print('All time {:.3f}ms. WaveRNN time: {:.3f}ms. ForwardTacotronTime {:.3f}ms' + .format((time_e_all - time_s_all) * 1000, time_wavernn, time_forward)) + + save_wav(np.array(audio_res), args.out) + + +if __name__ == '__main__': + sys.exit(main() or 0) diff --git a/demos/text_to_speech_demo/python/utils/__init__.py b/demos/text_to_speech_demo/python/utils/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/demos/text_to_speech_demo/python/utils/numbers.py b/demos/text_to_speech_demo/python/utils/numbers.py new file mode 100644 index 00000000000..d8611ba7f67 --- /dev/null +++ b/demos/text_to_speech_demo/python/utils/numbers.py @@ -0,0 +1,89 @@ +""" + Copyright (c) 2020 Intel Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +This file is based in numbers.py from https://github.com/keithito/tacotron, +commit d26c763342518d4e432e9c4036a1aff3b4fdaa1e on Feb 3, 2020 + +""" + +import inflect +import re + + +_inflect = inflect.engine() +_comma_number_re = re.compile(r'([0-9][0-9\,]+[0-9])') +_decimal_number_re = re.compile(r'([0-9]+\.[0-9]+)') +_pounds_re = re.compile(r'£([0-9\,]*[0-9]+)') +_dollars_re = re.compile(r'\$([0-9\.\,]*[0-9]+)') +_ordinal_re = re.compile(r'[0-9]+(st|nd|rd|th)') +_number_re = re.compile(r'[0-9]+') + + +def _remove_commas(m): + return m.group(1).replace(',', '') + + +def _expand_decimal_point(m): + return m.group(1).replace('.', ' point ') + + +def _expand_dollars(m): + match = m.group(1) + parts = match.split('.') + if len(parts) > 2: + return match + ' dollars' # Unexpected format + dollars = int(parts[0]) if parts[0] else 0 + cents = int(parts[1]) if len(parts) > 1 and parts[1] else 0 + if dollars and cents: + dollar_unit = 'dollar' if dollars == 1 else 'dollars' + cent_unit = 'cent' if cents == 1 else 'cents' + return '%s %s, %s %s' % (dollars, dollar_unit, cents, cent_unit) + elif dollars: + dollar_unit = 'dollar' if dollars == 1 else 'dollars' + return '%s %s' % (dollars, dollar_unit) + elif cents: + cent_unit = 'cent' if cents == 1 else 'cents' + return '%s %s' % (cents, cent_unit) + else: + return 'zero dollars' + + +def _expand_ordinal(m): + return _inflect.number_to_words(m.group(0)) + + +def _expand_number(m): + num = int(m.group(0)) + if num > 1000 and num < 3000: + if num == 2000: + return 'two thousand' + elif num > 2000 and num < 2010: + return 'two thousand ' + _inflect.number_to_words(num % 100) + elif num % 100 == 0: + return _inflect.number_to_words(num // 100) + ' hundred' + else: + return _inflect.number_to_words(num, andword='', zero='oh', group=2).replace(', ', ' ') + else: + return _inflect.number_to_words(num, andword='') + + +def normalize_numbers(text): + text = re.sub(_comma_number_re, _remove_commas, text) + text = re.sub(_pounds_re, r'\1 pounds', text) + text = re.sub(_dollars_re, _expand_dollars, text) + text = re.sub(_decimal_number_re, _expand_decimal_point, text) + text = re.sub(_ordinal_re, _expand_ordinal, text) + text = re.sub(_number_re, _expand_number, text) + return text diff --git a/demos/text_to_speech_demo/python/utils/text_preprocessing.py b/demos/text_to_speech_demo/python/utils/text_preprocessing.py new file mode 100644 index 00000000000..f7d163ccca3 --- /dev/null +++ b/demos/text_to_speech_demo/python/utils/text_preprocessing.py @@ -0,0 +1,100 @@ +""" + Copyright (c) 2020 Intel Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +This file is based in cleaners.py from https://github.com/keithito/tacotron, +commit d26c763342518d4e432e9c4036a1aff3b4fdaa1e on Feb 3, 2020 +""" + +from unidecode import unidecode +import re +from utils.numbers import normalize_numbers + + + +_pad = '_' +_punctuation = '!\'(),.:;? ' +_special = '-' +_letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' + + +# Export all symbols: +symbols = [_pad] + list(_special) + list(_punctuation) + list(_letters) + + +# Mappings from symbol to numeric ID and vice versa: +_symbol_to_id = {s: i for i, s in enumerate(symbols)} +_id_to_symbol = {i: s for i, s in enumerate(symbols)} + + + +_abbreviations = [(re.compile('\\b%s\\.' % x[0], re.IGNORECASE), x[1]) for x in [ + ('mrs', 'misess'), + ('mr', 'mister'), + ('dr', 'doctor'), + ('st', 'saint'), + ('co', 'company'), + ('jr', 'junior'), + ('maj', 'major'), + ('gen', 'general'), + ('drs', 'doctors'), + ('rev', 'reverend'), + ('lt', 'lieutenant'), + ('hon', 'honorable'), + ('sgt', 'sergeant'), + ('capt', 'captain'), + ('esq', 'esquire'), + ('ltd', 'limited'), + ('col', 'colonel'), + ('ft', 'fort'), +]] + + +def expand_abbreviations(text): + for regex, replacement in _abbreviations: + text = re.sub(regex, replacement, text) + return text + + +def collapse_whitespace(text): + _whitespace_re = re.compile(r'\s+') + return re.sub(_whitespace_re, ' ', text) + + +def text_to_sequence(text): + '''Converts a string of text to a sequence of IDs corresponding to the symbols in the text. + The text can optionally have ARPAbet sequences enclosed in curly braces embedded + in it. For example, "Turn left on {HH AW1 S S T AH0 N} Street." + Args: + text: string to convert to a sequence + cleaner_names: names of the cleaner functions to run the text through + Returns: + List of integers corresponding to the symbols in the text + ''' + text = unidecode(text) + text = text.lower() + text = normalize_numbers(text) + text = expand_abbreviations(text) + text = collapse_whitespace(text) + + sequence = _symbols_to_sequence(text) + return sequence + + +def _symbols_to_sequence(symbols): + return [_symbol_to_id[s] for s in symbols if _should_keep_symbol(s)] + + +def _should_keep_symbol(s): + return s in _symbol_to_id and s != _pad diff --git a/demos/text_to_speech_demo/python/utils/wav_processing.py b/demos/text_to_speech_demo/python/utils/wav_processing.py new file mode 100644 index 00000000000..a2a0f075bd9 --- /dev/null +++ b/demos/text_to_speech_demo/python/utils/wav_processing.py @@ -0,0 +1,211 @@ +""" + Copyright (c) 2020 Intel Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +This file is based in fatchord_version.py from https://github.com/fatchord/WaveRNN, +commit 3595219b2f2f5353f0867a7bb59abcb15aba8831 on Nov 27, 2019 +""" + +import math + +import numpy as np + + +# for WaveRNN approach (https://github.com/fatchord/WaveRNN), first step before upsample +def pad_tensor(x, pad, side='both'): + # NB - this is just a quick method i need right now + # i.e., it won't generalise to other shapes/dims + b, t, c = x.shape + total = t + 2 * pad if side == 'both' else t + pad + padded = np.zeros((b, total, c), dtype=np.float) + if side in ('before', 'both'): + padded[:, pad:pad + t, :] = x + elif side == 'after': + padded[:, :t, :] = x + return padded + + +# https://github.com/fatchord/WaveRNN +def fold_with_overlap(x, target, overlap): + ''' Fold the tensor with overlap for quick batched inference. + Overlap will be used for crossfading in xfade_and_unfold() + + Args: + x (tensor) : Upsampled conditioning features. + shape=(1, timesteps, features) + target (int) : Target timesteps for each index of batch + overlap (int) : Timesteps for both xfade and rnn warmup + + Return: + (tensor) : shape=(num_folds, target + 2 * overlap, features) + + Details: + x = [[h1, h2, ... hn]] + + Where each h is a vector of conditioning features + + Eg: target=2, overlap=1 with x.size(1)=10 + + folded = [[h1, h2, h3, h4], + [h4, h5, h6, h7], + [h7, h8, h9, h10]] + ''' + + _, total_len, features = x.shape + + # Calculate variables needed + num_folds = (total_len - overlap) // (target + overlap) + if num_folds < 1: + raise ValueError('Too short mel-spectrogram with width {0}. Try longer sentence.'.format(total_len)) + log_2 = math.log2(num_folds) + optimal_batch_sz = 2 ** int(math.ceil(log_2)) + + offset = 1 if optimal_batch_sz > 1 else 0 + target = (total_len - overlap) // (optimal_batch_sz - offset) - overlap + num_folds = (total_len - overlap) // (target + overlap) + if num_folds * (overlap + target) + overlap == total_len: + overlap += 1 + target = (total_len - overlap) // (optimal_batch_sz - offset) - overlap + + while target < overlap: + overlap = overlap // 2 + target = (total_len - overlap) // (optimal_batch_sz - offset) - overlap + if optimal_batch_sz * (overlap + target) + overlap == total_len: + target = (total_len - overlap) // optimal_batch_sz - overlap + + num_folds = (total_len - overlap) // (target + overlap) + + extended_len = num_folds * (overlap + target) + overlap + remaining = total_len - extended_len + # Pad if some time steps poking out + if remaining != 0: + num_folds += 1 + padding = target + 2 * overlap - remaining + x = pad_tensor(x, padding, side='after') + + folded = np.zeros((num_folds, target + 2 * overlap, features), dtype=np.float) + + + # Get the values for the folded tensor + for i in range(num_folds): + start = i * (target + overlap) + end = start + target + 2 * overlap + folded[i] = x[:, start:end, :] + + return folded, (target, overlap) + + +# https://github.com/fatchord/WaveRNN +def xfade_and_unfold(y, overlap): + ''' Applies a crossfade and unfolds into a 1d array. + + Args: + y (ndarry) : Batched sequences of audio samples + shape=(num_folds, target + 2 * overlap) + dtype=np.float64 + overlap (int) : Timesteps for both xfade and rnn warmup + + Return: + (ndarry) : audio samples in a 1d array + shape=(total_len) + dtype=np.float64 + + Details: + y = [[seq1], + [seq2], + [seq3]] + + Apply a gain envelope at both ends of the sequences + + y = [[seq1_in, seq1_target, seq1_out], + [seq2_in, seq2_target, seq2_out], + [seq3_in, seq3_target, seq3_out]] + + Stagger and add up the groups of samples: + + [seq1_in, seq1_target, (seq1_out + seq2_in), seq2_target, ...] + + ''' + num_folds, length = y.shape + target = length - 2 * overlap + total_len = num_folds * (target + overlap) + overlap + + # Need some silence for the rnn warmup + silence_len = overlap // 2 + fade_len = overlap - silence_len + silence = np.zeros((silence_len), dtype=np.float64) + linear = np.ones((silence_len), dtype=np.float64) + + # Equal power crossfade + t = np.linspace(-1, 1, fade_len, dtype=np.float64) + a = 0.3 + fade_in = np.sqrt(a * (1 + t)) + fade_out = np.sqrt((1.0 - a) * (1 - t)) + + # Concat the silence to the fades + fade_in = np.concatenate([silence, fade_in]) + fade_out = np.concatenate([linear, fade_out]) + + # Apply the gain to the overlap samples + y[:, :overlap] *= fade_in + y[:, -overlap:] *= fade_out + + unfolded = np.zeros((total_len), dtype=np.float64) + + # Loop to add up all the samples + for i in range(num_folds): + start = i * (target + overlap) + end = start + target + 2 * overlap + unfolded[start:end] += y[i] + + return unfolded + + +def get_one_hot(argmaxes, n_classes): + res = np.eye(n_classes)[np.array(argmaxes).reshape(-1)] + return res.reshape(list(argmaxes.shape)+[n_classes]) + + +def infer_from_discretized_mix_logistic(params): + """ + Sample from discretized mixture of logistic distributions + Args: + params (Tensor): B x C x T, [C/3,C/3,C/3] = [logit probs, means, log scales] + Returns: + Tensor: sample in range of [-1, 1]. + """ + log_scale_min = float(np.log(1e-14)) + assert params.shape[1] % 3 == 0 + nr_mix = params.shape[1] // 3 + + # B x T x C + y = params #np.transpose(params, (1, 0)) + logit_probs = y[:, :nr_mix] + + temp = np.random.uniform(low=1e-5, high=1.0 - 1e-5, size=logit_probs.shape) + temp = logit_probs - np.log(- np.log(temp)) + argmax = np.argmax(temp, axis=-1) + + one_hot = get_one_hot(argmax, nr_mix).astype(dtype=float) + + means = np.sum(y[:, nr_mix:2 * nr_mix] * one_hot, axis=-1) + log_scales = np.clip(np.sum( + y[:, 2 * nr_mix:3 * nr_mix] * one_hot, axis=-1), a_min=log_scale_min, a_max=None) + + u = np.random.uniform(low=1e-5, high=1.0 - 1e-5, size=means.shape) + x = means + np.exp(log_scales) * (np.log(u) - np.log(1. - u)) + + x = np.clip(x, a_min=-1., a_max=1.) + + return x diff --git a/demos/thirdparty/gflags/.gitignore b/demos/thirdparty/gflags/.gitignore index 321f70e72f0..706f7f88f0d 100644 --- a/demos/thirdparty/gflags/.gitignore +++ b/demos/thirdparty/gflags/.gitignore @@ -2,6 +2,7 @@ /build/ /builds/ /build-*/ +/_build/ .DS_Store CMakeCache.txt DartConfiguration.tcl diff --git a/demos/thirdparty/gflags/BUILD b/demos/thirdparty/gflags/BUILD index 0a5c9eb3c23..0e7ccdd6df1 100644 --- a/demos/thirdparty/gflags/BUILD +++ b/demos/thirdparty/gflags/BUILD @@ -4,9 +4,15 @@ licenses(["notice"]) -exports_files(["src/gflags_complections.sh", "COPYING.txt"]) +exports_files(["src/gflags_completions.sh", "COPYING.txt"]) + +config_setting( + name = "x64_windows", + values = {"cpu": "x64_windows"}, +) load(":bazel/gflags.bzl", "gflags_sources", "gflags_library") + (hdrs, srcs) = gflags_sources(namespace=["gflags", "google"]) gflags_library(hdrs=hdrs, srcs=srcs, threads=0) gflags_library(hdrs=hdrs, srcs=srcs, threads=1) diff --git a/demos/thirdparty/gflags/CMakeLists.txt b/demos/thirdparty/gflags/CMakeLists.txt index 370907364e2..657a1f4d413 100644 --- a/demos/thirdparty/gflags/CMakeLists.txt +++ b/demos/thirdparty/gflags/CMakeLists.txt @@ -14,9 +14,9 @@ ## ## When this project is a subproject (GFLAGS_IS_SUBPROJECT is TRUE), the default ## settings are such that only the static single-threaded library is built without -## installation of the gflags files. The "gflags" target is in this case an ALIAS +## installation of the gflags files. The "gflags::gflags" target is in this case an ALIAS ## library target for the "gflags_nothreads_static" library target. Targets which -## depend on the gflags library should link to the "gflags" library target. +## depend on the gflags library should link to the "gflags::gflags" library target. ## ## Example CMakeLists.txt of user project which requires separate gflags installation: ## cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) @@ -26,7 +26,7 @@ ## find_package(gflags REQUIRED) ## ## add_executable(foo src/foo.cc) -## target_link_libraries(foo gflags) +## target_link_libraries(foo gflags::gflags) ## ## Example CMakeLists.txt of user project which requires separate single-threaded static gflags installation: ## cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) @@ -36,7 +36,7 @@ ## find_package(gflags COMPONENTS nothreads_static) ## ## add_executable(foo src/foo.cc) -## target_link_libraries(foo gflags) +## target_link_libraries(foo gflags::gflags) ## ## Example CMakeLists.txt of super-project which contains gflags source tree: ## cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) @@ -46,7 +46,7 @@ ## add_subdirectory(gflags) ## ## add_executable(foo src/foo.cc) -## target_link_libraries(foo gflags) +## target_link_libraries(foo gflags::gflags) ## ## Variables to configure the source files: ## - GFLAGS_IS_A_DLL @@ -70,12 +70,16 @@ ## - GFLAGS_INSTALL_SHARED_LIBS ## - GFLAGS_INSTALL_STATIC_LIBS -cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR) +cmake_minimum_required (VERSION 3.0.2 FATAL_ERROR) if (POLICY CMP0042) cmake_policy (SET CMP0042 NEW) endif () +if (POLICY CMP0048) + cmake_policy (SET CMP0048 NEW) +endif () + # ---------------------------------------------------------------------------- # includes include ("${CMAKE_CURRENT_SOURCE_DIR}/cmake/utils.cmake") @@ -83,14 +87,14 @@ include ("${CMAKE_CURRENT_SOURCE_DIR}/cmake/utils.cmake") # ---------------------------------------------------------------------------- # package information set (PACKAGE_NAME "gflags") -set (PACKAGE_VERSION "2.2.1") +set (PACKAGE_VERSION "2.2.2") set (PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set (PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}") set (PACKAGE_BUGREPORT "https://github.com/gflags/gflags/issues") set (PACKAGE_DESCRIPTION "A commandline flags library that allows for distributed flags.") set (PACKAGE_URL "http://gflags.github.io/gflags") -project (${PACKAGE_NAME} CXX) +project (${PACKAGE_NAME} VERSION ${PACKAGE_VERSION} LANGUAGES CXX) if (CMAKE_VERSION VERSION_LESS 3.4) # C language still needed because the following required CMake modules # (or their dependencies, respectively) are not correctly handling @@ -352,6 +356,7 @@ else () endif () set (PRIVATE_HDRS + "defines.h" "config.h" "util.h" "mutex.h" @@ -402,6 +407,9 @@ if (NOT GFLAGS_IS_SUBPROJECT) set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "lib") set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "lib") endif () +# Set postfixes for generated libraries based on buildtype. +set(CMAKE_RELEASE_POSTFIX "") +set(CMAKE_DEBUG_POSTFIX "_debug") # ---------------------------------------------------------------------------- # installation directories @@ -490,11 +498,15 @@ if (GFLAGS_IS_SUBPROJECT) foreach (type IN ITEMS static shared) foreach (opts IN ITEMS "_nothreads" "") if (TARGET gflags${opts}_${type}) + # Define "gflags" alias for super-projects treating targets of this library as part of their own project + # (also for backwards compatibility with gflags 2.2.1 which only defined this alias) add_library (gflags ALIAS gflags${opts}_${type}) + # Define "gflags::gflags" alias for projects that support both find_package(gflags) and add_subdirectory(gflags) + add_library (gflags::gflags ALIAS gflags${opts}_${type}) break () endif () endforeach () - if (TARGET gflags) + if (TARGET gflags::gflags) break () endif () endforeach () @@ -514,7 +526,8 @@ if (BUILD_SHARED_LIBS AND INSTALL_SHARED_LIBS) EXPORT ${EXPORT_NAME} RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR} LIBRARY DESTINATION ${LIBRARY_INSTALL_DIR} - ARCHIVE DESTINATION ${LIBRARY_INSTALL_DIR}) + ARCHIVE DESTINATION ${LIBRARY_INSTALL_DIR} + ) endif () endforeach () endif () @@ -525,7 +538,8 @@ if (BUILD_STATIC_LIBS AND INSTALL_STATIC_LIBS) EXPORT ${EXPORT_NAME} RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR} LIBRARY DESTINATION ${LIBRARY_INSTALL_DIR} - ARCHIVE DESTINATION ${LIBRARY_INSTALL_DIR}) + ARCHIVE DESTINATION ${LIBRARY_INSTALL_DIR} + ) endif () endforeach () endif () @@ -541,7 +555,16 @@ if (INSTALL_HEADERS) FILES "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-config-version.cmake" DESTINATION ${CONFIG_INSTALL_DIR} ) - install (EXPORT ${EXPORT_NAME} DESTINATION ${CONFIG_INSTALL_DIR}) + install ( + EXPORT ${EXPORT_NAME} + NAMESPACE ${PACKAGE_NAME}:: + DESTINATION ${CONFIG_INSTALL_DIR} + ) + install ( + EXPORT ${EXPORT_NAME} + FILE ${PACKAGE_NAME}-nonamespace-targets.cmake + DESTINATION ${CONFIG_INSTALL_DIR} + ) if (UNIX) install (PROGRAMS src/gflags_completions.sh DESTINATION ${RUNTIME_INSTALL_DIR}) endif () @@ -555,7 +578,15 @@ endif () # ---------------------------------------------------------------------------- # support direct use of build tree set (INSTALL_PREFIX_REL2CONFIG_DIR .) -export (TARGETS ${TARGETS} FILE "${PROJECT_BINARY_DIR}/${EXPORT_NAME}.cmake") +export ( + TARGETS ${TARGETS} + NAMESPACE ${PACKAGE_NAME}:: + FILE "${PROJECT_BINARY_DIR}/${EXPORT_NAME}.cmake" +) +export ( + TARGETS ${TARGETS} + FILE "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-nonamespace-targets.cmake" +) if (REGISTER_BUILD_DIR) export (PACKAGE ${PACKAGE_NAME}) endif () @@ -568,7 +599,6 @@ configure_file (cmake/config.cmake.in "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-con # testing - MUST follow the generation of the build tree config file if (BUILD_TESTING) include (CTest) - enable_testing () add_subdirectory (test) endif () @@ -588,7 +618,8 @@ if (BUILD_PACKAGING) "\n BUILD_STATIC_LIBS=ON" "\n INSTALL_HEADERS=ON" "\n INSTALL_SHARED_LIBS=ON" - "\n INSTALL_STATIC_LIBS=ON") + "\n INSTALL_STATIC_LIBS=ON" + ) endif () # default package generators @@ -700,3 +731,11 @@ if (BUILD_PACKAGING) include (CPack) endif () # BUILD_PACKAGING + +if (NOT GFLAGS_IS_SUBPROJECT AND NOT TARGET uninstall) + configure_file ( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" @ONLY + ) + add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") +endif () diff --git a/demos/thirdparty/gflags/ChangeLog.txt b/demos/thirdparty/gflags/ChangeLog.txt index c26d0ab11fb..ecdd4658dc1 100644 --- a/demos/thirdparty/gflags/ChangeLog.txt +++ b/demos/thirdparty/gflags/ChangeLog.txt @@ -1,3 +1,25 @@ +* Sun Nov 11 2018 - Andreas Schuh + +- gflags: version 2.2.2 +Fixed 267: Support build with GCC option "-fvisibility=hidden". +Fixed 262: Declare FALGS_no##name variables as static to avoid "previous extern" warning. +Fixed 261: Declare FlagRegisterer c’tor explicit template instanations as extern in header +Fixed 257: Build with _UNICODE support on Windows. +Fixed 233/234/235: Move CMake defines that are unused by Bazel to separate header; makes config.h private again +Fixed 228: Build with recent MinGW versions that define setenv. +Fixed 226: Remove obsolete and unused CleanFileName code +Merged 266: Various PVS Studio and GCC warnings. +Merged 258: Fix build with some Clang variants that define "restrict" macro. +Merged 252: Update documentation on how to use Bazel. +Merged 249: Use "_debug" postfix for debug libraries. +Merged 247: CMake "project" VERSION; no enable_testing(); "gflags::" import target prefix. +Merged 246: Add Bazel-on-Windows support. +Merged 239: Use GFLAGS_NAMESPACE instead of "gflags" in test executable. +Merged 237: Removed unused functions; fixes compilation with -Werror compiler option. +Merged 232: Fix typo in Bazel's BUILD definition +Merged 230: Remove using ::fLS::clstring. +Merged 221: Add convenience 'uninstall' target + * Tue Jul 11 2017 - Andreas Schuh - gflags: version 2.2.1 diff --git a/demos/thirdparty/gflags/INSTALL.md b/demos/thirdparty/gflags/INSTALL.md index d37528fb841..76d7eddf752 100644 --- a/demos/thirdparty/gflags/INSTALL.md +++ b/demos/thirdparty/gflags/INSTALL.md @@ -78,11 +78,6 @@ your WORKSPACE file: remote = "https://github.com/gflags/gflags.git", ) - bind( - name = "gflags", - actual = "@com_github_gflags_gflags//:gflags", - ) - -You can then add `//external:gflags` to the `deps` section of a `cc_binary` or -`cc_library` rule, and `#include ` to include it in your source -code. +You can then add `@com_github_gflags_gflags//:gflags` to the `deps` section of a +`cc_binary` or `cc_library` rule, and `#include ` to include it +in your source code. diff --git a/demos/thirdparty/gflags/README.md b/demos/thirdparty/gflags/README.md index 9f3e3f2dac3..6e5267c1e41 100644 --- a/demos/thirdparty/gflags/README.md +++ b/demos/thirdparty/gflags/README.md @@ -3,6 +3,21 @@ The documentation of the gflags library is available online at https://gflags.github.io/gflags/. + +11 November 2018 +---------------- + +I've just released gflags 2.2.2. + +This maintenance release improves lives of Bazel users (no more "config.h" leaking into global include paths), +fixes build with recent MinGW versions, and silences a number of static code analyzer and compiler warnings. +The build targets exported by the CMake configuration of this library are now also prefixed by the package +name "gflags::" following a more recent (unwritten) CMake convention. The unprefixed target names are still +supported to avoid that dependent projects have to be modified due to this change in imported target names. + +Please report any further issues with this release using the GitHub issue tracker. + + 11 July 2017 ------------ diff --git a/demos/thirdparty/gflags/bazel/gflags.bzl b/demos/thirdparty/gflags/bazel/gflags.bzl index cd0edad6783..533fd61007a 100644 --- a/demos/thirdparty/gflags/bazel/gflags.bzl +++ b/demos/thirdparty/gflags/bazel/gflags.bzl @@ -1,16 +1,10 @@ # ------------------------------------------------------------------------------ # Add native rules to configure source files def gflags_sources(namespace=["google", "gflags"]): - native.genrule( - name = "config_h", - srcs = ["src/config.h.in"], - outs = ["config.h"], - cmd = "awk '{ gsub(/^#cmakedefine/, \"//cmakedefine\"); print; }' $(<) > $(@)" - ) native.genrule( name = "gflags_declare_h", srcs = ["src/gflags_declare.h.in"], - outs = ["include/gflags/gflags_declare.h"], + outs = ["gflags_declare.h"], cmd = ("awk '{ " + "gsub(/@GFLAGS_NAMESPACE@/, \"" + namespace[0] + "\"); " + "gsub(/@(HAVE_STDINT_H|HAVE_SYS_TYPES_H|HAVE_INTTYPES_H|GFLAGS_INTTYPES_FORMAT_C99)@/, \"1\"); " + @@ -23,7 +17,7 @@ def gflags_sources(namespace=["google", "gflags"]): native.genrule( name = gflags_ns_h_file.replace('.', '_'), srcs = ["src/gflags_ns.h.in"], - outs = ["include/gflags/" + gflags_ns_h_file], + outs = [gflags_ns_h_file], cmd = ("awk '{ " + "gsub(/@ns@/, \"" + ns + "\"); " + "gsub(/@NS@/, \"" + ns.upper() + "\"); " + @@ -33,7 +27,7 @@ def gflags_sources(namespace=["google", "gflags"]): native.genrule( name = "gflags_h", srcs = ["src/gflags.h.in"], - outs = ["include/gflags/gflags.h"], + outs = ["gflags.h"], cmd = ("awk '{ " + "gsub(/@GFLAGS_ATTRIBUTE_UNUSED@/, \"\"); " + "gsub(/@INCLUDE_GFLAGS_NS_H@/, \"" + '\n'.join(["#include \\\"gflags/{}\\\"".format(hdr) for hdr in gflags_ns_h_files]) + "\"); " + @@ -42,19 +36,25 @@ def gflags_sources(namespace=["google", "gflags"]): native.genrule( name = "gflags_completions_h", srcs = ["src/gflags_completions.h.in"], - outs = ["include/gflags/gflags_completions.h"], + outs = ["gflags_completions.h"], cmd = "awk '{ gsub(/@GFLAGS_NAMESPACE@/, \"" + namespace[0] + "\"); print; }' $(<) > $(@)" ) hdrs = [":gflags_h", ":gflags_declare_h", ":gflags_completions_h"] hdrs.extend([':' + hdr.replace('.', '_') for hdr in gflags_ns_h_files]) srcs = [ - ":config_h", + "src/config.h", "src/gflags.cc", "src/gflags_completions.cc", "src/gflags_reporting.cc", "src/mutex.h", - "src/util.h" - ] + "src/util.h", + ] + select({ + "//:x64_windows": [ + "src/windows_port.cc", + "src/windows_port.h", + ], + "//conditions:default": [], + }) return [hdrs, srcs] # ------------------------------------------------------------------------------ @@ -62,31 +62,42 @@ def gflags_sources(namespace=["google", "gflags"]): def gflags_library(hdrs=[], srcs=[], threads=1): name = "gflags" copts = [ + "-DGFLAGS_BAZEL_BUILD", + "-DGFLAGS_INTTYPES_FORMAT_C99", + "-DGFLAGS_IS_A_DLL=0", + # macros otherwise defined by CMake configured defines.h file "-DHAVE_STDINT_H", "-DHAVE_SYS_TYPES_H", "-DHAVE_INTTYPES_H", "-DHAVE_SYS_STAT_H", - "-DHAVE_UNISTD_H", - "-DHAVE_FNMATCH_H", "-DHAVE_STRTOLL", "-DHAVE_STRTOQ", - "-DHAVE_PTHREAD", "-DHAVE_RWLOCK", - "-DGFLAGS_INTTYPES_FORMAT_C99", - "-DGFLAGS_IS_A_DLL=0", - ] + ] + select({ + "//:x64_windows": [ + "-DOS_WINDOWS", + ], + "//conditions:default": [ + "-DHAVE_UNISTD_H", + "-DHAVE_FNMATCH_H", + "-DHAVE_PTHREAD", + ], + }) linkopts = [] if threads: - linkopts.append("-lpthread") + linkopts += select({ + "//:x64_windows": [], + "//conditions:default": ["-lpthread"], + }) else: name += "_nothreads" - copts.append("-DNO_THREADS") + copts += ["-DNO_THREADS"] native.cc_library( name = name, hdrs = hdrs, srcs = srcs, - includes = ["include/"], copts = copts, linkopts = linkopts, - visibility = ["//visibility:public"] + visibility = ["//visibility:public"], + include_prefix = 'gflags' ) diff --git a/demos/thirdparty/gflags/cmake/cmake_uninstall.cmake.in b/demos/thirdparty/gflags/cmake/cmake_uninstall.cmake.in new file mode 100644 index 00000000000..d00a5166581 --- /dev/null +++ b/demos/thirdparty/gflags/cmake/cmake_uninstall.cmake.in @@ -0,0 +1,26 @@ +if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") +endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + +if (NOT DEFINED CMAKE_INSTALL_PREFIX) + set (CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@") +endif () + message(${CMAKE_INSTALL_PREFIX}) + +file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) +string(REGEX REPLACE "\n" ";" files "${files}") +foreach(file ${files}) + message(STATUS "Uninstalling $ENV{DESTDIR}${file}") + if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + exec_program( + "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + OUTPUT_VARIABLE rm_out + RETURN_VALUE rm_retval + ) + if(NOT "${rm_retval}" STREQUAL 0) + message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") + endif(NOT "${rm_retval}" STREQUAL 0) + else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + message(STATUS "File $ENV{DESTDIR}${file} does not exist.") + endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") +endforeach(file) diff --git a/demos/thirdparty/gflags/cmake/config.cmake.in b/demos/thirdparty/gflags/cmake/config.cmake.in index a121b3a2489..a512c2a2e6e 100644 --- a/demos/thirdparty/gflags/cmake/config.cmake.in +++ b/demos/thirdparty/gflags/cmake/config.cmake.in @@ -7,7 +7,21 @@ set (@PACKAGE_PREFIX@_VERSION_MINOR @PACKAGE_VERSION_MINOR@) set (@PACKAGE_PREFIX@_VERSION_PATCH @PACKAGE_VERSION_PATCH@) # import targets -include ("${CMAKE_CURRENT_LIST_DIR}/@EXPORT_NAME@.cmake") +if (NOT DEFINED @PACKAGE_PREFIX@_USE_TARGET_NAMESPACE) + set (@PACKAGE_PREFIX@_USE_TARGET_NAMESPACE FALSE) +endif () +if (@PACKAGE_PREFIX@_USE_TARGET_NAMESPACE) + include ("${CMAKE_CURRENT_LIST_DIR}/@EXPORT_NAME@.cmake") + set (@PACKAGE_PREFIX@_TARGET_NAMESPACE @PACKAGE_NAME@) +else () + include ("${CMAKE_CURRENT_LIST_DIR}/@PACKAGE_NAME@-nonamespace-targets.cmake") + set (@PACKAGE_PREFIX@_TARGET_NAMESPACE) +endif () +if (@PACKAGE_PREFIX@_TARGET_NAMESPACE) + set (@PACKAGE_PREFIX@_TARGET_PREFIX ${@PACKAGE_PREFIX@_TARGET_NAMESPACE}::) +else () + set (@PACKAGE_PREFIX@_TARGET_PREFIX) +endif () # installation prefix get_filename_component (CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) @@ -49,7 +63,7 @@ if (NOT DEFINED @PACKAGE_PREFIX@_SHARED) else () set (@PACKAGE_PREFIX@_SHARED FALSE) endif () - elseif (TARGET @PACKAGE_NAME@_shared OR TARGET @PACKAGE_NAME@_nothreads_shared) + elseif (TARGET ${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@_shared OR TARGET ${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@_nothreads_shared) set (@PACKAGE_PREFIX@_SHARED TRUE) else () set (@PACKAGE_PREFIX@_SHARED FALSE) @@ -64,7 +78,7 @@ if (NOT DEFINED @PACKAGE_PREFIX@_NOTHREADS) else () set (@PACKAGE_PREFIX@_NOTHREADS FALSE) endif () - elseif (TARGET @PACKAGE_NAME@_static OR TARGET @PACKAGE_NAME@_shared) + elseif (TARGET ${@PACKAGE_PREFIX@_TARGET_PREFIX}PACKAGE_NAME@_static OR TARGET ${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@_shared) set (@PACKAGE_PREFIX@_NOTHREADS FALSE) else () set (@PACKAGE_PREFIX@_NOTHREADS TRUE) @@ -77,15 +91,15 @@ if (NOT @PACKAGE_PREFIX@_TARGET) set (@PACKAGE_PREFIX@_TARGET ${@PACKAGE_NAME@_TARGET}) elseif (@PACKAGE_PREFIX@_SHARED) if (@PACKAGE_PREFIX@_NOTHREADS) - set (@PACKAGE_PREFIX@_TARGET @PACKAGE_NAME@_nothreads_shared) + set (@PACKAGE_PREFIX@_TARGET ${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@_nothreads_shared) else () - set (@PACKAGE_PREFIX@_TARGET @PACKAGE_NAME@_shared) + set (@PACKAGE_PREFIX@_TARGET ${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@_shared) endif () else () if (@PACKAGE_PREFIX@_NOTHREADS) - set (@PACKAGE_PREFIX@_TARGET @PACKAGE_NAME@_nothreads_static) + set (@PACKAGE_PREFIX@_TARGET ${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@_nothreads_static) else () - set (@PACKAGE_PREFIX@_TARGET @PACKAGE_NAME@_static) + set (@PACKAGE_PREFIX@_TARGET ${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@_static) endif () endif () endif () @@ -94,12 +108,12 @@ if (NOT TARGET ${@PACKAGE_PREFIX@_TARGET}) " Try a different combination of @PACKAGE_PREFIX@_SHARED and @PACKAGE_PREFIX@_NOTHREADS.") endif () -# add more convenient "@PACKAGE_NAME@" import target -if (NOT TARGET @PACKAGE_NAME@) +# add more convenient "${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@" import target +if (NOT TARGET ${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@) if (@PACKAGE_PREFIX@_SHARED) - add_library (@PACKAGE_NAME@ SHARED IMPORTED) + add_library (${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@ SHARED IMPORTED) else () - add_library (@PACKAGE_NAME@ STATIC IMPORTED) + add_library (${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@ STATIC IMPORTED) endif () # copy INTERFACE_* properties foreach (_@PACKAGE_PREFIX@_PROPERTY_NAME IN ITEMS @@ -112,20 +126,20 @@ if (NOT TARGET @PACKAGE_NAME@) ) get_target_property (_@PACKAGE_PREFIX@_PROPERTY_VALUE ${@PACKAGE_PREFIX@_TARGET} INTERFACE_${_@PACKAGE_PREFIX@_PROPERTY_NAME}) if (_@PACKAGE_PREFIX@_PROPERTY_VALUE) - set_target_properties(@PACKAGE_NAME@ PROPERTIES + set_target_properties(${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@ PROPERTIES INTERFACE_${_@PACKAGE_PREFIX@_PROPERTY_NAME} "${_@PACKAGE_PREFIX@_PROPERTY_VALUE}" ) endif () endforeach () # copy IMPORTED_*_ properties get_target_property (_@PACKAGE_PREFIX@_CONFIGURATIONS ${@PACKAGE_PREFIX@_TARGET} IMPORTED_CONFIGURATIONS) - set_target_properties (@PACKAGE_NAME@ PROPERTIES IMPORTED_CONFIGURATIONS "${_@PACKAGE_PREFIX@_CONFIGURATIONS}") + set_target_properties (${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@ PROPERTIES IMPORTED_CONFIGURATIONS "${_@PACKAGE_PREFIX@_CONFIGURATIONS}") foreach (_@PACKAGE_PREFIX@_PROPERTY_NAME IN ITEMS IMPLIB LOCATION LINK_DEPENDENT_LIBRARIES LINK_INTERFACE_LIBRARIES - LINK_INTERFACE_LANGUAGES + LINK_INTERFACE_LANGUAGES LINK_INTERFACE_MULTIPLICITY NO_SONAME SONAME @@ -133,7 +147,7 @@ if (NOT TARGET @PACKAGE_NAME@) foreach (_@PACKAGE_PREFIX@_CONFIG IN LISTS _@PACKAGE_PREFIX@_CONFIGURATIONS) get_target_property (_@PACKAGE_PREFIX@_PROPERTY_VALUE ${@PACKAGE_PREFIX@_TARGET} IMPORTED_${_@PACKAGE_PREFIX@_PROPERTY_NAME}_${_@PACKAGE_PREFIX@_CONFIG}) if (_@PACKAGE_PREFIX@_PROPERTY_VALUE) - set_target_properties(@PACKAGE_NAME@ PROPERTIES + set_target_properties(${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@ PROPERTIES IMPORTED_${_@PACKAGE_PREFIX@_PROPERTY_NAME}_${_@PACKAGE_PREFIX@_CONFIG} "${_@PACKAGE_PREFIX@_PROPERTY_VALUE}" ) endif () diff --git a/demos/thirdparty/gflags/src/config.h b/demos/thirdparty/gflags/src/config.h new file mode 100644 index 00000000000..c33d207c7f3 --- /dev/null +++ b/demos/thirdparty/gflags/src/config.h @@ -0,0 +1,59 @@ +// Note: This header file is only used internally. It is not part of public interface! + +#ifndef GFLAGS_CONFIG_H_ +#define GFLAGS_CONFIG_H_ + + +// --------------------------------------------------------------------------- +// System checks + +// CMake build configuration is written to defines.h file, unused by Bazel build +#if !defined(GFLAGS_BAZEL_BUILD) +# include "defines.h" +#endif + +// gcc requires this to get PRId64, etc. +#if defined(HAVE_INTTYPES_H) && !defined(__STDC_FORMAT_MACROS) +# define __STDC_FORMAT_MACROS 1 +#endif + +// --------------------------------------------------------------------------- +// Path separator +#ifndef PATH_SEPARATOR +# ifdef OS_WINDOWS +# define PATH_SEPARATOR '\\' +# else +# define PATH_SEPARATOR '/' +# endif +#endif + +// --------------------------------------------------------------------------- +// Windows + +// Always export symbols when compiling a shared library as this file is only +// included by internal modules when building the gflags library itself. +// The gflags_declare.h header file will set it to import these symbols otherwise. +#ifndef GFLAGS_DLL_DECL +# if GFLAGS_IS_A_DLL && defined(_MSC_VER) +# define GFLAGS_DLL_DECL __declspec(dllexport) +# elif defined(__GNUC__) && __GNUC__ >= 4 +# define GFLAGS_DLL_DECL __attribute__((visibility("default"))) +# else +# define GFLAGS_DLL_DECL +# endif +#endif +// Flags defined by the gflags library itself must be exported +#ifndef GFLAGS_DLL_DEFINE_FLAG +# define GFLAGS_DLL_DEFINE_FLAG GFLAGS_DLL_DECL +#endif + +#ifdef OS_WINDOWS +// The unittests import the symbols of the shared gflags library +# if GFLAGS_IS_A_DLL && defined(_MSC_VER) +# define GFLAGS_DLL_DECL_FOR_UNITTESTS __declspec(dllimport) +# endif +# include "windows_port.h" +#endif + + +#endif // GFLAGS_CONFIG_H_ diff --git a/demos/thirdparty/gflags/src/config.h.in b/demos/thirdparty/gflags/src/config.h.in deleted file mode 100644 index f6d18d8dcc4..00000000000 --- a/demos/thirdparty/gflags/src/config.h.in +++ /dev/null @@ -1,114 +0,0 @@ -/* Generated from config.h.in during build configuration using CMake. */ - -// Note: This header file is only used internally. It is not part of public interface! - -#ifndef GFLAGS_CONFIG_H_ -#define GFLAGS_CONFIG_H_ - - -// --------------------------------------------------------------------------- -// System checks - -// Define if you build this library for a MS Windows OS. -#cmakedefine OS_WINDOWS - -// Define if you have the header file. -#cmakedefine HAVE_STDINT_H - -// Define if you have the header file. -#cmakedefine HAVE_SYS_TYPES_H - -// Define if you have the header file. -#cmakedefine HAVE_INTTYPES_H - -// Define if you have the header file. -#cmakedefine HAVE_SYS_STAT_H - -// Define if you have the header file. -#cmakedefine HAVE_UNISTD_H - -// Define if you have the header file. -#cmakedefine HAVE_FNMATCH_H - -// Define if you have the header file (Windows 2000/XP). -#cmakedefine HAVE_SHLWAPI_H - -// Define if you have the strtoll function. -#cmakedefine HAVE_STRTOLL - -// Define if you have the strtoq function. -#cmakedefine HAVE_STRTOQ - -// Define if you have the header file. -#cmakedefine HAVE_PTHREAD - -// Define if your pthread library defines the type pthread_rwlock_t -#cmakedefine HAVE_RWLOCK - -// gcc requires this to get PRId64, etc. -#if defined(HAVE_INTTYPES_H) && !defined(__STDC_FORMAT_MACROS) -# define __STDC_FORMAT_MACROS 1 -#endif - -// --------------------------------------------------------------------------- -// Package information - -// Name of package. -#define PACKAGE @PROJECT_NAME@ - -// Define to the full name of this package. -#define PACKAGE_NAME @PACKAGE_NAME@ - -// Define to the full name and version of this package. -#define PACKAGE_STRING @PACKAGE_STRING@ - -// Define to the one symbol short name of this package. -#define PACKAGE_TARNAME @PACKAGE_TARNAME@ - -// Define to the version of this package. -#define PACKAGE_VERSION @PACKAGE_VERSION@ - -// Version number of package. -#define VERSION PACKAGE_VERSION - -// Define to the address where bug reports for this package should be sent. -#define PACKAGE_BUGREPORT @PACKAGE_BUGREPORT@ - -// --------------------------------------------------------------------------- -// Path separator -#ifndef PATH_SEPARATOR -# ifdef OS_WINDOWS -# define PATH_SEPARATOR '\\' -# else -# define PATH_SEPARATOR '/' -# endif -#endif - -// --------------------------------------------------------------------------- -// Windows - -// Always export symbols when compiling a shared library as this file is only -// included by internal modules when building the gflags library itself. -// The gflags_declare.h header file will set it to import these symbols otherwise. -#ifndef GFLAGS_DLL_DECL -# if GFLAGS_IS_A_DLL && defined(_MSC_VER) -# define GFLAGS_DLL_DECL __declspec(dllexport) -# else -# define GFLAGS_DLL_DECL -# endif -#endif -// Flags defined by the gflags library itself must be exported -#ifndef GFLAGS_DLL_DEFINE_FLAG -# define GFLAGS_DLL_DEFINE_FLAG GFLAGS_DLL_DECL -#endif - -#ifdef OS_WINDOWS -// The unittests import the symbols of the shared gflags library -# if GFLAGS_IS_A_DLL && defined(_MSC_VER) -# define GFLAGS_DLL_DECL_FOR_UNITTESTS __declspec(dllimport) -# endif -# include "windows_port.h" -#endif - - -#endif // GFLAGS_CONFIG_H_ diff --git a/demos/thirdparty/gflags/src/defines.h.in b/demos/thirdparty/gflags/src/defines.h.in new file mode 100644 index 00000000000..dfb214edb9f --- /dev/null +++ b/demos/thirdparty/gflags/src/defines.h.in @@ -0,0 +1,48 @@ +/* Generated from defines.h.in during build configuration using CMake. */ + +// Note: This header file is only used internally. It is not part of public interface! +// Any cmakedefine is defined using the -D flag instead when Bazel is used. +// For Bazel, this file is thus not used to avoid a private file in $(GENDIR). + +#ifndef GFLAGS_DEFINES_H_ +#define GFLAGS_DEFINES_H_ + + +// Define if you build this library for a MS Windows OS. +#cmakedefine OS_WINDOWS + +// Define if you have the header file. +#cmakedefine HAVE_STDINT_H + +// Define if you have the header file. +#cmakedefine HAVE_SYS_TYPES_H + +// Define if you have the header file. +#cmakedefine HAVE_INTTYPES_H + +// Define if you have the header file. +#cmakedefine HAVE_SYS_STAT_H + +// Define if you have the header file. +#cmakedefine HAVE_UNISTD_H + +// Define if you have the header file. +#cmakedefine HAVE_FNMATCH_H + +// Define if you have the header file (Windows 2000/XP). +#cmakedefine HAVE_SHLWAPI_H + +// Define if you have the strtoll function. +#cmakedefine HAVE_STRTOLL + +// Define if you have the strtoq function. +#cmakedefine HAVE_STRTOQ + +// Define if you have the header file. +#cmakedefine HAVE_PTHREAD + +// Define if your pthread library defines the type pthread_rwlock_t +#cmakedefine HAVE_RWLOCK + + +#endif // GFLAGS_DEFINES_H_ diff --git a/demos/thirdparty/gflags/src/gflags.cc b/demos/thirdparty/gflags/src/gflags.cc index f27079862f0..8f5aa0babb3 100644 --- a/demos/thirdparty/gflags/src/gflags.cc +++ b/demos/thirdparty/gflags/src/gflags.cc @@ -225,7 +225,6 @@ class FlagValue { bool Equal(const FlagValue& x) const; FlagValue* New() const; // creates a new one with default value void CopyFrom(const FlagValue& x); - int ValueSize() const; // Calls the given validate-fn on value_buffer_, and returns // whatever it returns. But first casts validate_fn_proto to a @@ -485,23 +484,6 @@ void FlagValue::CopyFrom(const FlagValue& x) { } } -int FlagValue::ValueSize() const { - if (type_ > FV_MAX_INDEX) { - assert(false); // unknown type - return 0; - } - static const uint8 valuesize[] = { - sizeof(bool), - sizeof(int32), - sizeof(uint32), - sizeof(int64), - sizeof(uint64), - sizeof(double), - sizeof(string), - }; - return valuesize[type_]; -} - // -------------------------------------------------------------------- // CommandLineFlag // This represents a single flag, including its name, description, @@ -580,26 +562,14 @@ CommandLineFlag::~CommandLineFlag() { } const char* CommandLineFlag::CleanFileName() const { - // Compute top-level directory & file that this appears in - // search full path backwards. - // Stop going backwards at kRootDir; and skip by the first slash. - static const char kRootDir[] = ""; // can set this to root directory, - - if (sizeof(kRootDir)-1 == 0) // no prefix to strip - return filename(); - - const char* clean_name = filename() + strlen(filename()) - 1; - while ( clean_name > filename() ) { - if (*clean_name == PATH_SEPARATOR) { - if (sizeof(kRootDir) > 1 && strncmp(clean_name, kRootDir, sizeof(kRootDir)-1) == 0) { - clean_name += sizeof(kRootDir)-1; // past root-dir - break; - } - } - --clean_name; - } - while ( *clean_name == PATH_SEPARATOR ) ++clean_name; // Skip any slashes - return clean_name; + // This function has been used to strip off a common prefix from + // flag source file names. Because flags can be defined in different + // shared libraries, there may not be a single common prefix. + // Further, this functionality hasn't been active for many years. + // Need a better way to produce more user friendly help output or + // "anonymize" file paths in help output, respectively. + // Follow issue at: https://github.com/gflags/gflags/issues/86 + return filename(); } void CommandLineFlag::FillCommandLineFlagInfo( @@ -972,7 +942,6 @@ class CommandLineFlagParser { // Stage 3: validate all the commandline flags that have validators // registered and were not set/modified by ParseNewCommandLineFlags. void ValidateFlags(bool all); - void ValidateAllFlags(); void ValidateUnmodifiedFlags(); // Stage 4: report any errors and return true if any were found. @@ -1067,17 +1036,15 @@ uint32 CommandLineFlagParser::ParseNewCommandLineFlags(int* argc, char*** argv, char* arg = (*argv)[i]; // Like getopt(), we permute non-option flags to be at the end. - if (arg[0] != '-' || // must be a program argument - (arg[0] == '-' && arg[1] == '\0')) { // "-" is an argument, not a flag + if (arg[0] != '-' || arg[1] == '\0') { // must be a program argument: "-" is an argument, not a flag memmove((*argv) + i, (*argv) + i+1, (*argc - (i+1)) * sizeof((*argv)[i])); (*argv)[*argc-1] = arg; // we go last first_nonopt--; // we've been pushed onto the stack i--; // to undo the i++ in the loop continue; } - - if (arg[0] == '-') arg++; // allow leading '-' - if (arg[0] == '-') arg++; // or leading '--' + arg++; // skip leading '-' + if (arg[0] == '-') arg++; // or leading '--' // -- alone means what it does for GNU: stop options parsing if (*arg == '\0') { @@ -1257,10 +1224,6 @@ void CommandLineFlagParser::ValidateFlags(bool all) { } } -void CommandLineFlagParser::ValidateAllFlags() { - ValidateFlags(true); -} - void CommandLineFlagParser::ValidateUnmodifiedFlags() { ValidateFlags(false); } @@ -1378,8 +1341,8 @@ string CommandLineFlagParser::ProcessOptionsFromStringLocked( || fnmatch(glob.c_str(), ProgramInvocationName(), FNM_PATHNAME) == 0 || fnmatch(glob.c_str(), ProgramInvocationShortName(), FNM_PATHNAME) == 0 #elif defined(HAVE_SHLWAPI_H) - || PathMatchSpec(glob.c_str(), ProgramInvocationName()) - || PathMatchSpec(glob.c_str(), ProgramInvocationShortName()) + || PathMatchSpecA(glob.c_str(), ProgramInvocationName()) + || PathMatchSpecA(glob.c_str(), ProgramInvocationShortName()) #endif ) { flags_are_relevant = true; diff --git a/demos/thirdparty/gflags/src/gflags.h.in b/demos/thirdparty/gflags/src/gflags.h.in index 82e640fb0d8..7b218b90d15 100644 --- a/demos/thirdparty/gflags/src/gflags.h.in +++ b/demos/thirdparty/gflags/src/gflags.h.in @@ -441,6 +441,27 @@ class GFLAGS_DLL_DECL FlagRegisterer { FlagType* current_storage, FlagType* defvalue_storage); }; +// Force compiler to not generate code for the given template specialization. +#if defined(_MSC_VER) && _MSC_VER < 1800 // Visual Studio 2013 version 12.0 + #define GFLAGS_DECLARE_FLAG_REGISTERER_CTOR(type) +#else + #define GFLAGS_DECLARE_FLAG_REGISTERER_CTOR(type) \ + extern template GFLAGS_DLL_DECL FlagRegisterer::FlagRegisterer( \ + const char* name, const char* help, const char* filename, \ + type* current_storage, type* defvalue_storage) +#endif + +// Do this for all supported flag types. +GFLAGS_DECLARE_FLAG_REGISTERER_CTOR(bool); +GFLAGS_DECLARE_FLAG_REGISTERER_CTOR(int32); +GFLAGS_DECLARE_FLAG_REGISTERER_CTOR(uint32); +GFLAGS_DECLARE_FLAG_REGISTERER_CTOR(int64); +GFLAGS_DECLARE_FLAG_REGISTERER_CTOR(uint64); +GFLAGS_DECLARE_FLAG_REGISTERER_CTOR(double); +GFLAGS_DECLARE_FLAG_REGISTERER_CTOR(std::string); + +#undef GFLAGS_DECLARE_FLAG_REGISTERER_CTOR + // If your application #defines STRIP_FLAG_HELP to a non-zero value // before #including this file, we remove the help message from the // binary file. This can reduce the size of the resulting binary @@ -478,7 +499,7 @@ extern GFLAGS_DLL_DECL const char kStrippedFlagHelp[]; static const type FLAGS_nono##name = value; \ /* We always want to export defined variables, dll or no */ \ GFLAGS_DLL_DEFINE_FLAG type FLAGS_##name = FLAGS_nono##name; \ - type FLAGS_no##name = FLAGS_nono##name; \ + static type FLAGS_no##name = FLAGS_nono##name; \ static GFLAGS_NAMESPACE::FlagRegisterer o_##name( \ #name, MAYBE_STRIPPED_HELP(help), __FILE__, \ &FLAGS_##name, &FLAGS_no##name); \ diff --git a/demos/thirdparty/gflags/src/gflags_completions.cc b/demos/thirdparty/gflags/src/gflags_completions.cc index f7724864d58..c53a128de51 100644 --- a/demos/thirdparty/gflags/src/gflags_completions.cc +++ b/demos/thirdparty/gflags/src/gflags_completions.cc @@ -179,6 +179,11 @@ struct CompletionOptions { bool flag_description_substring_search; bool return_all_matching_flags; bool force_no_update; + CompletionOptions(): flag_name_substring_search(false), + flag_location_substring_search(false), + flag_description_substring_search(false), + return_all_matching_flags(false), + force_no_update(false) { } }; // Notable flags are flags that are special or preferred for some @@ -202,7 +207,7 @@ struct NotableFlags { static void PrintFlagCompletionInfo(void) { string cursor_word = FLAGS_tab_completion_word; string canonical_token; - CompletionOptions options = { }; + CompletionOptions options = CompletionOptions(); CanonicalizeCursorWordAndSearchOptions( cursor_word, &canonical_token, @@ -545,8 +550,7 @@ static void FinalizeCompletionOutput( vector output_groups; bool perfect_match_found = false; - if (lines_so_far < max_desired_lines && - !notable_flags->perfect_match_flag.empty()) { + if (!notable_flags->perfect_match_flag.empty()) { perfect_match_found = true; DisplayInfoGroup group = { "", diff --git a/demos/thirdparty/gflags/src/gflags_declare.h.in b/demos/thirdparty/gflags/src/gflags_declare.h.in index 508d46b37f9..ab7bd248418 100644 --- a/demos/thirdparty/gflags/src/gflags_declare.h.in +++ b/demos/thirdparty/gflags/src/gflags_declare.h.in @@ -58,6 +58,8 @@ #ifndef GFLAGS_DLL_DECL # if GFLAGS_IS_A_DLL && defined(_MSC_VER) # define GFLAGS_DLL_DECL __declspec(dllimport) +# elif defined(__GNUC__) && __GNUC__ >= 4 +# define GFLAGS_DLL_DECL __attribute__((visibility("default"))) # else # define GFLAGS_DLL_DECL # endif @@ -67,6 +69,8 @@ #ifndef GFLAGS_DLL_DECLARE_FLAG # if GFLAGS_IS_A_DLL && defined(_MSC_VER) # define GFLAGS_DLL_DECLARE_FLAG __declspec(dllimport) +# elif defined(__GNUC__) && __GNUC__ >= 4 +# define GFLAGS_DLL_DECLARE_FLAG __attribute__((visibility("default"))) # else # define GFLAGS_DLL_DECLARE_FLAG # endif @@ -144,7 +148,6 @@ typedef std::string clstring; #define DECLARE_string(name) \ /* We always want to import declared variables, dll or no */ \ namespace fLS { \ - using ::fLS::clstring; \ extern GFLAGS_DLL_DECLARE_FLAG ::fLS::clstring& FLAGS_##name; \ } \ using fLS::FLAGS_##name diff --git a/demos/thirdparty/gflags/src/gflags_reporting.cc b/demos/thirdparty/gflags/src/gflags_reporting.cc index 7cc66913459..29be922faeb 100644 --- a/demos/thirdparty/gflags/src/gflags_reporting.cc +++ b/demos/thirdparty/gflags/src/gflags_reporting.cc @@ -296,10 +296,10 @@ static void ShowUsageWithFlagsMatching(const char *argv0, } } -void ShowUsageWithFlagsRestrict(const char *argv0, const char *restrict) { +void ShowUsageWithFlagsRestrict(const char *argv0, const char *restrict_) { vector substrings; - if (restrict != NULL && *restrict != '\0') { - substrings.push_back(restrict); + if (restrict_ != NULL && *restrict_ != '\0') { + substrings.push_back(restrict_); } ShowUsageWithFlagsMatching(argv0, substrings); } @@ -389,8 +389,8 @@ void HandleCommandLineHelpFlags() { gflags_exitfunc(1); } else if (!FLAGS_helpon.empty()) { - string restrict = PATH_SEPARATOR + FLAGS_helpon + "."; - ShowUsageWithFlagsRestrict(progname, restrict.c_str()); + string restrict_ = PATH_SEPARATOR + FLAGS_helpon + "."; + ShowUsageWithFlagsRestrict(progname, restrict_.c_str()); gflags_exitfunc(1); } else if (!FLAGS_helpmatch.empty()) { diff --git a/demos/thirdparty/gflags/src/windows_port.h b/demos/thirdparty/gflags/src/windows_port.h index 61cf5b7e3a1..59a310e1031 100644 --- a/demos/thirdparty/gflags/src/windows_port.h +++ b/demos/thirdparty/gflags/src/windows_port.h @@ -77,6 +77,7 @@ extern int GFLAGS_DLL_DECL safe_vsnprintf(char *str, size_t size, # pragma warning(push) # pragma warning(disable: 4996) // ignore getenv security warning #endif +#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L inline void setenv(const char* name, const char* value, int) { // In windows, it's impossible to set a variable to the empty string. // We handle this by setting it to "0" and the NUL-ing out the \0. @@ -98,6 +99,7 @@ inline void setenv(const char* name, const char* value, int) { *getenv(name) = '\0'; // works when putenv() copies nameval } } +#endif #ifdef _MSC_VER # pragma warning(pop) #endif diff --git a/demos/thirdparty/gflags/test/config/CMakeLists.txt b/demos/thirdparty/gflags/test/config/CMakeLists.txt index c54f54b71ce..6190b253274 100644 --- a/demos/thirdparty/gflags/test/config/CMakeLists.txt +++ b/demos/thirdparty/gflags/test/config/CMakeLists.txt @@ -7,4 +7,4 @@ project (gflags_${TEST_NAME}) find_package (gflags REQUIRED) add_executable (foo main.cc) -target_link_libraries (foo gflags) +target_link_libraries (foo gflags::gflags) diff --git a/demos/thirdparty/gflags/test/gflags_declare_test.cc b/demos/thirdparty/gflags/test/gflags_declare_test.cc index 707bcc07d03..47d11c293b5 100644 --- a/demos/thirdparty/gflags/test/gflags_declare_test.cc +++ b/demos/thirdparty/gflags/test/gflags_declare_test.cc @@ -5,8 +5,8 @@ void print_message(); // in gflags_declare_flags.cc int main(int argc, char **argv) { - gflags::SetUsageMessage("Test compilation and use of gflags_declare.h"); - gflags::ParseCommandLineFlags(&argc, &argv, true); + GFLAGS_NAMESPACE::SetUsageMessage("Test compilation and use of gflags_declare.h"); + GFLAGS_NAMESPACE::ParseCommandLineFlags(&argc, &argv, true); print_message(); return 0; } diff --git a/demos/python_demos/whiteboard_inpainting_demo/README.md b/demos/whiteboard_inpainting_demo/python/README.md similarity index 60% rename from demos/python_demos/whiteboard_inpainting_demo/README.md rename to demos/whiteboard_inpainting_demo/python/README.md index cc81a32c9fd..6b33097311b 100644 --- a/demos/python_demos/whiteboard_inpainting_demo/README.md +++ b/demos/whiteboard_inpainting_demo/python/README.md @@ -1,7 +1,9 @@ # Whiteboard Inpainting Demo +![](./whiteboard_inpainting.gif) + This demo focuses on a whiteboard text overlapped by a person. The demo shows -how to use the OpenVINOTM toolkit to detect and hide a person on a +how to use the OpenVINO™ toolkit to detect and hide a person on a video so that all text on a whiteboard is visible. ## How It Works @@ -11,7 +13,7 @@ The demo expects one of the following models in the Intermediate Representation * Instance segmentation model * Semantic segmentation model -Use your own model or a pretrained model from the OpenVINOTM Open Model Zoo. +Use your own model or a pretrained model from the OpenVINO™ Open Model Zoo. Find the list of models suitable for this demo in `models.lst`. Use the [Model Downloader](../../../tools/downloader/README.md) to obtain the models. @@ -35,37 +37,43 @@ pip3 install -r requirements.txt Run the application with the `-h` option to see the following usage message: ``` -usage: whiteboard_inpainting_demo.py [-h] -i I [-m_i M_INSTANCE_SEGMENTATION] - [-m_s M_SEMANTIC_SEGMENTATION] - [-t THRESHOLD] - [--output_video OUTPUT_VIDEO] [--no_show] +usage: whiteboard_inpainting_demo.py [-h] -i INPUT [--loop] [-o OUTPUT] + [-limit OUTPUT_LIMIT] + -m_i M_INSTANCE_SEGMENTATION + -m_s M_SEMANTIC_SEGMENTATION + [-t THRESHOLD] [--no_show] [-d DEVICE] [-l CPU_EXTENSION] [-u UTILIZATION_MONITORS] Whiteboard inpainting demo optional arguments: - -h, --help show this help message and exit - -i I Input sources (index of camera or path to a video - file) + -h, --help Show this help message and exit. + -i INPUT, --input INPUT + Required. Path to a video file or a device node of a + web-camera. + --loop Optional. Enable reading the input in a loop. + -o OUTPUT, --output OUTPUT + Optional. Name of output to save. + -limit OUTPUT_LIMIT, --output_limit OUTPUT_LIMIT + Optional. Number of frames to store in output. + If -1 is set, all frames are stored. -m_i M_INSTANCE_SEGMENTATION, --m_instance_segmentation M_INSTANCE_SEGMENTATION - Path to the instance segmentation model + Required. Path to the instance segmentation model. -m_s M_SEMANTIC_SEGMENTATION, --m_semantic_segmentation M_SEMANTIC_SEGMENTATION - Path to the semantic segmentation model + Required. Path to the semantic segmentation model. -t THRESHOLD, --threshold THRESHOLD - Threshold for person instance segmentation model - --output_video OUTPUT_VIDEO - Optional. Path to output video - --no_show Optional. Don't show output + Optional. Threshold for person instance segmentation model. + --no_show Optional. Don't show output. -d DEVICE, --device DEVICE Optional. Specify a target device to infer on. CPU, GPU, FPGA, HDDL or MYRIAD is acceptable. The demo will - look for a suitable plugin for the device specified + look for a suitable plugin for the device specified. -l CPU_EXTENSION, --cpu_extension CPU_EXTENSION - MKLDNN (CPU)-targeted custom layers.Absolute path to a + MKLDNN (CPU)-targeted custom layers. Absolute path to a shared library with the kernels impl. -u UTILIZATION_MONITORS, --utilization_monitors UTILIZATION_MONITORS - Optional. List of monitors to show initially + Optional. List of monitors to show initially. ``` Example of a command: diff --git a/demos/python_demos/whiteboard_inpainting_demo/cityscapes_labels.txt b/demos/whiteboard_inpainting_demo/python/cityscapes_labels.txt similarity index 100% rename from demos/python_demos/whiteboard_inpainting_demo/cityscapes_labels.txt rename to demos/whiteboard_inpainting_demo/python/cityscapes_labels.txt diff --git a/demos/python_demos/whiteboard_inpainting_demo/coco_labels.txt b/demos/whiteboard_inpainting_demo/python/coco_labels.txt similarity index 100% rename from demos/python_demos/whiteboard_inpainting_demo/coco_labels.txt rename to demos/whiteboard_inpainting_demo/python/coco_labels.txt diff --git a/demos/python_demos/whiteboard_inpainting_demo/models.lst b/demos/whiteboard_inpainting_demo/python/models.lst similarity index 100% rename from demos/python_demos/whiteboard_inpainting_demo/models.lst rename to demos/whiteboard_inpainting_demo/python/models.lst diff --git a/demos/python_demos/whiteboard_inpainting_demo/requirements.txt b/demos/whiteboard_inpainting_demo/python/requirements.txt similarity index 100% rename from demos/python_demos/whiteboard_inpainting_demo/requirements.txt rename to demos/whiteboard_inpainting_demo/python/requirements.txt diff --git a/demos/whiteboard_inpainting_demo/python/utils/__init__.py b/demos/whiteboard_inpainting_demo/python/utils/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/demos/python_demos/whiteboard_inpainting_demo/utils/ie_tools.py b/demos/whiteboard_inpainting_demo/python/utils/ie_tools.py similarity index 99% rename from demos/python_demos/whiteboard_inpainting_demo/utils/ie_tools.py rename to demos/whiteboard_inpainting_demo/python/utils/ie_tools.py index d80068bea4e..5264c44f865 100644 --- a/demos/python_demos/whiteboard_inpainting_demo/utils/ie_tools.py +++ b/demos/whiteboard_inpainting_demo/python/utils/ie_tools.py @@ -15,7 +15,6 @@ import logging as log import numpy as np import os -import sys class IEModel: diff --git a/demos/python_demos/whiteboard_inpainting_demo/utils/misc.py b/demos/whiteboard_inpainting_demo/python/utils/misc.py similarity index 98% rename from demos/python_demos/whiteboard_inpainting_demo/utils/misc.py rename to demos/whiteboard_inpainting_demo/python/utils/misc.py index 420a151bda9..b3576120267 100644 --- a/demos/python_demos/whiteboard_inpainting_demo/utils/misc.py +++ b/demos/whiteboard_inpainting_demo/python/utils/misc.py @@ -13,7 +13,6 @@ import cv2 import logging as log -from os import path as osp import sys diff --git a/demos/python_demos/whiteboard_inpainting_demo/utils/network_wrappers.py b/demos/whiteboard_inpainting_demo/python/utils/network_wrappers.py similarity index 97% rename from demos/python_demos/whiteboard_inpainting_demo/utils/network_wrappers.py rename to demos/whiteboard_inpainting_demo/python/utils/network_wrappers.py index f08a070de54..4b21e6dd10e 100644 --- a/demos/python_demos/whiteboard_inpainting_demo/utils/network_wrappers.py +++ b/demos/whiteboard_inpainting_demo/python/utils/network_wrappers.py @@ -11,9 +11,6 @@ limitations under the License. """ -import json -import logging as log - import cv2 import numpy as np @@ -22,7 +19,7 @@ class MaskRCNN(IEModel): - def __init__(self, ie, model_path, labels_file, conf=.6, device='CPU', ext_path=''): + def __init__(self, ie, model_path, labels_file, conf=.6, device='CPU', ext_path=''): super().__init__(ie, model_path, labels_file, conf, device, ext_path) required_input_keys = {'im_info', 'im_data'} diff --git a/demos/python_demos/whiteboard_inpainting_demo/utils/segm_postprocess.py b/demos/whiteboard_inpainting_demo/python/utils/segm_postprocess.py similarity index 99% rename from demos/python_demos/whiteboard_inpainting_demo/utils/segm_postprocess.py rename to demos/whiteboard_inpainting_demo/python/utils/segm_postprocess.py index 2d71f28ea48..19ea196307c 100644 --- a/demos/python_demos/whiteboard_inpainting_demo/utils/segm_postprocess.py +++ b/demos/whiteboard_inpainting_demo/python/utils/segm_postprocess.py @@ -41,7 +41,7 @@ def postprocess(scores, classes, boxes, raw_cls_masks, im_h, im_w, im_scale_y=None, im_scale_x=None, im_scale=None, full_image_masks=True, encode_masks=False, confidence_threshold=0.0): - no_detections = (np.empty((0, ), dtype=np.float32), np.empty((0, ), dtype=np.float32),\ + no_detections = (np.empty((0, ), dtype=np.float32), np.empty((0, ), dtype=np.float32), np.empty((0, 4), dtype=np.float32), []) if scores is None: return no_detections diff --git a/demos/whiteboard_inpainting_demo/python/whiteboard_inpainting.gif b/demos/whiteboard_inpainting_demo/python/whiteboard_inpainting.gif new file mode 100644 index 00000000000..ec3f22e800d Binary files /dev/null and b/demos/whiteboard_inpainting_demo/python/whiteboard_inpainting.gif differ diff --git a/demos/python_demos/whiteboard_inpainting_demo/whiteboard_inpainting_demo.py b/demos/whiteboard_inpainting_demo/python/whiteboard_inpainting_demo.py similarity index 69% rename from demos/python_demos/whiteboard_inpainting_demo/whiteboard_inpainting_demo.py rename to demos/whiteboard_inpainting_demo/python/whiteboard_inpainting_demo.py index aa5287f60d4..59a5d15c70f 100755 --- a/demos/python_demos/whiteboard_inpainting_demo/whiteboard_inpainting_demo.py +++ b/demos/whiteboard_inpainting_demo/python/whiteboard_inpainting_demo.py @@ -22,12 +22,13 @@ from openvino.inference_engine import IECore # pylint: disable=import-error,E0611 -from utils.capture import VideoCapture from utils.network_wrappers import MaskRCNN, SemanticSegmentation from utils.misc import MouseClick, set_log_config, check_pressed_keys -sys.path.append(osp.join(osp.dirname(osp.dirname(osp.abspath(__file__))), 'common')) +sys.path.append(osp.join(osp.dirname(osp.dirname(osp.dirname(osp.abspath(__file__)))), 'common/python')) import monitors +from images_capture import open_images_capture + set_log_config() WINNAME = 'Whiteboard_inpainting_demo' @@ -65,36 +66,44 @@ def remove_background(img, kernel_size=(7, 7), blur_kernel_size=21, invert_color def main(): parser = argparse.ArgumentParser(description='Whiteboard inpainting demo') - parser.add_argument('-i', type=str, help='Input sources (index of camera \ - or path to a video file)', required=True) + parser.add_argument('-i', '--input', required=True, + help='Required. Path to a video file or a device node of a web-camera.') + parser.add_argument('--loop', default=False, action='store_true', + help='Optional. Enable reading the input in a loop.') + parser.add_argument('-o', '--output', required=False, + help='Optional. Name of output to save.') + parser.add_argument('-limit', '--output_limit', required=False, default=1000, type=int, + help='Optional. Number of frames to store in output. ' + 'If -1 is set, all frames are stored.') parser.add_argument('-m_i', '--m_instance_segmentation', type=str, required=False, - help='Path to the instance segmentation model') + help='Required. Path to the instance segmentation model.') parser.add_argument('-m_s', '--m_semantic_segmentation', type=str, required=False, - help='Path to the semantic segmentation model') + help='Required. Path to the semantic segmentation model.') parser.add_argument('-t', '--threshold', type=float, default=0.6, - help='Threshold for person instance segmentation model') - parser.add_argument('--output_video', type=str, default='', required=False, - help='Optional. Path to output video') - parser.add_argument("--no_show", help="Optional. Don't show output", action='store_true') - + help='Optional. Threshold for person instance segmentation model.') + parser.add_argument('--no_show', help="Optional. Don't show output.", action='store_true') parser.add_argument('-d', '--device', type=str, default='CPU', help='Optional. Specify a target device to infer on. CPU, GPU, FPGA, HDDL or MYRIAD is ' - 'acceptable. The demo will look for a suitable plugin for the device specified') + 'acceptable. The demo will look for a suitable plugin for the device specified.') parser.add_argument('-l', '--cpu_extension', type=str, default=None, - help='MKLDNN (CPU)-targeted custom layers.Absolute \ + help='MKLDNN (CPU)-targeted custom layers. Absolute \ path to a shared library with the kernels impl.') parser.add_argument('-u', '--utilization_monitors', default='', type=str, - help='Optional. List of monitors to show initially') + help='Optional. List of monitors to show initially.') args = parser.parse_args() - capture = VideoCapture(args.i) + cap = open_images_capture(args.input, args.loop) + if cap.get_type() not in ('VIDEO', 'CAMERA'): + raise RuntimeError("The input should be a video file or a numeric camera ID") + frame = cap.read() + if frame is None: + raise RuntimeError("Can't read an image from the input") if bool(args.m_instance_segmentation) == bool(args.m_semantic_segmentation): - raise ValueError('Set up exactly one of segmentation models: '\ + raise ValueError('Set up exactly one of segmentation models: ' '--m_instance_segmentation or --m_semantic_segmentation') - frame_size, fps = capture.get_source_parameters() - out_frame_size = (int(frame_size[0]), int(frame_size[1] * 2)) + out_frame_size = (frame.shape[1], frame.shape[0] * 2) presenter = monitors.Presenter(args.utilization_monitors, 20, (out_frame_size[0] // 4, out_frame_size[1] // 16)) @@ -105,11 +114,12 @@ def main(): cv2.namedWindow(WINNAME) cv2.setMouseCallback(WINNAME, mouse.get_points) - if args.output_video: - fourcc = cv2.VideoWriter_fourcc(*'XVID') - output_video = cv2.VideoWriter(args.output_video, fourcc, fps, out_frame_size) - else: - output_video = None + video_writer = cv2.VideoWriter() + if args.output: + video_writer = cv2.VideoWriter(args.output, cv2.VideoWriter_fourcc(*'MJPG'), cap.fps(), + out_frame_size) + if not video_writer.isOpened(): + raise RuntimeError("Can't open video writer") log.info("Initializing Inference Engine") ie = IECore() @@ -123,24 +133,19 @@ def main(): args.threshold, args.device, args.cpu_extension) black_board = False - output_frame = np.full((frame_size[1], frame_size[0], 3), 255, dtype='uint8') + output_frame = np.full((frame.shape[0], frame.shape[1], 3), 255, dtype='uint8') frame_number = 0 key = -1 + start = time.time() - while True: - start = time.time() - _, frame = capture.get_frame() - + while frame is not None: mask = None - if frame is not None: - detections = segmentation.get_detections([frame]) - expand_mask(detections, frame_size[0] // 27) - if len(detections[0]) > 0: - mask = detections[0][0][2] - for i in range(1, len(detections[0])): - mask = cv2.bitwise_or(mask, detections[0][i][2]) - else: - break + detections = segmentation.get_detections([frame]) + expand_mask(detections, frame.shape[1] // 27) + if len(detections[0]) > 0: + mask = detections[0][0][2] + for i in range(1, len(detections[0])): + mask = cv2.bitwise_or(mask, detections[0][i][2]) if mask is not None: mask = np.stack([mask, mask, mask], axis=-1) @@ -153,8 +158,8 @@ def main(): merged_frame = np.vstack([frame, output_frame]) merged_frame = cv2.resize(merged_frame, out_frame_size) - if output_video is not None: - output_video.write(merged_frame) + if video_writer.isOpened() and (args.output_limit == -1 or frame_number <= args.output_limit-1): + video_writer.write(merged_frame) presenter.drawGraphs(merged_frame) if not args.no_show: @@ -180,16 +185,15 @@ def main(): cv2.imshow('Board', board) end = time.time() - print('\rProcessing frame: {}, fps = {:.3}' \ + print('\rProcessing frame: {}, fps = {:.3}' .format(frame_number, 1. / (end - start)), end="") frame_number += 1 + start = time.time() + frame = cap.read() print('') log.info(presenter.reportMeans()) - if output_video is not None: - output_video.release() - if __name__ == '__main__': main() diff --git a/licensing/third-party-programs.txt b/licensing/third-party-programs.txt new file mode 100644 index 00000000000..2af3a62b1e8 --- /dev/null +++ b/licensing/third-party-programs.txt @@ -0,0 +1,353 @@ +Open Model Zoo Third Party Programs File + +This file contains the list of third party software ("third party programs") +contained in the Intel software and their required notices and/or license +terms. This third party software, even if included with the distribution of +the Intel software, may be governed by separate license terms, including +without limitation, third party license terms, other Intel software license +terms, and open source software license terms. These separate license terms +govern your use of the third party programs as set forth in the +"third-party-programs.txt" or other similarly-named text file. + +Third party programs and their corresponding required notices and/or license +terms are listed below. + +------------------------------------------------------------- + +1. gflags + Copyright (c) 2006, Google Inc. + All rights reserved. + +The 3-Clause BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------- + +2. ctcdecode + Copyright (c) 2017 Ryan Leary + + ONNX models + Copyright (c) ONNX Project Contributors + + fatchord/WaveRNN + Copyright (c) 2019 fatchord (https://github.com/fatchord) + + keithito/tacotron + Copyright (c) 2017 Keith Ito + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +------------------------------------------------------------- + +3. ThreadPool + Copyright (c) 2012 Jakob Progsch, Václav Zeman + +zlib License + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. + +------------------------------------------------------------- + +4. huggingface/transformers + Copyright 2020 The HuggingFace Inc. team. + + TensorFlow + Copyright 2019 The TensorFlow Authors. All rights reserved. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +------------------------------------------------------------- + +5. NumPy + Copyright (c) 2005-2020, NumPy Developers. + All rights reserved. + +The 3-Clause BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of the NumPy Developers nor the names of any + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/models/intel/action-recognition-0001/action-recognition-0001-decoder/model.yml b/models/intel/action-recognition-0001/action-recognition-0001-decoder/model.yml index 5d145c86a6f..1b9f097955e 100644 --- a/models/intel/action-recognition-0001/action-recognition-0001-decoder/model.yml +++ b/models/intel/action-recognition-0001/action-recognition-0001-decoder/model.yml @@ -18,28 +18,28 @@ description: >- task_type: action_recognition files: - name: FP32/action-recognition-0001-decoder.xml - size: 182773 - sha256: 3a17228738b7111fdab266864796f7d2940e2c5ceff9379d8fb92189f4be6908 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/action-recognition-0001/action-recognition-0001-decoder/FP32/action-recognition-0001-decoder.xml + size: 182480 + sha256: 1a70a9b064d603a9b529e01ede4ef0e70633e18f9695a3b718cd57985e35e1e4 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/action-recognition-0001/action-recognition-0001-decoder/FP32/action-recognition-0001-decoder.xml - name: FP32/action-recognition-0001-decoder.bin size: 30238732 sha256: afa0e9d40c8ef686a23672486c881338835df27b00e88b0db433ff3521e773ea - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/action-recognition-0001/action-recognition-0001-decoder/FP32/action-recognition-0001-decoder.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/action-recognition-0001/action-recognition-0001-decoder/FP32/action-recognition-0001-decoder.bin - name: FP16/action-recognition-0001-decoder.xml - size: 182721 - sha256: 2201832ee32c44a2dc8e0b17ab3917fb4371abe43a64be3379f9edc16c2f4b7b - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/action-recognition-0001/action-recognition-0001-decoder/FP16/action-recognition-0001-decoder.xml + size: 182428 + sha256: 07ede5c2ac9818900ebedaa0873b0103b65194381fc0561f6d07fb65fb496b69 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/action-recognition-0001/action-recognition-0001-decoder/FP16/action-recognition-0001-decoder.xml - name: FP16/action-recognition-0001-decoder.bin size: 15119468 sha256: 838ea1889c2cf6c07b87df874004318749dafb9413a7298a5adba33d3e764e72 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/action-recognition-0001/action-recognition-0001-decoder/FP16/action-recognition-0001-decoder.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/action-recognition-0001/action-recognition-0001-decoder/FP16/action-recognition-0001-decoder.bin - name: FP16-INT8/action-recognition-0001-decoder.xml - size: 315073 - sha256: e805093670a829cc087d5f02255fc506194f12a2935a8d5bd744659128b7fbd5 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/action-recognition-0001/action-recognition-0001-decoder/FP16-INT8/action-recognition-0001-decoder.xml + size: 315140 + sha256: efcf979653fabe5ce83faf39cc400b1212981c8120c7fa6d28cd54b46e7e8e9b + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/action-recognition-0001/action-recognition-0001-decoder/FP16-INT8/action-recognition-0001-decoder.xml - name: FP16-INT8/action-recognition-0001-decoder.bin size: 7601288 sha256: af7681aeba01294f706dea6ec7d6219ccdd34df7e4ffe0581cf8ef984d341358 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/action-recognition-0001/action-recognition-0001-decoder/FP16-INT8/action-recognition-0001-decoder.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/action-recognition-0001/action-recognition-0001-decoder/FP16-INT8/action-recognition-0001-decoder.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/action-recognition-0001/action-recognition-0001-encoder/model.yml b/models/intel/action-recognition-0001/action-recognition-0001-encoder/model.yml index d4cd39c2997..d94aeb26004 100644 --- a/models/intel/action-recognition-0001/action-recognition-0001-encoder/model.yml +++ b/models/intel/action-recognition-0001/action-recognition-0001-encoder/model.yml @@ -18,28 +18,28 @@ description: >- task_type: action_recognition files: - name: FP32/action-recognition-0001-encoder.xml - size: 98375 - sha256: ac37a5752bad5d9fd95c2015ced93a407d568a6784a2dfccd67893785f29ca7a - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/action-recognition-0001/action-recognition-0001-encoder/FP32/action-recognition-0001-encoder.xml + size: 99112 + sha256: 860ef0689fca4973da0056fa473c2b937757506094557522a379ad3fe81c3f1a + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/action-recognition-0001/action-recognition-0001-encoder/FP32/action-recognition-0001-encoder.xml - name: FP32/action-recognition-0001-encoder.bin size: 85104664 sha256: c33e24b3f74918104eeafc106ee7f0b56804f03b87098c14ad66af6386cdb648 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/action-recognition-0001/action-recognition-0001-encoder/FP32/action-recognition-0001-encoder.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/action-recognition-0001/action-recognition-0001-encoder/FP32/action-recognition-0001-encoder.bin - name: FP16/action-recognition-0001-encoder.xml - size: 98335 - sha256: 05b58477f370a380a3f66232e1d10ae867742c1abb3d66a0f5b8e3cf2f6d3334 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/action-recognition-0001/action-recognition-0001-encoder/FP16/action-recognition-0001-encoder.xml + size: 99072 + sha256: b7c01ed77324981e30bad2b0e084b6598b8c2219a6e985adf5cc7793b807fff2 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/action-recognition-0001/action-recognition-0001-encoder/FP16/action-recognition-0001-encoder.xml - name: FP16/action-recognition-0001-encoder.bin size: 42552332 sha256: 57d374b873dc87c72e5baab53245d59f1b866f6e2c3e670c923537f45018782c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/action-recognition-0001/action-recognition-0001-encoder/FP16/action-recognition-0001-encoder.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/action-recognition-0001/action-recognition-0001-encoder/FP16/action-recognition-0001-encoder.bin - name: FP16-INT8/action-recognition-0001-encoder.xml - size: 283398 - sha256: 99d5d03047aeff7d224fce64107fffe21369e5d28e202b1f5bbd2e0147ccab8a - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/action-recognition-0001/action-recognition-0001-encoder/FP16-INT8/action-recognition-0001-encoder.xml + size: 284128 + sha256: 19399844fe8f3c63809c546e2969b86faba9bfbca12ff895ebf04a8d87cfbfcf + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/action-recognition-0001/action-recognition-0001-encoder/FP16-INT8/action-recognition-0001-encoder.xml - name: FP16-INT8/action-recognition-0001-encoder.bin size: 21318880 - sha256: b1c437c1fe247e0c254960299b795bb900cc69fa52cb6ec5cc60072840ceec23 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/action-recognition-0001/action-recognition-0001-encoder/FP16-INT8/action-recognition-0001-encoder.bin + sha256: 365f448d81f866599f85ebe71ef7e31445937cd2ff4a82a7eb4a1b5e1540ec14 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/action-recognition-0001/action-recognition-0001-encoder/FP16-INT8/action-recognition-0001-encoder.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/action-recognition-0001/description/action-recognition-0001.md b/models/intel/action-recognition-0001/description/action-recognition-0001.md index 53eba71913a..b39d310a2c9 100644 --- a/models/intel/action-recognition-0001/description/action-recognition-0001.md +++ b/models/intel/action-recognition-0001/description/action-recognition-0001.md @@ -27,8 +27,6 @@ Video frames should be sampled to cover ~1 second fragment (i.e. skip every seco | MParams | 21.276 | -### Performance - ### Inputs 1. name: "0", shape: [1x3x224x224] - An input image in the format [BxCxHxW], @@ -55,8 +53,6 @@ The action-recognition-0001-decoder model accepts stack of frame embeddings, com | MParams | 4.405 | -### Performance - ### Inputs 1. name: "0" , shape: [1x16x512] - An embedding image in the format [BxTxC], diff --git a/models/intel/age-gender-recognition-retail-0013/description/age-gender-recognition-retail-0013.md b/models/intel/age-gender-recognition-retail-0013/description/age-gender-recognition-retail-0013.md index 15ab6c38e04..21c0e114064 100644 --- a/models/intel/age-gender-recognition-retail-0013/description/age-gender-recognition-retail-0013.md +++ b/models/intel/age-gender-recognition-retail-0013/description/age-gender-recognition-retail-0013.md @@ -36,8 +36,6 @@ applicable for children since their faces were not in the training set. | Avg. age error | 6.99 years | | Gender accuracy | 95.80% | -## Performance - ## Inputs Name: `input`, shape: [1x3x62x62] - An input image in [1xCxHxW] format. Expected color order is BGR. diff --git a/models/intel/age-gender-recognition-retail-0013/model.yml b/models/intel/age-gender-recognition-retail-0013/model.yml index d574c7fc762..cfa2c80a428 100644 --- a/models/intel/age-gender-recognition-retail-0013/model.yml +++ b/models/intel/age-gender-recognition-retail-0013/model.yml @@ -17,28 +17,28 @@ description: >- task_type: object_attributes files: - name: FP32/age-gender-recognition-retail-0013.xml - size: 29847 - sha256: e4808239cf130859b1ed26e1e775d8dd9dbe6f0ac71433a0c82448fa782b95c2 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013.xml + size: 30079 + sha256: 6dfd5690af56b3fd484d86c27cc55239eb25cb9ad22f454f10a54f2e1cd62f14 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013.xml - name: FP32/age-gender-recognition-retail-0013.bin size: 8552076 sha256: c7177ca11ad924b0bb34dacb92676b72acac1cb36a71bc336a951116556b6910 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013.bin - name: FP16/age-gender-recognition-retail-0013.xml - size: 29837 - sha256: e80917e377ecbad259c1dddc1c67d875f9aa52326f3430b2592b0da2b2a28b01 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/age-gender-recognition-retail-0013/FP16/age-gender-recognition-retail-0013.xml + size: 30069 + sha256: 71944b2066d271d2ef549a1ca5a11f5a347e8f31587b48fa3474b8ab770d64b9 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/age-gender-recognition-retail-0013/FP16/age-gender-recognition-retail-0013.xml - name: FP16/age-gender-recognition-retail-0013.bin size: 4276038 sha256: 401101e0a01b3d68add39deae833bcf9f54238d37dd13e3fb1534aa8fbe4719d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/age-gender-recognition-retail-0013/FP16/age-gender-recognition-retail-0013.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/age-gender-recognition-retail-0013/FP16/age-gender-recognition-retail-0013.bin - name: FP16-INT8/age-gender-recognition-retail-0013.xml - size: 74052 - sha256: d9f820495990bfa1d8cecc6190eec38cb286db5fb6644825e1b81abf5e0d8d6b - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/age-gender-recognition-retail-0013/FP16-INT8/age-gender-recognition-retail-0013.xml + size: 74320 + sha256: 634d4a1f0515dbe704d05a6dd9fd86c148d5d5a9d9a83f858c587424f0c7660f + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/age-gender-recognition-retail-0013/FP16-INT8/age-gender-recognition-retail-0013.xml - name: FP16-INT8/age-gender-recognition-retail-0013.bin size: 2150120 sha256: 4120ee9d73ad5e4ee34fc8a9ea77de6dfebfe784bc04a386a258e71ecef1613f - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/age-gender-recognition-retail-0013/FP16-INT8/age-gender-recognition-retail-0013.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/age-gender-recognition-retail-0013/FP16-INT8/age-gender-recognition-retail-0013.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/asl-recognition-0004/description/asl-recognition-0004.md b/models/intel/asl-recognition-0004/description/asl-recognition-0004.md index dff81d69e0d..4c99ea22714 100644 --- a/models/intel/asl-recognition-0004/description/asl-recognition-0004.md +++ b/models/intel/asl-recognition-0004/description/asl-recognition-0004.md @@ -23,8 +23,6 @@ on the input clip. | MParams | 4.133 | | Source framework | PyTorch\* | -## Performance - ## Inputs Name: `input`, shape: [1x3x16x224x224]. An input image sequence in the format [BxCxTxHxW], where: diff --git a/models/intel/asl-recognition-0004/model.yml b/models/intel/asl-recognition-0004/model.yml index 50da16dfabf..3dc43683a6f 100644 --- a/models/intel/asl-recognition-0004/model.yml +++ b/models/intel/asl-recognition-0004/model.yml @@ -17,20 +17,20 @@ description: >- task_type: action_recognition files: - name: FP32/asl-recognition-0004.xml - size: 277584 - sha256: 70a22e6ff2b28333be11344bb723a70233673d48af6c4ebb4c5c09ffd3c33211 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/asl-recognition-0004/FP32/asl-recognition-0004.xml + size: 278853 + sha256: baa5efa2b65d4bcf0404e803c97b7d87f7eb260ea8c7e8b40c405f075a463717 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/asl-recognition-0004/FP32/asl-recognition-0004.xml - name: FP32/asl-recognition-0004.bin size: 16530620 sha256: d045bc6e14f1557517dfaa2cad5225822a77df83408d37b12e7f8ab73ab27e4f - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/asl-recognition-0004/FP32/asl-recognition-0004.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/asl-recognition-0004/FP32/asl-recognition-0004.bin - name: FP16/asl-recognition-0004.xml - size: 277431 - sha256: 86f33201e8f065e52887ce1dab678e37fd617427819b1e6e4da132fb6e4f0439 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/asl-recognition-0004/FP16/asl-recognition-0004.xml + size: 278700 + sha256: 5ffe8780b53ce833b4e4feda19973246e86f65a74337c58d24cf2833650caa22 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/asl-recognition-0004/FP16/asl-recognition-0004.xml - name: FP16/asl-recognition-0004.bin size: 8265332 sha256: 327d35259906efb450c4794de7f8d302427a860f7dd3eceabeed14c53f6b8b1e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/asl-recognition-0004/FP16/asl-recognition-0004.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/asl-recognition-0004/FP16/asl-recognition-0004.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/bert-large-uncased-whole-word-masking-squad-fp32-0001/accuracy-check.yml b/models/intel/bert-large-uncased-whole-word-masking-squad-0001/accuracy-check.yml similarity index 93% rename from models/intel/bert-large-uncased-whole-word-masking-squad-fp32-0001/accuracy-check.yml rename to models/intel/bert-large-uncased-whole-word-masking-squad-0001/accuracy-check.yml index 7e1dc3de527..446502b210a 100644 --- a/models/intel/bert-large-uncased-whole-word-masking-squad-fp32-0001/accuracy-check.yml +++ b/models/intel/bert-large-uncased-whole-word-masking-squad-0001/accuracy-check.yml @@ -1,5 +1,5 @@ models: - - name: bert-large-uncased-whole-word-masking-squad-fp32-0001 + - name: bert-large-uncased-whole-word-masking-squad-0001 launchers: - framework: dlsdk adapter: diff --git a/models/intel/bert-large-uncased-whole-word-masking-squad-fp32-0001/description/bert-large-uncased-whole-word-masking-squad-fp32-0001.md b/models/intel/bert-large-uncased-whole-word-masking-squad-0001/description/bert-large-uncased-whole-word-masking-squad-0001.md similarity index 97% rename from models/intel/bert-large-uncased-whole-word-masking-squad-fp32-0001/description/bert-large-uncased-whole-word-masking-squad-fp32-0001.md rename to models/intel/bert-large-uncased-whole-word-masking-squad-0001/description/bert-large-uncased-whole-word-masking-squad-0001.md index b4312624499..05c0db77f72 100644 --- a/models/intel/bert-large-uncased-whole-word-masking-squad-fp32-0001/description/bert-large-uncased-whole-word-masking-squad-fp32-0001.md +++ b/models/intel/bert-large-uncased-whole-word-masking-squad-0001/description/bert-large-uncased-whole-word-masking-squad-0001.md @@ -1,4 +1,4 @@ -# bert-large-uncased-whole-word-masking-squad-fp32-0001 +# bert-large-uncased-whole-word-masking-squad-0001 ## Use Case and High-Level Description @@ -25,8 +25,6 @@ The quality metrics were calculated on the SQuAD v1.1 dataset ("dev" split). Max | Exact match (EM) | 87.20% | -## Performance - ## Input Input 0: A `1,384` sequence of tokens (integer values) representing the tokenized premise and question ("input_ids"). The sequence structure is as follows (`[CLS]`, `[SEP]` and `[PAD]` should be replaced by corresponding token IDs as specified by the dictionary): diff --git a/models/intel/bert-large-uncased-whole-word-masking-squad-0001/model.yml b/models/intel/bert-large-uncased-whole-word-masking-squad-0001/model.yml new file mode 100644 index 00000000000..be9de9bc4c2 --- /dev/null +++ b/models/intel/bert-large-uncased-whole-word-masking-squad-0001/model.yml @@ -0,0 +1,37 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + BERT-large pretrained on lower-cased English text using Whole-Word-Masking and fine-tuned + on the SQuAD v1.1 training set (93.21% F1 - 87.2% EM on the v1.1 dev set). +task_type: question_answering +files: + - name: FP32/bert-large-uncased-whole-word-masking-squad-0001.xml + size: 1214204 + sha256: 0d0823c21c400c3b0d41c6eb566fc54c5d35985331b2e3b0ebbbf143a82bf043 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-large-uncased-whole-word-masking-squad-0001/FP32/bert-large-uncased-whole-word-masking-squad-0001.xml + - name: FP32/bert-large-uncased-whole-word-masking-squad-0001.bin + size: 1336377584 + sha256: 8e7e34c465677ad9871f1ec04333ad5c4ce4d8cafdd65d212ba2f06195087932 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-large-uncased-whole-word-masking-squad-0001/FP32/bert-large-uncased-whole-word-masking-squad-0001.bin + - name: FP16/bert-large-uncased-whole-word-masking-squad-0001.xml + size: 1213011 + sha256: 1bc8ef17227f8363f00c4b1912d34a4b7e8d4d3767d6e0ac7434b3f1239aba91 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-large-uncased-whole-word-masking-squad-0001/FP16/bert-large-uncased-whole-word-masking-squad-0001.xml + - name: FP16/bert-large-uncased-whole-word-masking-squad-0001.bin + size: 668188872 + sha256: 5e301ff385bff3d361fe4119e373ae32060486b6a06071a817b44d52422fda78 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-large-uncased-whole-word-masking-squad-0001/FP16/bert-large-uncased-whole-word-masking-squad-0001.bin +framework: dldt +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/bert-large-uncased-whole-word-masking-squad-fp32-0001/vocab.txt b/models/intel/bert-large-uncased-whole-word-masking-squad-0001/vocab.txt similarity index 100% rename from models/intel/bert-large-uncased-whole-word-masking-squad-fp32-0001/vocab.txt rename to models/intel/bert-large-uncased-whole-word-masking-squad-0001/vocab.txt diff --git a/models/intel/bert-large-uncased-whole-word-masking-squad-emb-0001/description/bert-large-uncased-whole-word-masking-squad-emb-0001.md b/models/intel/bert-large-uncased-whole-word-masking-squad-emb-0001/description/bert-large-uncased-whole-word-masking-squad-emb-0001.md index 8eca7cf7a0b..6d32002603d 100644 --- a/models/intel/bert-large-uncased-whole-word-masking-squad-emb-0001/description/bert-large-uncased-whole-word-masking-squad-emb-0001.md +++ b/models/intel/bert-large-uncased-whole-word-masking-squad-emb-0001/description/bert-large-uncased-whole-word-masking-squad-emb-0001.md @@ -36,8 +36,6 @@ The top5 is calculated as follow: 2. For each question from SQuAD v1.1 dev set the question embedding vector is calculated and compared with each previously calculated context embedding vector. If the right context is in top 5 context embedding closest to question embedding then top5_count increased by 1. 3. top5 = top5_count / question_number -## Performance - ## Input 1. Token IDs, name: `input_ids`, shape: [1x384] for context and [1x32] for question. diff --git a/models/intel/bert-large-uncased-whole-word-masking-squad-emb-0001/model.yml b/models/intel/bert-large-uncased-whole-word-masking-squad-emb-0001/model.yml index f589f8ec955..0d52c88cbab 100644 --- a/models/intel/bert-large-uncased-whole-word-masking-squad-emb-0001/model.yml +++ b/models/intel/bert-large-uncased-whole-word-masking-squad-emb-0001/model.yml @@ -13,26 +13,26 @@ # limitations under the License. description: >- - Transformers's bert-large-uncased-whole-word-masking model fintuned on SQuAD v1.1 + Transformers's bert-large-uncased-whole-word-masking model finetuned on SQuAD v1.1 train set to produce question and context embeddings that are close to each other - in case of the question answer in the context and far to each other overwise. + in case of the question answer in the context and far from each other otherwise. task_type: question_answering files: - name: FP32/bert-large-uncased-whole-word-masking-squad-emb-0001.xml - size: 1278536 - sha256: 14e0de07ef6ff2025ffa863f56e3f86bc55e3c1aec30ff4b84d3dd970663ca40 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/bert-large-uncased-whole-word-masking-squad-emb-0001/FP32/bert-large-uncased-whole-word-masking-squad-emb-0001.xml + size: 1274320 + sha256: 7de29b46f33dcc10c8150813049661b398089259429fda7fddf5a65ebe21edba + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-large-uncased-whole-word-masking-squad-emb-0001/FP32/bert-large-uncased-whole-word-masking-squad-emb-0001.xml - name: FP32/bert-large-uncased-whole-word-masking-squad-emb-0001.bin size: 1340567776 sha256: acc5bbdf9af2b652c960440c095c7d601c2a38ccbccc4ea27cf1c5b7731df3ce - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/bert-large-uncased-whole-word-masking-squad-emb-0001/FP32/bert-large-uncased-whole-word-masking-squad-emb-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-large-uncased-whole-word-masking-squad-emb-0001/FP32/bert-large-uncased-whole-word-masking-squad-emb-0001.bin - name: FP16/bert-large-uncased-whole-word-masking-squad-emb-0001.xml - size: 1277284 - sha256: 8f1d7a5a2a085189b1cb1c5e55926a52c3df84d4f025717ac317b9fa7e63559c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/bert-large-uncased-whole-word-masking-squad-emb-0001/FP16/bert-large-uncased-whole-word-masking-squad-emb-0001.xml + size: 1273068 + sha256: 4705420d632c781b87b2127c4dc6f11d515f66bca8b24e57e234ca1c3c2c2de6 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-large-uncased-whole-word-masking-squad-emb-0001/FP16/bert-large-uncased-whole-word-masking-squad-emb-0001.xml - name: FP16/bert-large-uncased-whole-word-masking-squad-emb-0001.bin size: 670283958 sha256: 4b0aa7a332bc3dea59c73b24b2ca0d9e5d20769f97a7a4217d825761b83aae16 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/bert-large-uncased-whole-word-masking-squad-emb-0001/FP16/bert-large-uncased-whole-word-masking-squad-emb-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-large-uncased-whole-word-masking-squad-emb-0001/FP16/bert-large-uncased-whole-word-masking-squad-emb-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/bert-large-uncased-whole-word-masking-squad-fp32-0001/model.yml b/models/intel/bert-large-uncased-whole-word-masking-squad-fp32-0001/model.yml deleted file mode 100644 index a328e9c246f..00000000000 --- a/models/intel/bert-large-uncased-whole-word-masking-squad-fp32-0001/model.yml +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (c) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -description: >- - BERT-large pretrained on lower-cased English text using Whole-Word-Masking and fine-tuned - on the SQuAD v1.1 training set (93.21% F1 - 87.2% EM on the v1.1 dev set). -task_type: question_answering -files: - - name: FP32/bert-large-uncased-whole-word-masking-squad-fp32-0001.xml - size: 1218568 - sha256: 5368341ac51bbb42a5f05893597ca3adccb089ee7701c889aba5be0ee8c29c48 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/bert-large-uncased-whole-word-masking-squad-fp32-0001/FP32/bert-large-uncased-whole-word-masking-squad-fp32-0001.xml - - name: FP32/bert-large-uncased-whole-word-masking-squad-fp32-0001.bin - size: 1336377584 - sha256: 8e7e34c465677ad9871f1ec04333ad5c4ce4d8cafdd65d212ba2f06195087932 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/bert-large-uncased-whole-word-masking-squad-fp32-0001/FP32/bert-large-uncased-whole-word-masking-squad-fp32-0001.bin - - name: FP16/bert-large-uncased-whole-word-masking-squad-fp32-0001.xml - size: 1217375 - sha256: ea95238148c4cf2790a7b91ce367960735ed4d62a168417f782cdd1eee5764ed - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/bert-large-uncased-whole-word-masking-squad-fp32-0001/FP16/bert-large-uncased-whole-word-masking-squad-fp32-0001.xml - - name: FP16/bert-large-uncased-whole-word-masking-squad-fp32-0001.bin - size: 668188872 - sha256: 5e301ff385bff3d361fe4119e373ae32060486b6a06071a817b44d52422fda78 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/bert-large-uncased-whole-word-masking-squad-fp32-0001/FP16/bert-large-uncased-whole-word-masking-squad-fp32-0001.bin -framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE diff --git a/models/intel/bert-large-uncased-whole-word-masking-squad-int8-0001/description/bert-large-uncased-whole-word-masking-squad-int8-0001.md b/models/intel/bert-large-uncased-whole-word-masking-squad-int8-0001/description/bert-large-uncased-whole-word-masking-squad-int8-0001.md index 700443f8bb1..3401aa3adfe 100644 --- a/models/intel/bert-large-uncased-whole-word-masking-squad-int8-0001/description/bert-large-uncased-whole-word-masking-squad-int8-0001.md +++ b/models/intel/bert-large-uncased-whole-word-masking-squad-int8-0001/description/bert-large-uncased-whole-word-masking-squad-int8-0001.md @@ -27,8 +27,6 @@ The quality metrics were calculated on the SQuAD v1.1 dataset ("dev" split). Max | Exact match (EM) | 86.36% | -## Performance - ## Input Input 0: A `1,384` sequence of tokens (integer values) representing the tokenized premise and question ("input_ids"). The sequence structure is as follows (`[CLS]`, `[SEP]` and `[PAD]` should be replaced by corresponding token IDs as specified by the dictionary): diff --git a/models/intel/bert-large-uncased-whole-word-masking-squad-int8-0001/model.yml b/models/intel/bert-large-uncased-whole-word-masking-squad-int8-0001/model.yml index 7e1af8ed4da..1fce1e6e087 100644 --- a/models/intel/bert-large-uncased-whole-word-masking-squad-int8-0001/model.yml +++ b/models/intel/bert-large-uncased-whole-word-masking-squad-int8-0001/model.yml @@ -19,20 +19,20 @@ description: >- task_type: question_answering files: - name: FP32-INT8/bert-large-uncased-whole-word-masking-squad-int8-0001.xml - size: 1983606 - sha256: 793172afe4803aececbb8815341b650e3590283ba9e8a0f183ca2925a7b818fa - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/bert-large-uncased-whole-word-masking-squad-int8-0001/FP32-INT8/bert-large-uncased-whole-word-masking-squad-int8-0001.xml + size: 1976840 + sha256: b4c7d5f6be8ca7b6a653d2e6c416836110ddb10c760709c14749d2e5068d05cc + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-large-uncased-whole-word-masking-squad-int8-0001/FP32-INT8/bert-large-uncased-whole-word-masking-squad-int8-0001.xml - name: FP32-INT8/bert-large-uncased-whole-word-masking-squad-int8-0001.bin size: 430404624 sha256: 1e5307694df4a3a3f1399ed5ebfd84bbfbf9355a6fc6af287f3e7768f3ae762c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/bert-large-uncased-whole-word-masking-squad-int8-0001/FP32-INT8/bert-large-uncased-whole-word-masking-squad-int8-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-large-uncased-whole-word-masking-squad-int8-0001/FP32-INT8/bert-large-uncased-whole-word-masking-squad-int8-0001.bin - name: FP16-INT8/bert-large-uncased-whole-word-masking-squad-int8-0001.xml - size: 1982151 - sha256: bff159e30bbfe1e6a92915619f6bbbaf4068efe303860021bc9ca185d8814dd9 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/bert-large-uncased-whole-word-masking-squad-int8-0001/FP16-INT8/bert-large-uncased-whole-word-masking-squad-int8-0001.xml + size: 1975385 + sha256: 5afeef599e7cab9404f288ccc915cbfbfbe0956feb6abac41ee5b304af1e12ca + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-large-uncased-whole-word-masking-squad-int8-0001/FP16-INT8/bert-large-uncased-whole-word-masking-squad-int8-0001.xml - name: FP16-INT8/bert-large-uncased-whole-word-masking-squad-int8-0001.bin size: 366198326 sha256: aa7d3a79c2362ea8061eb16f8b1ad3295abd0591943a19339b727e8635176706 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/bert-large-uncased-whole-word-masking-squad-int8-0001/FP16-INT8/bert-large-uncased-whole-word-masking-squad-int8-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-large-uncased-whole-word-masking-squad-int8-0001/FP16-INT8/bert-large-uncased-whole-word-masking-squad-int8-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/bert-small-uncased-whole-word-masking-squad-0001/description/bert-small-uncased-whole-word-masking-squad-0001.md b/models/intel/bert-small-uncased-whole-word-masking-squad-0001/description/bert-small-uncased-whole-word-masking-squad-0001.md index 85db8bfaee4..15780bf0568 100644 --- a/models/intel/bert-small-uncased-whole-word-masking-squad-0001/description/bert-small-uncased-whole-word-masking-squad-0001.md +++ b/models/intel/bert-small-uncased-whole-word-masking-squad-0001/description/bert-small-uncased-whole-word-masking-squad-0001.md @@ -30,8 +30,6 @@ The quality metrics were calculated on the SQuAD v1.1 dataset ("dev" split). Max | F1 | 91.57% | | Exact match (EM) | 85.04% | -## Performance - ## Input 1. Token IDs, name: `input_ids`, shape: [1x384]. diff --git a/models/intel/bert-small-uncased-whole-word-masking-squad-0001/model.yml b/models/intel/bert-small-uncased-whole-word-masking-squad-0001/model.yml index 9d708e209e7..6890b596a65 100644 --- a/models/intel/bert-small-uncased-whole-word-masking-squad-0001/model.yml +++ b/models/intel/bert-small-uncased-whole-word-masking-squad-0001/model.yml @@ -20,20 +20,20 @@ description: >- task_type: question_answering files: - name: FP32/bert-small-uncased-whole-word-masking-squad-0001.xml - size: 675001 - sha256: 05aa4cf5eb517d64bc7fd3556255e70f0895bcae561a0c1562d813592570e311 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/bert-small-uncased-whole-word-masking-squad-0001/FP32/bert-small-uncased-whole-word-masking-squad-0001.xml + size: 672263 + sha256: 16780b7efe82bc3c37a81117afb1d01ab6a653b1b85459d3cac96a2d9c30974e + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-small-uncased-whole-word-masking-squad-0001/FP32/bert-small-uncased-whole-word-masking-squad-0001.xml - name: FP32/bert-small-uncased-whole-word-masking-squad-0001.bin size: 232298716 sha256: 72ac3665b24dbb814b9e83a15c7c097cd6384cb375bc692aec3ea6f19ac8eb8d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/bert-small-uncased-whole-word-masking-squad-0001/FP32/bert-small-uncased-whole-word-masking-squad-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-small-uncased-whole-word-masking-squad-0001/FP32/bert-small-uncased-whole-word-masking-squad-0001.bin - name: FP16/bert-small-uncased-whole-word-masking-squad-0001.xml - size: 674230 - sha256: b279b1e5dee8eaca1ed339436d475f7d6bdc8d31f0ee5c7fb16459f40d632afc - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/bert-small-uncased-whole-word-masking-squad-0001/FP16/bert-small-uncased-whole-word-masking-squad-0001.xml + size: 671492 + sha256: 68978736b5302a28412cab292d5b0b0e8afa083b2f1ca86d6f393036b26c41a6 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-small-uncased-whole-word-masking-squad-0001/FP16/bert-small-uncased-whole-word-masking-squad-0001.xml - name: FP16/bert-small-uncased-whole-word-masking-squad-0001.bin size: 116149444 sha256: 39a2380222daf846edff1d7ec19ff86aca2ea5081028ff3c300173bcf531e318 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/bert-small-uncased-whole-word-masking-squad-0001/FP16/bert-small-uncased-whole-word-masking-squad-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-small-uncased-whole-word-masking-squad-0001/FP16/bert-small-uncased-whole-word-masking-squad-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/bert-small-uncased-whole-word-masking-squad-0002/description/bert-small-uncased-whole-word-masking-squad-0002.md b/models/intel/bert-small-uncased-whole-word-masking-squad-0002/description/bert-small-uncased-whole-word-masking-squad-0002.md index 5ee679e85d4..83d57672619 100644 --- a/models/intel/bert-small-uncased-whole-word-masking-squad-0002/description/bert-small-uncased-whole-word-masking-squad-0002.md +++ b/models/intel/bert-small-uncased-whole-word-masking-squad-0002/description/bert-small-uncased-whole-word-masking-squad-0002.md @@ -30,8 +30,6 @@ The quality metrics were calculated on the SQuAD v1.1 dataset ("dev" split). Max | F1 | 91.9% | | Exact match (EM) | 85.4% | -## Performance - ## Input 1. Token IDs, name: `input_ids`, shape: [1x384]. diff --git a/models/intel/bert-small-uncased-whole-word-masking-squad-0002/model.yml b/models/intel/bert-small-uncased-whole-word-masking-squad-0002/model.yml index 2b4284dd7e2..27c7882b8fd 100644 --- a/models/intel/bert-small-uncased-whole-word-masking-squad-0002/model.yml +++ b/models/intel/bert-small-uncased-whole-word-masking-squad-0002/model.yml @@ -20,20 +20,20 @@ description: >- task_type: question_answering files: - name: FP32/bert-small-uncased-whole-word-masking-squad-0002.xml - size: 771671 - sha256: 2db345b5f4bafa6d1e15beeae194277c0adf6ef1c0f6f1dff5c1cd487923fd5b - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/bert-small-uncased-whole-word-masking-squad-0002/FP32/bert-small-uncased-whole-word-masking-squad-0002.xml + size: 769117 + sha256: 09c5ab67248728d45e3c79654f1209bc59d5e1dd07ac0a14191f342f2f064833 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-small-uncased-whole-word-masking-squad-0002/FP32/bert-small-uncased-whole-word-masking-squad-0002.xml - name: FP32/bert-small-uncased-whole-word-masking-squad-0002.bin size: 164528344 sha256: 93fc8ae8b61a98cca844b7cc90715c086e44543a07c787e17ad8663932d20714 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/bert-small-uncased-whole-word-masking-squad-0002/FP32/bert-small-uncased-whole-word-masking-squad-0002.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-small-uncased-whole-word-masking-squad-0002/FP32/bert-small-uncased-whole-word-masking-squad-0002.bin - name: FP16/bert-small-uncased-whole-word-masking-squad-0002.xml - size: 771416 - sha256: df59e572776173e4496bdb62799b04aeb6c2556096f29202b370172abfcacb44 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/bert-small-uncased-whole-word-masking-squad-0002/FP16/bert-small-uncased-whole-word-masking-squad-0002.xml + size: 768862 + sha256: 47e654258785b84af6301ebe6de643a6be858590060b3f43885c436b0325e067 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-small-uncased-whole-word-masking-squad-0002/FP16/bert-small-uncased-whole-word-masking-squad-0002.xml - name: FP16/bert-small-uncased-whole-word-masking-squad-0002.bin size: 82264250 sha256: a55f46ac4c364e05a134085cdc7e1e267465705abc81489056f90a808a8c5a88 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/bert-small-uncased-whole-word-masking-squad-0002/FP16/bert-small-uncased-whole-word-masking-squad-0002.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-small-uncased-whole-word-masking-squad-0002/FP16/bert-small-uncased-whole-word-masking-squad-0002.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/bert-small-uncased-whole-word-masking-squad-emb-int8-0001/accuracy-check.yml b/models/intel/bert-small-uncased-whole-word-masking-squad-emb-int8-0001/accuracy-check.yml new file mode 100644 index 00000000000..f2d4d84a4e4 --- /dev/null +++ b/models/intel/bert-small-uncased-whole-word-masking-squad-emb-int8-0001/accuracy-check.yml @@ -0,0 +1,35 @@ +models: + - name: bert-small-uncased-whole-word-masking-squad-emb-int8-0001 + launchers: + - framework: dlsdk + allow_reshape_input: True + adapter: + type: bert_question_answering_embedding + embedding: "embedding" + inputs: + - name: "input_ids" + type: INPUT + value: "input_ids" + - name: "attention_mask" + type: INPUT + value: "input_mask" + - name: "token_type_ids" + type: INPUT + value: "segment_ids" + - name: "position_ids" + type: INPUT + value: "position_ids" + + datasets: + - name: squad_emb_v1_1_msl384_mql32_lowercase + reader: + type: annotation_features_extractor + features: + - input_ids + - input_mask + - segment_ids + - position_ids + metrics: + - name: 'top_5_acc' + type: 'qa_embedding_accuracy' + top_k: 5 diff --git a/models/intel/bert-small-uncased-whole-word-masking-squad-emb-int8-0001/bert-small-uncased-whole-word-masking-squad-emb-int8-0001.md b/models/intel/bert-small-uncased-whole-word-masking-squad-emb-int8-0001/bert-small-uncased-whole-word-masking-squad-emb-int8-0001.md new file mode 100644 index 00000000000..9fcd035391e --- /dev/null +++ b/models/intel/bert-small-uncased-whole-word-masking-squad-emb-int8-0001/bert-small-uncased-whole-word-masking-squad-emb-int8-0001.md @@ -0,0 +1,83 @@ +# bert-small-uncased-whole-word-masking-squad-emb-int8-0001 + +## Use Case and High-Level Description + +The model performs embeddings for context or question for English language; +the input is a context or question to them, +and the output is the 1024D embedding vectors that allow to find context with answer to the question by simple comparison the context and the question embedding vectors in the 1024D embedding space. +For details about the original model, check out +[BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://arxiv.org/abs/1810.04805), +[HuggingFace's Transformers: State-of-the-art Natural Language Processing](https://arxiv.org/abs/1910.03771). + +Tokenization occurs using the BERT tokenizer (see the demo code for implementation details) and the enclosed `vocab.txt` dictionary file. Input is to be lower-cased before tokenizing. + +The difference between this model and similar [FP32 version large model](../bert-large-uncased-whole-word-masking-squad-emb-0001/description/bert-large-uncased-whole-word-masking-squad-emb-0001.md) +is that this model is significantly smaller and quantized to INT8. + +The model created by 3 steps: +1. Initial BERT-large model finetuned to produce embeddings on SQuAD v1.1 training set from original +bert-large-uncased-whole-word-masking provided by the [Transformers](https://github.com/huggingface/transformers) library. +2. Then the finetuned model is distilled to much smaller FP32 model on SQuAD v1.1 training set +3. On final step the distilled small model symmetricaly quantized to INT8. + +## Specification + +| Metric | Value | +|-------------------|-----------------------| +| GOps | 23.9 | +| MParams | 41.1 | +| Source framework | PyTorch\* | +GOps is calculated for for [1,384] input size that is suitable for long context + +## Accuracy + +The quality metrics were calculated on the SQuAD v1.1 dataset ("dev" split). Maximum sequence length for context is 384 and for question is 32, input is lower-cased. + +| Metric | Value | +|---------------------------|---------------| +| top5 | 87.6% | + +The top5 is calculated as follow: +1. For each context from SQuAD v1.1 dev set the context embedding vector is calculated. +2. For each question from SQuAD v1.1 dev set the question embedding vector is calculated and compared with each previously calculated context embedding vector. +If the right context is in top 5 context embedding list sorted by distance to the given question embedding then top5_count increased by 1. +3. top5 = top5_count / question_number + +## Input + +1. Token IDs, name: `input_ids`, shape: [1x384] for context and [1x32] for question. +Token IDs is sequence of integer values that is representing the tokenized context or question. +The sequence structure is as follows (`[CLS]`, `[SEP]` and `[PAD]` should be replaced by corresponding token IDs +as specified by the dictionary): +`[CLS]` + *tokenized context or question* + `[SEP]` + (`[PAD]` tokens to pad to the maximum sequence length of 384 or 32) + +2. Input mask, name: `attention_mask`, shape: [1x384] for context and [1x32] for question. +Input mask is a sequence of integer values representing the mask of valid values in the input. +The values of this input are equal to: + * `1` at positions corresponding to the `[CLS]` + *tokenized context or question* + `[SEP]` part of the `input_ids` (i.e. all positions except those containing the `[PAD]` tokens), and + * `[PAD]` at all other positions + +3. Token types, name: `token_type_ids`, shape: [1x384] for context and [1x32] for question. +Token types is sequence of integer values representing the segmentation of the `input_ids` into question and premise. +The values are equal to: + * `0` at positions corresponding to the `[CLS]` + *tokenized context or question* + `[SEP]` part of the `input_ids` (i.e. all positions except those containing the `[PAD]` tokens), and + * `[PAD]` at all other positions + +* `[CLS]` is a special symbol added in front of the question. +* `[SEP]` is a special separator token inserted between the question and premise of the question. +* `[PAD]` is a special token used to fill the rest of the input to get given input length (384). + +4. Position indexes, name: `position_ids`, shape: [1x384] for context and [1x32] for question. +Position indexes are sequence of integer values from 0 to 383 (or 31 for question) representing the position index for each input token. The `position_ids` is always the same for any input tokens set + +## Output + +The outputs of the net is `1, 1024` floating point-valued embedding vector. These vectors can be used to find better context with answer to the question by simple comparing the context embedding vector with question context embedding vector in 1024D embedding space. + +1. Embedding: name: `embedding`, shape: [1x1024]. +embedding vector that represent input context or question. + +## Legal Information +[*] Other names and brands may be claimed as the property of others. + +The original `bert-large-uncased-whole-word-masking` model is taken from [Transformers](https://github.com/huggingface/transformers) library, which is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/huggingface/transformers/master/LICENSE). diff --git a/models/intel/bert-small-uncased-whole-word-masking-squad-emb-int8-0001/model.yml b/models/intel/bert-small-uncased-whole-word-masking-squad-emb-int8-0001/model.yml new file mode 100644 index 00000000000..779da53d464 --- /dev/null +++ b/models/intel/bert-small-uncased-whole-word-masking-squad-emb-int8-0001/model.yml @@ -0,0 +1,40 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + Transformers's bert-large-uncased-whole-word-masking model finetuned on SQuAD v1.1 + train set then distilled to smaller model on SQuAD v1.1 train set and then quantized + in symmetrical INT8 on SQuAD v1.1 train set to produce question and context embeddings + that are close to each other in case of the question answer in the context and far + from each other otherwise. +task_type: question_answering +files: + - name: FP32-INT8/bert-small-uncased-whole-word-masking-squad-emb-int8-0001.xml + size: 1351134 + sha256: a3062311904bb3640fcf79d3cff1ca581b6503b1fc29223f15596c5b183f5942 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-small-uncased-whole-word-masking-squad-emb-int8-0001/FP32-INT8/bert-small-uncased-whole-word-masking-squad-emb-int8-0001.xml + - name: FP32-INT8/bert-small-uncased-whole-word-masking-squad-emb-int8-0001.bin + size: 41893904 + sha256: 08c5cc53e30d4056027a8d86544aff8457e30fe58a28ea6e1a247e12174d55ea + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-small-uncased-whole-word-masking-squad-emb-int8-0001/FP32-INT8/bert-small-uncased-whole-word-masking-squad-emb-int8-0001.bin + - name: FP16-INT8/bert-small-uncased-whole-word-masking-squad-emb-int8-0001.xml + size: 1351134 + sha256: b4327e00bacca071cda1380d0a52db67376c4f72a509d126a8c48afa4daa370b + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-small-uncased-whole-word-masking-squad-emb-int8-0001/FP16-INT8/bert-small-uncased-whole-word-masking-squad-emb-int8-0001.xml + - name: FP16-INT8/bert-small-uncased-whole-word-masking-squad-emb-int8-0001.bin + size: 41737374 + sha256: 82cb74cef22f08e37887ceb4051c5a6d7f752c71d142983eb7296c71a422b3d4 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-small-uncased-whole-word-masking-squad-emb-int8-0001/FP16-INT8/bert-small-uncased-whole-word-masking-squad-emb-int8-0001.bin +framework: dldt +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/bert-small-uncased-whole-word-masking-squad-emb-int8-0001/vocab.txt b/models/intel/bert-small-uncased-whole-word-masking-squad-emb-int8-0001/vocab.txt new file mode 100644 index 00000000000..fb140275c15 --- /dev/null +++ b/models/intel/bert-small-uncased-whole-word-masking-squad-emb-int8-0001/vocab.txt @@ -0,0 +1,30522 @@ +[PAD] +[unused0] +[unused1] +[unused2] +[unused3] +[unused4] +[unused5] +[unused6] +[unused7] +[unused8] +[unused9] +[unused10] +[unused11] +[unused12] +[unused13] +[unused14] +[unused15] +[unused16] +[unused17] +[unused18] +[unused19] +[unused20] +[unused21] +[unused22] +[unused23] +[unused24] +[unused25] +[unused26] +[unused27] +[unused28] +[unused29] +[unused30] +[unused31] +[unused32] +[unused33] +[unused34] +[unused35] +[unused36] +[unused37] +[unused38] +[unused39] +[unused40] +[unused41] +[unused42] +[unused43] +[unused44] +[unused45] +[unused46] +[unused47] +[unused48] +[unused49] +[unused50] +[unused51] +[unused52] +[unused53] +[unused54] +[unused55] +[unused56] +[unused57] +[unused58] +[unused59] +[unused60] +[unused61] +[unused62] +[unused63] +[unused64] +[unused65] +[unused66] +[unused67] +[unused68] +[unused69] +[unused70] +[unused71] +[unused72] +[unused73] +[unused74] +[unused75] +[unused76] +[unused77] +[unused78] +[unused79] +[unused80] +[unused81] +[unused82] +[unused83] +[unused84] +[unused85] +[unused86] +[unused87] +[unused88] +[unused89] +[unused90] +[unused91] +[unused92] +[unused93] +[unused94] +[unused95] +[unused96] +[unused97] +[unused98] +[UNK] +[CLS] +[SEP] +[MASK] +[unused99] +[unused100] +[unused101] +[unused102] +[unused103] +[unused104] +[unused105] +[unused106] +[unused107] +[unused108] +[unused109] +[unused110] +[unused111] +[unused112] +[unused113] +[unused114] +[unused115] +[unused116] +[unused117] +[unused118] +[unused119] +[unused120] +[unused121] +[unused122] +[unused123] +[unused124] +[unused125] +[unused126] +[unused127] +[unused128] +[unused129] +[unused130] +[unused131] +[unused132] +[unused133] +[unused134] +[unused135] +[unused136] +[unused137] +[unused138] +[unused139] +[unused140] +[unused141] +[unused142] +[unused143] +[unused144] +[unused145] +[unused146] +[unused147] +[unused148] +[unused149] +[unused150] +[unused151] +[unused152] +[unused153] +[unused154] +[unused155] +[unused156] +[unused157] +[unused158] +[unused159] +[unused160] +[unused161] +[unused162] +[unused163] +[unused164] +[unused165] +[unused166] +[unused167] +[unused168] +[unused169] +[unused170] +[unused171] +[unused172] +[unused173] +[unused174] +[unused175] +[unused176] +[unused177] +[unused178] +[unused179] +[unused180] +[unused181] +[unused182] +[unused183] +[unused184] +[unused185] +[unused186] +[unused187] +[unused188] +[unused189] +[unused190] +[unused191] +[unused192] +[unused193] +[unused194] +[unused195] +[unused196] +[unused197] +[unused198] +[unused199] +[unused200] +[unused201] +[unused202] +[unused203] +[unused204] +[unused205] +[unused206] +[unused207] +[unused208] +[unused209] +[unused210] +[unused211] +[unused212] +[unused213] +[unused214] +[unused215] +[unused216] +[unused217] +[unused218] +[unused219] +[unused220] +[unused221] +[unused222] +[unused223] +[unused224] +[unused225] +[unused226] +[unused227] +[unused228] +[unused229] +[unused230] +[unused231] +[unused232] +[unused233] +[unused234] +[unused235] +[unused236] +[unused237] +[unused238] +[unused239] +[unused240] +[unused241] +[unused242] +[unused243] +[unused244] +[unused245] +[unused246] +[unused247] +[unused248] +[unused249] +[unused250] +[unused251] +[unused252] +[unused253] +[unused254] +[unused255] +[unused256] +[unused257] +[unused258] +[unused259] +[unused260] +[unused261] +[unused262] +[unused263] +[unused264] +[unused265] +[unused266] +[unused267] +[unused268] +[unused269] +[unused270] +[unused271] +[unused272] +[unused273] +[unused274] +[unused275] +[unused276] +[unused277] +[unused278] +[unused279] +[unused280] +[unused281] +[unused282] +[unused283] +[unused284] +[unused285] +[unused286] +[unused287] +[unused288] +[unused289] +[unused290] +[unused291] +[unused292] +[unused293] +[unused294] +[unused295] +[unused296] +[unused297] +[unused298] +[unused299] +[unused300] +[unused301] +[unused302] +[unused303] +[unused304] +[unused305] +[unused306] +[unused307] +[unused308] +[unused309] +[unused310] +[unused311] +[unused312] +[unused313] +[unused314] +[unused315] +[unused316] +[unused317] +[unused318] +[unused319] +[unused320] +[unused321] +[unused322] +[unused323] +[unused324] +[unused325] +[unused326] +[unused327] +[unused328] +[unused329] +[unused330] +[unused331] +[unused332] +[unused333] +[unused334] +[unused335] +[unused336] +[unused337] +[unused338] +[unused339] +[unused340] +[unused341] +[unused342] +[unused343] +[unused344] +[unused345] +[unused346] +[unused347] +[unused348] +[unused349] +[unused350] +[unused351] +[unused352] +[unused353] +[unused354] +[unused355] +[unused356] +[unused357] +[unused358] +[unused359] +[unused360] +[unused361] +[unused362] +[unused363] +[unused364] +[unused365] +[unused366] +[unused367] +[unused368] +[unused369] +[unused370] +[unused371] +[unused372] +[unused373] +[unused374] +[unused375] +[unused376] +[unused377] +[unused378] +[unused379] +[unused380] +[unused381] +[unused382] +[unused383] +[unused384] +[unused385] +[unused386] +[unused387] +[unused388] +[unused389] +[unused390] +[unused391] +[unused392] +[unused393] +[unused394] +[unused395] +[unused396] +[unused397] +[unused398] +[unused399] +[unused400] +[unused401] +[unused402] +[unused403] +[unused404] +[unused405] +[unused406] +[unused407] +[unused408] +[unused409] +[unused410] +[unused411] +[unused412] +[unused413] +[unused414] +[unused415] +[unused416] +[unused417] +[unused418] +[unused419] +[unused420] +[unused421] +[unused422] +[unused423] +[unused424] +[unused425] +[unused426] +[unused427] +[unused428] +[unused429] +[unused430] +[unused431] +[unused432] +[unused433] +[unused434] +[unused435] +[unused436] +[unused437] +[unused438] +[unused439] +[unused440] +[unused441] +[unused442] +[unused443] +[unused444] +[unused445] +[unused446] +[unused447] +[unused448] +[unused449] +[unused450] +[unused451] +[unused452] +[unused453] +[unused454] +[unused455] +[unused456] +[unused457] +[unused458] +[unused459] +[unused460] +[unused461] +[unused462] +[unused463] +[unused464] +[unused465] +[unused466] +[unused467] +[unused468] +[unused469] +[unused470] +[unused471] +[unused472] +[unused473] +[unused474] +[unused475] +[unused476] +[unused477] +[unused478] +[unused479] +[unused480] +[unused481] +[unused482] +[unused483] +[unused484] +[unused485] +[unused486] +[unused487] +[unused488] +[unused489] +[unused490] +[unused491] +[unused492] +[unused493] +[unused494] +[unused495] +[unused496] +[unused497] +[unused498] +[unused499] +[unused500] +[unused501] +[unused502] +[unused503] +[unused504] +[unused505] +[unused506] +[unused507] +[unused508] +[unused509] +[unused510] +[unused511] +[unused512] +[unused513] +[unused514] +[unused515] +[unused516] +[unused517] +[unused518] +[unused519] +[unused520] +[unused521] +[unused522] +[unused523] +[unused524] +[unused525] +[unused526] +[unused527] +[unused528] +[unused529] +[unused530] +[unused531] +[unused532] +[unused533] +[unused534] +[unused535] +[unused536] +[unused537] +[unused538] +[unused539] +[unused540] +[unused541] +[unused542] +[unused543] +[unused544] +[unused545] +[unused546] +[unused547] +[unused548] +[unused549] +[unused550] +[unused551] +[unused552] +[unused553] +[unused554] +[unused555] +[unused556] +[unused557] +[unused558] +[unused559] +[unused560] +[unused561] +[unused562] +[unused563] +[unused564] +[unused565] +[unused566] +[unused567] +[unused568] +[unused569] +[unused570] +[unused571] +[unused572] +[unused573] +[unused574] +[unused575] +[unused576] +[unused577] +[unused578] +[unused579] +[unused580] +[unused581] +[unused582] +[unused583] +[unused584] +[unused585] +[unused586] +[unused587] +[unused588] +[unused589] +[unused590] +[unused591] +[unused592] +[unused593] +[unused594] +[unused595] +[unused596] +[unused597] +[unused598] +[unused599] +[unused600] +[unused601] +[unused602] +[unused603] +[unused604] +[unused605] +[unused606] +[unused607] +[unused608] +[unused609] +[unused610] +[unused611] +[unused612] +[unused613] +[unused614] +[unused615] +[unused616] +[unused617] +[unused618] +[unused619] +[unused620] +[unused621] +[unused622] +[unused623] +[unused624] +[unused625] +[unused626] +[unused627] +[unused628] +[unused629] +[unused630] +[unused631] +[unused632] +[unused633] +[unused634] +[unused635] +[unused636] +[unused637] +[unused638] +[unused639] +[unused640] +[unused641] +[unused642] +[unused643] +[unused644] +[unused645] +[unused646] +[unused647] +[unused648] +[unused649] +[unused650] +[unused651] +[unused652] +[unused653] +[unused654] +[unused655] +[unused656] +[unused657] +[unused658] +[unused659] +[unused660] +[unused661] +[unused662] +[unused663] +[unused664] +[unused665] +[unused666] +[unused667] +[unused668] +[unused669] +[unused670] +[unused671] +[unused672] +[unused673] +[unused674] +[unused675] +[unused676] +[unused677] +[unused678] +[unused679] +[unused680] +[unused681] +[unused682] +[unused683] +[unused684] +[unused685] +[unused686] +[unused687] +[unused688] +[unused689] +[unused690] +[unused691] +[unused692] +[unused693] +[unused694] +[unused695] +[unused696] +[unused697] +[unused698] +[unused699] +[unused700] +[unused701] +[unused702] +[unused703] +[unused704] +[unused705] +[unused706] +[unused707] +[unused708] +[unused709] +[unused710] +[unused711] +[unused712] +[unused713] +[unused714] +[unused715] +[unused716] +[unused717] +[unused718] +[unused719] +[unused720] +[unused721] +[unused722] +[unused723] +[unused724] +[unused725] +[unused726] +[unused727] +[unused728] +[unused729] +[unused730] +[unused731] +[unused732] +[unused733] +[unused734] +[unused735] +[unused736] +[unused737] +[unused738] +[unused739] +[unused740] +[unused741] +[unused742] +[unused743] +[unused744] +[unused745] +[unused746] +[unused747] +[unused748] +[unused749] +[unused750] +[unused751] +[unused752] +[unused753] +[unused754] +[unused755] +[unused756] +[unused757] +[unused758] +[unused759] +[unused760] +[unused761] +[unused762] +[unused763] +[unused764] +[unused765] +[unused766] +[unused767] +[unused768] +[unused769] +[unused770] +[unused771] +[unused772] +[unused773] +[unused774] +[unused775] +[unused776] +[unused777] +[unused778] +[unused779] +[unused780] +[unused781] +[unused782] +[unused783] +[unused784] +[unused785] +[unused786] +[unused787] +[unused788] +[unused789] +[unused790] +[unused791] +[unused792] +[unused793] +[unused794] +[unused795] +[unused796] +[unused797] +[unused798] +[unused799] +[unused800] +[unused801] +[unused802] +[unused803] +[unused804] +[unused805] +[unused806] +[unused807] +[unused808] +[unused809] +[unused810] +[unused811] +[unused812] +[unused813] +[unused814] +[unused815] +[unused816] +[unused817] +[unused818] +[unused819] +[unused820] +[unused821] +[unused822] +[unused823] +[unused824] +[unused825] +[unused826] +[unused827] +[unused828] +[unused829] +[unused830] +[unused831] +[unused832] +[unused833] +[unused834] +[unused835] +[unused836] +[unused837] +[unused838] +[unused839] +[unused840] +[unused841] +[unused842] +[unused843] +[unused844] +[unused845] +[unused846] +[unused847] +[unused848] +[unused849] +[unused850] +[unused851] +[unused852] +[unused853] +[unused854] +[unused855] +[unused856] +[unused857] +[unused858] +[unused859] +[unused860] +[unused861] +[unused862] +[unused863] +[unused864] +[unused865] +[unused866] +[unused867] +[unused868] +[unused869] +[unused870] +[unused871] +[unused872] +[unused873] +[unused874] +[unused875] +[unused876] +[unused877] +[unused878] +[unused879] +[unused880] +[unused881] +[unused882] +[unused883] +[unused884] +[unused885] +[unused886] +[unused887] +[unused888] +[unused889] +[unused890] +[unused891] +[unused892] +[unused893] +[unused894] +[unused895] +[unused896] +[unused897] +[unused898] +[unused899] +[unused900] +[unused901] +[unused902] +[unused903] +[unused904] +[unused905] +[unused906] +[unused907] +[unused908] +[unused909] +[unused910] +[unused911] +[unused912] +[unused913] +[unused914] +[unused915] +[unused916] +[unused917] +[unused918] +[unused919] +[unused920] +[unused921] +[unused922] +[unused923] +[unused924] +[unused925] +[unused926] +[unused927] +[unused928] +[unused929] +[unused930] +[unused931] +[unused932] +[unused933] +[unused934] +[unused935] +[unused936] +[unused937] +[unused938] +[unused939] +[unused940] +[unused941] +[unused942] +[unused943] +[unused944] +[unused945] +[unused946] +[unused947] +[unused948] +[unused949] +[unused950] +[unused951] +[unused952] +[unused953] +[unused954] +[unused955] +[unused956] +[unused957] +[unused958] +[unused959] +[unused960] +[unused961] +[unused962] +[unused963] +[unused964] +[unused965] +[unused966] +[unused967] +[unused968] +[unused969] +[unused970] +[unused971] +[unused972] +[unused973] +[unused974] +[unused975] +[unused976] +[unused977] +[unused978] +[unused979] +[unused980] +[unused981] +[unused982] +[unused983] +[unused984] +[unused985] +[unused986] +[unused987] +[unused988] +[unused989] +[unused990] +[unused991] +[unused992] +[unused993] +! +" +# +$ +% +& +' +( +) +* ++ +, +- +. +/ +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +: +; +< += +> +? +@ +[ +\ +] +^ +_ +` +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +p +q +r +s +t +u +v +w +x +y +z +{ +| +} +~ +¡ +¢ +£ +¤ +¥ +¦ +§ +¨ +© +ª +« +¬ +® +° +± +² +³ +´ +µ +¶ +· +¹ +º +» +¼ +½ +¾ +¿ +× +ß +æ +ð +÷ +ø +þ +đ +ħ +ı +ł +ŋ +œ +ƒ +ɐ +ɑ +ɒ +ɔ +ɕ +ə +ɛ +ɡ +ɣ +ɨ +ɪ +ɫ +ɬ +ɯ +ɲ +ɴ +ɹ +ɾ +ʀ +ʁ +ʂ +ʃ +ʉ +ʊ +ʋ +ʌ +ʎ +ʐ +ʑ +ʒ +ʔ +ʰ +ʲ +ʳ +ʷ +ʸ +ʻ +ʼ +ʾ +ʿ +ˈ +ː +ˡ +ˢ +ˣ +ˤ +α +β +γ +δ +ε +ζ +η +θ +ι +κ +λ +μ +ν +ξ +ο +π +ρ +ς +σ +τ +υ +φ +χ +ψ +ω +а +б +в +г +д +е +ж +з +и +к +л +м +н +о +п +р +с +т +у +ф +х +ц +ч +ш +щ +ъ +ы +ь +э +ю +я +ђ +є +і +ј +љ +њ +ћ +ӏ +ա +բ +գ +դ +ե +թ +ի +լ +կ +հ +մ +յ +ն +ո +պ +ս +վ +տ +ր +ւ +ք +־ +א +ב +ג +ד +ה +ו +ז +ח +ט +י +ך +כ +ל +ם +מ +ן +נ +ס +ע +ף +פ +ץ +צ +ק +ר +ש +ת +، +ء +ا +ب +ة +ت +ث +ج +ح +خ +د +ذ +ر +ز +س +ش +ص +ض +ط +ظ +ع +غ +ـ +ف +ق +ك +ل +م +ن +ه +و +ى +ي +ٹ +پ +چ +ک +گ +ں +ھ +ہ +ی +ے +अ +आ +उ +ए +क +ख +ग +च +ज +ट +ड +ण +त +थ +द +ध +न +प +ब +भ +म +य +र +ल +व +श +ष +स +ह +ा +ि +ी +ो +। +॥ +ং +অ +আ +ই +উ +এ +ও +ক +খ +গ +চ +ছ +জ +ট +ড +ণ +ত +থ +দ +ধ +ন +প +ব +ভ +ম +য +র +ল +শ +ষ +স +হ +া +ি +ী +ে +க +ச +ட +த +ந +ன +ப +ம +ய +ர +ல +ள +வ +ா +ி +ு +ே +ை +ನ +ರ +ಾ +ක +ය +ර +ල +ව +ා +ก +ง +ต +ท +น +พ +ม +ย +ร +ล +ว +ส +อ +า +เ +་ +། +ག +ང +ད +ན +པ +བ +མ +འ +ར +ལ +ས +မ +ა +ბ +გ +დ +ე +ვ +თ +ი +კ +ლ +მ +ნ +ო +რ +ს +ტ +უ +ᄀ +ᄂ +ᄃ +ᄅ +ᄆ +ᄇ +ᄉ +ᄊ +ᄋ +ᄌ +ᄎ +ᄏ +ᄐ +ᄑ +ᄒ +ᅡ +ᅢ +ᅥ +ᅦ +ᅧ +ᅩ +ᅪ +ᅭ +ᅮ +ᅯ +ᅲ +ᅳ +ᅴ +ᅵ +ᆨ +ᆫ +ᆯ +ᆷ +ᆸ +ᆼ +ᴬ +ᴮ +ᴰ +ᴵ +ᴺ +ᵀ +ᵃ +ᵇ +ᵈ +ᵉ +ᵍ +ᵏ +ᵐ +ᵒ +ᵖ +ᵗ +ᵘ +ᵢ +ᵣ +ᵤ +ᵥ +ᶜ +ᶠ +‐ +‑ +‒ +– +— +― +‖ +‘ +’ +‚ +“ +” +„ +† +‡ +• +… +‰ +′ +″ +› +‿ +⁄ +⁰ +ⁱ +⁴ +⁵ +⁶ +⁷ +⁸ +⁹ +⁺ +⁻ +ⁿ +₀ +₁ +₂ +₃ +₄ +₅ +₆ +₇ +₈ +₉ +₊ +₍ +₎ +ₐ +ₑ +ₒ +ₓ +ₕ +ₖ +ₗ +ₘ +ₙ +ₚ +ₛ +ₜ +₤ +₩ +€ +₱ +₹ +ℓ +№ +ℝ +™ +⅓ +⅔ +← +↑ +→ +↓ +↔ +↦ +⇄ +⇌ +⇒ +∂ +∅ +∆ +∇ +∈ +− +∗ +∘ +√ +∞ +∧ +∨ +∩ +∪ +≈ +≡ +≤ +≥ +⊂ +⊆ +⊕ +⊗ +⋅ +─ +│ +■ +▪ +● +★ +☆ +☉ +♠ +♣ +♥ +♦ +♭ +♯ +⟨ +⟩ +ⱼ +⺩ +⺼ +⽥ +、 +。 +〈 +〉 +《 +》 +「 +」 +『 +』 +〜 +あ +い +う +え +お +か +き +く +け +こ +さ +し +す +せ +そ +た +ち +っ +つ +て +と +な +に +ぬ +ね +の +は +ひ +ふ +へ +ほ +ま +み +む +め +も +や +ゆ +よ +ら +り +る +れ +ろ +を +ん +ァ +ア +ィ +イ +ウ +ェ +エ +オ +カ +キ +ク +ケ +コ +サ +シ +ス +セ +タ +チ +ッ +ツ +テ +ト +ナ +ニ +ノ +ハ +ヒ +フ +ヘ +ホ +マ +ミ +ム +メ +モ +ャ +ュ +ョ +ラ +リ +ル +レ +ロ +ワ +ン +・ +ー +一 +三 +上 +下 +不 +世 +中 +主 +久 +之 +也 +事 +二 +五 +井 +京 +人 +亻 +仁 +介 +代 +仮 +伊 +会 +佐 +侍 +保 +信 +健 +元 +光 +八 +公 +内 +出 +分 +前 +劉 +力 +加 +勝 +北 +区 +十 +千 +南 +博 +原 +口 +古 +史 +司 +合 +吉 +同 +名 +和 +囗 +四 +国 +國 +土 +地 +坂 +城 +堂 +場 +士 +夏 +外 +大 +天 +太 +夫 +奈 +女 +子 +学 +宀 +宇 +安 +宗 +定 +宣 +宮 +家 +宿 +寺 +將 +小 +尚 +山 +岡 +島 +崎 +川 +州 +巿 +帝 +平 +年 +幸 +广 +弘 +張 +彳 +後 +御 +德 +心 +忄 +志 +忠 +愛 +成 +我 +戦 +戸 +手 +扌 +政 +文 +新 +方 +日 +明 +星 +春 +昭 +智 +曲 +書 +月 +有 +朝 +木 +本 +李 +村 +東 +松 +林 +森 +楊 +樹 +橋 +歌 +止 +正 +武 +比 +氏 +民 +水 +氵 +氷 +永 +江 +沢 +河 +治 +法 +海 +清 +漢 +瀬 +火 +版 +犬 +王 +生 +田 +男 +疒 +発 +白 +的 +皇 +目 +相 +省 +真 +石 +示 +社 +神 +福 +禾 +秀 +秋 +空 +立 +章 +竹 +糹 +美 +義 +耳 +良 +艹 +花 +英 +華 +葉 +藤 +行 +街 +西 +見 +訁 +語 +谷 +貝 +貴 +車 +軍 +辶 +道 +郎 +郡 +部 +都 +里 +野 +金 +鈴 +镇 +長 +門 +間 +阝 +阿 +陳 +陽 +雄 +青 +面 +風 +食 +香 +馬 +高 +龍 +龸 +fi +fl +! +( +) +, +- +. +/ +: +? +~ +the +of +and +in +to +was +he +is +as +for +on +with +that +it +his +by +at +from +her +##s +she +you +had +an +were +but +be +this +are +not +my +they +one +which +or +have +him +me +first +all +also +their +has +up +who +out +been +when +after +there +into +new +two +its +##a +time +would +no +what +about +said +we +over +then +other +so +more +##e +can +if +like +back +them +only +some +could +##i +where +just +##ing +during +before +##n +do +##o +made +school +through +than +now +years +most +world +may +between +down +well +three +##d +year +while +will +##ed +##r +##y +later +##t +city +under +around +did +such +being +used +state +people +part +know +against +your +many +second +university +both +national +##er +these +don +known +off +way +until +re +how +even +get +head +... +didn +##ly +team +american +because +de +##l +born +united +film +since +still +long +work +south +us +became +any +high +again +day +family +see +right +man +eyes +house +season +war +states +including +took +life +north +same +each +called +name +much +place +however +go +four +group +another +found +won +area +here +going +10 +away +series +left +home +music +best +make +hand +number +company +several +never +last +john +000 +very +album +take +end +good +too +following +released +game +played +little +began +district +##m +old +want +those +side +held +own +early +county +ll +league +use +west +##u +face +think +##es +2010 +government +##h +march +came +small +general +town +june +##on +line +based +something +##k +september +thought +looked +along +international +2011 +air +july +club +went +january +october +our +august +april +york +12 +few +2012 +2008 +east +show +member +college +2009 +father +public +##us +come +men +five +set +station +church +##c +next +former +november +room +party +located +december +2013 +age +got +2007 +##g +system +let +love +2006 +though +every +2014 +look +song +water +century +without +body +black +night +within +great +women +single +ve +building +large +population +river +named +band +white +started +##an +once +15 +20 +should +18 +2015 +service +top +built +british +open +death +king +moved +local +times +children +february +book +why +11 +door +need +president +order +final +road +wasn +although +due +major +died +village +third +knew +2016 +asked +turned +st +wanted +say +##p +together +received +main +son +served +different +##en +behind +himself +felt +members +power +football +law +voice +play +##in +near +park +history +30 +having +2005 +16 +##man +saw +mother +##al +army +point +front +help +english +street +art +late +hands +games +award +##ia +young +14 +put +published +country +division +across +told +13 +often +ever +french +london +center +six +red +2017 +led +days +include +light +25 +find +tell +among +species +really +according +central +half +2004 +form +original +gave +office +making +enough +lost +full +opened +must +included +live +given +german +player +run +business +woman +community +cup +might +million +land +2000 +court +development +17 +short +round +ii +km +seen +class +story +always +become +sure +research +almost +director +council +la +##2 +career +things +using +island +##z +couldn +car +##is +24 +close +force +##1 +better +free +support +control +field +students +2003 +education +married +##b +nothing +worked +others +record +big +inside +level +anything +continued +give +james +##3 +military +established +non +returned +feel +does +title +written +thing +feet +william +far +co +association +hard +already +2002 +##ra +championship +human +western +100 +##na +department +hall +role +various +production +21 +19 +heart +2001 +living +fire +version +##ers +##f +television +royal +##4 +produced +working +act +case +society +region +present +radio +period +looking +least +total +keep +england +wife +program +per +brother +mind +special +22 +##le +am +works +soon +##6 +political +george +services +taken +created +##7 +further +able +reached +david +union +joined +upon +done +important +social +information +either +##ic +##x +appeared +position +ground +lead +rock +dark +election +23 +board +france +hair +course +arms +site +police +girl +instead +real +sound +##v +words +moment +##te +someone +##8 +summer +project +announced +san +less +wrote +past +followed +##5 +blue +founded +al +finally +india +taking +records +america +##ne +1999 +design +considered +northern +god +stop +battle +toward +european +outside +described +track +today +playing +language +28 +call +26 +heard +professional +low +australia +miles +california +win +yet +green +##ie +trying +blood +##ton +southern +science +maybe +everything +match +square +27 +mouth +video +race +recorded +leave +above +##9 +daughter +points +space +1998 +museum +change +middle +common +##0 +move +tv +post +##ta +lake +seven +tried +elected +closed +ten +paul +minister +##th +months +start +chief +return +canada +person +sea +release +similar +modern +brought +rest +hit +formed +mr +##la +1997 +floor +event +doing +thomas +1996 +robert +care +killed +training +star +week +needed +turn +finished +railway +rather +news +health +sent +example +ran +term +michael +coming +currently +yes +forces +despite +gold +areas +50 +stage +fact +29 +dead +says +popular +2018 +originally +germany +probably +developed +result +pulled +friend +stood +money +running +mi +signed +word +songs +child +eventually +met +tour +average +teams +minutes +festival +current +deep +kind +1995 +decided +usually +eastern +seemed +##ness +episode +bed +added +table +indian +private +charles +route +available +idea +throughout +centre +addition +appointed +style +1994 +books +eight +construction +press +mean +wall +friends +remained +schools +study +##ch +##um +institute +oh +chinese +sometimes +events +possible +1992 +australian +type +brown +forward +talk +process +food +debut +seat +performance +committee +features +character +arts +herself +else +lot +strong +russian +range +hours +peter +arm +##da +morning +dr +sold +##ry +quickly +directed +1993 +guitar +china +##w +31 +list +##ma +performed +media +uk +players +smile +##rs +myself +40 +placed +coach +province +towards +wouldn +leading +whole +boy +official +designed +grand +census +##el +europe +attack +japanese +henry +1991 +##re +##os +cross +getting +alone +action +lower +network +wide +washington +japan +1990 +hospital +believe +changed +sister +##ar +hold +gone +sir +hadn +ship +##ka +studies +academy +shot +rights +below +base +bad +involved +kept +largest +##ist +bank +future +especially +beginning +mark +movement +section +female +magazine +plan +professor +lord +longer +##ian +sat +walked +hill +actually +civil +energy +model +families +size +thus +aircraft +completed +includes +data +captain +##or +fight +vocals +featured +richard +bridge +fourth +1989 +officer +stone +hear +##ism +means +medical +groups +management +self +lips +competition +entire +lived +technology +leaving +federal +tournament +bit +passed +hot +independent +awards +kingdom +mary +spent +fine +doesn +reported +##ling +jack +fall +raised +itself +stay +true +studio +1988 +sports +replaced +paris +systems +saint +leader +theatre +whose +market +capital +parents +spanish +canadian +earth +##ity +cut +degree +writing +bay +christian +awarded +natural +higher +bill +##as +coast +provided +previous +senior +ft +valley +organization +stopped +onto +countries +parts +conference +queen +security +interest +saying +allowed +master +earlier +phone +matter +smith +winning +try +happened +moving +campaign +los +##ley +breath +nearly +mid +1987 +certain +girls +date +italian +african +standing +fell +artist +##ted +shows +deal +mine +industry +1986 +##ng +everyone +republic +provide +collection +library +student +##ville +primary +owned +older +via +heavy +1st +makes +##able +attention +anyone +africa +##ri +stated +length +ended +fingers +command +staff +skin +foreign +opening +governor +okay +medal +kill +sun +cover +job +1985 +introduced +chest +hell +feeling +##ies +success +meet +reason +standard +meeting +novel +1984 +trade +source +buildings +##land +rose +guy +goal +##ur +chapter +native +husband +previously +unit +limited +entered +weeks +producer +operations +mountain +takes +covered +forced +related +roman +complete +successful +key +texas +cold +##ya +channel +1980 +traditional +films +dance +clear +approximately +500 +nine +van +prince +question +active +tracks +ireland +regional +silver +author +personal +sense +operation +##ine +economic +1983 +holding +twenty +isbn +additional +speed +hour +edition +regular +historic +places +whom +shook +movie +km² +secretary +prior +report +chicago +read +foundation +view +engine +scored +1982 +units +ask +airport +property +ready +immediately +lady +month +listed +contract +##de +manager +themselves +lines +##ki +navy +writer +meant +##ts +runs +##ro +practice +championships +singer +glass +commission +required +forest +starting +culture +generally +giving +access +attended +test +couple +stand +catholic +martin +caught +executive +##less +eye +##ey +thinking +chair +quite +shoulder +1979 +hope +decision +plays +defeated +municipality +whether +structure +offered +slowly +pain +ice +direction +##ion +paper +mission +1981 +mostly +200 +noted +individual +managed +nature +lives +plant +##ha +helped +except +studied +computer +figure +relationship +issue +significant +loss +die +smiled +gun +ago +highest +1972 +##am +male +bring +goals +mexico +problem +distance +commercial +completely +location +annual +famous +drive +1976 +neck +1978 +surface +caused +italy +understand +greek +highway +wrong +hotel +comes +appearance +joseph +double +issues +musical +companies +castle +income +review +assembly +bass +initially +parliament +artists +experience +1974 +particular +walk +foot +engineering +talking +window +dropped +##ter +miss +baby +boys +break +1975 +stars +edge +remember +policy +carried +train +stadium +bar +sex +angeles +evidence +##ge +becoming +assistant +soviet +1977 +upper +step +wing +1970 +youth +financial +reach +##ll +actor +numerous +##se +##st +nodded +arrived +##ation +minute +##nt +believed +sorry +complex +beautiful +victory +associated +temple +1968 +1973 +chance +perhaps +metal +##son +1945 +bishop +##et +lee +launched +particularly +tree +le +retired +subject +prize +contains +yeah +theory +empire +##ce +suddenly +waiting +trust +recording +##to +happy +terms +camp +champion +1971 +religious +pass +zealand +names +2nd +port +ancient +tom +corner +represented +watch +legal +anti +justice +cause +watched +brothers +45 +material +changes +simply +response +louis +fast +##ting +answer +60 +historical +1969 +stories +straight +create +feature +increased +rate +administration +virginia +el +activities +cultural +overall +winner +programs +basketball +legs +guard +beyond +cast +doctor +mm +flight +results +remains +cost +effect +winter +##ble +larger +islands +problems +chairman +grew +commander +isn +1967 +pay +failed +selected +hurt +fort +box +regiment +majority +journal +35 +edward +plans +##ke +##ni +shown +pretty +irish +characters +directly +scene +likely +operated +allow +spring +##j +junior +matches +looks +mike +houses +fellow +##tion +beach +marriage +##ham +##ive +rules +oil +65 +florida +expected +nearby +congress +sam +peace +recent +iii +wait +subsequently +cell +##do +variety +serving +agreed +please +poor +joe +pacific +attempt +wood +democratic +piece +prime +##ca +rural +mile +touch +appears +township +1964 +1966 +soldiers +##men +##ized +1965 +pennsylvania +closer +fighting +claimed +score +jones +physical +editor +##ous +filled +genus +specific +sitting +super +mom +##va +therefore +supported +status +fear +cases +store +meaning +wales +minor +spain +tower +focus +vice +frank +follow +parish +separate +golden +horse +fifth +remaining +branch +32 +presented +stared +##id +uses +secret +forms +##co +baseball +exactly +##ck +choice +note +discovered +travel +composed +truth +russia +ball +color +kiss +dad +wind +continue +ring +referred +numbers +digital +greater +##ns +metres +slightly +direct +increase +1960 +responsible +crew +rule +trees +troops +##no +broke +goes +individuals +hundred +weight +creek +sleep +memory +defense +provides +ordered +code +value +jewish +windows +1944 +safe +judge +whatever +corps +realized +growing +pre +##ga +cities +alexander +gaze +lies +spread +scott +letter +showed +situation +mayor +transport +watching +workers +extended +##li +expression +normal +##ment +chart +multiple +border +##ba +host +##ner +daily +mrs +walls +piano +##ko +heat +cannot +##ate +earned +products +drama +era +authority +seasons +join +grade +##io +sign +difficult +machine +1963 +territory +mainly +##wood +stations +squadron +1962 +stepped +iron +19th +##led +serve +appear +sky +speak +broken +charge +knowledge +kilometres +removed +ships +article +campus +simple +##ty +pushed +britain +##ve +leaves +recently +cd +soft +boston +latter +easy +acquired +poland +##sa +quality +officers +presence +planned +nations +mass +broadcast +jean +share +image +influence +wild +offer +emperor +electric +reading +headed +ability +promoted +yellow +ministry +1942 +throat +smaller +politician +##by +latin +spoke +cars +williams +males +lack +pop +80 +##ier +acting +seeing +consists +##ti +estate +1961 +pressure +johnson +newspaper +jr +chris +olympics +online +conditions +beat +elements +walking +vote +##field +needs +carolina +text +featuring +global +block +shirt +levels +francisco +purpose +females +et +dutch +duke +ahead +gas +twice +safety +serious +turning +highly +lieutenant +firm +maria +amount +mixed +daniel +proposed +perfect +agreement +affairs +3rd +seconds +contemporary +paid +1943 +prison +save +kitchen +label +administrative +intended +constructed +academic +nice +teacher +races +1956 +formerly +corporation +ben +nation +issued +shut +1958 +drums +housing +victoria +seems +opera +1959 +graduated +function +von +mentioned +picked +build +recognized +shortly +protection +picture +notable +exchange +elections +1980s +loved +percent +racing +fish +elizabeth +garden +volume +hockey +1941 +beside +settled +##ford +1940 +competed +replied +drew +1948 +actress +marine +scotland +steel +glanced +farm +steve +1957 +risk +tonight +positive +magic +singles +effects +gray +screen +dog +##ja +residents +bus +sides +none +secondary +literature +polish +destroyed +flying +founder +households +1939 +lay +reserve +usa +gallery +##ler +1946 +industrial +younger +approach +appearances +urban +ones +1950 +finish +avenue +powerful +fully +growth +page +honor +jersey +projects +advanced +revealed +basic +90 +infantry +pair +equipment +visit +33 +evening +search +grant +effort +solo +treatment +buried +republican +primarily +bottom +owner +1970s +israel +gives +jim +dream +bob +remain +spot +70 +notes +produce +champions +contact +ed +soul +accepted +ways +del +##ally +losing +split +price +capacity +basis +trial +questions +##ina +1955 +20th +guess +officially +memorial +naval +initial +##ization +whispered +median +engineer +##ful +sydney +##go +columbia +strength +300 +1952 +tears +senate +00 +card +asian +agent +1947 +software +44 +draw +warm +supposed +com +pro +##il +transferred +leaned +##at +candidate +escape +mountains +asia +potential +activity +entertainment +seem +traffic +jackson +murder +36 +slow +product +orchestra +haven +agency +bbc +taught +website +comedy +unable +storm +planning +albums +rugby +environment +scientific +grabbed +protect +##hi +boat +typically +1954 +1953 +damage +principal +divided +dedicated +mount +ohio +##berg +pick +fought +driver +##der +empty +shoulders +sort +thank +berlin +prominent +account +freedom +necessary +efforts +alex +headquarters +follows +alongside +des +simon +andrew +suggested +operating +learning +steps +1949 +sweet +technical +begin +easily +34 +teeth +speaking +settlement +scale +##sh +renamed +ray +max +enemy +semi +joint +compared +##rd +scottish +leadership +analysis +offers +georgia +pieces +captured +animal +deputy +guest +organized +##lin +tony +combined +method +challenge +1960s +huge +wants +battalion +sons +rise +crime +types +facilities +telling +path +1951 +platform +sit +1990s +##lo +tells +assigned +rich +pull +##ot +commonly +alive +##za +letters +concept +conducted +wearing +happen +bought +becomes +holy +gets +ocean +defeat +languages +purchased +coffee +occurred +titled +##q +declared +applied +sciences +concert +sounds +jazz +brain +##me +painting +fleet +tax +nick +##ius +michigan +count +animals +leaders +episodes +##line +content +##den +birth +##it +clubs +64 +palace +critical +refused +fair +leg +laughed +returning +surrounding +participated +formation +lifted +pointed +connected +rome +medicine +laid +taylor +santa +powers +adam +tall +shared +focused +knowing +yards +entrance +falls +##wa +calling +##ad +sources +chosen +beneath +resources +yard +##ite +nominated +silence +zone +defined +##que +gained +thirty +38 +bodies +moon +##ard +adopted +christmas +widely +register +apart +iran +premier +serves +du +unknown +parties +##les +generation +##ff +continues +quick +fields +brigade +quiet +teaching +clothes +impact +weapons +partner +flat +theater +supreme +1938 +37 +relations +##tor +plants +suffered +1936 +wilson +kids +begins +##age +1918 +seats +armed +internet +models +worth +laws +400 +communities +classes +background +knows +thanks +quarter +reaching +humans +carry +killing +format +kong +hong +setting +75 +architecture +disease +railroad +inc +possibly +wish +arthur +thoughts +harry +doors +density +##di +crowd +illinois +stomach +tone +unique +reports +anyway +##ir +liberal +der +vehicle +thick +dry +drug +faced +largely +facility +theme +holds +creation +strange +colonel +##mi +revolution +bell +politics +turns +silent +rail +relief +independence +combat +shape +write +determined +sales +learned +4th +finger +oxford +providing +1937 +heritage +fiction +situated +designated +allowing +distribution +hosted +##est +sight +interview +estimated +reduced +##ria +toronto +footballer +keeping +guys +damn +claim +motion +sport +sixth +stayed +##ze +en +rear +receive +handed +twelve +dress +audience +granted +brazil +##well +spirit +##ated +noticed +etc +olympic +representative +eric +tight +trouble +reviews +drink +vampire +missing +roles +ranked +newly +household +finals +wave +critics +##ee +phase +massachusetts +pilot +unlike +philadelphia +bright +guns +crown +organizations +roof +42 +respectively +clearly +tongue +marked +circle +fox +korea +bronze +brian +expanded +sexual +supply +yourself +inspired +labour +fc +##ah +reference +vision +draft +connection +brand +reasons +1935 +classic +driving +trip +jesus +cells +entry +1920 +neither +trail +claims +atlantic +orders +labor +nose +afraid +identified +intelligence +calls +cancer +attacked +passing +stephen +positions +imperial +grey +jason +39 +sunday +48 +swedish +avoid +extra +uncle +message +covers +allows +surprise +materials +fame +hunter +##ji +1930 +citizens +figures +davis +environmental +confirmed +shit +titles +di +performing +difference +acts +attacks +##ov +existing +votes +opportunity +nor +shop +entirely +trains +opposite +pakistan +##pa +develop +resulted +representatives +actions +reality +pressed +##ish +barely +wine +conversation +faculty +northwest +ends +documentary +nuclear +stock +grace +sets +eat +alternative +##ps +bag +resulting +creating +surprised +cemetery +1919 +drop +finding +sarah +cricket +streets +tradition +ride +1933 +exhibition +target +ear +explained +rain +composer +injury +apartment +municipal +educational +occupied +netherlands +clean +billion +constitution +learn +1914 +maximum +classical +francis +lose +opposition +jose +ontario +bear +core +hills +rolled +ending +drawn +permanent +fun +##tes +##lla +lewis +sites +chamber +ryan +##way +scoring +height +1934 +##house +lyrics +staring +55 +officials +1917 +snow +oldest +##tic +orange +##ger +qualified +interior +apparently +succeeded +thousand +dinner +lights +existence +fans +heavily +41 +greatest +conservative +send +bowl +plus +enter +catch +##un +economy +duty +1929 +speech +authorities +princess +performances +versions +shall +graduate +pictures +effective +remembered +poetry +desk +crossed +starring +starts +passenger +sharp +##ant +acres +ass +weather +falling +rank +fund +supporting +check +adult +publishing +heads +cm +southeast +lane +##burg +application +bc +##ura +les +condition +transfer +prevent +display +ex +regions +earl +federation +cool +relatively +answered +besides +1928 +obtained +portion +##town +mix +##ding +reaction +liked +dean +express +peak +1932 +##tte +counter +religion +chain +rare +miller +convention +aid +lie +vehicles +mobile +perform +squad +wonder +lying +crazy +sword +##ping +attempted +centuries +weren +philosophy +category +##ize +anna +interested +47 +sweden +wolf +frequently +abandoned +kg +literary +alliance +task +entitled +##ay +threw +promotion +factory +tiny +soccer +visited +matt +fm +achieved +52 +defence +internal +persian +43 +methods +##ging +arrested +otherwise +cambridge +programming +villages +elementary +districts +rooms +criminal +conflict +worry +trained +1931 +attempts +waited +signal +bird +truck +subsequent +programme +##ol +ad +49 +communist +details +faith +sector +patrick +carrying +laugh +##ss +controlled +korean +showing +origin +fuel +evil +1927 +##ent +brief +identity +darkness +address +pool +missed +publication +web +planet +ian +anne +wings +invited +##tt +briefly +standards +kissed +##be +ideas +climate +causing +walter +worse +albert +articles +winners +desire +aged +northeast +dangerous +gate +doubt +1922 +wooden +multi +##ky +poet +rising +funding +46 +communications +communication +violence +copies +prepared +ford +investigation +skills +1924 +pulling +electronic +##ak +##ial +##han +containing +ultimately +offices +singing +understanding +restaurant +tomorrow +fashion +christ +ward +da +pope +stands +5th +flow +studios +aired +commissioned +contained +exist +fresh +americans +##per +wrestling +approved +kid +employed +respect +suit +1925 +angel +asking +increasing +frame +angry +selling +1950s +thin +finds +##nd +temperature +statement +ali +explain +inhabitants +towns +extensive +narrow +51 +jane +flowers +images +promise +somewhere +object +fly +closely +##ls +1912 +bureau +cape +1926 +weekly +presidential +legislative +1921 +##ai +##au +launch +founding +##ny +978 +##ring +artillery +strike +un +institutions +roll +writers +landing +chose +kevin +anymore +pp +##ut +attorney +fit +dan +billboard +receiving +agricultural +breaking +sought +dave +admitted +lands +mexican +##bury +charlie +specifically +hole +iv +howard +credit +moscow +roads +accident +1923 +proved +wear +struck +hey +guards +stuff +slid +expansion +1915 +cat +anthony +##kin +melbourne +opposed +sub +southwest +architect +failure +plane +1916 +##ron +map +camera +tank +listen +regarding +wet +introduction +metropolitan +link +ep +fighter +inch +grown +gene +anger +fixed +buy +dvd +khan +domestic +worldwide +chapel +mill +functions +examples +##head +developing +1910 +turkey +hits +pocket +antonio +papers +grow +unless +circuit +18th +concerned +attached +journalist +selection +journey +converted +provincial +painted +hearing +aren +bands +negative +aside +wondered +knight +lap +survey +ma +##ow +noise +billy +##ium +shooting +guide +bedroom +priest +resistance +motor +homes +sounded +giant +##mer +150 +scenes +equal +comic +patients +hidden +solid +actual +bringing +afternoon +touched +funds +wedding +consisted +marie +canal +sr +kim +treaty +turkish +recognition +residence +cathedral +broad +knees +incident +shaped +fired +norwegian +handle +cheek +contest +represent +##pe +representing +beauty +##sen +birds +advantage +emergency +wrapped +drawing +notice +pink +broadcasting +##ong +somehow +bachelor +seventh +collected +registered +establishment +alan +assumed +chemical +personnel +roger +retirement +jeff +portuguese +wore +tied +device +threat +progress +advance +##ised +banks +hired +manchester +nfl +teachers +structures +forever +##bo +tennis +helping +saturday +sale +applications +junction +hip +incorporated +neighborhood +dressed +ceremony +##ds +influenced +hers +visual +stairs +decades +inner +kansas +hung +hoped +gain +scheduled +downtown +engaged +austria +clock +norway +certainly +pale +protected +1913 +victor +employees +plate +putting +surrounded +##ists +finishing +blues +tropical +##ries +minnesota +consider +philippines +accept +54 +retrieved +1900 +concern +anderson +properties +institution +gordon +successfully +vietnam +##dy +backing +outstanding +muslim +crossing +folk +producing +usual +demand +occurs +observed +lawyer +educated +##ana +kelly +string +pleasure +budget +items +quietly +colorado +philip +typical +##worth +derived +600 +survived +asks +mental +##ide +56 +jake +jews +distinguished +ltd +1911 +sri +extremely +53 +athletic +loud +thousands +worried +shadow +transportation +horses +weapon +arena +importance +users +tim +objects +contributed +dragon +douglas +aware +senator +johnny +jordan +sisters +engines +flag +investment +samuel +shock +capable +clark +row +wheel +refers +session +familiar +biggest +wins +hate +maintained +drove +hamilton +request +expressed +injured +underground +churches +walker +wars +tunnel +passes +stupid +agriculture +softly +cabinet +regarded +joining +indiana +##ea +##ms +push +dates +spend +behavior +woods +protein +gently +chase +morgan +mention +burning +wake +combination +occur +mirror +leads +jimmy +indeed +impossible +singapore +paintings +covering +##nes +soldier +locations +attendance +sell +historian +wisconsin +invasion +argued +painter +diego +changing +egypt +##don +experienced +inches +##ku +missouri +vol +grounds +spoken +switzerland +##gan +reform +rolling +ha +forget +massive +resigned +burned +allen +tennessee +locked +values +improved +##mo +wounded +universe +sick +dating +facing +pack +purchase +user +##pur +moments +##ul +merged +anniversary +1908 +coal +brick +understood +causes +dynasty +queensland +establish +stores +crisis +promote +hoping +views +cards +referee +extension +##si +raise +arizona +improve +colonial +formal +charged +##rt +palm +lucky +hide +rescue +faces +95 +feelings +candidates +juan +##ell +goods +6th +courses +weekend +59 +luke +cash +fallen +##om +delivered +affected +installed +carefully +tries +swiss +hollywood +costs +lincoln +responsibility +##he +shore +file +proper +normally +maryland +assistance +jump +constant +offering +friendly +waters +persons +realize +contain +trophy +800 +partnership +factor +58 +musicians +cry +bound +oregon +indicated +hero +houston +medium +##ure +consisting +somewhat +##ara +57 +cycle +##che +beer +moore +frederick +gotten +eleven +worst +weak +approached +arranged +chin +loan +universal +bond +fifteen +pattern +disappeared +##ney +translated +##zed +lip +arab +capture +interests +insurance +##chi +shifted +cave +prix +warning +sections +courts +coat +plot +smell +feed +golf +favorite +maintain +knife +vs +voted +degrees +finance +quebec +opinion +translation +manner +ruled +operate +productions +choose +musician +discovery +confused +tired +separated +stream +techniques +committed +attend +ranking +kings +throw +passengers +measure +horror +fan +mining +sand +danger +salt +calm +decade +dam +require +runner +##ik +rush +associate +greece +##ker +rivers +consecutive +matthew +##ski +sighed +sq +documents +steam +edited +closing +tie +accused +1905 +##ini +islamic +distributed +directors +organisation +bruce +7th +breathing +mad +lit +arrival +concrete +taste +08 +composition +shaking +faster +amateur +adjacent +stating +1906 +twin +flew +##ran +tokyo +publications +##tone +obviously +ridge +storage +1907 +carl +pages +concluded +desert +driven +universities +ages +terminal +sequence +borough +250 +constituency +creative +cousin +economics +dreams +margaret +notably +reduce +montreal +mode +17th +ears +saved +jan +vocal +##ica +1909 +andy +##jo +riding +roughly +threatened +##ise +meters +meanwhile +landed +compete +repeated +grass +czech +regularly +charges +tea +sudden +appeal +##ung +solution +describes +pierre +classification +glad +parking +##ning +belt +physics +99 +rachel +add +hungarian +participate +expedition +damaged +gift +childhood +85 +fifty +##red +mathematics +jumped +letting +defensive +mph +##ux +##gh +testing +##hip +hundreds +shoot +owners +matters +smoke +israeli +kentucky +dancing +mounted +grandfather +emma +designs +profit +argentina +##gs +truly +li +lawrence +cole +begun +detroit +willing +branches +smiling +decide +miami +enjoyed +recordings +##dale +poverty +ethnic +gay +##bi +gary +arabic +09 +accompanied +##one +##ons +fishing +determine +residential +acid +##ary +alice +returns +starred +mail +##ang +jonathan +strategy +##ue +net +forty +cook +businesses +equivalent +commonwealth +distinct +ill +##cy +seriously +##ors +##ped +shift +harris +replace +rio +imagine +formula +ensure +##ber +additionally +scheme +conservation +occasionally +purposes +feels +favor +##and +##ore +1930s +contrast +hanging +hunt +movies +1904 +instruments +victims +danish +christopher +busy +demon +sugar +earliest +colony +studying +balance +duties +##ks +belgium +slipped +carter +05 +visible +stages +iraq +fifa +##im +commune +forming +zero +07 +continuing +talked +counties +legend +bathroom +option +tail +clay +daughters +afterwards +severe +jaw +visitors +##ded +devices +aviation +russell +kate +##vi +entering +subjects +##ino +temporary +swimming +forth +smooth +ghost +audio +bush +operates +rocks +movements +signs +eddie +##tz +ann +voices +honorary +06 +memories +dallas +pure +measures +racial +promised +66 +harvard +ceo +16th +parliamentary +indicate +benefit +flesh +dublin +louisiana +1902 +1901 +patient +sleeping +1903 +membership +coastal +medieval +wanting +element +scholars +rice +62 +limit +survive +makeup +rating +definitely +collaboration +obvious +##tan +boss +ms +baron +birthday +linked +soil +diocese +##lan +ncaa +##mann +offensive +shell +shouldn +waist +##tus +plain +ross +organ +resolution +manufacturing +adding +relative +kennedy +98 +whilst +moth +marketing +gardens +crash +72 +heading +partners +credited +carlos +moves +cable +##zi +marshall +##out +depending +bottle +represents +rejected +responded +existed +04 +jobs +denmark +lock +##ating +treated +graham +routes +talent +commissioner +drugs +secure +tests +reign +restored +photography +##gi +contributions +oklahoma +designer +disc +grin +seattle +robin +paused +atlanta +unusual +##gate +praised +las +laughing +satellite +hungary +visiting +##sky +interesting +factors +deck +poems +norman +##water +stuck +speaker +rifle +domain +premiered +##her +dc +comics +actors +01 +reputation +eliminated +8th +ceiling +prisoners +script +##nce +leather +austin +mississippi +rapidly +admiral +parallel +charlotte +guilty +tools +gender +divisions +fruit +##bs +laboratory +nelson +fantasy +marry +rapid +aunt +tribe +requirements +aspects +suicide +amongst +adams +bone +ukraine +abc +kick +sees +edinburgh +clothing +column +rough +gods +hunting +broadway +gathered +concerns +##ek +spending +ty +12th +snapped +requires +solar +bones +cavalry +##tta +iowa +drinking +waste +index +franklin +charity +thompson +stewart +tip +flash +landscape +friday +enjoy +singh +poem +listening +##back +eighth +fred +differences +adapted +bomb +ukrainian +surgery +corporate +masters +anywhere +##more +waves +odd +sean +portugal +orleans +dick +debate +kent +eating +puerto +cleared +96 +expect +cinema +97 +guitarist +blocks +electrical +agree +involving +depth +dying +panel +struggle +##ged +peninsula +adults +novels +emerged +vienna +metro +debuted +shoes +tamil +songwriter +meets +prove +beating +instance +heaven +scared +sending +marks +artistic +passage +superior +03 +significantly +shopping +##tive +retained +##izing +malaysia +technique +cheeks +##ola +warren +maintenance +destroy +extreme +allied +120 +appearing +##yn +fill +advice +alabama +qualifying +policies +cleveland +hat +battery +smart +authors +10th +soundtrack +acted +dated +lb +glance +equipped +coalition +funny +outer +ambassador +roy +possibility +couples +campbell +dna +loose +ethan +supplies +1898 +gonna +88 +monster +##res +shake +agents +frequency +springs +dogs +practices +61 +gang +plastic +easier +suggests +gulf +blade +exposed +colors +industries +markets +pan +nervous +electoral +charts +legislation +ownership +##idae +mac +appointment +shield +copy +assault +socialist +abbey +monument +license +throne +employment +jay +93 +replacement +charter +cloud +powered +suffering +accounts +oak +connecticut +strongly +wright +colour +crystal +13th +context +welsh +networks +voiced +gabriel +jerry +##cing +forehead +mp +##ens +manage +schedule +totally +remix +##ii +forests +occupation +print +nicholas +brazilian +strategic +vampires +engineers +76 +roots +seek +correct +instrumental +und +alfred +backed +hop +##des +stanley +robinson +traveled +wayne +welcome +austrian +achieve +67 +exit +rates +1899 +strip +whereas +##cs +sing +deeply +adventure +bobby +rick +jamie +careful +components +cap +useful +personality +knee +##shi +pushing +hosts +02 +protest +ca +ottoman +symphony +##sis +63 +boundary +1890 +processes +considering +considerable +tons +##work +##ft +##nia +cooper +trading +dear +conduct +91 +illegal +apple +revolutionary +holiday +definition +harder +##van +jacob +circumstances +destruction +##lle +popularity +grip +classified +liverpool +donald +baltimore +flows +seeking +honour +approval +92 +mechanical +till +happening +statue +critic +increasingly +immediate +describe +commerce +stare +##ster +indonesia +meat +rounds +boats +baker +orthodox +depression +formally +worn +naked +claire +muttered +sentence +11th +emily +document +77 +criticism +wished +vessel +spiritual +bent +virgin +parker +minimum +murray +lunch +danny +printed +compilation +keyboards +false +blow +belonged +68 +raising +78 +cutting +##board +pittsburgh +##up +9th +shadows +81 +hated +indigenous +jon +15th +barry +scholar +ah +##zer +oliver +##gy +stick +susan +meetings +attracted +spell +romantic +##ver +ye +1895 +photo +demanded +customers +##ac +1896 +logan +revival +keys +modified +commanded +jeans +##ious +upset +raw +phil +detective +hiding +resident +vincent +##bly +experiences +diamond +defeating +coverage +lucas +external +parks +franchise +helen +bible +successor +percussion +celebrated +il +lift +profile +clan +romania +##ied +mills +##su +nobody +achievement +shrugged +fault +1897 +rhythm +initiative +breakfast +carbon +700 +69 +lasted +violent +74 +wound +ken +killer +gradually +filmed +°c +dollars +processing +94 +remove +criticized +guests +sang +chemistry +##vin +legislature +disney +##bridge +uniform +escaped +integrated +proposal +purple +denied +liquid +karl +influential +morris +nights +stones +intense +experimental +twisted +71 +84 +##ld +pace +nazi +mitchell +ny +blind +reporter +newspapers +14th +centers +burn +basin +forgotten +surviving +filed +collections +monastery +losses +manual +couch +description +appropriate +merely +tag +missions +sebastian +restoration +replacing +triple +73 +elder +julia +warriors +benjamin +julian +convinced +stronger +amazing +declined +versus +merchant +happens +output +finland +bare +barbara +absence +ignored +dawn +injuries +##port +producers +##ram +82 +luis +##ities +kw +admit +expensive +electricity +nba +exception +symbol +##ving +ladies +shower +sheriff +characteristics +##je +aimed +button +ratio +effectively +summit +angle +jury +bears +foster +vessels +pants +executed +evans +dozen +advertising +kicked +patrol +1889 +competitions +lifetime +principles +athletics +##logy +birmingham +sponsored +89 +rob +nomination +1893 +acoustic +##sm +creature +longest +##tra +credits +harbor +dust +josh +##so +territories +milk +infrastructure +completion +thailand +indians +leon +archbishop +##sy +assist +pitch +blake +arrangement +girlfriend +serbian +operational +hence +sad +scent +fur +dj +sessions +hp +refer +rarely +##ora +exists +1892 +##ten +scientists +dirty +penalty +burst +portrait +seed +79 +pole +limits +rival +1894 +stable +alpha +grave +constitutional +alcohol +arrest +flower +mystery +devil +architectural +relationships +greatly +habitat +##istic +larry +progressive +remote +cotton +##ics +##ok +preserved +reaches +##ming +cited +86 +vast +scholarship +decisions +cbs +joy +teach +1885 +editions +knocked +eve +searching +partly +participation +gap +animated +fate +excellent +##ett +na +87 +alternate +saints +youngest +##ily +climbed +##ita +##tors +suggest +##ct +discussion +staying +choir +lakes +jacket +revenue +nevertheless +peaked +instrument +wondering +annually +managing +neil +1891 +signing +terry +##ice +apply +clinical +brooklyn +aim +catherine +fuck +farmers +figured +ninth +pride +hugh +evolution +ordinary +involvement +comfortable +shouted +tech +encouraged +taiwan +representation +sharing +##lia +##em +panic +exact +cargo +competing +fat +cried +83 +1920s +occasions +pa +cabin +borders +utah +marcus +##isation +badly +muscles +##ance +victorian +transition +warner +bet +permission +##rin +slave +terrible +similarly +shares +seth +uefa +possession +medals +benefits +colleges +lowered +perfectly +mall +transit +##ye +##kar +publisher +##ened +harrison +deaths +elevation +##ae +asleep +machines +sigh +ash +hardly +argument +occasion +parent +leo +decline +1888 +contribution +##ua +concentration +1000 +opportunities +hispanic +guardian +extent +emotions +hips +mason +volumes +bloody +controversy +diameter +steady +mistake +phoenix +identify +violin +##sk +departure +richmond +spin +funeral +enemies +1864 +gear +literally +connor +random +sergeant +grab +confusion +1865 +transmission +informed +op +leaning +sacred +suspended +thinks +gates +portland +luck +agencies +yours +hull +expert +muscle +layer +practical +sculpture +jerusalem +latest +lloyd +statistics +deeper +recommended +warrior +arkansas +mess +supports +greg +eagle +1880 +recovered +rated +concerts +rushed +##ano +stops +eggs +files +premiere +keith +##vo +delhi +turner +pit +affair +belief +paint +##zing +mate +##ach +##ev +victim +##ology +withdrew +bonus +styles +fled +##ud +glasgow +technologies +funded +nbc +adaptation +##ata +portrayed +cooperation +supporters +judges +bernard +justin +hallway +ralph +##ick +graduating +controversial +distant +continental +spider +bite +##ho +recognize +intention +mixing +##ese +egyptian +bow +tourism +suppose +claiming +tiger +dominated +participants +vi +##ru +nurse +partially +tape +##rum +psychology +##rn +essential +touring +duo +voting +civilian +emotional +channels +##king +apparent +hebrew +1887 +tommy +carrier +intersection +beast +hudson +##gar +##zo +lab +nova +bench +discuss +costa +##ered +detailed +behalf +drivers +unfortunately +obtain +##lis +rocky +##dae +siege +friendship +honey +##rian +1861 +amy +hang +posted +governments +collins +respond +wildlife +preferred +operator +##po +laura +pregnant +videos +dennis +suspected +boots +instantly +weird +automatic +businessman +alleged +placing +throwing +ph +mood +1862 +perry +venue +jet +remainder +##lli +##ci +passion +biological +boyfriend +1863 +dirt +buffalo +ron +segment +fa +abuse +##era +genre +thrown +stroke +colored +stress +exercise +displayed +##gen +struggled +##tti +abroad +dramatic +wonderful +thereafter +madrid +component +widespread +##sed +tale +citizen +todd +monday +1886 +vancouver +overseas +forcing +crying +descent +##ris +discussed +substantial +ranks +regime +1870 +provinces +switch +drum +zane +ted +tribes +proof +lp +cream +researchers +volunteer +manor +silk +milan +donated +allies +venture +principle +delivery +enterprise +##ves +##ans +bars +traditionally +witch +reminded +copper +##uk +pete +inter +links +colin +grinned +elsewhere +competitive +frequent +##oy +scream +##hu +tension +texts +submarine +finnish +defending +defend +pat +detail +1884 +affiliated +stuart +themes +villa +periods +tool +belgian +ruling +crimes +answers +folded +licensed +resort +demolished +hans +lucy +1881 +lion +traded +photographs +writes +craig +##fa +trials +generated +beth +noble +debt +percentage +yorkshire +erected +ss +viewed +grades +confidence +ceased +islam +telephone +retail +##ible +chile +m² +roberts +sixteen +##ich +commented +hampshire +innocent +dual +pounds +checked +regulations +afghanistan +sung +rico +liberty +assets +bigger +options +angels +relegated +tribute +wells +attending +leaf +##yan +butler +romanian +forum +monthly +lisa +patterns +gmina +##tory +madison +hurricane +rev +##ians +bristol +##ula +elite +valuable +disaster +democracy +awareness +germans +freyja +##ins +loop +absolutely +paying +populations +maine +sole +prayer +spencer +releases +doorway +bull +##ani +lover +midnight +conclusion +##sson +thirteen +lily +mediterranean +##lt +nhl +proud +sample +##hill +drummer +guinea +##ova +murphy +climb +##ston +instant +attributed +horn +ain +railways +steven +##ao +autumn +ferry +opponent +root +traveling +secured +corridor +stretched +tales +sheet +trinity +cattle +helps +indicates +manhattan +murdered +fitted +1882 +gentle +grandmother +mines +shocked +vegas +produces +##light +caribbean +##ou +belong +continuous +desperate +drunk +historically +trio +waved +raf +dealing +nathan +bat +murmured +interrupted +residing +scientist +pioneer +harold +aaron +##net +delta +attempting +minority +mini +believes +chorus +tend +lots +eyed +indoor +load +shots +updated +jail +##llo +concerning +connecting +wealth +##ved +slaves +arrive +rangers +sufficient +rebuilt +##wick +cardinal +flood +muhammad +whenever +relation +runners +moral +repair +viewers +arriving +revenge +punk +assisted +bath +fairly +breathe +lists +innings +illustrated +whisper +nearest +voters +clinton +ties +ultimate +screamed +beijing +lions +andre +fictional +gathering +comfort +radar +suitable +dismissed +hms +ban +pine +wrist +atmosphere +voivodeship +bid +timber +##ned +##nan +giants +##ane +cameron +recovery +uss +identical +categories +switched +serbia +laughter +noah +ensemble +therapy +peoples +touching +##off +locally +pearl +platforms +everywhere +ballet +tables +lanka +herbert +outdoor +toured +derek +1883 +spaces +contested +swept +1878 +exclusive +slight +connections +##dra +winds +prisoner +collective +bangladesh +tube +publicly +wealthy +thai +##ys +isolated +select +##ric +insisted +pen +fortune +ticket +spotted +reportedly +animation +enforcement +tanks +110 +decides +wider +lowest +owen +##time +nod +hitting +##hn +gregory +furthermore +magazines +fighters +solutions +##ery +pointing +requested +peru +reed +chancellor +knights +mask +worker +eldest +flames +reduction +1860 +volunteers +##tis +reporting +##hl +wire +advisory +endemic +origins +settlers +pursue +knock +consumer +1876 +eu +compound +creatures +mansion +sentenced +ivan +deployed +guitars +frowned +involves +mechanism +kilometers +perspective +shops +maps +terminus +duncan +alien +fist +bridges +##pers +heroes +fed +derby +swallowed +##ros +patent +sara +illness +characterized +adventures +slide +hawaii +jurisdiction +##op +organised +##side +adelaide +walks +biology +se +##ties +rogers +swing +tightly +boundaries +##rie +prepare +implementation +stolen +##sha +certified +colombia +edwards +garage +##mm +recalled +##ball +rage +harm +nigeria +breast +##ren +furniture +pupils +settle +##lus +cuba +balls +client +alaska +21st +linear +thrust +celebration +latino +genetic +terror +##cia +##ening +lightning +fee +witness +lodge +establishing +skull +##ique +earning +hood +##ei +rebellion +wang +sporting +warned +missile +devoted +activist +porch +worship +fourteen +package +1871 +decorated +##shire +housed +##ock +chess +sailed +doctors +oscar +joan +treat +garcia +harbour +jeremy +##ire +traditions +dominant +jacques +##gon +##wan +relocated +1879 +amendment +sized +companion +simultaneously +volleyball +spun +acre +increases +stopping +loves +belongs +affect +drafted +tossed +scout +battles +1875 +filming +shoved +munich +tenure +vertical +romance +pc +##cher +argue +##ical +craft +ranging +www +opens +honest +tyler +yesterday +virtual +##let +muslims +reveal +snake +immigrants +radical +screaming +speakers +firing +saving +belonging +ease +lighting +prefecture +blame +farmer +hungry +grows +rubbed +beam +sur +subsidiary +##cha +armenian +sao +dropping +conventional +##fer +microsoft +reply +qualify +spots +1867 +sweat +festivals +##ken +immigration +physician +discover +exposure +sandy +explanation +isaac +implemented +##fish +hart +initiated +connect +stakes +presents +heights +householder +pleased +tourist +regardless +slip +closest +##ction +surely +sultan +brings +riley +preparation +aboard +slammed +baptist +experiment +ongoing +interstate +organic +playoffs +##ika +1877 +130 +##tar +hindu +error +tours +tier +plenty +arrangements +talks +trapped +excited +sank +ho +athens +1872 +denver +welfare +suburb +athletes +trick +diverse +belly +exclusively +yelled +1868 +##med +conversion +##ette +1874 +internationally +computers +conductor +abilities +sensitive +hello +dispute +measured +globe +rocket +prices +amsterdam +flights +tigers +inn +municipalities +emotion +references +3d +##mus +explains +airlines +manufactured +pm +archaeological +1873 +interpretation +devon +comment +##ites +settlements +kissing +absolute +improvement +suite +impressed +barcelona +sullivan +jefferson +towers +jesse +julie +##tin +##lu +grandson +hi +gauge +regard +rings +interviews +trace +raymond +thumb +departments +burns +serial +bulgarian +scores +demonstrated +##ix +1866 +kyle +alberta +underneath +romanized +##ward +relieved +acquisition +phrase +cliff +reveals +han +cuts +merger +custom +##dar +nee +gilbert +graduation +##nts +assessment +cafe +difficulty +demands +swung +democrat +jennifer +commons +1940s +grove +##yo +completing +focuses +sum +substitute +bearing +stretch +reception +##py +reflected +essentially +destination +pairs +##ched +survival +resource +##bach +promoting +doubles +messages +tear +##down +##fully +parade +florence +harvey +incumbent +partial +framework +900 +pedro +frozen +procedure +olivia +controls +##mic +shelter +personally +temperatures +##od +brisbane +tested +sits +marble +comprehensive +oxygen +leonard +##kov +inaugural +iranian +referring +quarters +attitude +##ivity +mainstream +lined +mars +dakota +norfolk +unsuccessful +##° +explosion +helicopter +congressional +##sing +inspector +bitch +seal +departed +divine +##ters +coaching +examination +punishment +manufacturer +sink +columns +unincorporated +signals +nevada +squeezed +dylan +dining +photos +martial +manuel +eighteen +elevator +brushed +plates +ministers +ivy +congregation +##len +slept +specialized +taxes +curve +restricted +negotiations +likes +statistical +arnold +inspiration +execution +bold +intermediate +significance +margin +ruler +wheels +gothic +intellectual +dependent +listened +eligible +buses +widow +syria +earn +cincinnati +collapsed +recipient +secrets +accessible +philippine +maritime +goddess +clerk +surrender +breaks +playoff +database +##ified +##lon +ideal +beetle +aspect +soap +regulation +strings +expand +anglo +shorter +crosses +retreat +tough +coins +wallace +directions +pressing +##oon +shipping +locomotives +comparison +topics +nephew +##mes +distinction +honors +travelled +sierra +ibn +##over +fortress +sa +recognised +carved +1869 +clients +##dan +intent +##mar +coaches +describing +bread +##ington +beaten +northwestern +##ona +merit +youtube +collapse +challenges +em +historians +objective +submitted +virus +attacking +drake +assume +##ere +diseases +marc +stem +leeds +##cus +##ab +farming +glasses +##lock +visits +nowhere +fellowship +relevant +carries +restaurants +experiments +101 +constantly +bases +targets +shah +tenth +opponents +verse +territorial +##ira +writings +corruption +##hs +instruction +inherited +reverse +emphasis +##vic +employee +arch +keeps +rabbi +watson +payment +uh +##ala +nancy +##tre +venice +fastest +sexy +banned +adrian +properly +ruth +touchdown +dollar +boards +metre +circles +edges +favour +comments +ok +travels +liberation +scattered +firmly +##ular +holland +permitted +diesel +kenya +den +originated +##ral +demons +resumed +dragged +rider +##rus +servant +blinked +extend +torn +##ias +##sey +input +meal +everybody +cylinder +kinds +camps +##fe +bullet +logic +##wn +croatian +evolved +healthy +fool +chocolate +wise +preserve +pradesh +##ess +respective +1850 +##ew +chicken +artificial +gross +corresponding +convicted +cage +caroline +dialogue +##dor +narrative +stranger +mario +br +christianity +failing +trent +commanding +buddhist +1848 +maurice +focusing +yale +bike +altitude +##ering +mouse +revised +##sley +veteran +##ig +pulls +theology +crashed +campaigns +legion +##ability +drag +excellence +customer +cancelled +intensity +excuse +##lar +liga +participating +contributing +printing +##burn +variable +##rk +curious +bin +legacy +renaissance +##my +symptoms +binding +vocalist +dancer +##nie +grammar +gospel +democrats +ya +enters +sc +diplomatic +hitler +##ser +clouds +mathematical +quit +defended +oriented +##heim +fundamental +hardware +impressive +equally +convince +confederate +guilt +chuck +sliding +##ware +magnetic +narrowed +petersburg +bulgaria +otto +phd +skill +##ama +reader +hopes +pitcher +reservoir +hearts +automatically +expecting +mysterious +bennett +extensively +imagined +seeds +monitor +fix +##ative +journalism +struggling +signature +ranch +encounter +photographer +observation +protests +##pin +influences +##hr +calendar +##all +cruz +croatia +locomotive +hughes +naturally +shakespeare +basement +hook +uncredited +faded +theories +approaches +dare +phillips +filling +fury +obama +##ain +efficient +arc +deliver +min +raid +breeding +inducted +leagues +efficiency +axis +montana +eagles +##ked +supplied +instructions +karen +picking +indicating +trap +anchor +practically +christians +tomb +vary +occasional +electronics +lords +readers +newcastle +faint +innovation +collect +situations +engagement +160 +claude +mixture +##feld +peer +tissue +logo +lean +##ration +°f +floors +##ven +architects +reducing +##our +##ments +rope +1859 +ottawa +##har +samples +banking +declaration +proteins +resignation +francois +saudi +advocate +exhibited +armor +twins +divorce +##ras +abraham +reviewed +jo +temporarily +matrix +physically +pulse +curled +##ena +difficulties +bengal +usage +##ban +annie +riders +certificate +##pi +holes +warsaw +distinctive +jessica +##mon +mutual +1857 +customs +circular +eugene +removal +loaded +mere +vulnerable +depicted +generations +dame +heir +enormous +lightly +climbing +pitched +lessons +pilots +nepal +ram +google +preparing +brad +louise +renowned +##₂ +liam +##ably +plaza +shaw +sophie +brilliant +bills +##bar +##nik +fucking +mainland +server +pleasant +seized +veterans +jerked +fail +beta +brush +radiation +stored +warmth +southeastern +nate +sin +raced +berkeley +joke +athlete +designation +trunk +##low +roland +qualification +archives +heels +artwork +receives +judicial +reserves +##bed +woke +installation +abu +floating +fake +lesser +excitement +interface +concentrated +addressed +characteristic +amanda +saxophone +monk +auto +##bus +releasing +egg +dies +interaction +defender +ce +outbreak +glory +loving +##bert +sequel +consciousness +http +awake +ski +enrolled +##ress +handling +rookie +brow +somebody +biography +warfare +amounts +contracts +presentation +fabric +dissolved +challenged +meter +psychological +lt +elevated +rally +accurate +##tha +hospitals +undergraduate +specialist +venezuela +exhibit +shed +nursing +protestant +fluid +structural +footage +jared +consistent +prey +##ska +succession +reflect +exile +lebanon +wiped +suspect +shanghai +resting +integration +preservation +marvel +variant +pirates +sheep +rounded +capita +sailing +colonies +manuscript +deemed +variations +clarke +functional +emerging +boxing +relaxed +curse +azerbaijan +heavyweight +nickname +editorial +rang +grid +tightened +earthquake +flashed +miguel +rushing +##ches +improvements +boxes +brooks +180 +consumption +molecular +felix +societies +repeatedly +variation +aids +civic +graphics +professionals +realm +autonomous +receiver +delayed +workshop +militia +chairs +trump +canyon +##point +harsh +extending +lovely +happiness +##jan +stake +eyebrows +embassy +wellington +hannah +##ella +sony +corners +bishops +swear +cloth +contents +xi +namely +commenced +1854 +stanford +nashville +courage +graphic +commitment +garrison +##bin +hamlet +clearing +rebels +attraction +literacy +cooking +ruins +temples +jenny +humanity +celebrate +hasn +freight +sixty +rebel +bastard +##art +newton +##ada +deer +##ges +##ching +smiles +delaware +singers +##ets +approaching +assists +flame +##ph +boulevard +barrel +planted +##ome +pursuit +##sia +consequences +posts +shallow +invitation +rode +depot +ernest +kane +rod +concepts +preston +topic +chambers +striking +blast +arrives +descendants +montgomery +ranges +worlds +##lay +##ari +span +chaos +praise +##ag +fewer +1855 +sanctuary +mud +fbi +##ions +programmes +maintaining +unity +harper +bore +handsome +closure +tournaments +thunder +nebraska +linda +facade +puts +satisfied +argentine +dale +cork +dome +panama +##yl +1858 +tasks +experts +##ates +feeding +equation +##las +##ida +##tu +engage +bryan +##ax +um +quartet +melody +disbanded +sheffield +blocked +gasped +delay +kisses +maggie +connects +##non +sts +poured +creator +publishers +##we +guided +ellis +extinct +hug +gaining +##ord +complicated +##bility +poll +clenched +investigate +##use +thereby +quantum +spine +cdp +humor +kills +administered +semifinals +##du +encountered +ignore +##bu +commentary +##maker +bother +roosevelt +140 +plains +halfway +flowing +cultures +crack +imprisoned +neighboring +airline +##ses +##view +##mate +##ec +gather +wolves +marathon +transformed +##ill +cruise +organisations +carol +punch +exhibitions +numbered +alarm +ratings +daddy +silently +##stein +queens +colours +impression +guidance +liu +tactical +##rat +marshal +della +arrow +##ings +rested +feared +tender +owns +bitter +advisor +escort +##ides +spare +farms +grants +##ene +dragons +encourage +colleagues +cameras +##und +sucked +pile +spirits +prague +statements +suspension +landmark +fence +torture +recreation +bags +permanently +survivors +pond +spy +predecessor +bombing +coup +##og +protecting +transformation +glow +##lands +##book +dug +priests +andrea +feat +barn +jumping +##chen +##ologist +##con +casualties +stern +auckland +pipe +serie +revealing +ba +##bel +trevor +mercy +spectrum +yang +consist +governing +collaborated +possessed +epic +comprises +blew +shane +##ack +lopez +honored +magical +sacrifice +judgment +perceived +hammer +mtv +baronet +tune +das +missionary +sheets +350 +neutral +oral +threatening +attractive +shade +aims +seminary +##master +estates +1856 +michel +wounds +refugees +manufacturers +##nic +mercury +syndrome +porter +##iya +##din +hamburg +identification +upstairs +purse +widened +pause +cared +breathed +affiliate +santiago +prevented +celtic +fisher +125 +recruited +byzantine +reconstruction +farther +##mp +diet +sake +au +spite +sensation +##ert +blank +separation +105 +##hon +vladimir +armies +anime +##lie +accommodate +orbit +cult +sofia +archive +##ify +##box +founders +sustained +disorder +honours +northeastern +mia +crops +violet +threats +blanket +fires +canton +followers +southwestern +prototype +voyage +assignment +altered +moderate +protocol +pistol +##eo +questioned +brass +lifting +1852 +math +authored +##ual +doug +dimensional +dynamic +##san +1851 +pronounced +grateful +quest +uncomfortable +boom +presidency +stevens +relating +politicians +chen +barrier +quinn +diana +mosque +tribal +cheese +palmer +portions +sometime +chester +treasure +wu +bend +download +millions +reforms +registration +##osa +consequently +monitoring +ate +preliminary +brandon +invented +ps +eaten +exterior +intervention +ports +documented +log +displays +lecture +sally +favourite +##itz +vermont +lo +invisible +isle +breed +##ator +journalists +relay +speaks +backward +explore +midfielder +actively +stefan +procedures +cannon +blond +kenneth +centered +servants +chains +libraries +malcolm +essex +henri +slavery +##hal +facts +fairy +coached +cassie +cats +washed +cop +##fi +announcement +item +2000s +vinyl +activated +marco +frontier +growled +curriculum +##das +loyal +accomplished +leslie +ritual +kenny +##00 +vii +napoleon +hollow +hybrid +jungle +stationed +friedrich +counted +##ulated +platinum +theatrical +seated +col +rubber +glen +1840 +diversity +healing +extends +id +provisions +administrator +columbus +##oe +tributary +te +assured +org +##uous +prestigious +examined +lectures +grammy +ronald +associations +bailey +allan +essays +flute +believing +consultant +proceedings +travelling +1853 +kit +kerala +yugoslavia +buddy +methodist +##ith +burial +centres +batman +##nda +discontinued +bo +dock +stockholm +lungs +severely +##nk +citing +manga +##ugh +steal +mumbai +iraqi +robot +celebrity +bride +broadcasts +abolished +pot +joel +overhead +franz +packed +reconnaissance +johann +acknowledged +introduce +handled +doctorate +developments +drinks +alley +palestine +##nis +##aki +proceeded +recover +bradley +grain +patch +afford +infection +nationalist +legendary +##ath +interchange +virtually +gen +gravity +exploration +amber +vital +wishes +powell +doctrine +elbow +screenplay +##bird +contribute +indonesian +pet +creates +##com +enzyme +kylie +discipline +drops +manila +hunger +##ien +layers +suffer +fever +bits +monica +keyboard +manages +##hood +searched +appeals +##bad +testament +grande +reid +##war +beliefs +congo +##ification +##dia +si +requiring +##via +casey +1849 +regret +streak +rape +depends +syrian +sprint +pound +tourists +upcoming +pub +##xi +tense +##els +practiced +echo +nationwide +guild +motorcycle +liz +##zar +chiefs +desired +elena +bye +precious +absorbed +relatives +booth +pianist +##mal +citizenship +exhausted +wilhelm +##ceae +##hed +noting +quarterback +urge +hectares +##gue +ace +holly +##tal +blonde +davies +parked +sustainable +stepping +twentieth +airfield +galaxy +nest +chip +##nell +tan +shaft +paulo +requirement +##zy +paradise +tobacco +trans +renewed +vietnamese +##cker +##ju +suggesting +catching +holmes +enjoying +md +trips +colt +holder +butterfly +nerve +reformed +cherry +bowling +trailer +carriage +goodbye +appreciate +toy +joshua +interactive +enabled +involve +##kan +collar +determination +bunch +facebook +recall +shorts +superintendent +episcopal +frustration +giovanni +nineteenth +laser +privately +array +circulation +##ovic +armstrong +deals +painful +permit +discrimination +##wi +aires +retiring +cottage +ni +##sta +horizon +ellen +jamaica +ripped +fernando +chapters +playstation +patron +lecturer +navigation +behaviour +genes +georgian +export +solomon +rivals +swift +seventeen +rodriguez +princeton +independently +sox +1847 +arguing +entity +casting +hank +criteria +oakland +geographic +milwaukee +reflection +expanding +conquest +dubbed +##tv +halt +brave +brunswick +doi +arched +curtis +divorced +predominantly +somerset +streams +ugly +zoo +horrible +curved +buenos +fierce +dictionary +vector +theological +unions +handful +stability +chan +punjab +segments +##lly +altar +ignoring +gesture +monsters +pastor +##stone +thighs +unexpected +operators +abruptly +coin +compiled +associates +improving +migration +pin +##ose +compact +collegiate +reserved +##urs +quarterfinals +roster +restore +assembled +hurry +oval +##cies +1846 +flags +martha +##del +victories +sharply +##rated +argues +deadly +neo +drawings +symbols +performer +##iel +griffin +restrictions +editing +andrews +java +journals +arabia +compositions +dee +pierce +removing +hindi +casino +runway +civilians +minds +nasa +hotels +##zation +refuge +rent +retain +potentially +conferences +suburban +conducting +##tto +##tions +##tle +descended +massacre +##cal +ammunition +terrain +fork +souls +counts +chelsea +durham +drives +cab +##bank +perth +realizing +palestinian +finn +simpson +##dal +betty +##ule +moreover +particles +cardinals +tent +evaluation +extraordinary +##oid +inscription +##works +wednesday +chloe +maintains +panels +ashley +trucks +##nation +cluster +sunlight +strikes +zhang +##wing +dialect +canon +##ap +tucked +##ws +collecting +##mas +##can +##sville +maker +quoted +evan +franco +aria +buying +cleaning +eva +closet +provision +apollo +clinic +rat +##ez +necessarily +ac +##gle +##ising +venues +flipped +cent +spreading +trustees +checking +authorized +##sco +disappointed +##ado +notion +duration +trumpet +hesitated +topped +brussels +rolls +theoretical +hint +define +aggressive +repeat +wash +peaceful +optical +width +allegedly +mcdonald +strict +copyright +##illa +investors +mar +jam +witnesses +sounding +miranda +michelle +privacy +hugo +harmony +##pp +valid +lynn +glared +nina +102 +headquartered +diving +boarding +gibson +##ncy +albanian +marsh +routine +dealt +enhanced +er +intelligent +substance +targeted +enlisted +discovers +spinning +observations +pissed +smoking +rebecca +capitol +visa +varied +costume +seemingly +indies +compensation +surgeon +thursday +arsenal +westminster +suburbs +rid +anglican +##ridge +knots +foods +alumni +lighter +fraser +whoever +portal +scandal +##ray +gavin +advised +instructor +flooding +terrorist +##ale +teenage +interim +senses +duck +teen +thesis +abby +eager +overcome +##ile +newport +glenn +rises +shame +##cc +prompted +priority +forgot +bomber +nicolas +protective +360 +cartoon +katherine +breeze +lonely +trusted +henderson +richardson +relax +banner +candy +palms +remarkable +##rio +legends +cricketer +essay +ordained +edmund +rifles +trigger +##uri +##away +sail +alert +1830 +audiences +penn +sussex +siblings +pursued +indianapolis +resist +rosa +consequence +succeed +avoided +1845 +##ulation +inland +##tie +##nna +counsel +profession +chronicle +hurried +##una +eyebrow +eventual +bleeding +innovative +cure +##dom +committees +accounting +con +scope +hardy +heather +tenor +gut +herald +codes +tore +scales +wagon +##oo +luxury +tin +prefer +fountain +triangle +bonds +darling +convoy +dried +traced +beings +troy +accidentally +slam +findings +smelled +joey +lawyers +outcome +steep +bosnia +configuration +shifting +toll +brook +performers +lobby +philosophical +construct +shrine +aggregate +boot +cox +phenomenon +savage +insane +solely +reynolds +lifestyle +##ima +nationally +holdings +consideration +enable +edgar +mo +mama +##tein +fights +relegation +chances +atomic +hub +conjunction +awkward +reactions +currency +finale +kumar +underwent +steering +elaborate +gifts +comprising +melissa +veins +reasonable +sunshine +chi +solve +trails +inhabited +elimination +ethics +huh +ana +molly +consent +apartments +layout +marines +##ces +hunters +bulk +##oma +hometown +##wall +##mont +cracked +reads +neighbouring +withdrawn +admission +wingspan +damned +anthology +lancashire +brands +batting +forgive +cuban +awful +##lyn +104 +dimensions +imagination +##ade +dante +##ship +tracking +desperately +goalkeeper +##yne +groaned +workshops +confident +burton +gerald +milton +circus +uncertain +slope +copenhagen +sophia +fog +philosopher +portraits +accent +cycling +varying +gripped +larvae +garrett +specified +scotia +mature +luther +kurt +rap +##kes +aerial +750 +ferdinand +heated +es +transported +##shan +safely +nonetheless +##orn +##gal +motors +demanding +##sburg +startled +##brook +ally +generate +caps +ghana +stained +demo +mentions +beds +ap +afterward +diary +##bling +utility +##iro +richards +1837 +conspiracy +conscious +shining +footsteps +observer +cyprus +urged +loyalty +developer +probability +olive +upgraded +gym +miracle +insects +graves +1844 +ourselves +hydrogen +amazon +katie +tickets +poets +##pm +planes +##pan +prevention +witnessed +dense +jin +randy +tang +warehouse +monroe +bang +archived +elderly +investigations +alec +granite +mineral +conflicts +controlling +aboriginal +carlo +##zu +mechanics +stan +stark +rhode +skirt +est +##berry +bombs +respected +##horn +imposed +limestone +deny +nominee +memphis +grabbing +disabled +##als +amusement +aa +frankfurt +corn +referendum +varies +slowed +disk +firms +unconscious +incredible +clue +sue +##zhou +twist +##cio +joins +idaho +chad +developers +computing +destroyer +103 +mortal +tucker +kingston +choices +yu +carson +1800 +os +whitney +geneva +pretend +dimension +staged +plateau +maya +##une +freestyle +##bc +rovers +hiv +##ids +tristan +classroom +prospect +##hus +honestly +diploma +lied +thermal +auxiliary +feast +unlikely +iata +##tel +morocco +pounding +treasury +lithuania +considerably +1841 +dish +1812 +geological +matching +stumbled +destroying +marched +brien +advances +cake +nicole +belle +settling +measuring +directing +##mie +tuesday +bassist +capabilities +stunned +fraud +torpedo +##list +##phone +anton +wisdom +surveillance +ruined +##ulate +lawsuit +healthcare +theorem +halls +trend +aka +horizontal +dozens +acquire +lasting +swim +hawk +gorgeous +fees +vicinity +decrease +adoption +tactics +##ography +pakistani +##ole +draws +##hall +willie +burke +heath +algorithm +integral +powder +elliott +brigadier +jackie +tate +varieties +darker +##cho +lately +cigarette +specimens +adds +##ree +##ensis +##inger +exploded +finalist +cia +murders +wilderness +arguments +nicknamed +acceptance +onwards +manufacture +robertson +jets +tampa +enterprises +blog +loudly +composers +nominations +1838 +ai +malta +inquiry +automobile +hosting +viii +rays +tilted +grief +museums +strategies +furious +euro +equality +cohen +poison +surrey +wireless +governed +ridiculous +moses +##esh +##room +vanished +##ito +barnes +attract +morrison +istanbul +##iness +absent +rotation +petition +janet +##logical +satisfaction +custody +deliberately +observatory +comedian +surfaces +pinyin +novelist +strictly +canterbury +oslo +monks +embrace +ibm +jealous +photograph +continent +dorothy +marina +doc +excess +holden +allegations +explaining +stack +avoiding +lance +storyline +majesty +poorly +spike +dos +bradford +raven +travis +classics +proven +voltage +pillow +fists +butt +1842 +interpreted +##car +1839 +gage +telegraph +lens +promising +expelled +casual +collector +zones +##min +silly +nintendo +##kh +##bra +downstairs +chef +suspicious +afl +flies +vacant +uganda +pregnancy +condemned +lutheran +estimates +cheap +decree +saxon +proximity +stripped +idiot +deposits +contrary +presenter +magnus +glacier +im +offense +edwin +##ori +upright +##long +bolt +##ois +toss +geographical +##izes +environments +delicate +marking +abstract +xavier +nails +windsor +plantation +occurring +equity +saskatchewan +fears +drifted +sequences +vegetation +revolt +##stic +1843 +sooner +fusion +opposing +nato +skating +1836 +secretly +ruin +lease +##oc +edit +##nne +flora +anxiety +ruby +##ological +##mia +tel +bout +taxi +emmy +frost +rainbow +compounds +foundations +rainfall +assassination +nightmare +dominican +##win +achievements +deserve +orlando +intact +armenia +##nte +calgary +valentine +106 +marion +proclaimed +theodore +bells +courtyard +thigh +gonzalez +console +troop +minimal +monte +everyday +##ence +##if +supporter +terrorism +buck +openly +presbyterian +activists +carpet +##iers +rubbing +uprising +##yi +cute +conceived +legally +##cht +millennium +cello +velocity +ji +rescued +cardiff +1835 +rex +concentrate +senators +beard +rendered +glowing +battalions +scouts +competitors +sculptor +catalogue +arctic +ion +raja +bicycle +wow +glancing +lawn +##woman +gentleman +lighthouse +publish +predicted +calculated +##val +variants +##gne +strain +##ui +winston +deceased +##nus +touchdowns +brady +caleb +sinking +echoed +crush +hon +blessed +protagonist +hayes +endangered +magnitude +editors +##tine +estimate +responsibilities +##mel +backup +laying +consumed +sealed +zurich +lovers +frustrated +##eau +ahmed +kicking +mit +treasurer +1832 +biblical +refuse +terrified +pump +agrees +genuine +imprisonment +refuses +plymouth +##hen +lou +##nen +tara +trembling +antarctic +ton +learns +##tas +crap +crucial +faction +atop +##borough +wrap +lancaster +odds +hopkins +erik +lyon +##eon +bros +##ode +snap +locality +tips +empress +crowned +cal +acclaimed +chuckled +##ory +clara +sends +mild +towel +##fl +##day +##а +wishing +assuming +interviewed +##bal +##die +interactions +eden +cups +helena +##lf +indie +beck +##fire +batteries +filipino +wizard +parted +##lam +traces +##born +rows +idol +albany +delegates +##ees +##sar +discussions +##ex +notre +instructed +belgrade +highways +suggestion +lauren +possess +orientation +alexandria +abdul +beats +salary +reunion +ludwig +alright +wagner +intimate +pockets +slovenia +hugged +brighton +merchants +cruel +stole +trek +slopes +repairs +enrollment +politically +underlying +promotional +counting +boeing +##bb +isabella +naming +##и +keen +bacteria +listing +separately +belfast +ussr +450 +lithuanian +anybody +ribs +sphere +martinez +cock +embarrassed +proposals +fragments +nationals +##fs +##wski +premises +fin +1500 +alpine +matched +freely +bounded +jace +sleeve +##af +gaming +pier +populated +evident +##like +frances +flooded +##dle +frightened +pour +trainer +framed +visitor +challenging +pig +wickets +##fold +infected +email +##pes +arose +##aw +reward +ecuador +oblast +vale +ch +shuttle +##usa +bach +rankings +forbidden +cornwall +accordance +salem +consumers +bruno +fantastic +toes +machinery +resolved +julius +remembering +propaganda +iceland +bombardment +tide +contacts +wives +##rah +concerto +macdonald +albania +implement +daisy +tapped +sudan +helmet +angela +mistress +##lic +crop +sunk +finest +##craft +hostile +##ute +##tsu +boxer +fr +paths +adjusted +habit +ballot +supervision +soprano +##zen +bullets +wicked +sunset +regiments +disappear +lamp +performs +app +##gia +##oa +rabbit +digging +incidents +entries +##cion +dishes +##oi +introducing +##ati +##fied +freshman +slot +jill +tackles +baroque +backs +##iest +lone +sponsor +destiny +altogether +convert +##aro +consensus +shapes +demonstration +basically +feminist +auction +artifacts +##bing +strongest +twitter +halifax +2019 +allmusic +mighty +smallest +precise +alexandra +viola +##los +##ille +manuscripts +##illo +dancers +ari +managers +monuments +blades +barracks +springfield +maiden +consolidated +electron +##end +berry +airing +wheat +nobel +inclusion +blair +payments +geography +bee +cc +eleanor +react +##hurst +afc +manitoba +##yu +su +lineup +fitness +recreational +investments +airborne +disappointment +##dis +edmonton +viewing +##row +renovation +##cast +infant +bankruptcy +roses +aftermath +pavilion +##yer +carpenter +withdrawal +ladder +##hy +discussing +popped +reliable +agreements +rochester +##abad +curves +bombers +220 +rao +reverend +decreased +choosing +107 +stiff +consulting +naples +crawford +tracy +ka +ribbon +cops +##lee +crushed +deciding +unified +teenager +accepting +flagship +explorer +poles +sanchez +inspection +revived +skilled +induced +exchanged +flee +locals +tragedy +swallow +loading +hanna +demonstrate +##ela +salvador +flown +contestants +civilization +##ines +wanna +rhodes +fletcher +hector +knocking +considers +##ough +nash +mechanisms +sensed +mentally +walt +unclear +##eus +renovated +madame +##cks +crews +governmental +##hin +undertaken +monkey +##ben +##ato +fatal +armored +copa +caves +governance +grasp +perception +certification +froze +damp +tugged +wyoming +##rg +##ero +newman +##lor +nerves +curiosity +graph +115 +##ami +withdraw +tunnels +dull +meredith +moss +exhibits +neighbors +communicate +accuracy +explored +raiders +republicans +secular +kat +superman +penny +criticised +##tch +freed +update +conviction +wade +ham +likewise +delegation +gotta +doll +promises +technological +myth +nationality +resolve +convent +##mark +sharon +dig +sip +coordinator +entrepreneur +fold +##dine +capability +councillor +synonym +blown +swan +cursed +1815 +jonas +haired +sofa +canvas +keeper +rivalry +##hart +rapper +speedway +swords +postal +maxwell +estonia +potter +recurring +##nn +##ave +errors +##oni +cognitive +1834 +##² +claws +nadu +roberto +bce +wrestler +ellie +##ations +infinite +ink +##tia +presumably +finite +staircase +108 +noel +patricia +nacional +##cation +chill +eternal +tu +preventing +prussia +fossil +limbs +##logist +ernst +frog +perez +rene +##ace +pizza +prussian +##ios +##vy +molecules +regulatory +answering +opinions +sworn +lengths +supposedly +hypothesis +upward +habitats +seating +ancestors +drank +yield +hd +synthesis +researcher +modest +##var +mothers +peered +voluntary +homeland +##the +acclaim +##igan +static +valve +luxembourg +alto +carroll +fe +receptor +norton +ambulance +##tian +johnston +catholics +depicting +jointly +elephant +gloria +mentor +badge +ahmad +distinguish +remarked +councils +precisely +allison +advancing +detection +crowded +##10 +cooperative +ankle +mercedes +dagger +surrendered +pollution +commit +subway +jeffrey +lesson +sculptures +provider +##fication +membrane +timothy +rectangular +fiscal +heating +teammate +basket +particle +anonymous +deployment +##ple +missiles +courthouse +proportion +shoe +sec +##ller +complaints +forbes +blacks +abandon +remind +sizes +overwhelming +autobiography +natalie +##awa +risks +contestant +countryside +babies +scorer +invaded +enclosed +proceed +hurling +disorders +##cu +reflecting +continuously +cruiser +graduates +freeway +investigated +ore +deserved +maid +blocking +phillip +jorge +shakes +dove +mann +variables +lacked +burden +accompanying +que +consistently +organizing +provisional +complained +endless +##rm +tubes +juice +georges +krishna +mick +labels +thriller +##uch +laps +arcade +sage +snail +##table +shannon +fi +laurence +seoul +vacation +presenting +hire +churchill +surprisingly +prohibited +savannah +technically +##oli +170 +##lessly +testimony +suited +speeds +toys +romans +mlb +flowering +measurement +talented +kay +settings +charleston +expectations +shattered +achieving +triumph +ceremonies +portsmouth +lanes +mandatory +loser +stretching +cologne +realizes +seventy +cornell +careers +webb +##ulating +americas +budapest +ava +suspicion +##ison +yo +conrad +##hai +sterling +jessie +rector +##az +1831 +transform +organize +loans +christine +volcanic +warrant +slender +summers +subfamily +newer +danced +dynamics +rhine +proceeds +heinrich +gastropod +commands +sings +facilitate +easter +ra +positioned +responses +expense +fruits +yanked +imported +25th +velvet +vic +primitive +tribune +baldwin +neighbourhood +donna +rip +hay +pr +##uro +1814 +espn +welcomed +##aria +qualifier +glare +highland +timing +##cted +shells +eased +geometry +louder +exciting +slovakia +##sion +##iz +##lot +savings +prairie +##ques +marching +rafael +tonnes +##lled +curtain +preceding +shy +heal +greene +worthy +##pot +detachment +bury +sherman +##eck +reinforced +seeks +bottles +contracted +duchess +outfit +walsh +##sc +mickey +##ase +geoffrey +archer +squeeze +dawson +eliminate +invention +##enberg +neal +##eth +stance +dealer +coral +maple +retire +polo +simplified +##ht +1833 +hid +watts +backwards +jules +##oke +genesis +mt +frames +rebounds +burma +woodland +moist +santos +whispers +drained +subspecies +##aa +streaming +ulster +burnt +correspondence +maternal +gerard +denis +stealing +##load +genius +duchy +##oria +inaugurated +momentum +suits +placement +sovereign +clause +thames +##hara +confederation +reservation +sketch +yankees +lets +rotten +charm +hal +verses +ultra +commercially +dot +salon +citation +adopt +winnipeg +mist +allocated +cairo +##boy +jenkins +interference +objectives +##wind +1820 +portfolio +armoured +sectors +##eh +initiatives +##world +integrity +exercises +robe +tap +ab +gazed +##tones +distracted +rulers +111 +favorable +jerome +tended +cart +factories +##eri +diplomat +valued +gravel +charitable +##try +calvin +exploring +chang +shepherd +terrace +pdf +pupil +##ural +reflects +ups +##rch +governors +shelf +depths +##nberg +trailed +crest +tackle +##nian +##ats +hatred +##kai +clare +makers +ethiopia +longtime +detected +embedded +lacking +slapped +rely +thomson +anticipation +iso +morton +successive +agnes +screenwriter +straightened +philippe +playwright +haunted +licence +iris +intentions +sutton +112 +logical +correctly +##weight +branded +licked +tipped +silva +ricky +narrator +requests +##ents +greeted +supernatural +cow +##wald +lung +refusing +employer +strait +gaelic +liner +##piece +zoe +sabha +##mba +driveway +harvest +prints +bates +reluctantly +threshold +algebra +ira +wherever +coupled +240 +assumption +picks +##air +designers +raids +gentlemen +##ean +roller +blowing +leipzig +locks +screw +dressing +strand +##lings +scar +dwarf +depicts +##nu +nods +##mine +differ +boris +##eur +yuan +flip +##gie +mob +invested +questioning +applying +##ture +shout +##sel +gameplay +blamed +illustrations +bothered +weakness +rehabilitation +##of +##zes +envelope +rumors +miners +leicester +subtle +kerry +##ico +ferguson +##fu +premiership +ne +##cat +bengali +prof +catches +remnants +dana +##rily +shouting +presidents +baltic +ought +ghosts +dances +sailors +shirley +fancy +dominic +##bie +madonna +##rick +bark +buttons +gymnasium +ashes +liver +toby +oath +providence +doyle +evangelical +nixon +cement +carnegie +embarked +hatch +surroundings +guarantee +needing +pirate +essence +##bee +filter +crane +hammond +projected +immune +percy +twelfth +##ult +regent +doctoral +damon +mikhail +##ichi +lu +critically +elect +realised +abortion +acute +screening +mythology +steadily +##fc +frown +nottingham +kirk +wa +minneapolis +##rra +module +algeria +mc +nautical +encounters +surprising +statues +availability +shirts +pie +alma +brows +munster +mack +soup +crater +tornado +sanskrit +cedar +explosive +bordered +dixon +planets +stamp +exam +happily +##bble +carriers +kidnapped +##vis +accommodation +emigrated +##met +knockout +correspondent +violation +profits +peaks +lang +specimen +agenda +ancestry +pottery +spelling +equations +obtaining +ki +linking +1825 +debris +asylum +##20 +buddhism +teddy +##ants +gazette +##nger +##sse +dental +eligibility +utc +fathers +averaged +zimbabwe +francesco +coloured +hissed +translator +lynch +mandate +humanities +mackenzie +uniforms +lin +##iana +##gio +asset +mhz +fitting +samantha +genera +wei +rim +beloved +shark +riot +entities +expressions +indo +carmen +slipping +owing +abbot +neighbor +sidney +##av +rats +recommendations +encouraging +squadrons +anticipated +commanders +conquered +##oto +donations +diagnosed +##mond +divide +##iva +guessed +decoration +vernon +auditorium +revelation +conversations +##kers +##power +herzegovina +dash +alike +protested +lateral +herman +accredited +mg +##gent +freeman +mel +fiji +crow +crimson +##rine +livestock +##pped +humanitarian +bored +oz +whip +##lene +##ali +legitimate +alter +grinning +spelled +anxious +oriental +wesley +##nin +##hole +carnival +controller +detect +##ssa +bowed +educator +kosovo +macedonia +##sin +occupy +mastering +stephanie +janeiro +para +unaware +nurses +noon +135 +cam +hopefully +ranger +combine +sociology +polar +rica +##eer +neill +##sman +holocaust +##ip +doubled +lust +1828 +109 +decent +cooling +unveiled +##card +1829 +nsw +homer +chapman +meyer +##gin +dive +mae +reagan +expertise +##gled +darwin +brooke +sided +prosecution +investigating +comprised +petroleum +genres +reluctant +differently +trilogy +johns +vegetables +corpse +highlighted +lounge +pension +unsuccessfully +elegant +aided +ivory +beatles +amelia +cain +dubai +sunny +immigrant +babe +click +##nder +underwater +pepper +combining +mumbled +atlas +horns +accessed +ballad +physicians +homeless +gestured +rpm +freak +louisville +corporations +patriots +prizes +rational +warn +modes +decorative +overnight +din +troubled +phantom +##ort +monarch +sheer +##dorf +generals +guidelines +organs +addresses +##zon +enhance +curling +parishes +cord +##kie +linux +caesar +deutsche +bavaria +##bia +coleman +cyclone +##eria +bacon +petty +##yama +##old +hampton +diagnosis +1824 +throws +complexity +rita +disputed +##₃ +pablo +##sch +marketed +trafficking +##ulus +examine +plague +formats +##oh +vault +faithful +##bourne +webster +##ox +highlights +##ient +##ann +phones +vacuum +sandwich +modeling +##gated +bolivia +clergy +qualities +isabel +##nas +##ars +wears +screams +reunited +annoyed +bra +##ancy +##rate +differential +transmitter +tattoo +container +poker +##och +excessive +resides +cowboys +##tum +augustus +trash +providers +statute +retreated +balcony +reversed +void +storey +preceded +masses +leap +laughs +neighborhoods +wards +schemes +falcon +santo +battlefield +pad +ronnie +thread +lesbian +venus +##dian +beg +sandstone +daylight +punched +gwen +analog +stroked +wwe +acceptable +measurements +dec +toxic +##kel +adequate +surgical +economist +parameters +varsity +##sberg +quantity +ella +##chy +##rton +countess +generating +precision +diamonds +expressway +ga +##ı +1821 +uruguay +talents +galleries +expenses +scanned +colleague +outlets +ryder +lucien +##ila +paramount +##bon +syracuse +dim +fangs +gown +sweep +##sie +toyota +missionaries +websites +##nsis +sentences +adviser +val +trademark +spells +##plane +patience +starter +slim +##borg +toe +incredibly +shoots +elliot +nobility +##wyn +cowboy +endorsed +gardner +tendency +persuaded +organisms +emissions +kazakhstan +amused +boring +chips +themed +##hand +llc +constantinople +chasing +systematic +guatemala +borrowed +erin +carey +##hard +highlands +struggles +1810 +##ifying +##ced +wong +exceptions +develops +enlarged +kindergarten +castro +##ern +##rina +leigh +zombie +juvenile +##most +consul +##nar +sailor +hyde +clarence +intensive +pinned +nasty +useless +jung +clayton +stuffed +exceptional +ix +apostolic +230 +transactions +##dge +exempt +swinging +cove +religions +##ash +shields +dairy +bypass +190 +pursuing +bug +joyce +bombay +chassis +southampton +chat +interact +redesignated +##pen +nascar +pray +salmon +rigid +regained +malaysian +grim +publicity +constituted +capturing +toilet +delegate +purely +tray +drift +loosely +striker +weakened +trinidad +mitch +itv +defines +transmitted +ming +scarlet +nodding +fitzgerald +fu +narrowly +sp +tooth +standings +virtue +##₁ +##wara +##cting +chateau +gloves +lid +##nel +hurting +conservatory +##pel +sinclair +reopened +sympathy +nigerian +strode +advocated +optional +chronic +discharge +##rc +suck +compatible +laurel +stella +shi +fails +wage +dodge +128 +informal +sorts +levi +buddha +villagers +##aka +chronicles +heavier +summoned +gateway +3000 +eleventh +jewelry +translations +accordingly +seas +##ency +fiber +pyramid +cubic +dragging +##ista +caring +##ops +android +contacted +lunar +##dt +kai +lisbon +patted +1826 +sacramento +theft +madagascar +subtropical +disputes +ta +holidays +piper +willow +mare +cane +itunes +newfoundland +benny +companions +dong +raj +observe +roar +charming +plaque +tibetan +fossils +enacted +manning +bubble +tina +tanzania +##eda +##hir +funk +swamp +deputies +cloak +ufc +scenario +par +scratch +metals +anthem +guru +engaging +specially +##boat +dialects +nineteen +cecil +duet +disability +messenger +unofficial +##lies +defunct +eds +moonlight +drainage +surname +puzzle +honda +switching +conservatives +mammals +knox +broadcaster +sidewalk +cope +##ried +benson +princes +peterson +##sal +bedford +sharks +eli +wreck +alberto +gasp +archaeology +lgbt +teaches +securities +madness +compromise +waving +coordination +davidson +visions +leased +possibilities +eighty +jun +fernandez +enthusiasm +assassin +sponsorship +reviewer +kingdoms +estonian +laboratories +##fy +##nal +applies +verb +celebrations +##zzo +rowing +lightweight +sadness +submit +mvp +balanced +dude +##vas +explicitly +metric +magnificent +mound +brett +mohammad +mistakes +irregular +##hing +##ass +sanders +betrayed +shipped +surge +##enburg +reporters +termed +georg +pity +verbal +bulls +abbreviated +enabling +appealed +##are +##atic +sicily +sting +heel +sweetheart +bart +spacecraft +brutal +monarchy +##tter +aberdeen +cameo +diane +##ub +survivor +clyde +##aries +complaint +##makers +clarinet +delicious +chilean +karnataka +coordinates +1818 +panties +##rst +pretending +ar +dramatically +kiev +bella +tends +distances +113 +catalog +launching +instances +telecommunications +portable +lindsay +vatican +##eim +angles +aliens +marker +stint +screens +bolton +##rne +judy +wool +benedict +plasma +europa +spark +imaging +filmmaker +swiftly +##een +contributor +##nor +opted +stamps +apologize +financing +butter +gideon +sophisticated +alignment +avery +chemicals +yearly +speculation +prominence +professionally +##ils +immortal +institutional +inception +wrists +identifying +tribunal +derives +gains +##wo +papal +preference +linguistic +vince +operative +brewery +##ont +unemployment +boyd +##ured +##outs +albeit +prophet +1813 +bi +##rr +##face +##rad +quarterly +asteroid +cleaned +radius +temper +##llen +telugu +jerk +viscount +menu +##ote +glimpse +##aya +yacht +hawaiian +baden +##rl +laptop +readily +##gu +monetary +offshore +scots +watches +##yang +##arian +upgrade +needle +xbox +lea +encyclopedia +flank +fingertips +##pus +delight +teachings +confirm +roth +beaches +midway +winters +##iah +teasing +daytime +beverly +gambling +bonnie +##backs +regulated +clement +hermann +tricks +knot +##shing +##uring +##vre +detached +ecological +owed +specialty +byron +inventor +bats +stays +screened +unesco +midland +trim +affection +##ander +##rry +jess +thoroughly +feedback +##uma +chennai +strained +heartbeat +wrapping +overtime +pleaded +##sworth +mon +leisure +oclc +##tate +##ele +feathers +angelo +thirds +nuts +surveys +clever +gill +commentator +##dos +darren +rides +gibraltar +##nc +##mu +dissolution +dedication +shin +meals +saddle +elvis +reds +chaired +taller +appreciation +functioning +niece +favored +advocacy +robbie +criminals +suffolk +yugoslav +passport +constable +congressman +hastings +vera +##rov +consecrated +sparks +ecclesiastical +confined +##ovich +muller +floyd +nora +1822 +paved +1827 +cumberland +ned +saga +spiral +##flow +appreciated +yi +collaborative +treating +similarities +feminine +finishes +##ib +jade +import +##nse +##hot +champagne +mice +securing +celebrities +helsinki +attributes +##gos +cousins +phases +ache +lucia +gandhi +submission +vicar +spear +shine +tasmania +biting +detention +constitute +tighter +seasonal +##gus +terrestrial +matthews +##oka +effectiveness +parody +philharmonic +##onic +1816 +strangers +encoded +consortium +guaranteed +regards +shifts +tortured +collision +supervisor +inform +broader +insight +theaters +armour +emeritus +blink +incorporates +mapping +##50 +##ein +handball +flexible +##nta +substantially +generous +thief +##own +carr +loses +1793 +prose +ucla +romeo +generic +metallic +realization +damages +mk +commissioners +zach +default +##ther +helicopters +lengthy +stems +spa +partnered +spectators +rogue +indication +penalties +teresa +1801 +sen +##tric +dalton +##wich +irving +photographic +##vey +dell +deaf +peters +excluded +unsure +##vable +patterson +crawled +##zio +resided +whipped +latvia +slower +ecole +pipes +employers +maharashtra +comparable +va +textile +pageant +##gel +alphabet +binary +irrigation +chartered +choked +antoine +offs +waking +supplement +##wen +quantities +demolition +regain +locate +urdu +folks +alt +114 +##mc +scary +andreas +whites +##ava +classrooms +mw +aesthetic +publishes +valleys +guides +cubs +johannes +bryant +conventions +affecting +##itt +drain +awesome +isolation +prosecutor +ambitious +apology +captive +downs +atmospheric +lorenzo +aisle +beef +foul +##onia +kidding +composite +disturbed +illusion +natives +##ffer +emi +rockets +riverside +wartime +painters +adolf +melted +##ail +uncertainty +simulation +hawks +progressed +meantime +builder +spray +breach +unhappy +regina +russians +##urg +determining +##tation +tram +1806 +##quin +aging +##12 +1823 +garion +rented +mister +diaz +terminated +clip +1817 +depend +nervously +disco +owe +defenders +shiva +notorious +disbelief +shiny +worcester +##gation +##yr +trailing +undertook +islander +belarus +limitations +watershed +fuller +overlooking +utilized +raphael +1819 +synthetic +breakdown +klein +##nate +moaned +memoir +lamb +practicing +##erly +cellular +arrows +exotic +##graphy +witches +117 +charted +rey +hut +hierarchy +subdivision +freshwater +giuseppe +aloud +reyes +qatar +marty +sideways +utterly +sexually +jude +prayers +mccarthy +softball +blend +damien +##gging +##metric +wholly +erupted +lebanese +negro +revenues +tasted +comparative +teamed +transaction +labeled +maori +sovereignty +parkway +trauma +gran +malay +121 +advancement +descendant +2020 +buzz +salvation +inventory +symbolic +##making +antarctica +mps +##gas +##bro +mohammed +myanmar +holt +submarines +tones +##lman +locker +patriarch +bangkok +emerson +remarks +predators +kin +afghan +confession +norwich +rental +emerge +advantages +##zel +rca +##hold +shortened +storms +aidan +##matic +autonomy +compliance +##quet +dudley +atp +##osis +1803 +motto +documentation +summary +professors +spectacular +christina +archdiocese +flashing +innocence +remake +##dell +psychic +reef +scare +employ +rs +sticks +meg +gus +leans +##ude +accompany +bergen +tomas +##iko +doom +wages +pools +##nch +##bes +breasts +scholarly +alison +outline +brittany +breakthrough +willis +realistic +##cut +##boro +competitor +##stan +pike +picnic +icon +designing +commercials +washing +villain +skiing +micro +costumes +auburn +halted +executives +##hat +logistics +cycles +vowel +applicable +barrett +exclaimed +eurovision +eternity +ramon +##umi +##lls +modifications +sweeping +disgust +##uck +torch +aviv +ensuring +rude +dusty +sonic +donovan +outskirts +cu +pathway +##band +##gun +##lines +disciplines +acids +cadet +paired +##40 +sketches +##sive +marriages +##⁺ +folding +peers +slovak +implies +admired +##beck +1880s +leopold +instinct +attained +weston +megan +horace +##ination +dorsal +ingredients +evolutionary +##its +complications +deity +lethal +brushing +levy +deserted +institutes +posthumously +delivering +telescope +coronation +motivated +rapids +luc +flicked +pays +volcano +tanner +weighed +##nica +crowds +frankie +gifted +addressing +granddaughter +winding +##rna +constantine +gomez +##front +landscapes +rudolf +anthropology +slate +werewolf +##lio +astronomy +circa +rouge +dreaming +sack +knelt +drowned +naomi +prolific +tracked +freezing +herb +##dium +agony +randall +twisting +wendy +deposit +touches +vein +wheeler +##bbled +##bor +batted +retaining +tire +presently +compare +specification +daemon +nigel +##grave +merry +recommendation +czechoslovakia +sandra +ng +roma +##sts +lambert +inheritance +sheikh +winchester +cries +examining +##yle +comeback +cuisine +nave +##iv +ko +retrieve +tomatoes +barker +polished +defining +irene +lantern +personalities +begging +tract +swore +1809 +175 +##gic +omaha +brotherhood +##rley +haiti +##ots +exeter +##ete +##zia +steele +dumb +pearson +210 +surveyed +elisabeth +trends +##ef +fritz +##rf +premium +bugs +fraction +calmly +viking +##birds +tug +inserted +unusually +##ield +confronted +distress +crashing +brent +turks +resign +##olo +cambodia +gabe +sauce +##kal +evelyn +116 +extant +clusters +quarry +teenagers +luna +##lers +##ister +affiliation +drill +##ashi +panthers +scenic +libya +anita +strengthen +inscriptions +##cated +lace +sued +judith +riots +##uted +mint +##eta +preparations +midst +dub +challenger +##vich +mock +cf +displaced +wicket +breaths +enables +schmidt +analyst +##lum +ag +highlight +automotive +axe +josef +newark +sufficiently +resembles +50th +##pal +flushed +mum +traits +##ante +commodore +incomplete +warming +titular +ceremonial +ethical +118 +celebrating +eighteenth +cao +lima +medalist +mobility +strips +snakes +##city +miniature +zagreb +barton +escapes +umbrella +automated +doubted +differs +cooled +georgetown +dresden +cooked +fade +wyatt +rna +jacobs +carlton +abundant +stereo +boost +madras +inning +##hia +spur +ip +malayalam +begged +osaka +groan +escaping +charging +dose +vista +##aj +bud +papa +communists +advocates +edged +tri +##cent +resemble +peaking +necklace +fried +montenegro +saxony +goose +glances +stuttgart +curator +recruit +grocery +sympathetic +##tting +##fort +127 +lotus +randolph +ancestor +##rand +succeeding +jupiter +1798 +macedonian +##heads +hiking +1808 +handing +fischer +##itive +garbage +node +##pies +prone +singular +papua +inclined +attractions +italia +pouring +motioned +grandma +garnered +jacksonville +corp +ego +ringing +aluminum +##hausen +ordering +##foot +drawer +traders +synagogue +##play +##kawa +resistant +wandering +fragile +fiona +teased +var +hardcore +soaked +jubilee +decisive +exposition +mercer +poster +valencia +hale +kuwait +1811 +##ises +##wr +##eed +tavern +gamma +122 +johan +##uer +airways +amino +gil +##ury +vocational +domains +torres +##sp +generator +folklore +outcomes +##keeper +canberra +shooter +fl +beams +confrontation +##lling +##gram +feb +aligned +forestry +pipeline +jax +motorway +conception +decay +##tos +coffin +##cott +stalin +1805 +escorted +minded +##nam +sitcom +purchasing +twilight +veronica +additions +passive +tensions +straw +123 +frequencies +1804 +refugee +cultivation +##iate +christie +clary +bulletin +crept +disposal +##rich +##zong +processor +crescent +##rol +bmw +emphasized +whale +nazis +aurora +##eng +dwelling +hauled +sponsors +toledo +mega +ideology +theatres +tessa +cerambycidae +saves +turtle +cone +suspects +kara +rusty +yelling +greeks +mozart +shades +cocked +participant +##tro +shire +spit +freeze +necessity +##cos +inmates +nielsen +councillors +loaned +uncommon +omar +peasants +botanical +offspring +daniels +formations +jokes +1794 +pioneers +sigma +licensing +##sus +wheelchair +polite +1807 +liquor +pratt +trustee +##uta +forewings +balloon +##zz +kilometre +camping +explicit +casually +shawn +foolish +teammates +nm +hassan +carrie +judged +satisfy +vanessa +knives +selective +cnn +flowed +##lice +eclipse +stressed +eliza +mathematician +cease +cultivated +##roy +commissions +browns +##ania +destroyers +sheridan +meadow +##rius +minerals +##cial +downstream +clash +gram +memoirs +ventures +baha +seymour +archie +midlands +edith +fare +flynn +invite +canceled +tiles +stabbed +boulder +incorporate +amended +camden +facial +mollusk +unreleased +descriptions +yoga +grabs +550 +raises +ramp +shiver +##rose +coined +pioneering +tunes +qing +warwick +tops +119 +melanie +giles +##rous +wandered +##inal +annexed +nov +30th +unnamed +##ished +organizational +airplane +normandy +stoke +whistle +blessing +violations +chased +holders +shotgun +##ctic +outlet +reactor +##vik +tires +tearing +shores +fortified +mascot +constituencies +nc +columnist +productive +tibet +##rta +lineage +hooked +oct +tapes +judging +cody +##gger +hansen +kashmir +triggered +##eva +solved +cliffs +##tree +resisted +anatomy +protesters +transparent +implied +##iga +injection +mattress +excluding +##mbo +defenses +helpless +devotion +##elli +growl +liberals +weber +phenomena +atoms +plug +##iff +mortality +apprentice +howe +convincing +aaa +swimmer +barber +leone +promptly +sodium +def +nowadays +arise +##oning +gloucester +corrected +dignity +norm +erie +##ders +elders +evacuated +sylvia +compression +##yar +hartford +pose +backpack +reasoning +accepts +24th +wipe +millimetres +marcel +##oda +dodgers +albion +1790 +overwhelmed +aerospace +oaks +1795 +showcase +acknowledge +recovering +nolan +ashe +hurts +geology +fashioned +disappearance +farewell +swollen +shrug +marquis +wimbledon +124 +rue +1792 +commemorate +reduces +experiencing +inevitable +calcutta +intel +##court +murderer +sticking +fisheries +imagery +bloom +280 +brake +##inus +gustav +hesitation +memorable +po +viral +beans +accidents +tunisia +antenna +spilled +consort +treatments +aye +perimeter +##gard +donation +hostage +migrated +banker +addiction +apex +lil +trout +##ously +conscience +##nova +rams +sands +genome +passionate +troubles +##lets +##set +amid +##ibility +##ret +higgins +exceed +vikings +##vie +payne +##zan +muscular +##ste +defendant +sucking +##wal +ibrahim +fuselage +claudia +vfl +europeans +snails +interval +##garh +preparatory +statewide +tasked +lacrosse +viktor +##lation +angola +##hra +flint +implications +employs +teens +patrons +stall +weekends +barriers +scrambled +nucleus +tehran +jenna +parsons +lifelong +robots +displacement +5000 +##bles +precipitation +##gt +knuckles +clutched +1802 +marrying +ecology +marx +accusations +declare +scars +kolkata +mat +meadows +bermuda +skeleton +finalists +vintage +crawl +coordinate +affects +subjected +orchestral +mistaken +##tc +mirrors +dipped +relied +260 +arches +candle +##nick +incorporating +wildly +fond +basilica +owl +fringe +rituals +whispering +stirred +feud +tertiary +slick +goat +honorable +whereby +skip +ricardo +stripes +parachute +adjoining +submerged +synthesizer +##gren +intend +positively +ninety +phi +beaver +partition +fellows +alexis +prohibition +carlisle +bizarre +fraternity +##bre +doubts +icy +cbc +aquatic +sneak +sonny +combines +airports +crude +supervised +spatial +merge +alfonso +##bic +corrupt +scan +undergo +##ams +disabilities +colombian +comparing +dolphins +perkins +##lish +reprinted +unanimous +bounced +hairs +underworld +midwest +semester +bucket +paperback +miniseries +coventry +demise +##leigh +demonstrations +sensor +rotating +yan +##hler +arrange +soils +##idge +hyderabad +labs +##dr +brakes +grandchildren +##nde +negotiated +rover +ferrari +continuation +directorate +augusta +stevenson +counterpart +gore +##rda +nursery +rican +ave +collectively +broadly +pastoral +repertoire +asserted +discovering +nordic +styled +fiba +cunningham +harley +middlesex +survives +tumor +tempo +zack +aiming +lok +urgent +##rade +##nto +devils +##ement +contractor +turin +##wl +##ool +bliss +repaired +simmons +moan +astronomical +cr +negotiate +lyric +1890s +lara +bred +clad +angus +pbs +##ience +engineered +posed +##lk +hernandez +possessions +elbows +psychiatric +strokes +confluence +electorate +lifts +campuses +lava +alps +##ep +##ution +##date +physicist +woody +##page +##ographic +##itis +juliet +reformation +sparhawk +320 +complement +suppressed +jewel +##½ +floated +##kas +continuity +sadly +##ische +inability +melting +scanning +paula +flour +judaism +safer +vague +##lm +solving +curb +##stown +financially +gable +bees +expired +miserable +cassidy +dominion +1789 +cupped +145 +robbery +facto +amos +warden +resume +tallest +marvin +ing +pounded +usd +declaring +gasoline +##aux +darkened +270 +650 +sophomore +##mere +erection +gossip +televised +risen +dial +##eu +pillars +##link +passages +profound +##tina +arabian +ashton +silicon +nail +##ead +##lated +##wer +##hardt +fleming +firearms +ducked +circuits +blows +waterloo +titans +##lina +atom +fireplace +cheshire +financed +activation +algorithms +##zzi +constituent +catcher +cherokee +partnerships +sexuality +platoon +tragic +vivian +guarded +whiskey +meditation +poetic +##late +##nga +##ake +porto +listeners +dominance +kendra +mona +chandler +factions +22nd +salisbury +attitudes +derivative +##ido +##haus +intake +paced +javier +illustrator +barrels +bias +cockpit +burnett +dreamed +ensuing +##anda +receptors +someday +hawkins +mattered +##lal +slavic +1799 +jesuit +cameroon +wasted +tai +wax +lowering +victorious +freaking +outright +hancock +librarian +sensing +bald +calcium +myers +tablet +announcing +barack +shipyard +pharmaceutical +##uan +greenwich +flush +medley +patches +wolfgang +pt +speeches +acquiring +exams +nikolai +##gg +hayden +kannada +##type +reilly +##pt +waitress +abdomen +devastated +capped +pseudonym +pharmacy +fulfill +paraguay +1796 +clicked +##trom +archipelago +syndicated +##hman +lumber +orgasm +rejection +clifford +lorraine +advent +mafia +rodney +brock +##ght +##used +##elia +cassette +chamberlain +despair +mongolia +sensors +developmental +upstream +##eg +##alis +spanning +165 +trombone +basque +seeded +interred +renewable +rhys +leapt +revision +molecule +##ages +chord +vicious +nord +shivered +23rd +arlington +debts +corpus +sunrise +bays +blackburn +centimetres +##uded +shuddered +gm +strangely +gripping +cartoons +isabelle +orbital +##ppa +seals +proving +##lton +refusal +strengthened +bust +assisting +baghdad +batsman +portrayal +mara +pushes +spears +og +##cock +reside +nathaniel +brennan +1776 +confirmation +caucus +##worthy +markings +yemen +nobles +ku +lazy +viewer +catalan +encompasses +sawyer +##fall +sparked +substances +patents +braves +arranger +evacuation +sergio +persuade +dover +tolerance +penguin +cum +jockey +insufficient +townships +occupying +declining +plural +processed +projection +puppet +flanders +introduces +liability +##yon +gymnastics +antwerp +taipei +hobart +candles +jeep +wes +observers +126 +chaplain +bundle +glorious +##hine +hazel +flung +sol +excavations +dumped +stares +sh +bangalore +triangular +icelandic +intervals +expressing +turbine +##vers +songwriting +crafts +##igo +jasmine +ditch +rite +##ways +entertaining +comply +sorrow +wrestlers +basel +emirates +marian +rivera +helpful +##some +caution +downward +networking +##atory +##tered +darted +genocide +emergence +replies +specializing +spokesman +convenient +unlocked +fading +augustine +concentrations +resemblance +elijah +investigator +andhra +##uda +promotes +bean +##rrell +fleeing +wan +simone +announcer +##ame +##bby +lydia +weaver +132 +residency +modification +##fest +stretches +##ast +alternatively +nat +lowe +lacks +##ented +pam +tile +concealed +inferior +abdullah +residences +tissues +vengeance +##ided +moisture +peculiar +groove +zip +bologna +jennings +ninja +oversaw +zombies +pumping +batch +livingston +emerald +installations +1797 +peel +nitrogen +rama +##fying +##star +schooling +strands +responding +werner +##ost +lime +casa +accurately +targeting +##rod +underway +##uru +hemisphere +lester +##yard +occupies +2d +griffith +angrily +reorganized +##owing +courtney +deposited +##dd +##30 +estadio +##ifies +dunn +exiled +##ying +checks +##combe +##о +##fly +successes +unexpectedly +blu +assessed +##flower +##ه +observing +sacked +spiders +kn +##tail +mu +nodes +prosperity +audrey +divisional +155 +broncos +tangled +adjust +feeds +erosion +paolo +surf +directory +snatched +humid +admiralty +screwed +gt +reddish +##nese +modules +trench +lamps +bind +leah +bucks +competes +##nz +##form +transcription +##uc +isles +violently +clutching +pga +cyclist +inflation +flats +ragged +unnecessary +##hian +stubborn +coordinated +harriet +baba +disqualified +330 +insect +wolfe +##fies +reinforcements +rocked +duel +winked +embraced +bricks +##raj +hiatus +defeats +pending +brightly +jealousy +##xton +##hm +##uki +lena +gdp +colorful +##dley +stein +kidney +##shu +underwear +wanderers +##haw +##icus +guardians +m³ +roared +habits +##wise +permits +gp +uranium +punished +disguise +bundesliga +elise +dundee +erotic +partisan +pi +collectors +float +individually +rendering +behavioral +bucharest +ser +hare +valerie +corporal +nutrition +proportional +##isa +immense +##kis +pavement +##zie +##eld +sutherland +crouched +1775 +##lp +suzuki +trades +endurance +operas +crosby +prayed +priory +rory +socially +##urn +gujarat +##pu +walton +cube +pasha +privilege +lennon +floods +thorne +waterfall +nipple +scouting +approve +##lov +minorities +voter +dwight +extensions +assure +ballroom +slap +dripping +privileges +rejoined +confessed +demonstrating +patriotic +yell +investor +##uth +pagan +slumped +squares +##cle +##kins +confront +bert +embarrassment +##aid +aston +urging +sweater +starr +yuri +brains +williamson +commuter +mortar +structured +selfish +exports +##jon +cds +##him +unfinished +##rre +mortgage +destinations +##nagar +canoe +solitary +buchanan +delays +magistrate +fk +##pling +motivation +##lier +##vier +recruiting +assess +##mouth +malik +antique +1791 +pius +rahman +reich +tub +zhou +smashed +airs +galway +xii +conditioning +honduras +discharged +dexter +##pf +lionel +129 +debates +lemon +tiffany +volunteered +dom +dioxide +procession +devi +sic +tremendous +advertisements +colts +transferring +verdict +hanover +decommissioned +utter +relate +pac +racism +##top +beacon +limp +similarity +terra +occurrence +ant +##how +becky +capt +updates +armament +richie +pal +##graph +halloween +mayo +##ssen +##bone +cara +serena +fcc +dolls +obligations +##dling +violated +lafayette +jakarta +exploitation +##ime +infamous +iconic +##lah +##park +kitty +moody +reginald +dread +spill +crystals +olivier +modeled +bluff +equilibrium +separating +notices +ordnance +extinction +onset +cosmic +attachment +sammy +expose +privy +anchored +##bil +abbott +admits +bending +baritone +emmanuel +policeman +vaughan +winged +climax +dresses +denny +polytechnic +mohamed +burmese +authentic +nikki +genetics +grandparents +homestead +gaza +postponed +metacritic +una +##sby +##bat +unstable +dissertation +##rial +##cian +curls +obscure +uncovered +bronx +praying +disappearing +##hoe +prehistoric +coke +turret +mutations +nonprofit +pits +monaco +##ي +##usion +prominently +dispatched +podium +##mir +uci +##uation +133 +fortifications +birthplace +kendall +##lby +##oll +preacher +rack +goodman +##rman +persistent +##ott +countless +jaime +recorder +lexington +persecution +jumps +renewal +wagons +##11 +crushing +##holder +decorations +##lake +abundance +wrath +laundry +£1 +garde +##rp +jeanne +beetles +peasant +##sl +splitting +caste +sergei +##rer +##ema +scripts +##ively +rub +satellites +##vor +inscribed +verlag +scrapped +gale +packages +chick +potato +slogan +kathleen +arabs +##culture +counterparts +reminiscent +choral +##tead +rand +retains +bushes +dane +accomplish +courtesy +closes +##oth +slaughter +hague +krakow +lawson +tailed +elias +ginger +##ttes +canopy +betrayal +rebuilding +turf +##hof +frowning +allegiance +brigades +kicks +rebuild +polls +alias +nationalism +td +rowan +audition +bowie +fortunately +recognizes +harp +dillon +horrified +##oro +renault +##tics +ropes +##α +presumed +rewarded +infrared +wiping +accelerated +illustration +##rid +presses +practitioners +badminton +##iard +detained +##tera +recognizing +relates +misery +##sies +##tly +reproduction +piercing +potatoes +thornton +esther +manners +hbo +##aan +ours +bullshit +ernie +perennial +sensitivity +illuminated +rupert +##jin +##iss +##ear +rfc +nassau +##dock +staggered +socialism +##haven +appointments +nonsense +prestige +sharma +haul +##tical +solidarity +gps +##ook +##rata +igor +pedestrian +##uit +baxter +tenants +wires +medication +unlimited +guiding +impacts +diabetes +##rama +sasha +pas +clive +extraction +131 +continually +constraints +##bilities +sonata +hunted +sixteenth +chu +planting +quote +mayer +pretended +abs +spat +##hua +ceramic +##cci +curtains +pigs +pitching +##dad +latvian +sore +dayton +##sted +##qi +patrols +slice +playground +##nted +shone +stool +apparatus +inadequate +mates +treason +##ija +desires +##liga +##croft +somalia +laurent +mir +leonardo +oracle +grape +obliged +chevrolet +thirteenth +stunning +enthusiastic +##ede +accounted +concludes +currents +basil +##kovic +drought +##rica +mai +##aire +shove +posting +##shed +pilgrimage +humorous +packing +fry +pencil +wines +smells +144 +marilyn +aching +newest +clung +bon +neighbours +sanctioned +##pie +mug +##stock +drowning +##mma +hydraulic +##vil +hiring +reminder +lilly +investigators +##ncies +sour +##eous +compulsory +packet +##rion +##graphic +##elle +cannes +##inate +depressed +##rit +heroic +importantly +theresa +##tled +conway +saturn +marginal +rae +##xia +corresponds +royce +pact +jasper +explosives +packaging +aluminium +##ttered +denotes +rhythmic +spans +assignments +hereditary +outlined +originating +sundays +lad +reissued +greeting +beatrice +##dic +pillar +marcos +plots +handbook +alcoholic +judiciary +avant +slides +extract +masculine +blur +##eum +##force +homage +trembled +owens +hymn +trey +omega +signaling +socks +accumulated +reacted +attic +theo +lining +angie +distraction +primera +talbot +##key +1200 +ti +creativity +billed +##hey +deacon +eduardo +identifies +proposition +dizzy +gunner +hogan +##yam +##pping +##hol +ja +##chan +jensen +reconstructed +##berger +clearance +darius +##nier +abe +harlem +plea +dei +circled +emotionally +notation +fascist +neville +exceeded +upwards +viable +ducks +##fo +workforce +racer +limiting +shri +##lson +possesses +1600 +kerr +moths +devastating +laden +disturbing +locking +##cture +gal +fearing +accreditation +flavor +aide +1870s +mountainous +##baum +melt +##ures +motel +texture +servers +soda +##mb +herd +##nium +erect +puzzled +hum +peggy +examinations +gould +testified +geoff +ren +devised +sacks +##law +denial +posters +grunted +cesar +tutor +ec +gerry +offerings +byrne +falcons +combinations +ct +incoming +pardon +rocking +26th +avengers +flared +mankind +seller +uttar +loch +nadia +stroking +exposing +##hd +fertile +ancestral +instituted +##has +noises +prophecy +taxation +eminent +vivid +pol +##bol +dart +indirect +multimedia +notebook +upside +displaying +adrenaline +referenced +geometric +##iving +progression +##ddy +blunt +announce +##far +implementing +##lav +aggression +liaison +cooler +cares +headache +plantations +gorge +dots +impulse +thickness +ashamed +averaging +kathy +obligation +precursor +137 +fowler +symmetry +thee +225 +hears +##rai +undergoing +ads +butcher +bowler +##lip +cigarettes +subscription +goodness +##ically +browne +##hos +##tech +kyoto +donor +##erty +damaging +friction +drifting +expeditions +hardened +prostitution +152 +fauna +blankets +claw +tossing +snarled +butterflies +recruits +investigative +coated +healed +138 +communal +hai +xiii +academics +boone +psychologist +restless +lahore +stephens +mba +brendan +foreigners +printer +##pc +ached +explode +27th +deed +scratched +dared +##pole +cardiac +1780 +okinawa +proto +commando +compelled +oddly +electrons +##base +replica +thanksgiving +##rist +sheila +deliberate +stafford +tidal +representations +hercules +ou +##path +##iated +kidnapping +lenses +##tling +deficit +samoa +mouths +consuming +computational +maze +granting +smirk +razor +fixture +ideals +inviting +aiden +nominal +##vs +issuing +julio +pitt +ramsey +docks +##oss +exhaust +##owed +bavarian +draped +anterior +mating +ethiopian +explores +noticing +##nton +discarded +convenience +hoffman +endowment +beasts +cartridge +mormon +paternal +probe +sleeves +interfere +lump +deadline +##rail +jenks +bulldogs +scrap +alternating +justified +reproductive +nam +seize +descending +secretariat +kirby +coupe +grouped +smash +panther +sedan +tapping +##18 +lola +cheer +germanic +unfortunate +##eter +unrelated +##fan +subordinate +##sdale +suzanne +advertisement +##ility +horsepower +##lda +cautiously +discourse +luigi +##mans +##fields +noun +prevalent +mao +schneider +everett +surround +governorate +kira +##avia +westward +##take +misty +rails +sustainability +134 +unused +##rating +packs +toast +unwilling +regulate +thy +suffrage +nile +awe +assam +definitions +travelers +affordable +##rb +conferred +sells +undefeated +beneficial +torso +basal +repeating +remixes +##pass +bahrain +cables +fang +##itated +excavated +numbering +statutory +##rey +deluxe +##lian +forested +ramirez +derbyshire +zeus +slamming +transfers +astronomer +banana +lottery +berg +histories +bamboo +##uchi +resurrection +posterior +bowls +vaguely +##thi +thou +preserving +tensed +offence +##inas +meyrick +callum +ridden +watt +langdon +tying +lowland +snorted +daring +truman +##hale +##girl +aura +overly +filing +weighing +goa +infections +philanthropist +saunders +eponymous +##owski +latitude +perspectives +reviewing +mets +commandant +radial +##kha +flashlight +reliability +koch +vowels +amazed +ada +elaine +supper +##rth +##encies +predator +debated +soviets +cola +##boards +##nah +compartment +crooked +arbitrary +fourteenth +##ctive +havana +majors +steelers +clips +profitable +ambush +exited +packers +##tile +nude +cracks +fungi +##е +limb +trousers +josie +shelby +tens +frederic +##ος +definite +smoothly +constellation +insult +baton +discs +lingering +##nco +conclusions +lent +staging +becker +grandpa +shaky +##tron +einstein +obstacles +sk +adverse +elle +economically +##moto +mccartney +thor +dismissal +motions +readings +nostrils +treatise +##pace +squeezing +evidently +prolonged +1783 +venezuelan +je +marguerite +beirut +takeover +shareholders +##vent +denise +digit +airplay +norse +##bbling +imaginary +pills +hubert +blaze +vacated +eliminating +##ello +vine +mansfield +##tty +retrospective +barrow +borne +clutch +bail +forensic +weaving +##nett +##witz +desktop +citadel +promotions +worrying +dorset +ieee +subdivided +##iating +manned +expeditionary +pickup +synod +chuckle +185 +barney +##rz +##ffin +functionality +karachi +litigation +meanings +uc +lick +turbo +anders +##ffed +execute +curl +oppose +ankles +typhoon +##د +##ache +##asia +linguistics +compassion +pressures +grazing +perfection +##iting +immunity +monopoly +muddy +backgrounds +136 +namibia +francesca +monitors +attracting +stunt +tuition +##ии +vegetable +##mates +##quent +mgm +jen +complexes +forts +##ond +cellar +bites +seventeenth +royals +flemish +failures +mast +charities +##cular +peruvian +capitals +macmillan +ipswich +outward +frigate +postgraduate +folds +employing +##ouse +concurrently +fiery +##tai +contingent +nightmares +monumental +nicaragua +##kowski +lizard +mal +fielding +gig +reject +##pad +harding +##ipe +coastline +##cin +##nos +beethoven +humphrey +innovations +##tam +##nge +norris +doris +solicitor +huang +obey +141 +##lc +niagara +##tton +shelves +aug +bourbon +curry +nightclub +specifications +hilton +##ndo +centennial +dispersed +worm +neglected +briggs +sm +font +kuala +uneasy +plc +##nstein +##bound +##aking +##burgh +awaiting +pronunciation +##bbed +##quest +eh +optimal +zhu +raped +greens +presided +brenda +worries +##life +venetian +marxist +turnout +##lius +refined +braced +sins +grasped +sunderland +nickel +speculated +lowell +cyrillic +communism +fundraising +resembling +colonists +mutant +freddie +usc +##mos +gratitude +##run +mural +##lous +chemist +wi +reminds +28th +steals +tess +pietro +##ingen +promoter +ri +microphone +honoured +rai +sant +##qui +feather +##nson +burlington +kurdish +terrorists +deborah +sickness +##wed +##eet +hazard +irritated +desperation +veil +clarity +##rik +jewels +xv +##gged +##ows +##cup +berkshire +unfair +mysteries +orchid +winced +exhaustion +renovations +stranded +obe +infinity +##nies +adapt +redevelopment +thanked +registry +olga +domingo +noir +tudor +ole +##atus +commenting +behaviors +##ais +crisp +pauline +probable +stirling +wigan +##bian +paralympics +panting +surpassed +##rew +luca +barred +pony +famed +##sters +cassandra +waiter +carolyn +exported +##orted +andres +destructive +deeds +jonah +castles +vacancy +suv +##glass +1788 +orchard +yep +famine +belarusian +sprang +##forth +skinny +##mis +administrators +rotterdam +zambia +zhao +boiler +discoveries +##ride +##physics +lucius +disappointing +outreach +spoon +##frame +qualifications +unanimously +enjoys +regency +##iidae +stade +realism +veterinary +rodgers +dump +alain +chestnut +castile +censorship +rumble +gibbs +##itor +communion +reggae +inactivated +logs +loads +##houses +homosexual +##iano +ale +informs +##cas +phrases +plaster +linebacker +ambrose +kaiser +fascinated +850 +limerick +recruitment +forge +mastered +##nding +leinster +rooted +threaten +##strom +borneo +##hes +suggestions +scholarships +propeller +documentaries +patronage +coats +constructing +invest +neurons +comet +entirety +shouts +identities +annoying +unchanged +wary +##antly +##ogy +neat +oversight +##kos +phillies +replay +constance +##kka +incarnation +humble +skies +minus +##acy +smithsonian +##chel +guerrilla +jar +cadets +##plate +surplus +audit +##aru +cracking +joanna +louisa +pacing +##lights +intentionally +##iri +diner +nwa +imprint +australians +tong +unprecedented +bunker +naive +specialists +ark +nichols +railing +leaked +pedal +##uka +shrub +longing +roofs +v8 +captains +neural +tuned +##ntal +##jet +emission +medina +frantic +codex +definitive +sid +abolition +intensified +stocks +enrique +sustain +genoa +oxide +##written +clues +cha +##gers +tributaries +fragment +venom +##rity +##ente +##sca +muffled +vain +sire +laos +##ingly +##hana +hastily +snapping +surfaced +sentiment +motive +##oft +contests +approximate +mesa +luckily +dinosaur +exchanges +propelled +accord +bourne +relieve +tow +masks +offended +##ues +cynthia +##mmer +rains +bartender +zinc +reviewers +lois +##sai +legged +arrogant +rafe +rosie +comprise +handicap +blockade +inlet +lagoon +copied +drilling +shelley +petals +##inian +mandarin +obsolete +##inated +onward +arguably +productivity +cindy +praising +seldom +busch +discusses +raleigh +shortage +ranged +stanton +encouragement +firstly +conceded +overs +temporal +##uke +cbe +##bos +woo +certainty +pumps +##pton +stalked +##uli +lizzie +periodic +thieves +weaker +##night +gases +shoving +chooses +wc +##chemical +prompting +weights +##kill +robust +flanked +sticky +hu +tuberculosis +##eb +##eal +christchurch +resembled +wallet +reese +inappropriate +pictured +distract +fixing +fiddle +giggled +burger +heirs +hairy +mechanic +torque +apache +obsessed +chiefly +cheng +logging +##tag +extracted +meaningful +numb +##vsky +gloucestershire +reminding +##bay +unite +##lit +breeds +diminished +clown +glove +1860s +##ن +##ug +archibald +focal +freelance +sliced +depiction +##yk +organism +switches +sights +stray +crawling +##ril +lever +leningrad +interpretations +loops +anytime +reel +alicia +delighted +##ech +inhaled +xiv +suitcase +bernie +vega +licenses +northampton +exclusion +induction +monasteries +racecourse +homosexuality +##right +##sfield +##rky +dimitri +michele +alternatives +ions +commentators +genuinely +objected +pork +hospitality +fencing +stephan +warships +peripheral +wit +drunken +wrinkled +quentin +spends +departing +chung +numerical +spokesperson +##zone +johannesburg +caliber +killers +##udge +assumes +neatly +demographic +abigail +bloc +##vel +mounting +##lain +bentley +slightest +xu +recipients +##jk +merlin +##writer +seniors +prisons +blinking +hindwings +flickered +kappa +##hel +80s +strengthening +appealing +brewing +gypsy +mali +lashes +hulk +unpleasant +harassment +bio +treaties +predict +instrumentation +pulp +troupe +boiling +mantle +##ffe +ins +##vn +dividing +handles +verbs +##onal +coconut +senegal +340 +thorough +gum +momentarily +##sto +cocaine +panicked +destined +##turing +teatro +denying +weary +captained +mans +##hawks +##code +wakefield +bollywood +thankfully +##16 +cyril +##wu +amendments +##bahn +consultation +stud +reflections +kindness +1787 +internally +##ovo +tex +mosaic +distribute +paddy +seeming +143 +##hic +piers +##15 +##mura +##verse +popularly +winger +kang +sentinel +mccoy +##anza +covenant +##bag +verge +fireworks +suppress +thrilled +dominate +##jar +swansea +##60 +142 +reconciliation +##ndi +stiffened +cue +dorian +##uf +damascus +amor +ida +foremost +##aga +porsche +unseen +dir +##had +##azi +stony +lexi +melodies +##nko +angular +integer +podcast +ants +inherent +jaws +justify +persona +##olved +josephine +##nr +##ressed +customary +flashes +gala +cyrus +glaring +backyard +ariel +physiology +greenland +html +stir +avon +atletico +finch +methodology +ked +##lent +mas +catholicism +townsend +branding +quincy +fits +containers +1777 +ashore +aragon +##19 +forearm +poisoning +##sd +adopting +conquer +grinding +amnesty +keller +finances +evaluate +forged +lankan +instincts +##uto +guam +bosnian +photographed +workplace +desirable +protector +##dog +allocation +intently +encourages +willy +##sten +bodyguard +electro +brighter +##ν +bihar +##chev +lasts +opener +amphibious +sal +verde +arte +##cope +captivity +vocabulary +yields +##tted +agreeing +desmond +pioneered +##chus +strap +campaigned +railroads +##ович +emblem +##dre +stormed +501 +##ulous +marijuana +northumberland +##gn +##nath +bowen +landmarks +beaumont +##qua +danube +##bler +attorneys +th +ge +flyers +critique +villains +cass +mutation +acc +##0s +colombo +mckay +motif +sampling +concluding +syndicate +##rell +neon +stables +ds +warnings +clint +mourning +wilkinson +##tated +merrill +leopard +evenings +exhaled +emil +sonia +ezra +discrete +stove +farrell +fifteenth +prescribed +superhero +##rier +worms +helm +wren +##duction +##hc +expo +##rator +hq +unfamiliar +antony +prevents +acceleration +fiercely +mari +painfully +calculations +cheaper +ign +clifton +irvine +davenport +mozambique +##np +pierced +##evich +wonders +##wig +##cate +##iling +crusade +ware +##uel +enzymes +reasonably +mls +##coe +mater +ambition +bunny +eliot +kernel +##fin +asphalt +headmaster +torah +aden +lush +pins +waived +##care +##yas +joao +substrate +enforce +##grad +##ules +alvarez +selections +epidemic +tempted +##bit +bremen +translates +ensured +waterfront +29th +forrest +manny +malone +kramer +reigning +cookies +simpler +absorption +205 +engraved +##ffy +evaluated +1778 +haze +146 +comforting +crossover +##abe +thorn +##rift +##imo +##pop +suppression +fatigue +cutter +##tr +201 +wurttemberg +##orf +enforced +hovering +proprietary +gb +samurai +syllable +ascent +lacey +tick +lars +tractor +merchandise +rep +bouncing +defendants +##yre +huntington +##ground +##oko +standardized +##hor +##hima +assassinated +nu +predecessors +rainy +liar +assurance +lyrical +##uga +secondly +flattened +ios +parameter +undercover +##mity +bordeaux +punish +ridges +markers +exodus +inactive +hesitate +debbie +nyc +pledge +savoy +nagar +offset +organist +##tium +hesse +marin +converting +##iver +diagram +propulsion +pu +validity +reverted +supportive +##dc +ministries +clans +responds +proclamation +##inae +##ø +##rea +ein +pleading +patriot +sf +birch +islanders +strauss +hates +##dh +brandenburg +concession +rd +##ob +1900s +killings +textbook +antiquity +cinematography +wharf +embarrassing +setup +creed +farmland +inequality +centred +signatures +fallon +370 +##ingham +##uts +ceylon +gazing +directive +laurie +##tern +globally +##uated +##dent +allah +excavation +threads +##cross +148 +frantically +icc +utilize +determines +respiratory +thoughtful +receptions +##dicate +merging +chandra +seine +147 +builders +builds +diagnostic +dev +visibility +goddamn +analyses +dhaka +cho +proves +chancel +concurrent +curiously +canadians +pumped +restoring +1850s +turtles +jaguar +sinister +spinal +traction +declan +vows +1784 +glowed +capitalism +swirling +install +universidad +##lder +##oat +soloist +##genic +##oor +coincidence +beginnings +nissan +dip +resorts +caucasus +combustion +infectious +##eno +pigeon +serpent +##itating +conclude +masked +salad +jew +##gr +surreal +toni +##wc +harmonica +151 +##gins +##etic +##coat +fishermen +intending +bravery +##wave +klaus +titan +wembley +taiwanese +ransom +40th +incorrect +hussein +eyelids +jp +cooke +dramas +utilities +##etta +##print +eisenhower +principally +granada +lana +##rak +openings +concord +##bl +bethany +connie +morality +sega +##mons +##nard +earnings +##kara +##cine +wii +communes +##rel +coma +composing +softened +severed +grapes +##17 +nguyen +analyzed +warlord +hubbard +heavenly +behave +slovenian +##hit +##ony +hailed +filmmakers +trance +caldwell +skye +unrest +coward +likelihood +##aging +bern +sci +taliban +honolulu +propose +##wang +1700 +browser +imagining +cobra +contributes +dukes +instinctively +conan +violinist +##ores +accessories +gradual +##amp +quotes +sioux +##dating +undertake +intercepted +sparkling +compressed +139 +fungus +tombs +haley +imposing +rests +degradation +lincolnshire +retailers +wetlands +tulsa +distributor +dungeon +nun +greenhouse +convey +atlantis +aft +exits +oman +dresser +lyons +##sti +joking +eddy +judgement +omitted +digits +##cts +##game +juniors +##rae +cents +stricken +une +##ngo +wizards +weir +breton +nan +technician +fibers +liking +royalty +##cca +154 +persia +terribly +magician +##rable +##unt +vance +cafeteria +booker +camille +warmer +##static +consume +cavern +gaps +compass +contemporaries +foyer +soothing +graveyard +maj +plunged +blush +##wear +cascade +demonstrates +ordinance +##nov +boyle +##lana +rockefeller +shaken +banjo +izzy +##ense +breathless +vines +##32 +##eman +alterations +chromosome +dwellings +feudal +mole +153 +catalonia +relics +tenant +mandated +##fm +fridge +hats +honesty +patented +raul +heap +cruisers +accusing +enlightenment +infants +wherein +chatham +contractors +zen +affinity +hc +osborne +piston +156 +traps +maturity +##rana +lagos +##zal +peering +##nay +attendant +dealers +protocols +subset +prospects +biographical +##cre +artery +##zers +insignia +nuns +endured +##eration +recommend +schwartz +serbs +berger +cromwell +crossroads +##ctor +enduring +clasped +grounded +##bine +marseille +twitched +abel +choke +https +catalyst +moldova +italians +##tist +disastrous +wee +##oured +##nti +wwf +nope +##piration +##asa +expresses +thumbs +167 +##nza +coca +1781 +cheating +##ption +skipped +sensory +heidelberg +spies +satan +dangers +semifinal +202 +bohemia +whitish +confusing +shipbuilding +relies +surgeons +landings +ravi +baku +moor +suffix +alejandro +##yana +litre +upheld +##unk +rajasthan +##rek +coaster +insists +posture +scenarios +etienne +favoured +appoint +transgender +elephants +poked +greenwood +defences +fulfilled +militant +somali +1758 +chalk +potent +##ucci +migrants +wink +assistants +nos +restriction +activism +niger +##ario +colon +shaun +##sat +daphne +##erated +swam +congregations +reprise +considerations +magnet +playable +xvi +##р +overthrow +tobias +knob +chavez +coding +##mers +propped +katrina +orient +newcomer +##suke +temperate +##pool +farmhouse +interrogation +##vd +committing +##vert +forthcoming +strawberry +joaquin +macau +ponds +shocking +siberia +##cellular +chant +contributors +##nant +##ologists +sped +absorb +hail +1782 +spared +##hore +barbados +karate +opus +originates +saul +##xie +evergreen +leaped +##rock +correlation +exaggerated +weekday +unification +bump +tracing +brig +afb +pathways +utilizing +##ners +mod +mb +disturbance +kneeling +##stad +##guchi +100th +pune +##thy +decreasing +168 +manipulation +miriam +academia +ecosystem +occupational +rbi +##lem +rift +##14 +rotary +stacked +incorporation +awakening +generators +guerrero +racist +##omy +cyber +derivatives +culminated +allie +annals +panzer +sainte +wikipedia +pops +zu +austro +##vate +algerian +politely +nicholson +mornings +educate +tastes +thrill +dartmouth +##gating +db +##jee +regan +differing +concentrating +choreography +divinity +##media +pledged +alexandre +routing +gregor +madeline +##idal +apocalypse +##hora +gunfire +culminating +elves +fined +liang +lam +programmed +tar +guessing +transparency +gabrielle +##gna +cancellation +flexibility +##lining +accession +shea +stronghold +nets +specializes +##rgan +abused +hasan +sgt +ling +exceeding +##₄ +admiration +supermarket +##ark +photographers +specialised +tilt +resonance +hmm +perfume +380 +sami +threatens +garland +botany +guarding +boiled +greet +puppy +russo +supplier +wilmington +vibrant +vijay +##bius +paralympic +grumbled +paige +faa +licking +margins +hurricanes +##gong +fest +grenade +ripping +##uz +counseling +weigh +##sian +needles +wiltshire +edison +costly +##not +fulton +tramway +redesigned +staffordshire +cache +gasping +watkins +sleepy +candidacy +##group +monkeys +timeline +throbbing +##bid +##sos +berth +uzbekistan +vanderbilt +bothering +overturned +ballots +gem +##iger +sunglasses +subscribers +hooker +compelling +ang +exceptionally +saloon +stab +##rdi +carla +terrifying +rom +##vision +coil +##oids +satisfying +vendors +31st +mackay +deities +overlooked +ambient +bahamas +felipe +olympia +whirled +botanist +advertised +tugging +##dden +disciples +morales +unionist +rites +foley +morse +motives +creepy +##₀ +soo +##sz +bargain +highness +frightening +turnpike +tory +reorganization +##cer +depict +biographer +##walk +unopposed +manifesto +##gles +institut +emile +accidental +kapoor +##dam +kilkenny +cortex +lively +##13 +romanesque +jain +shan +cannons +##ood +##ske +petrol +echoing +amalgamated +disappears +cautious +proposes +sanctions +trenton +##ر +flotilla +aus +contempt +tor +canary +cote +theirs +##hun +conceptual +deleted +fascinating +paso +blazing +elf +honourable +hutchinson +##eiro +##outh +##zin +surveyor +tee +amidst +wooded +reissue +intro +##ono +cobb +shelters +newsletter +hanson +brace +encoding +confiscated +dem +caravan +marino +scroll +melodic +cows +imam +##adi +##aneous +northward +searches +biodiversity +cora +310 +roaring +##bers +connell +theologian +halo +compose +pathetic +unmarried +dynamo +##oot +az +calculation +toulouse +deserves +humour +nr +forgiveness +tam +undergone +martyr +pamela +myths +whore +counselor +hicks +290 +heavens +battleship +electromagnetic +##bbs +stellar +establishments +presley +hopped +##chin +temptation +90s +wills +nas +##yuan +nhs +##nya +seminars +##yev +adaptations +gong +asher +lex +indicator +sikh +tobago +cites +goin +##yte +satirical +##gies +characterised +correspond +bubbles +lure +participates +##vid +eruption +skate +therapeutic +1785 +canals +wholesale +defaulted +sac +460 +petit +##zzled +virgil +leak +ravens +256 +portraying +##yx +ghetto +creators +dams +portray +vicente +##rington +fae +namesake +bounty +##arium +joachim +##ota +##iser +aforementioned +axle +snout +depended +dismantled +reuben +480 +##ibly +gallagher +##lau +##pd +earnest +##ieu +##iary +inflicted +objections +##llar +asa +gritted +##athy +jericho +##sea +##was +flick +underside +ceramics +undead +substituted +195 +eastward +undoubtedly +wheeled +chimney +##iche +guinness +cb +##ager +siding +##bell +traitor +baptiste +disguised +inauguration +149 +tipperary +choreographer +perched +warmed +stationary +eco +##ike +##ntes +bacterial +##aurus +flores +phosphate +##core +attacker +invaders +alvin +intersects +a1 +indirectly +immigrated +businessmen +cornelius +valves +narrated +pill +sober +ul +nationale +monastic +applicants +scenery +##jack +161 +motifs +constitutes +cpu +##osh +jurisdictions +sd +tuning +irritation +woven +##uddin +fertility +gao +##erie +antagonist +impatient +glacial +hides +boarded +denominations +interception +##jas +cookie +nicola +##tee +algebraic +marquess +bahn +parole +buyers +bait +turbines +paperwork +bestowed +natasha +renee +oceans +purchases +157 +vaccine +215 +##tock +fixtures +playhouse +integrate +jai +oswald +intellectuals +##cky +booked +nests +mortimer +##isi +obsession +sept +##gler +##sum +440 +scrutiny +simultaneous +squinted +##shin +collects +oven +shankar +penned +remarkably +##я +slips +luggage +spectral +1786 +collaborations +louie +consolidation +##ailed +##ivating +420 +hoover +blackpool +harness +ignition +vest +tails +belmont +mongol +skinner +##nae +visually +mage +derry +##tism +##unce +stevie +transitional +##rdy +redskins +drying +prep +prospective +##21 +annoyance +oversee +##loaded +fills +##books +##iki +announces +fda +scowled +respects +prasad +mystic +tucson +##vale +revue +springer +bankrupt +1772 +aristotle +salvatore +habsburg +##geny +dal +natal +nut +pod +chewing +darts +moroccan +walkover +rosario +lenin +punjabi +##ße +grossed +scattering +wired +invasive +hui +polynomial +corridors +wakes +gina +portrays +##cratic +arid +retreating +erich +irwin +sniper +##dha +linen +lindsey +maneuver +butch +shutting +socio +bounce +commemorative +postseason +jeremiah +pines +275 +mystical +beads +bp +abbas +furnace +bidding +consulted +assaulted +empirical +rubble +enclosure +sob +weakly +cancel +polly +yielded +##emann +curly +prediction +battered +70s +vhs +jacqueline +render +sails +barked +detailing +grayson +riga +sloane +raging +##yah +herbs +bravo +##athlon +alloy +giggle +imminent +suffers +assumptions +waltz +##itate +accomplishments +##ited +bathing +remixed +deception +prefix +##emia +deepest +##tier +##eis +balkan +frogs +##rong +slab +##pate +philosophers +peterborough +grains +imports +dickinson +rwanda +##atics +1774 +dirk +lan +tablets +##rove +clone +##rice +caretaker +hostilities +mclean +##gre +regimental +treasures +norms +impose +tsar +tango +diplomacy +variously +complain +192 +recognise +arrests +1779 +celestial +pulitzer +##dus +bing +libretto +##moor +adele +splash +##rite +expectation +lds +confronts +##izer +spontaneous +harmful +wedge +entrepreneurs +buyer +##ope +bilingual +translate +rugged +conner +circulated +uae +eaton +##gra +##zzle +lingered +lockheed +vishnu +reelection +alonso +##oom +joints +yankee +headline +cooperate +heinz +laureate +invading +##sford +echoes +scandinavian +##dham +hugging +vitamin +salute +micah +hind +trader +##sper +radioactive +##ndra +militants +poisoned +ratified +remark +campeonato +deprived +wander +prop +##dong +outlook +##tani +##rix +##eye +chiang +darcy +##oping +mandolin +spice +statesman +babylon +182 +walled +forgetting +afro +##cap +158 +giorgio +buffer +##polis +planetary +##gis +overlap +terminals +kinda +centenary +##bir +arising +manipulate +elm +ke +1770 +ak +##tad +chrysler +mapped +moose +pomeranian +quad +macarthur +assemblies +shoreline +recalls +stratford +##rted +noticeable +##evic +imp +##rita +##sque +accustomed +supplying +tents +disgusted +vogue +sipped +filters +khz +reno +selecting +luftwaffe +mcmahon +tyne +masterpiece +carriages +collided +dunes +exercised +flare +remembers +muzzle +##mobile +heck +##rson +burgess +lunged +middleton +boycott +bilateral +##sity +hazardous +lumpur +multiplayer +spotlight +jackets +goldman +liege +porcelain +rag +waterford +benz +attracts +hopeful +battling +ottomans +kensington +baked +hymns +cheyenne +lattice +levine +borrow +polymer +clashes +michaels +monitored +commitments +denounced +##25 +##von +cavity +##oney +hobby +akin +##holders +futures +intricate +cornish +patty +##oned +illegally +dolphin +##lag +barlow +yellowish +maddie +apologized +luton +plagued +##puram +nana +##rds +sway +fanny +łodz +##rino +psi +suspicions +hanged +##eding +initiate +charlton +##por +nak +competent +235 +analytical +annex +wardrobe +reservations +##rma +sect +162 +fairfax +hedge +piled +buckingham +uneven +bauer +simplicity +snyder +interpret +accountability +donors +moderately +byrd +continents +##cite +##max +disciple +hr +jamaican +ping +nominees +##uss +mongolian +diver +attackers +eagerly +ideological +pillows +miracles +apartheid +revolver +sulfur +clinics +moran +163 +##enko +ile +katy +rhetoric +##icated +chronology +recycling +##hrer +elongated +mughal +pascal +profiles +vibration +databases +domination +##fare +##rant +matthias +digest +rehearsal +polling +weiss +initiation +reeves +clinging +flourished +impress +ngo +##hoff +##ume +buckley +symposium +rhythms +weed +emphasize +transforming +##taking +##gence +##yman +accountant +analyze +flicker +foil +priesthood +voluntarily +decreases +##80 +##hya +slater +sv +charting +mcgill +##lde +moreno +##iu +besieged +zur +robes +##phic +admitting +api +deported +turmoil +peyton +earthquakes +##ares +nationalists +beau +clair +brethren +interrupt +welch +curated +galerie +requesting +164 +##ested +impending +steward +viper +##vina +complaining +beautifully +brandy +foam +nl +1660 +##cake +alessandro +punches +laced +explanations +##lim +attribute +clit +reggie +discomfort +##cards +smoothed +whales +##cene +adler +countered +duffy +disciplinary +widening +recipe +reliance +conducts +goats +gradient +preaching +##shaw +matilda +quasi +striped +meridian +cannabis +cordoba +certificates +##agh +##tering +graffiti +hangs +pilgrims +repeats +##ych +revive +urine +etat +##hawk +fueled +belts +fuzzy +susceptible +##hang +mauritius +salle +sincere +beers +hooks +##cki +arbitration +entrusted +advise +sniffed +seminar +junk +donnell +processors +principality +strapped +celia +mendoza +everton +fortunes +prejudice +starving +reassigned +steamer +##lund +tuck +evenly +foreman +##ffen +dans +375 +envisioned +slit +##xy +baseman +liberia +rosemary +##weed +electrified +periodically +potassium +stride +contexts +sperm +slade +mariners +influx +bianca +subcommittee +##rane +spilling +icao +estuary +##nock +delivers +iphone +##ulata +isa +mira +bohemian +dessert +##sbury +welcoming +proudly +slowing +##chs +musee +ascension +russ +##vian +waits +##psy +africans +exploit +##morphic +gov +eccentric +crab +peck +##ull +entrances +formidable +marketplace +groom +bolted +metabolism +patton +robbins +courier +payload +endure +##ifier +andes +refrigerator +##pr +ornate +##uca +ruthless +illegitimate +masonry +strasbourg +bikes +adobe +##³ +apples +quintet +willingly +niche +bakery +corpses +energetic +##cliffe +##sser +##ards +177 +centimeters +centro +fuscous +cretaceous +rancho +##yde +andrei +telecom +tottenham +oasis +ordination +vulnerability +presiding +corey +cp +penguins +sims +##pis +malawi +piss +##48 +correction +##cked +##ffle +##ryn +countdown +detectives +psychiatrist +psychedelic +dinosaurs +blouse +##get +choi +vowed +##oz +randomly +##pol +49ers +scrub +blanche +bruins +dusseldorf +##using +unwanted +##ums +212 +dominique +elevations +headlights +om +laguna +##oga +1750 +famously +ignorance +shrewsbury +##aine +ajax +breuning +che +confederacy +greco +overhaul +##screen +paz +skirts +disagreement +cruelty +jagged +phoebe +shifter +hovered +viruses +##wes +mandy +##lined +##gc +landlord +squirrel +dashed +##ι +ornamental +gag +wally +grange +literal +spurs +undisclosed +proceeding +yin +##text +billie +orphan +spanned +humidity +indy +weighted +presentations +explosions +lucian +##tary +vaughn +hindus +##anga +##hell +psycho +171 +daytona +protects +efficiently +rematch +sly +tandem +##oya +rebranded +impaired +hee +metropolis +peach +godfrey +diaspora +ethnicity +prosperous +gleaming +dar +grossing +playback +##rden +stripe +pistols +##tain +births +labelled +##cating +172 +rudy +alba +##onne +aquarium +hostility +##gb +##tase +shudder +sumatra +hardest +lakers +consonant +creeping +demos +homicide +capsule +zeke +liberties +expulsion +pueblo +##comb +trait +transporting +##ddin +##neck +##yna +depart +gregg +mold +ledge +hangar +oldham +playboy +termination +analysts +gmbh +romero +##itic +insist +cradle +filthy +brightness +slash +shootout +deposed +bordering +##truct +isis +microwave +tumbled +sheltered +cathy +werewolves +messy +andersen +convex +clapped +clinched +satire +wasting +edo +vc +rufus +##jak +mont +##etti +poznan +##keeping +restructuring +transverse +##rland +azerbaijani +slovene +gestures +roommate +choking +shear +##quist +vanguard +oblivious +##hiro +disagreed +baptism +##lich +coliseum +##aceae +salvage +societe +cory +locke +relocation +relying +versailles +ahl +swelling +##elo +cheerful +##word +##edes +gin +sarajevo +obstacle +diverted +##nac +messed +thoroughbred +fluttered +utrecht +chewed +acquaintance +assassins +dispatch +mirza +##wart +nike +salzburg +swell +yen +##gee +idle +ligue +samson +##nds +##igh +playful +spawned +##cise +tease +##case +burgundy +##bot +stirring +skeptical +interceptions +marathi +##dies +bedrooms +aroused +pinch +##lik +preferences +tattoos +buster +digitally +projecting +rust +##ital +kitten +priorities +addison +pseudo +##guard +dusk +icons +sermon +##psis +##iba +bt +##lift +##xt +ju +truce +rink +##dah +##wy +defects +psychiatry +offences +calculate +glucose +##iful +##rized +##unda +francaise +##hari +richest +warwickshire +carly +1763 +purity +redemption +lending +##cious +muse +bruises +cerebral +aero +carving +##name +preface +terminology +invade +monty +##int +anarchist +blurred +##iled +rossi +treats +guts +shu +foothills +ballads +undertaking +premise +cecilia +affiliates +blasted +conditional +wilder +minors +drone +rudolph +buffy +swallowing +horton +attested +##hop +rutherford +howell +primetime +livery +penal +##bis +minimize +hydro +wrecked +wrought +palazzo +##gling +cans +vernacular +friedman +nobleman +shale +walnut +danielle +##ection +##tley +sears +##kumar +chords +lend +flipping +streamed +por +dracula +gallons +sacrifices +gamble +orphanage +##iman +mckenzie +##gible +boxers +daly +##balls +##ان +208 +##ific +##rative +##iq +exploited +slated +##uity +circling +hillary +pinched +goldberg +provost +campaigning +lim +piles +ironically +jong +mohan +successors +usaf +##tem +##ught +autobiographical +haute +preserves +##ending +acquitted +comparisons +203 +hydroelectric +gangs +cypriot +torpedoes +rushes +chrome +derive +bumps +instability +fiat +pets +##mbe +silas +dye +reckless +settler +##itation +info +heats +##writing +176 +canonical +maltese +fins +mushroom +stacy +aspen +avid +##kur +##loading +vickers +gaston +hillside +statutes +wilde +gail +kung +sabine +comfortably +motorcycles +##rgo +169 +pneumonia +fetch +##sonic +axel +faintly +parallels +##oop +mclaren +spouse +compton +interdisciplinary +miner +##eni +181 +clamped +##chal +##llah +separates +versa +##mler +scarborough +labrador +##lity +##osing +rutgers +hurdles +como +166 +burt +divers +##100 +wichita +cade +coincided +##erson +bruised +mla +##pper +vineyard +##ili +##brush +notch +mentioning +jase +hearted +kits +doe +##acle +pomerania +##ady +ronan +seizure +pavel +problematic +##zaki +domenico +##ulin +catering +penelope +dependence +parental +emilio +ministerial +atkinson +##bolic +clarkson +chargers +colby +grill +peeked +arises +summon +##aged +fools +##grapher +faculties +qaeda +##vial +garner +refurbished +##hwa +geelong +disasters +nudged +bs +shareholder +lori +algae +reinstated +rot +##ades +##nous +invites +stainless +183 +inclusive +##itude +diocesan +til +##icz +denomination +##xa +benton +floral +registers +##ider +##erman +##kell +absurd +brunei +guangzhou +hitter +retaliation +##uled +##eve +blanc +nh +consistency +contamination +##eres +##rner +dire +palermo +broadcasters +diaries +inspire +vols +brewer +tightening +ky +mixtape +hormone +##tok +stokes +##color +##dly +##ssi +pg +##ometer +##lington +sanitation +##tility +intercontinental +apps +##adt +¹⁄₂ +cylinders +economies +favourable +unison +croix +gertrude +odyssey +vanity +dangling +##logists +upgrades +dice +middleweight +practitioner +##ight +206 +henrik +parlor +orion +angered +lac +python +blurted +##rri +sensual +intends +swings +angled +##phs +husky +attain +peerage +precinct +textiles +cheltenham +shuffled +dai +confess +tasting +bhutan +##riation +tyrone +segregation +abrupt +ruiz +##rish +smirked +blackwell +confidential +browning +amounted +##put +vase +scarce +fabulous +raided +staple +guyana +unemployed +glider +shay +##tow +carmine +troll +intervene +squash +superstar +##uce +cylindrical +len +roadway +researched +handy +##rium +##jana +meta +lao +declares +##rring +##tadt +##elin +##kova +willem +shrubs +napoleonic +realms +skater +qi +volkswagen +##ł +tad +hara +archaeologist +awkwardly +eerie +##kind +wiley +##heimer +##24 +titus +organizers +cfl +crusaders +lama +usb +vent +enraged +thankful +occupants +maximilian +##gaard +possessing +textbooks +##oran +collaborator +quaker +##ulo +avalanche +mono +silky +straits +isaiah +mustang +surged +resolutions +potomac +descend +cl +kilograms +plato +strains +saturdays +##olin +bernstein +##ype +holstein +ponytail +##watch +belize +conversely +heroine +perpetual +##ylus +charcoal +piedmont +glee +negotiating +backdrop +prologue +##jah +##mmy +pasadena +climbs +ramos +sunni +##holm +##tner +##tri +anand +deficiency +hertfordshire +stout +##avi +aperture +orioles +##irs +doncaster +intrigued +bombed +coating +otis +##mat +cocktail +##jit +##eto +amir +arousal +sar +##proof +##act +##ories +dixie +pots +##bow +whereabouts +159 +##fted +drains +bullying +cottages +scripture +coherent +fore +poe +appetite +##uration +sampled +##ators +##dp +derrick +rotor +jays +peacock +installment +##rro +advisors +##coming +rodeo +scotch +##mot +##db +##fen +##vant +ensued +rodrigo +dictatorship +martyrs +twenties +##н +towed +incidence +marta +rainforest +sai +scaled +##cles +oceanic +qualifiers +symphonic +mcbride +dislike +generalized +aubrey +colonization +##iation +##lion +##ssing +disliked +lublin +salesman +##ulates +spherical +whatsoever +sweating +avalon +contention +punt +severity +alderman +atari +##dina +##grant +##rop +scarf +seville +vertices +annexation +fairfield +fascination +inspiring +launches +palatinate +regretted +##rca +feral +##iom +elk +nap +olsen +reddy +yong +##leader +##iae +garment +transports +feng +gracie +outrage +viceroy +insides +##esis +breakup +grady +organizer +softer +grimaced +222 +murals +galicia +arranging +vectors +##rsten +bas +##sb +##cens +sloan +##eka +bitten +ara +fender +nausea +bumped +kris +banquet +comrades +detector +persisted +##llan +adjustment +endowed +cinemas +##shot +sellers +##uman +peek +epa +kindly +neglect +simpsons +talon +mausoleum +runaway +hangul +lookout +##cic +rewards +coughed +acquainted +chloride +##ald +quicker +accordion +neolithic +##qa +artemis +coefficient +lenny +pandora +tx +##xed +ecstasy +litter +segunda +chairperson +gemma +hiss +rumor +vow +nasal +antioch +compensate +patiently +transformers +##eded +judo +morrow +penis +posthumous +philips +bandits +husbands +denote +flaming +##any +##phones +langley +yorker +1760 +walters +##uo +##kle +gubernatorial +fatty +samsung +leroy +outlaw +##nine +unpublished +poole +jakob +##ᵢ +##ₙ +crete +distorted +superiority +##dhi +intercept +crust +mig +claus +crashes +positioning +188 +stallion +301 +frontal +armistice +##estinal +elton +aj +encompassing +camel +commemorated +malaria +woodward +calf +cigar +penetrate +##oso +willard +##rno +##uche +illustrate +amusing +convergence +noteworthy +##lma +##rva +journeys +realise +manfred +##sable +410 +##vocation +hearings +fiance +##posed +educators +provoked +adjusting +##cturing +modular +stockton +paterson +vlad +rejects +electors +selena +maureen +##tres +uber +##rce +swirled +##num +proportions +nanny +pawn +naturalist +parma +apostles +awoke +ethel +wen +##bey +monsoon +overview +##inating +mccain +rendition +risky +adorned +##ih +equestrian +germain +nj +conspicuous +confirming +##yoshi +shivering +##imeter +milestone +rumours +flinched +bounds +smacked +token +##bei +lectured +automobiles +##shore +impacted +##iable +nouns +nero +##leaf +ismail +prostitute +trams +##lace +bridget +sud +stimulus +impressions +reins +revolves +##oud +##gned +giro +honeymoon +##swell +criterion +##sms +##uil +libyan +prefers +##osition +211 +preview +sucks +accusation +bursts +metaphor +diffusion +tolerate +faye +betting +cinematographer +liturgical +specials +bitterly +humboldt +##ckle +flux +rattled +##itzer +archaeologists +odor +authorised +marshes +discretion +##ов +alarmed +archaic +inverse +##leton +explorers +##pine +drummond +tsunami +woodlands +##minate +##tland +booklet +insanity +owning +insert +crafted +calculus +##tore +receivers +##bt +stung +##eca +##nched +prevailing +travellers +eyeing +lila +graphs +##borne +178 +julien +##won +morale +adaptive +therapist +erica +cw +libertarian +bowman +pitches +vita +##ional +crook +##ads +##entation +caledonia +mutiny +##sible +1840s +automation +##ß +flock +##pia +ironic +pathology +##imus +remarried +##22 +joker +withstand +energies +##att +shropshire +hostages +madeleine +tentatively +conflicting +mateo +recipes +euros +ol +mercenaries +nico +##ndon +albuquerque +augmented +mythical +bel +freud +##child +cough +##lica +365 +freddy +lillian +genetically +nuremberg +calder +209 +bonn +outdoors +paste +suns +urgency +vin +restraint +tyson +##cera +##selle +barrage +bethlehem +kahn +##par +mounts +nippon +barony +happier +ryu +makeshift +sheldon +blushed +castillo +barking +listener +taped +bethel +fluent +headlines +pornography +rum +disclosure +sighing +mace +doubling +gunther +manly +##plex +rt +interventions +physiological +forwards +emerges +##tooth +##gny +compliment +rib +recession +visibly +barge +faults +connector +exquisite +prefect +##rlin +patio +##cured +elevators +brandt +italics +pena +173 +wasp +satin +ea +botswana +graceful +respectable +##jima +##rter +##oic +franciscan +generates +##dl +alfredo +disgusting +##olate +##iously +sherwood +warns +cod +promo +cheryl +sino +##ة +##escu +twitch +##zhi +brownish +thom +ortiz +##dron +densely +##beat +carmel +reinforce +##bana +187 +anastasia +downhill +vertex +contaminated +remembrance +harmonic +homework +##sol +fiancee +gears +olds +angelica +loft +ramsay +quiz +colliery +sevens +##cape +autism +##hil +walkway +##boats +ruben +abnormal +ounce +khmer +##bbe +zachary +bedside +morphology +punching +##olar +sparrow +convinces +##35 +hewitt +queer +remastered +rods +mabel +solemn +notified +lyricist +symmetric +##xide +174 +encore +passports +wildcats +##uni +baja +##pac +mildly +##ease +bleed +commodity +mounds +glossy +orchestras +##omo +damian +prelude +ambitions +##vet +awhile +remotely +##aud +asserts +imply +##iques +distinctly +modelling +remedy +##dded +windshield +dani +xiao +##endra +audible +powerplant +1300 +invalid +elemental +acquisitions +##hala +immaculate +libby +plata +smuggling +ventilation +denoted +minh +##morphism +430 +differed +dion +kelley +lore +mocking +sabbath +spikes +hygiene +drown +runoff +stylized +tally +liberated +aux +interpreter +righteous +aba +siren +reaper +pearce +millie +##cier +##yra +gaius +##iso +captures +##ttering +dorm +claudio +##sic +benches +knighted +blackness +##ored +discount +fumble +oxidation +routed +##ς +novak +perpendicular +spoiled +fracture +splits +##urt +pads +topology +##cats +axes +fortunate +offenders +protestants +esteem +221 +broadband +convened +frankly +hound +prototypes +isil +facilitated +keel +##sher +sahara +awaited +bubba +orb +prosecutors +186 +hem +520 +##xing +relaxing +remnant +romney +sorted +slalom +stefano +ulrich +##active +exemption +folder +pauses +foliage +hitchcock +epithet +204 +criticisms +##aca +ballistic +brody +hinduism +chaotic +youths +equals +##pala +pts +thicker +analogous +capitalist +improvised +overseeing +sinatra +ascended +beverage +##tl +straightforward +##kon +curran +##west +bois +325 +induce +surveying +emperors +sax +unpopular +##kk +cartoonist +fused +##mble +unto +##yuki +localities +##cko +##ln +darlington +slain +academie +lobbying +sediment +puzzles +##grass +defiance +dickens +manifest +tongues +alumnus +arbor +coincide +184 +appalachian +mustafa +examiner +cabaret +traumatic +yves +bracelet +draining +heroin +magnum +baths +odessa +consonants +mitsubishi +##gua +kellan +vaudeville +##fr +joked +null +straps +probation +##ław +ceded +interfaces +##pas +##zawa +blinding +viet +224 +rothschild +museo +640 +huddersfield +##vr +tactic +##storm +brackets +dazed +incorrectly +##vu +reg +glazed +fearful +manifold +benefited +irony +##sun +stumbling +##rte +willingness +balkans +mei +wraps +##aba +injected +##lea +gu +syed +harmless +##hammer +bray +takeoff +poppy +timor +cardboard +astronaut +purdue +weeping +southbound +cursing +stalls +diagonal +##neer +lamar +bryce +comte +weekdays +harrington +##uba +negatively +##see +lays +grouping +##cken +##henko +affirmed +halle +modernist +##lai +hodges +smelling +aristocratic +baptized +dismiss +justification +oilers +##now +coupling +qin +snack +healer +##qing +gardener +layla +battled +formulated +stephenson +gravitational +##gill +##jun +1768 +granny +coordinating +suites +##cd +##ioned +monarchs +##cote +##hips +sep +blended +apr +barrister +deposition +fia +mina +policemen +paranoid +##pressed +churchyard +covert +crumpled +creep +abandoning +tr +transmit +conceal +barr +understands +readiness +spire +##cology +##enia +##erry +610 +startling +unlock +vida +bowled +slots +##nat +##islav +spaced +trusting +admire +rig +##ink +slack +##70 +mv +207 +casualty +##wei +classmates +##odes +##rar +##rked +amherst +furnished +evolve +foundry +menace +mead +##lein +flu +wesleyan +##kled +monterey +webber +##vos +wil +##mith +##на +bartholomew +justices +restrained +##cke +amenities +191 +mediated +sewage +trenches +ml +mainz +##thus +1800s +##cula +##inski +caine +bonding +213 +converts +spheres +superseded +marianne +crypt +sweaty +ensign +historia +##br +spruce +##post +##ask +forks +thoughtfully +yukon +pamphlet +ames +##uter +karma +##yya +bryn +negotiation +sighs +incapable +##mbre +##ntial +actresses +taft +##mill +luce +prevailed +##amine +1773 +motionless +envoy +testify +investing +sculpted +instructors +provence +kali +cullen +horseback +##while +goodwin +##jos +gaa +norte +##ldon +modify +wavelength +abd +214 +skinned +sprinter +forecast +scheduling +marries +squared +tentative +##chman +boer +##isch +bolts +swap +fisherman +assyrian +impatiently +guthrie +martins +murdoch +194 +tanya +nicely +dolly +lacy +med +##45 +syn +decks +fashionable +millionaire +##ust +surfing +##ml +##ision +heaved +tammy +consulate +attendees +routinely +197 +fuse +saxophonist +backseat +malaya +##lord +scowl +tau +##ishly +193 +sighted +steaming +##rks +303 +911 +##holes +##hong +ching +##wife +bless +conserved +jurassic +stacey +unix +zion +chunk +rigorous +blaine +198 +peabody +slayer +dismay +brewers +nz +##jer +det +##glia +glover +postwar +int +penetration +sylvester +imitation +vertically +airlift +heiress +knoxville +viva +##uin +390 +macon +##rim +##fighter +##gonal +janice +##orescence +##wari +marius +belongings +leicestershire +196 +blanco +inverted +preseason +sanity +sobbing +##due +##elt +##dled +collingwood +regeneration +flickering +shortest +##mount +##osi +feminism +##lat +sherlock +cabinets +fumbled +northbound +precedent +snaps +##mme +researching +##akes +guillaume +insights +manipulated +vapor +neighbour +sap +gangster +frey +f1 +stalking +scarcely +callie +barnett +tendencies +audi +doomed +assessing +slung +panchayat +ambiguous +bartlett +##etto +distributing +violating +wolverhampton +##hetic +swami +histoire +##urus +liable +pounder +groin +hussain +larsen +popping +surprises +##atter +vie +curt +##station +mute +relocate +musicals +authorization +richter +##sef +immortality +tna +bombings +##press +deteriorated +yiddish +##acious +robbed +colchester +cs +pmid +ao +verified +balancing +apostle +swayed +recognizable +oxfordshire +retention +nottinghamshire +contender +judd +invitational +shrimp +uhf +##icient +cleaner +longitudinal +tanker +##mur +acronym +broker +koppen +sundance +suppliers +##gil +4000 +clipped +fuels +petite +##anne +landslide +helene +diversion +populous +landowners +auspices +melville +quantitative +##xes +ferries +nicky +##llus +doo +haunting +roche +carver +downed +unavailable +##pathy +approximation +hiroshima +##hue +garfield +valle +comparatively +keyboardist +traveler +##eit +congestion +calculating +subsidiaries +##bate +serb +modernization +fairies +deepened +ville +averages +##lore +inflammatory +tonga +##itch +co₂ +squads +##hea +gigantic +serum +enjoyment +retailer +verona +35th +cis +##phobic +magna +technicians +##vati +arithmetic +##sport +levin +##dation +amtrak +chow +sienna +##eyer +backstage +entrepreneurship +##otic +learnt +tao +##udy +worcestershire +formulation +baggage +hesitant +bali +sabotage +##kari +barren +enhancing +murmur +pl +freshly +putnam +syntax +aces +medicines +resentment +bandwidth +##sier +grins +chili +guido +##sei +framing +implying +gareth +lissa +genevieve +pertaining +admissions +geo +thorpe +proliferation +sato +bela +analyzing +parting +##gor +awakened +##isman +huddled +secrecy +##kling +hush +gentry +540 +dungeons +##ego +coasts +##utz +sacrificed +##chule +landowner +mutually +prevalence +programmer +adolescent +disrupted +seaside +gee +trusts +vamp +georgie +##nesian +##iol +schedules +sindh +##market +etched +hm +sparse +bey +beaux +scratching +gliding +unidentified +216 +collaborating +gems +jesuits +oro +accumulation +shaping +mbe +anal +##xin +231 +enthusiasts +newscast +##egan +janata +dewey +parkinson +179 +ankara +biennial +towering +dd +inconsistent +950 +##chet +thriving +terminate +cabins +furiously +eats +advocating +donkey +marley +muster +phyllis +leiden +##user +grassland +glittering +iucn +loneliness +217 +memorandum +armenians +##ddle +popularized +rhodesia +60s +lame +##illon +sans +bikini +header +orbits +##xx +##finger +##ulator +sharif +spines +biotechnology +strolled +naughty +yates +##wire +fremantle +milo +##mour +abducted +removes +##atin +humming +wonderland +##chrome +##ester +hume +pivotal +##rates +armand +grams +believers +elector +rte +apron +bis +scraped +##yria +endorsement +initials +##llation +eps +dotted +hints +buzzing +emigration +nearer +##tom +indicators +##ulu +coarse +neutron +protectorate +##uze +directional +exploits +pains +loire +1830s +proponents +guggenheim +rabbits +ritchie +305 +hectare +inputs +hutton +##raz +verify +##ako +boilers +longitude +##lev +skeletal +yer +emilia +citrus +compromised +##gau +pokemon +prescription +paragraph +eduard +cadillac +attire +categorized +kenyan +weddings +charley +##bourg +entertain +monmouth +##lles +nutrients +davey +mesh +incentive +practised +ecosystems +kemp +subdued +overheard +##rya +bodily +maxim +##nius +apprenticeship +ursula +##fight +lodged +rug +silesian +unconstitutional +patel +inspected +coyote +unbeaten +##hak +34th +disruption +convict +parcel +##cl +##nham +collier +implicated +mallory +##iac +##lab +susannah +winkler +##rber +shia +phelps +sediments +graphical +robotic +##sner +adulthood +mart +smoked +##isto +kathryn +clarified +##aran +divides +convictions +oppression +pausing +burying +##mt +federico +mathias +eileen +##tana +kite +hunched +##acies +189 +##atz +disadvantage +liza +kinetic +greedy +paradox +yokohama +dowager +trunks +ventured +##gement +gupta +vilnius +olaf +##thest +crimean +hopper +##ej +progressively +arturo +mouthed +arrondissement +##fusion +rubin +simulcast +oceania +##orum +##stra +##rred +busiest +intensely +navigator +cary +##vine +##hini +##bies +fife +rowe +rowland +posing +insurgents +shafts +lawsuits +activate +conor +inward +culturally +garlic +265 +##eering +eclectic +##hui +##kee +##nl +furrowed +vargas +meteorological +rendezvous +##aus +culinary +commencement +##dition +quota +##notes +mommy +salaries +overlapping +mule +##iology +##mology +sums +wentworth +##isk +##zione +mainline +subgroup +##illy +hack +plaintiff +verdi +bulb +differentiation +engagements +multinational +supplemented +bertrand +caller +regis +##naire +##sler +##arts +##imated +blossom +propagation +kilometer +viaduct +vineyards +##uate +beckett +optimization +golfer +songwriters +seminal +semitic +thud +volatile +evolving +ridley +##wley +trivial +distributions +scandinavia +jiang +##ject +wrestled +insistence +##dio +emphasizes +napkin +##ods +adjunct +rhyme +##ricted +##eti +hopeless +surrounds +tremble +32nd +smoky +##ntly +oils +medicinal +padded +steer +wilkes +219 +255 +concessions +hue +uniquely +blinded +landon +yahoo +##lane +hendrix +commemorating +dex +specify +chicks +##ggio +intercity +1400 +morley +##torm +highlighting +##oting +pang +oblique +stalled +##liner +flirting +newborn +1769 +bishopric +shaved +232 +currie +##ush +dharma +spartan +##ooped +favorites +smug +novella +sirens +abusive +creations +espana +##lage +paradigm +semiconductor +sheen +##rdo +##yen +##zak +nrl +renew +##pose +##tur +adjutant +marches +norma +##enity +ineffective +weimar +grunt +##gat +lordship +plotting +expenditure +infringement +lbs +refrain +av +mimi +mistakenly +postmaster +1771 +##bara +ras +motorsports +tito +199 +subjective +##zza +bully +stew +##kaya +prescott +1a +##raphic +##zam +bids +styling +paranormal +reeve +sneaking +exploding +katz +akbar +migrant +syllables +indefinitely +##ogical +destroys +replaces +applause +##phine +pest +##fide +218 +articulated +bertie +##thing +##cars +##ptic +courtroom +crowley +aesthetics +cummings +tehsil +hormones +titanic +dangerously +##ibe +stadion +jaenelle +auguste +ciudad +##chu +mysore +partisans +##sio +lucan +philipp +##aly +debating +henley +interiors +##rano +##tious +homecoming +beyonce +usher +henrietta +prepares +weeds +##oman +ely +plucked +##pire +##dable +luxurious +##aq +artifact +password +pasture +juno +maddy +minsk +##dder +##ologies +##rone +assessments +martian +royalist +1765 +examines +##mani +##rge +nino +223 +parry +scooped +relativity +##eli +##uting +##cao +congregational +noisy +traverse +##agawa +strikeouts +nickelodeon +obituary +transylvania +binds +depictions +polk +trolley +##yed +##lard +breeders +##under +dryly +hokkaido +1762 +strengths +stacks +bonaparte +connectivity +neared +prostitutes +stamped +anaheim +gutierrez +sinai +##zzling +bram +fresno +madhya +##86 +proton +##lena +##llum +##phon +reelected +wanda +##anus +##lb +ample +distinguishing +##yler +grasping +sermons +tomato +bland +stimulation +avenues +##eux +spreads +scarlett +fern +pentagon +assert +baird +chesapeake +ir +calmed +distortion +fatalities +##olis +correctional +pricing +##astic +##gina +prom +dammit +ying +collaborate +##chia +welterweight +33rd +pointer +substitution +bonded +umpire +communicating +multitude +paddle +##obe +federally +intimacy +##insky +betray +ssr +##lett +##lean +##lves +##therapy +airbus +##tery +functioned +ud +bearer +biomedical +netflix +##hire +##nca +condom +brink +ik +##nical +macy +##bet +flap +gma +experimented +jelly +lavender +##icles +##ulia +munro +##mian +##tial +rye +##rle +60th +gigs +hottest +rotated +predictions +fuji +bu +##erence +##omi +barangay +##fulness +##sas +clocks +##rwood +##liness +cereal +roe +wight +decker +uttered +babu +onion +xml +forcibly +##df +petra +sarcasm +hartley +peeled +storytelling +##42 +##xley +##ysis +##ffa +fibre +kiel +auditor +fig +harald +greenville +##berries +geographically +nell +quartz +##athic +cemeteries +##lr +crossings +nah +holloway +reptiles +chun +sichuan +snowy +660 +corrections +##ivo +zheng +ambassadors +blacksmith +fielded +fluids +hardcover +turnover +medications +melvin +academies +##erton +ro +roach +absorbing +spaniards +colton +##founded +outsider +espionage +kelsey +245 +edible +##ulf +dora +establishes +##sham +##tries +contracting +##tania +cinematic +costello +nesting +##uron +connolly +duff +##nology +mma +##mata +fergus +sexes +gi +optics +spectator +woodstock +banning +##hee +##fle +differentiate +outfielder +refinery +226 +312 +gerhard +horde +lair +drastically +##udi +landfall +##cheng +motorsport +odi +##achi +predominant +quay +skins +##ental +edna +harshly +complementary +murdering +##aves +wreckage +##90 +ono +outstretched +lennox +munitions +galen +reconcile +470 +scalp +bicycles +gillespie +questionable +rosenberg +guillermo +hostel +jarvis +kabul +volvo +opium +yd +##twined +abuses +decca +outpost +##cino +sensible +neutrality +##64 +ponce +anchorage +atkins +turrets +inadvertently +disagree +libre +vodka +reassuring +weighs +##yal +glide +jumper +ceilings +repertory +outs +stain +##bial +envy +##ucible +smashing +heightened +policing +hyun +mixes +lai +prima +##ples +celeste +##bina +lucrative +intervened +kc +manually +##rned +stature +staffed +bun +bastards +nairobi +priced +##auer +thatcher +##kia +tripped +comune +##ogan +##pled +brasil +incentives +emanuel +hereford +musica +##kim +benedictine +biennale +##lani +eureka +gardiner +rb +knocks +sha +##ael +##elled +##onate +efficacy +ventura +masonic +sanford +maize +leverage +##feit +capacities +santana +##aur +novelty +vanilla +##cter +##tour +benin +##oir +##rain +neptune +drafting +tallinn +##cable +humiliation +##boarding +schleswig +fabian +bernardo +liturgy +spectacle +sweeney +pont +routledge +##tment +cosmos +ut +hilt +sleek +universally +##eville +##gawa +typed +##dry +favors +allegheny +glaciers +##rly +recalling +aziz +##log +parasite +requiem +auf +##berto +##llin +illumination +##breaker +##issa +festivities +bows +govern +vibe +vp +333 +sprawled +larson +pilgrim +bwf +leaping +##rts +##ssel +alexei +greyhound +hoarse +##dler +##oration +seneca +##cule +gaping +##ulously +##pura +cinnamon +##gens +##rricular +craven +fantasies +houghton +engined +reigned +dictator +supervising +##oris +bogota +commentaries +unnatural +fingernails +spirituality +tighten +##tm +canadiens +protesting +intentional +cheers +sparta +##ytic +##iere +##zine +widen +belgarath +controllers +dodd +iaaf +navarre +##ication +defect +squire +steiner +whisky +##mins +560 +inevitably +tome +##gold +chew +##uid +##lid +elastic +##aby +streaked +alliances +jailed +regal +##ined +##phy +czechoslovak +narration +absently +##uld +bluegrass +guangdong +quran +criticizing +hose +hari +##liest +##owa +skier +streaks +deploy +##lom +raft +bose +dialed +huff +##eira +haifa +simplest +bursting +endings +ib +sultanate +##titled +franks +whitman +ensures +sven +##ggs +collaborators +forster +organising +ui +banished +napier +injustice +teller +layered +thump +##otti +roc +battleships +evidenced +fugitive +sadie +robotics +##roud +equatorial +geologist +##iza +yielding +##bron +##sr +internationale +mecca +##diment +sbs +skyline +toad +uploaded +reflective +undrafted +lal +leafs +bayern +##dai +lakshmi +shortlisted +##stick +##wicz +camouflage +donate +af +christi +lau +##acio +disclosed +nemesis +1761 +assemble +straining +northamptonshire +tal +##asi +bernardino +premature +heidi +42nd +coefficients +galactic +reproduce +buzzed +sensations +zionist +monsieur +myrtle +##eme +archery +strangled +musically +viewpoint +antiquities +bei +trailers +seahawks +cured +pee +preferring +tasmanian +lange +sul +##mail +##working +colder +overland +lucivar +massey +gatherings +haitian +##smith +disapproval +flaws +##cco +##enbach +1766 +npr +##icular +boroughs +creole +forums +techno +1755 +dent +abdominal +streetcar +##eson +##stream +procurement +gemini +predictable +##tya +acheron +christoph +feeder +fronts +vendor +bernhard +jammu +tumors +slang +##uber +goaltender +twists +curving +manson +vuelta +mer +peanut +confessions +pouch +unpredictable +allowance +theodor +vascular +##factory +bala +authenticity +metabolic +coughing +nanjing +##cea +pembroke +##bard +splendid +36th +ff +hourly +##ahu +elmer +handel +##ivate +awarding +thrusting +dl +experimentation +##hesion +##46 +caressed +entertained +steak +##rangle +biologist +orphans +baroness +oyster +stepfather +##dridge +mirage +reefs +speeding +##31 +barons +1764 +227 +inhabit +preached +repealed +##tral +honoring +boogie +captives +administer +johanna +##imate +gel +suspiciously +1767 +sobs +##dington +backbone +hayward +garry +##folding +##nesia +maxi +##oof +##ppe +ellison +galileo +##stand +crimea +frenzy +amour +bumper +matrices +natalia +baking +garth +palestinians +##grove +smack +conveyed +ensembles +gardening +##manship +##rup +##stituting +1640 +harvesting +topography +jing +shifters +dormitory +##carriage +##lston +ist +skulls +##stadt +dolores +jewellery +sarawak +##wai +##zier +fences +christy +confinement +tumbling +credibility +fir +stench +##bria +##plication +##nged +##sam +virtues +##belt +marjorie +pba +##eem +##made +celebrates +schooner +agitated +barley +fulfilling +anthropologist +##pro +restrict +novi +regulating +##nent +padres +##rani +##hesive +loyola +tabitha +milky +olson +proprietor +crambidae +guarantees +intercollegiate +ljubljana +hilda +##sko +ignorant +hooded +##lts +sardinia +##lidae +##vation +frontman +privileged +witchcraft +##gp +jammed +laude +poking +##than +bracket +amazement +yunnan +##erus +maharaja +linnaeus +264 +commissioning +milano +peacefully +##logies +akira +rani +regulator +##36 +grasses +##rance +luzon +crows +compiler +gretchen +seaman +edouard +tab +buccaneers +ellington +hamlets +whig +socialists +##anto +directorial +easton +mythological +##kr +##vary +rhineland +semantic +taut +dune +inventions +succeeds +##iter +replication +branched +##pired +jul +prosecuted +kangaroo +penetrated +##avian +middlesbrough +doses +bleak +madam +predatory +relentless +##vili +reluctance +##vir +hailey +crore +silvery +1759 +monstrous +swimmers +transmissions +hawthorn +informing +##eral +toilets +caracas +crouch +kb +##sett +295 +cartel +hadley +##aling +alexia +yvonne +##biology +cinderella +eton +superb +blizzard +stabbing +industrialist +maximus +##gm +##orus +groves +maud +clade +oversized +comedic +##bella +rosen +nomadic +fulham +montane +beverages +galaxies +redundant +swarm +##rot +##folia +##llis +buckinghamshire +fen +bearings +bahadur +##rom +gilles +phased +dynamite +faber +benoit +vip +##ount +##wd +booking +fractured +tailored +anya +spices +westwood +cairns +auditions +inflammation +steamed +##rocity +##acion +##urne +skyla +thereof +watford +torment +archdeacon +transforms +lulu +demeanor +fucked +serge +##sor +mckenna +minas +entertainer +##icide +caress +originate +residue +##sty +1740 +##ilised +##org +beech +##wana +subsidies +##ghton +emptied +gladstone +ru +firefighters +voodoo +##rcle +het +nightingale +tamara +edmond +ingredient +weaknesses +silhouette +285 +compatibility +withdrawing +hampson +##mona +anguish +giggling +##mber +bookstore +##jiang +southernmost +tilting +##vance +bai +economical +rf +briefcase +dreadful +hinted +projections +shattering +totaling +##rogate +analogue +indicted +periodical +fullback +##dman +haynes +##tenberg +##ffs +##ishment +1745 +thirst +stumble +penang +vigorous +##ddling +##kor +##lium +octave +##ove +##enstein +##inen +##ones +siberian +##uti +cbn +repeal +swaying +##vington +khalid +tanaka +unicorn +otago +plastered +lobe +riddle +##rella +perch +##ishing +croydon +filtered +graeme +tripoli +##ossa +crocodile +##chers +sufi +mined +##tung +inferno +lsu +##phi +swelled +utilizes +£2 +cale +periodicals +styx +hike +informally +coop +lund +##tidae +ala +hen +qui +transformations +disposed +sheath +chickens +##cade +fitzroy +sas +silesia +unacceptable +odisha +1650 +sabrina +pe +spokane +ratios +athena +massage +shen +dilemma +##drum +##riz +##hul +corona +doubtful +niall +##pha +##bino +fines +cite +acknowledging +bangor +ballard +bathurst +##resh +huron +mustered +alzheimer +garments +kinase +tyre +warship +##cp +flashback +pulmonary +braun +cheat +kamal +cyclists +constructions +grenades +ndp +traveller +excuses +stomped +signalling +trimmed +futsal +mosques +relevance +##wine +wta +##23 +##vah +##lter +hoc +##riding +optimistic +##´s +deco +sim +interacting +rejecting +moniker +waterways +##ieri +##oku +mayors +gdansk +outnumbered +pearls +##ended +##hampton +fairs +totals +dominating +262 +notions +stairway +compiling +pursed +commodities +grease +yeast +##jong +carthage +griffiths +residual +amc +contraction +laird +sapphire +##marine +##ivated +amalgamation +dissolve +inclination +lyle +packaged +altitudes +suez +canons +graded +lurched +narrowing +boasts +guise +wed +enrico +##ovsky +rower +scarred +bree +cub +iberian +protagonists +bargaining +proposing +trainers +voyages +vans +fishes +##aea +##ivist +##verance +encryption +artworks +kazan +sabre +cleopatra +hepburn +rotting +supremacy +mecklenburg +##brate +burrows +hazards +outgoing +flair +organizes +##ctions +scorpion +##usions +boo +234 +chevalier +dunedin +slapping +##34 +ineligible +pensions +##38 +##omic +manufactures +emails +bismarck +238 +weakening +blackish +ding +mcgee +quo +##rling +northernmost +xx +manpower +greed +sampson +clicking +##ange +##horpe +##inations +##roving +torre +##eptive +##moral +symbolism +38th +asshole +meritorious +outfits +splashed +biographies +sprung +astros +##tale +302 +737 +filly +raoul +nw +tokugawa +linden +clubhouse +##apa +tracts +romano +##pio +putin +tags +##note +chained +dickson +gunshot +moe +gunn +rashid +##tails +zipper +##bas +##nea +contrasted +##ply +##udes +plum +pharaoh +##pile +aw +comedies +ingrid +sandwiches +subdivisions +1100 +mariana +nokia +kamen +hz +delaney +veto +herring +##words +possessive +outlines +##roup +siemens +stairwell +rc +gallantry +messiah +palais +yells +233 +zeppelin +##dm +bolivar +##cede +smackdown +mckinley +##mora +##yt +muted +geologic +finely +unitary +avatar +hamas +maynard +rees +bog +contrasting +##rut +liv +chico +disposition +pixel +##erate +becca +dmitry +yeshiva +narratives +##lva +##ulton +mercenary +sharpe +tempered +navigate +stealth +amassed +keynes +##lini +untouched +##rrie +havoc +lithium +##fighting +abyss +graf +southward +wolverine +balloons +implements +ngos +transitions +##icum +ambushed +concacaf +dormant +economists +##dim +costing +csi +rana +universite +boulders +verity +##llon +collin +mellon +misses +cypress +fluorescent +lifeless +spence +##ulla +crewe +shepard +pak +revelations +##م +jolly +gibbons +paw +##dro +##quel +freeing +##test +shack +fries +palatine +##51 +##hiko +accompaniment +cruising +recycled +##aver +erwin +sorting +synthesizers +dyke +realities +sg +strides +enslaved +wetland +##ghan +competence +gunpowder +grassy +maroon +reactors +objection +##oms +carlson +gearbox +macintosh +radios +shelton +##sho +clergyman +prakash +254 +mongols +trophies +oricon +228 +stimuli +twenty20 +cantonese +cortes +mirrored +##saurus +bhp +cristina +melancholy +##lating +enjoyable +nuevo +##wny +downfall +schumacher +##ind +banging +lausanne +rumbled +paramilitary +reflex +ax +amplitude +migratory +##gall +##ups +midi +barnard +lastly +sherry +##hp +##nall +keystone +##kra +carleton +slippery +##53 +coloring +foe +socket +otter +##rgos +mats +##tose +consultants +bafta +bison +topping +##km +490 +primal +abandonment +transplant +atoll +hideous +mort +pained +reproduced +tae +howling +##turn +unlawful +billionaire +hotter +poised +lansing +##chang +dinamo +retro +messing +nfc +domesday +##mina +blitz +timed +##athing +##kley +ascending +gesturing +##izations +signaled +tis +chinatown +mermaid +savanna +jameson +##aint +catalina +##pet +##hers +cochrane +cy +chatting +##kus +alerted +computation +mused +noelle +majestic +mohawk +campo +octagonal +##sant +##hend +241 +aspiring +##mart +comprehend +iona +paralyzed +shimmering +swindon +rhone +##eley +reputed +configurations +pitchfork +agitation +francais +gillian +lipstick +##ilo +outsiders +pontifical +resisting +bitterness +sewer +rockies +##edd +##ucher +misleading +1756 +exiting +galloway +##nging +risked +##heart +246 +commemoration +schultz +##rka +integrating +##rsa +poses +shrieked +##weiler +guineas +gladys +jerking +owls +goldsmith +nightly +penetrating +##unced +lia +##33 +ignited +betsy +##aring +##thorpe +follower +vigorously +##rave +coded +kiran +knit +zoology +tbilisi +##28 +##bered +repository +govt +deciduous +dino +growling +##bba +enhancement +unleashed +chanting +pussy +biochemistry +##eric +kettle +repression +toxicity +nrhp +##arth +##kko +##bush +ernesto +commended +outspoken +242 +mca +parchment +sms +kristen +##aton +bisexual +raked +glamour +navajo +a2 +conditioned +showcased +##hma +spacious +youthful +##esa +usl +appliances +junta +brest +layne +conglomerate +enchanted +chao +loosened +picasso +circulating +inspect +montevideo +##centric +##kti +piazza +spurred +##aith +bari +freedoms +poultry +stamford +lieu +##ect +indigo +sarcastic +bahia +stump +attach +dvds +frankenstein +lille +approx +scriptures +pollen +##script +nmi +overseen +##ivism +tides +proponent +newmarket +inherit +milling +##erland +centralized +##rou +distributors +credentials +drawers +abbreviation +##lco +##xon +downing +uncomfortably +ripe +##oes +erase +franchises +##ever +populace +##bery +##khar +decomposition +pleas +##tet +daryl +sabah +##stle +##wide +fearless +genie +lesions +annette +##ogist +oboe +appendix +nair +dripped +petitioned +maclean +mosquito +parrot +rpg +hampered +1648 +operatic +reservoirs +##tham +irrelevant +jolt +summarized +##fp +medallion +##taff +##− +clawed +harlow +narrower +goddard +marcia +bodied +fremont +suarez +altering +tempest +mussolini +porn +##isms +sweetly +oversees +walkers +solitude +grimly +shrines +hk +ich +supervisors +hostess +dietrich +legitimacy +brushes +expressive +##yp +dissipated +##rse +localized +systemic +##nikov +gettysburg +##js +##uaries +dialogues +muttering +251 +housekeeper +sicilian +discouraged +##frey +beamed +kaladin +halftime +kidnap +##amo +##llet +1754 +synonymous +depleted +instituto +insulin +reprised +##opsis +clashed +##ctric +interrupting +radcliffe +insisting +medici +1715 +ejected +playfully +turbulent +##47 +starvation +##rini +shipment +rebellious +petersen +verification +merits +##rified +cakes +##charged +1757 +milford +shortages +spying +fidelity +##aker +emitted +storylines +harvested +seismic +##iform +cheung +kilda +theoretically +barbie +lynx +##rgy +##tius +goblin +mata +poisonous +##nburg +reactive +residues +obedience +##евич +conjecture +##rac +401 +hating +sixties +kicker +moaning +motown +##bha +emancipation +neoclassical +##hering +consoles +ebert +professorship +##tures +sustaining +assaults +obeyed +affluent +incurred +tornadoes +##eber +##zow +emphasizing +highlanders +cheated +helmets +##ctus +internship +terence +bony +executions +legislators +berries +peninsular +tinged +##aco +1689 +amplifier +corvette +ribbons +lavish +pennant +##lander +worthless +##chfield +##forms +mariano +pyrenees +expenditures +##icides +chesterfield +mandir +tailor +39th +sergey +nestled +willed +aristocracy +devotees +goodnight +raaf +rumored +weaponry +remy +appropriations +harcourt +burr +riaa +##lence +limitation +unnoticed +guo +soaking +swamps +##tica +collapsing +tatiana +descriptive +brigham +psalm +##chment +maddox +##lization +patti +caliph +##aja +akron +injuring +serra +##ganj +basins +##sari +astonished +launcher +##church +hilary +wilkins +sewing +##sf +stinging +##fia +##ncia +underwood +startup +##ition +compilations +vibrations +embankment +jurist +##nity +bard +juventus +groundwater +kern +palaces +helium +boca +cramped +marissa +soto +##worm +jae +princely +##ggy +faso +bazaar +warmly +##voking +229 +pairing +##lite +##grate +##nets +wien +freaked +ulysses +rebirth +##alia +##rent +mummy +guzman +jimenez +stilled +##nitz +trajectory +tha +woken +archival +professions +##pts +##pta +hilly +shadowy +shrink +##bolt +norwood +glued +migrate +stereotypes +devoid +##pheus +625 +evacuate +horrors +infancy +gotham +knowles +optic +downloaded +sachs +kingsley +parramatta +darryl +mor +##onale +shady +commence +confesses +kan +##meter +##placed +marlborough +roundabout +regents +frigates +io +##imating +gothenburg +revoked +carvings +clockwise +convertible +intruder +##sche +banged +##ogo +vicky +bourgeois +##mony +dupont +footing +##gum +pd +##real +buckle +yun +penthouse +sane +720 +serviced +stakeholders +neumann +bb +##eers +comb +##gam +catchment +pinning +rallies +typing +##elles +forefront +freiburg +sweetie +giacomo +widowed +goodwill +worshipped +aspirations +midday +##vat +fishery +##trick +bournemouth +turk +243 +hearth +ethanol +guadalajara +murmurs +sl +##uge +afforded +scripted +##hta +wah +##jn +coroner +translucent +252 +memorials +puck +progresses +clumsy +##race +315 +candace +recounted +##27 +##slin +##uve +filtering +##mac +howl +strata +heron +leveled +##ays +dubious +##oja +##т +##wheel +citations +exhibiting +##laya +##mics +##pods +turkic +##lberg +injunction +##ennial +##mit +antibodies +##44 +organise +##rigues +cardiovascular +cushion +inverness +##zquez +dia +cocoa +sibling +##tman +##roid +expanse +feasible +tunisian +algiers +##relli +rus +bloomberg +dso +westphalia +bro +tacoma +281 +downloads +##ours +konrad +duran +##hdi +continuum +jett +compares +legislator +secession +##nable +##gues +##zuka +translating +reacher +##gley +##ła +aleppo +##agi +tc +orchards +trapping +linguist +versatile +drumming +postage +calhoun +superiors +##mx +barefoot +leary +##cis +ignacio +alfa +kaplan +##rogen +bratislava +mori +##vot +disturb +haas +313 +cartridges +gilmore +radiated +salford +tunic +hades +##ulsive +archeological +delilah +magistrates +auditioned +brewster +charters +empowerment +blogs +cappella +dynasties +iroquois +whipping +##krishna +raceway +truths +myra +weaken +judah +mcgregor +##horse +mic +refueling +37th +burnley +bosses +markus +premio +query +##gga +dunbar +##economic +darkest +lyndon +sealing +commendation +reappeared +##mun +addicted +ezio +slaughtered +satisfactory +shuffle +##eves +##thic +##uj +fortification +warrington +##otto +resurrected +fargo +mane +##utable +##lei +##space +foreword +ox +##aris +##vern +abrams +hua +##mento +sakura +##alo +uv +sentimental +##skaya +midfield +##eses +sturdy +scrolls +macleod +##kyu +entropy +##lance +mitochondrial +cicero +excelled +thinner +convoys +perceive +##oslav +##urable +systematically +grind +burkina +287 +##tagram +ops +##aman +guantanamo +##cloth +##tite +forcefully +wavy +##jou +pointless +##linger +##tze +layton +portico +superficial +clerical +outlaws +##hism +burials +muir +##inn +creditors +hauling +rattle +##leg +calais +monde +archers +reclaimed +dwell +wexford +hellenic +falsely +remorse +##tek +dough +furnishings +##uttered +gabon +neurological +novice +##igraphy +contemplated +pulpit +nightstand +saratoga +##istan +documenting +pulsing +taluk +##firmed +busted +marital +##rien +disagreements +wasps +##yes +hodge +mcdonnell +mimic +fran +pendant +dhabi +musa +##nington +congratulations +argent +darrell +concussion +losers +regrets +thessaloniki +reversal +donaldson +hardwood +thence +achilles +ritter +##eran +demonic +jurgen +prophets +goethe +eki +classmate +buff +##cking +yank +irrational +##inging +perished +seductive +qur +sourced +##crat +##typic +mustard +ravine +barre +horizontally +characterization +phylogenetic +boise +##dit +##runner +##tower +brutally +intercourse +seduce +##bbing +fay +ferris +ogden +amar +nik +unarmed +##inator +evaluating +kyrgyzstan +sweetness +##lford +##oki +mccormick +meiji +notoriety +stimulate +disrupt +figuring +instructional +mcgrath +##zoo +groundbreaking +##lto +flinch +khorasan +agrarian +bengals +mixer +radiating +##sov +ingram +pitchers +nad +tariff +##cript +tata +##codes +##emi +##ungen +appellate +lehigh +##bled +##giri +brawl +duct +texans +##ciation +##ropolis +skipper +speculative +vomit +doctrines +stresses +253 +davy +graders +whitehead +jozef +timely +cumulative +haryana +paints +appropriately +boon +cactus +##ales +##pid +dow +legions +##pit +perceptions +1730 +picturesque +##yse +periphery +rune +wr +##aha +celtics +sentencing +whoa +##erin +confirms +variance +425 +moines +mathews +spade +rave +m1 +fronted +fx +blending +alleging +reared +##gl +237 +##paper +grassroots +eroded +##free +##physical +directs +ordeal +##sław +accelerate +hacker +rooftop +##inia +lev +buys +cebu +devote +##lce +specialising +##ulsion +choreographed +repetition +warehouses +##ryl +paisley +tuscany +analogy +sorcerer +hash +huts +shards +descends +exclude +nix +chaplin +gaga +ito +vane +##drich +causeway +misconduct +limo +orchestrated +glands +jana +##kot +u2 +##mple +##sons +branching +contrasts +scoop +longed +##virus +chattanooga +##75 +syrup +cornerstone +##tized +##mind +##iaceae +careless +precedence +frescoes +##uet +chilled +consult +modelled +snatch +peat +##thermal +caucasian +humane +relaxation +spins +temperance +##lbert +occupations +lambda +hybrids +moons +mp3 +##oese +247 +rolf +societal +yerevan +ness +##ssler +befriended +mechanized +nominate +trough +boasted +cues +seater +##hom +bends +##tangle +conductors +emptiness +##lmer +eurasian +adriatic +tian +##cie +anxiously +lark +propellers +chichester +jock +ev +2a +##holding +credible +recounts +tori +loyalist +abduction +##hoot +##redo +nepali +##mite +ventral +tempting +##ango +##crats +steered +##wice +javelin +dipping +laborers +prentice +looming +titanium +##ː +badges +emir +tensor +##ntation +egyptians +rash +denies +hawthorne +lombard +showers +wehrmacht +dietary +trojan +##reus +welles +executing +horseshoe +lifeboat +##lak +elsa +infirmary +nearing +roberta +boyer +mutter +trillion +joanne +##fine +##oked +sinks +vortex +uruguayan +clasp +sirius +##block +accelerator +prohibit +sunken +byu +chronological +diplomats +ochreous +510 +symmetrical +1644 +maia +##tology +salts +reigns +atrocities +##ия +hess +bared +issn +##vyn +cater +saturated +##cycle +##isse +sable +voyager +dyer +yusuf +##inge +fountains +wolff +##39 +##nni +engraving +rollins +atheist +ominous +##ault +herr +chariot +martina +strung +##fell +##farlane +horrific +sahib +gazes +saetan +erased +ptolemy +##olic +flushing +lauderdale +analytic +##ices +530 +navarro +beak +gorilla +herrera +broom +guadalupe +raiding +sykes +311 +bsc +deliveries +1720 +invasions +carmichael +tajikistan +thematic +ecumenical +sentiments +onstage +##rians +##brand +##sume +catastrophic +flanks +molten +##arns +waller +aimee +terminating +##icing +alternately +##oche +nehru +printers +outraged +##eving +empires +template +banners +repetitive +za +##oise +vegetarian +##tell +guiana +opt +cavendish +lucknow +synthesized +##hani +##mada +finalized +##ctable +fictitious +mayoral +unreliable +##enham +embracing +peppers +rbis +##chio +##neo +inhibition +slashed +togo +orderly +embroidered +safari +salty +236 +barron +benito +totaled +##dak +pubs +simulated +caden +devin +tolkien +momma +welding +sesame +##ept +gottingen +hardness +630 +shaman +temeraire +620 +adequately +pediatric +##kit +ck +assertion +radicals +composure +cadence +seafood +beaufort +lazarus +mani +warily +cunning +kurdistan +249 +cantata +##kir +ares +##41 +##clusive +nape +townland +geared +insulted +flutter +boating +violate +draper +dumping +malmo +##hh +##romatic +firearm +alta +bono +obscured +##clave +exceeds +panorama +unbelievable +##train +preschool +##essed +disconnected +installing +rescuing +secretaries +accessibility +##castle +##drive +##ifice +##film +bouts +slug +waterway +mindanao +##buro +##ratic +halves +##ل +calming +liter +maternity +adorable +bragg +electrification +mcc +##dote +roxy +schizophrenia +##body +munoz +kaye +whaling +239 +mil +tingling +tolerant +##ago +unconventional +volcanoes +##finder +deportivo +##llie +robson +kaufman +neuroscience +wai +deportation +masovian +scraping +converse +##bh +hacking +bulge +##oun +administratively +yao +580 +amp +mammoth +booster +claremont +hooper +nomenclature +pursuits +mclaughlin +melinda +##sul +catfish +barclay +substrates +taxa +zee +originals +kimberly +packets +padma +##ality +borrowing +ostensibly +solvent +##bri +##genesis +##mist +lukas +shreveport +veracruz +##ь +##lou +##wives +cheney +tt +anatolia +hobbs +##zyn +cyclic +radiant +alistair +greenish +siena +dat +independents +##bation +conform +pieter +hyper +applicant +bradshaw +spores +telangana +vinci +inexpensive +nuclei +322 +jang +nme +soho +spd +##ign +cradled +receptionist +pow +##43 +##rika +fascism +##ifer +experimenting +##ading +##iec +##region +345 +jocelyn +maris +stair +nocturnal +toro +constabulary +elgin +##kker +msc +##giving +##schen +##rase +doherty +doping +sarcastically +batter +maneuvers +##cano +##apple +##gai +##git +intrinsic +##nst +##stor +1753 +showtime +cafes +gasps +lviv +ushered +##thed +fours +restart +astonishment +transmitting +flyer +shrugs +##sau +intriguing +cones +dictated +mushrooms +medial +##kovsky +##elman +escorting +gaped +##26 +godfather +##door +##sell +djs +recaptured +timetable +vila +1710 +3a +aerodrome +mortals +scientology +##orne +angelina +mag +convection +unpaid +insertion +intermittent +lego +##nated +endeavor +kota +pereira +##lz +304 +bwv +glamorgan +insults +agatha +fey +##cend +fleetwood +mahogany +protruding +steamship +zeta +##arty +mcguire +suspense +##sphere +advising +urges +##wala +hurriedly +meteor +gilded +inline +arroyo +stalker +##oge +excitedly +revered +##cure +earle +introductory +##break +##ilde +mutants +puff +pulses +reinforcement +##haling +curses +lizards +stalk +correlated +##fixed +fallout +macquarie +##unas +bearded +denton +heaving +802 +##ocation +winery +assign +dortmund +##lkirk +everest +invariant +charismatic +susie +##elling +bled +lesley +telegram +sumner +bk +##ogen +##к +wilcox +needy +colbert +duval +##iferous +##mbled +allotted +attends +imperative +##hita +replacements +hawker +##inda +insurgency +##zee +##eke +casts +##yla +680 +ives +transitioned +##pack +##powering +authoritative +baylor +flex +cringed +plaintiffs +woodrow +##skie +drastic +ape +aroma +unfolded +commotion +nt +preoccupied +theta +routines +lasers +privatization +wand +domino +ek +clenching +nsa +strategically +showered +bile +handkerchief +pere +storing +christophe +insulting +316 +nakamura +romani +asiatic +magdalena +palma +cruises +stripping +405 +konstantin +soaring +##berman +colloquially +forerunner +havilland +incarcerated +parasites +sincerity +##utus +disks +plank +saigon +##ining +corbin +homo +ornaments +powerhouse +##tlement +chong +fastened +feasibility +idf +morphological +usable +##nish +##zuki +aqueduct +jaguars +keepers +##flies +aleksandr +faust +assigns +ewing +bacterium +hurled +tricky +hungarians +integers +wallis +321 +yamaha +##isha +hushed +oblivion +aviator +evangelist +friars +##eller +monograph +ode +##nary +airplanes +labourers +charms +##nee +1661 +hagen +tnt +rudder +fiesta +transcript +dorothea +ska +inhibitor +maccabi +retorted +raining +encompassed +clauses +menacing +1642 +lineman +##gist +vamps +##ape +##dick +gloom +##rera +dealings +easing +seekers +##nut +##pment +helens +unmanned +##anu +##isson +basics +##amy +##ckman +adjustments +1688 +brutality +horne +##zell +sui +##55 +##mable +aggregator +##thal +rhino +##drick +##vira +counters +zoom +##01 +##rting +mn +montenegrin +packard +##unciation +##♭ +##kki +reclaim +scholastic +thugs +pulsed +##icia +syriac +quan +saddam +banda +kobe +blaming +buddies +dissent +##lusion +##usia +corbett +jaya +delle +erratic +lexie +##hesis +435 +amiga +hermes +##pressing +##leen +chapels +gospels +jamal +##uating +compute +revolving +warp +##sso +##thes +armory +##eras +##gol +antrim +loki +##kow +##asian +##good +##zano +braid +handwriting +subdistrict +funky +pantheon +##iculate +concurrency +estimation +improper +juliana +##his +newcomers +johnstone +staten +communicated +##oco +##alle +sausage +stormy +##stered +##tters +superfamily +##grade +acidic +collateral +tabloid +##oped +##rza +bladder +austen +##ellant +mcgraw +##hay +hannibal +mein +aquino +lucifer +wo +badger +boar +cher +christensen +greenberg +interruption +##kken +jem +244 +mocked +bottoms +cambridgeshire +##lide +sprawling +##bbly +eastwood +ghent +synth +##buck +advisers +##bah +nominally +hapoel +qu +daggers +estranged +fabricated +towels +vinnie +wcw +misunderstanding +anglia +nothin +unmistakable +##dust +##lova +chilly +marquette +truss +##edge +##erine +reece +##lty +##chemist +##connected +272 +308 +41st +bash +raion +waterfalls +##ump +##main +labyrinth +queue +theorist +##istle +bharatiya +flexed +soundtracks +rooney +leftist +patrolling +wharton +plainly +alleviate +eastman +schuster +topographic +engages +immensely +unbearable +fairchild +1620 +dona +lurking +parisian +oliveira +ia +indictment +hahn +bangladeshi +##aster +vivo +##uming +##ential +antonia +expects +indoors +kildare +harlan +##logue +##ogenic +##sities +forgiven +##wat +childish +tavi +##mide +##orra +plausible +grimm +successively +scooted +##bola +##dget +##rith +spartans +emery +flatly +azure +epilogue +##wark +flourish +##iny +##tracted +##overs +##oshi +bestseller +distressed +receipt +spitting +hermit +topological +##cot +drilled +subunit +francs +##layer +eel +##fk +##itas +octopus +footprint +petitions +ufo +##say +##foil +interfering +leaking +palo +##metry +thistle +valiant +##pic +narayan +mcpherson +##fast +gonzales +##ym +##enne +dustin +novgorod +solos +##zman +doin +##raph +##patient +##meyer +soluble +ashland +cuffs +carole +pendleton +whistling +vassal +##river +deviation +revisited +constituents +rallied +rotate +loomed +##eil +##nting +amateurs +augsburg +auschwitz +crowns +skeletons +##cona +bonnet +257 +dummy +globalization +simeon +sleeper +mandal +differentiated +##crow +##mare +milne +bundled +exasperated +talmud +owes +segregated +##feng +##uary +dentist +piracy +props +##rang +devlin +##torium +malicious +paws +##laid +dependency +##ergy +##fers +##enna +258 +pistons +rourke +jed +grammatical +tres +maha +wig +512 +ghostly +jayne +##achal +##creen +##ilis +##lins +##rence +designate +##with +arrogance +cambodian +clones +showdown +throttle +twain +##ception +lobes +metz +nagoya +335 +braking +##furt +385 +roaming +##minster +amin +crippled +##37 +##llary +indifferent +hoffmann +idols +intimidating +1751 +261 +influenza +memo +onions +1748 +bandage +consciously +##landa +##rage +clandestine +observes +swiped +tangle +##ener +##jected +##trum +##bill +##lta +hugs +congresses +josiah +spirited +##dek +humanist +managerial +filmmaking +inmate +rhymes +debuting +grimsby +ur +##laze +duplicate +vigor +##tf +republished +bolshevik +refurbishment +antibiotics +martini +methane +newscasts +royale +horizons +levant +iain +visas +##ischen +paler +##around +manifestation +snuck +alf +chop +futile +pedestal +rehab +##kat +bmg +kerman +res +fairbanks +jarrett +abstraction +saharan +##zek +1746 +procedural +clearer +kincaid +sash +luciano +##ffey +crunch +helmut +##vara +revolutionaries +##tute +creamy +leach +##mmon +1747 +permitting +nes +plight +wendell +##lese +contra +ts +clancy +ipa +mach +staples +autopsy +disturbances +nueva +karin +pontiac +##uding +proxy +venerable +haunt +leto +bergman +expands +##helm +wal +##pipe +canning +celine +cords +obesity +##enary +intrusion +planner +##phate +reasoned +sequencing +307 +harrow +##chon +##dora +marred +mcintyre +repay +tarzan +darting +248 +harrisburg +margarita +repulsed +##hur +##lding +belinda +hamburger +novo +compliant +runways +bingham +registrar +skyscraper +ic +cuthbert +improvisation +livelihood +##corp +##elial +admiring +##dened +sporadic +believer +casablanca +popcorn +##29 +asha +shovel +##bek +##dice +coiled +tangible +##dez +casper +elsie +resin +tenderness +rectory +##ivision +avail +sonar +##mori +boutique +##dier +guerre +bathed +upbringing +vaulted +sandals +blessings +##naut +##utnant +1680 +306 +foxes +pia +corrosion +hesitantly +confederates +crystalline +footprints +shapiro +tirana +valentin +drones +45th +microscope +shipments +texted +inquisition +wry +guernsey +unauthorized +resigning +760 +ripple +schubert +stu +reassure +felony +##ardo +brittle +koreans +##havan +##ives +dun +implicit +tyres +##aldi +##lth +magnolia +##ehan +##puri +##poulos +aggressively +fei +gr +familiarity +##poo +indicative +##trust +fundamentally +jimmie +overrun +395 +anchors +moans +##opus +britannia +armagh +##ggle +purposely +seizing +##vao +bewildered +mundane +avoidance +cosmopolitan +geometridae +quartermaster +caf +415 +chatter +engulfed +gleam +purge +##icate +juliette +jurisprudence +guerra +revisions +##bn +casimir +brew +##jm +1749 +clapton +cloudy +conde +hermitage +278 +simulations +torches +vincenzo +matteo +##rill +hidalgo +booming +westbound +accomplishment +tentacles +unaffected +##sius +annabelle +flopped +sloping +##litz +dreamer +interceptor +vu +##loh +consecration +copying +messaging +breaker +climates +hospitalized +1752 +torino +afternoons +winfield +witnessing +##teacher +breakers +choirs +sawmill +coldly +##ege +sipping +haste +uninhabited +conical +bibliography +pamphlets +severn +edict +##oca +deux +illnesses +grips +##pl +rehearsals +sis +thinkers +tame +##keepers +1690 +acacia +reformer +##osed +##rys +shuffling +##iring +##shima +eastbound +ionic +rhea +flees +littered +##oum +rocker +vomiting +groaning +champ +overwhelmingly +civilizations +paces +sloop +adoptive +##tish +skaters +##vres +aiding +mango +##joy +nikola +shriek +##ignon +pharmaceuticals +##mg +tuna +calvert +gustavo +stocked +yearbook +##urai +##mana +computed +subsp +riff +hanoi +kelvin +hamid +moors +pastures +summons +jihad +nectar +##ctors +bayou +untitled +pleasing +vastly +republics +intellect +##η +##ulio +##tou +crumbling +stylistic +sb +##ی +consolation +frequented +h₂o +walden +widows +##iens +404 +##ignment +chunks +improves +288 +grit +recited +##dev +snarl +sociological +##arte +##gul +inquired +##held +bruise +clube +consultancy +homogeneous +hornets +multiplication +pasta +prick +savior +##grin +##kou +##phile +yoon +##gara +grimes +vanishing +cheering +reacting +bn +distillery +##quisite +##vity +coe +dockyard +massif +##jord +escorts +voss +##valent +byte +chopped +hawke +illusions +workings +floats +##koto +##vac +kv +annapolis +madden +##onus +alvaro +noctuidae +##cum +##scopic +avenge +steamboat +forte +illustrates +erika +##trip +570 +dew +nationalities +bran +manifested +thirsty +diversified +muscled +reborn +##standing +arson +##lessness +##dran +##logram +##boys +##kushima +##vious +willoughby +##phobia +286 +alsace +dashboard +yuki +##chai +granville +myspace +publicized +tricked +##gang +adjective +##ater +relic +reorganisation +enthusiastically +indications +saxe +##lassified +consolidate +iec +padua +helplessly +ramps +renaming +regulars +pedestrians +accents +convicts +inaccurate +lowers +mana +##pati +barrie +bjp +outta +someplace +berwick +flanking +invoked +marrow +sparsely +excerpts +clothed +rei +##ginal +wept +##straße +##vish +alexa +excel +##ptive +membranes +aquitaine +creeks +cutler +sheppard +implementations +ns +##dur +fragrance +budge +concordia +magnesium +marcelo +##antes +gladly +vibrating +##rral +##ggles +montrose +##omba +lew +seamus +1630 +cocky +##ament +##uen +bjorn +##rrick +fielder +fluttering +##lase +methyl +kimberley +mcdowell +reductions +barbed +##jic +##tonic +aeronautical +condensed +distracting +##promising +huffed +##cala +##sle +claudius +invincible +missy +pious +balthazar +ci +##lang +butte +combo +orson +##dication +myriad +1707 +silenced +##fed +##rh +coco +netball +yourselves +##oza +clarify +heller +peg +durban +etudes +offender +roast +blackmail +curvature +##woods +vile +309 +illicit +suriname +##linson +overture +1685 +bubbling +gymnast +tucking +##mming +##ouin +maldives +##bala +gurney +##dda +##eased +##oides +backside +pinto +jars +racehorse +tending +##rdial +baronetcy +wiener +duly +##rke +barbarian +cupping +flawed +##thesis +bertha +pleistocene +puddle +swearing +##nob +##tically +fleeting +prostate +amulet +educating +##mined +##iti +##tler +75th +jens +respondents +analytics +cavaliers +papacy +raju +##iente +##ulum +##tip +funnel +271 +disneyland +##lley +sociologist +##iam +2500 +faulkner +louvre +menon +##dson +276 +##ower +afterlife +mannheim +peptide +referees +comedians +meaningless +##anger +##laise +fabrics +hurley +renal +sleeps +##bour +##icle +breakout +kristin +roadside +animator +clover +disdain +unsafe +redesign +##urity +firth +barnsley +portage +reset +narrows +268 +commandos +expansive +speechless +tubular +##lux +essendon +eyelashes +smashwords +##yad +##bang +##claim +craved +sprinted +chet +somme +astor +wrocław +orton +266 +bane +##erving +##uing +mischief +##amps +##sund +scaling +terre +##xious +impairment +offenses +undermine +moi +soy +contiguous +arcadia +inuit +seam +##tops +macbeth +rebelled +##icative +##iot +590 +elaborated +frs +uniformed +##dberg +259 +powerless +priscilla +stimulated +980 +qc +arboretum +frustrating +trieste +bullock +##nified +enriched +glistening +intern +##adia +locus +nouvelle +ollie +ike +lash +starboard +ee +tapestry +headlined +hove +rigged +##vite +pollock +##yme +thrive +clustered +cas +roi +gleamed +olympiad +##lino +pressured +regimes +##hosis +##lick +ripley +##ophone +kickoff +gallon +rockwell +##arable +crusader +glue +revolutions +scrambling +1714 +grover +##jure +englishman +aztec +263 +contemplating +coven +ipad +preach +triumphant +tufts +##esian +rotational +##phus +328 +falkland +##brates +strewn +clarissa +rejoin +environmentally +glint +banded +drenched +moat +albanians +johor +rr +maestro +malley +nouveau +shaded +taxonomy +v6 +adhere +bunk +airfields +##ritan +1741 +encompass +remington +tran +##erative +amelie +mazda +friar +morals +passions +##zai +breadth +vis +##hae +argus +burnham +caressing +insider +rudd +##imov +##mini +##rso +italianate +murderous +textual +wainwright +armada +bam +weave +timer +##taken +##nh +fra +##crest +ardent +salazar +taps +tunis +##ntino +allegro +gland +philanthropic +##chester +implication +##optera +esq +judas +noticeably +wynn +##dara +inched +indexed +crises +villiers +bandit +royalties +patterned +cupboard +interspersed +accessory +isla +kendrick +entourage +stitches +##esthesia +headwaters +##ior +interlude +distraught +draught +1727 +##basket +biased +sy +transient +triad +subgenus +adapting +kidd +shortstop +##umatic +dimly +spiked +mcleod +reprint +nellie +pretoria +windmill +##cek +singled +##mps +273 +reunite +##orous +747 +bankers +outlying +##omp +##ports +##tream +apologies +cosmetics +patsy +##deh +##ocks +##yson +bender +nantes +serene +##nad +lucha +mmm +323 +##cius +##gli +cmll +coinage +nestor +juarez +##rook +smeared +sprayed +twitching +sterile +irina +embodied +juveniles +enveloped +miscellaneous +cancers +dq +gulped +luisa +crested +swat +donegal +ref +##anov +##acker +hearst +mercantile +##lika +doorbell +ua +vicki +##alla +##som +bilbao +psychologists +stryker +sw +horsemen +turkmenistan +wits +##national +anson +mathew +screenings +##umb +rihanna +##agne +##nessy +aisles +##iani +##osphere +hines +kenton +saskatoon +tasha +truncated +##champ +##itan +mildred +advises +fredrik +interpreting +inhibitors +##athi +spectroscopy +##hab +##kong +karim +panda +##oia +##nail +##vc +conqueror +kgb +leukemia +##dity +arrivals +cheered +pisa +phosphorus +shielded +##riated +mammal +unitarian +urgently +chopin +sanitary +##mission +spicy +drugged +hinges +##tort +tipping +trier +impoverished +westchester +##caster +267 +epoch +nonstop +##gman +##khov +aromatic +centrally +cerro +##tively +##vio +billions +modulation +sedimentary +283 +facilitating +outrageous +goldstein +##eak +##kt +ld +maitland +penultimate +pollard +##dance +fleets +spaceship +vertebrae +##nig +alcoholism +als +recital +##bham +##ference +##omics +m2 +##bm +trois +##tropical +##в +commemorates +##meric +marge +##raction +1643 +670 +cosmetic +ravaged +##ige +catastrophe +eng +##shida +albrecht +arterial +bellamy +decor +harmon +##rde +bulbs +synchronized +vito +easiest +shetland +shielding +wnba +##glers +##ssar +##riam +brianna +cumbria +##aceous +##rard +cores +thayer +##nsk +brood +hilltop +luminous +carts +keynote +larkin +logos +##cta +##ا +##mund +##quay +lilith +tinted +277 +wrestle +mobilization +##uses +sequential +siam +bloomfield +takahashi +274 +##ieving +presenters +ringo +blazed +witty +##oven +##ignant +devastation +haydn +harmed +newt +therese +##peed +gershwin +molina +rabbis +sudanese +001 +innate +restarted +##sack +##fus +slices +wb +##shah +enroll +hypothetical +hysterical +1743 +fabio +indefinite +warped +##hg +exchanging +525 +unsuitable +##sboro +gallo +1603 +bret +cobalt +homemade +##hunter +mx +operatives +##dhar +terraces +durable +latch +pens +whorls +##ctuated +##eaux +billing +ligament +succumbed +##gly +regulators +spawn +##brick +##stead +filmfare +rochelle +##nzo +1725 +circumstance +saber +supplements +##nsky +##tson +crowe +wellesley +carrot +##9th +##movable +primate +drury +sincerely +topical +##mad +##rao +callahan +kyiv +smarter +tits +undo +##yeh +announcements +anthologies +barrio +nebula +##islaus +##shaft +##tyn +bodyguards +2021 +assassinate +barns +emmett +scully +##mah +##yd +##eland +##tino +##itarian +demoted +gorman +lashed +prized +adventist +writ +##gui +alla +invertebrates +##ausen +1641 +amman +1742 +align +healy +redistribution +##gf +##rize +insulation +##drop +adherents +hezbollah +vitro +ferns +yanking +269 +php +registering +uppsala +cheerleading +confines +mischievous +tully +##ross +49th +docked +roam +stipulated +pumpkin +##bry +prompt +##ezer +blindly +shuddering +craftsmen +frail +scented +katharine +scramble +shaggy +sponge +helix +zaragoza +279 +##52 +43rd +backlash +fontaine +seizures +posse +cowan +nonfiction +telenovela +wwii +hammered +undone +##gpur +encircled +irs +##ivation +artefacts +oneself +searing +smallpox +##belle +##osaurus +shandong +breached +upland +blushing +rankin +infinitely +psyche +tolerated +docking +evicted +##col +unmarked +##lving +gnome +lettering +litres +musique +##oint +benevolent +##jal +blackened +##anna +mccall +racers +tingle +##ocene +##orestation +introductions +radically +292 +##hiff +##باد +1610 +1739 +munchen +plead +##nka +condo +scissors +##sight +##tens +apprehension +##cey +##yin +hallmark +watering +formulas +sequels +##llas +aggravated +bae +commencing +##building +enfield +prohibits +marne +vedic +civilized +euclidean +jagger +beforehand +blasts +dumont +##arney +##nem +740 +conversions +hierarchical +rios +simulator +##dya +##lellan +hedges +oleg +thrusts +shadowed +darby +maximize +1744 +gregorian +##nded +##routed +sham +unspecified +##hog +emory +factual +##smo +##tp +fooled +##rger +ortega +wellness +marlon +##oton +##urance +casket +keating +ley +enclave +##ayan +char +influencing +jia +##chenko +412 +ammonia +erebidae +incompatible +violins +cornered +##arat +grooves +astronauts +columbian +rampant +fabrication +kyushu +mahmud +vanish +##dern +mesopotamia +##lete +ict +##rgen +caspian +kenji +pitted +##vered +999 +grimace +roanoke +tchaikovsky +twinned +##analysis +##awan +xinjiang +arias +clemson +kazakh +sizable +1662 +##khand +##vard +plunge +tatum +vittorio +##nden +cholera +##dana +##oper +bracing +indifference +projectile +superliga +##chee +realises +upgrading +299 +porte +retribution +##vies +nk +stil +##resses +ama +bureaucracy +blackberry +bosch +testosterone +collapses +greer +##pathic +ioc +fifties +malls +##erved +bao +baskets +adolescents +siegfried +##osity +##tosis +mantra +detecting +existent +fledgling +##cchi +dissatisfied +gan +telecommunication +mingled +sobbed +6000 +controversies +outdated +taxis +##raus +fright +slams +##lham +##fect +##tten +detectors +fetal +tanned +##uw +fray +goth +olympian +skipping +mandates +scratches +sheng +unspoken +hyundai +tracey +hotspur +restrictive +##buch +americana +mundo +##bari +burroughs +diva +vulcan +##6th +distinctions +thumping +##ngen +mikey +sheds +fide +rescues +springsteen +vested +valuation +##ece +##ely +pinnacle +rake +sylvie +##edo +almond +quivering +##irus +alteration +faltered +##wad +51st +hydra +ticked +##kato +recommends +##dicated +antigua +arjun +stagecoach +wilfred +trickle +pronouns +##pon +aryan +nighttime +##anian +gall +pea +stitch +##hei +leung +milos +##dini +eritrea +nexus +starved +snowfall +kant +parasitic +cot +discus +hana +strikers +appleton +kitchens +##erina +##partisan +##itha +##vius +disclose +metis +##channel +1701 +tesla +##vera +fitch +1735 +blooded +##tila +decimal +##tang +##bai +cyclones +eun +bottled +peas +pensacola +basha +bolivian +crabs +boil +lanterns +partridge +roofed +1645 +necks +##phila +opined +patting +##kla +##lland +chuckles +volta +whereupon +##nche +devout +euroleague +suicidal +##dee +inherently +involuntary +knitting +nasser +##hide +puppets +colourful +courageous +southend +stills +miraculous +hodgson +richer +rochdale +ethernet +greta +uniting +prism +umm +##haya +##itical +##utation +deterioration +pointe +prowess +##ropriation +lids +scranton +billings +subcontinent +##koff +##scope +brute +kellogg +psalms +degraded +##vez +stanisław +##ructured +ferreira +pun +astonishing +gunnar +##yat +arya +prc +gottfried +##tight +excursion +##ographer +dina +##quil +##nare +huffington +illustrious +wilbur +gundam +verandah +##zard +naacp +##odle +constructive +fjord +kade +##naud +generosity +thrilling +baseline +cayman +frankish +plastics +accommodations +zoological +##fting +cedric +qb +motorized +##dome +##otted +squealed +tackled +canucks +budgets +situ +asthma +dail +gabled +grasslands +whimpered +writhing +judgments +##65 +minnie +pv +##carbon +bananas +grille +domes +monique +odin +maguire +markham +tierney +##estra +##chua +libel +poke +speedy +atrium +laval +notwithstanding +##edly +fai +kala +##sur +robb +##sma +listings +luz +supplementary +tianjin +##acing +enzo +jd +ric +scanner +croats +transcribed +##49 +arden +cv +##hair +##raphy +##lver +##uy +357 +seventies +staggering +alam +horticultural +hs +regression +timbers +blasting +##ounded +montagu +manipulating +##cit +catalytic +1550 +troopers +##meo +condemnation +fitzpatrick +##oire +##roved +inexperienced +1670 +castes +##lative +outing +314 +dubois +flicking +quarrel +ste +learners +1625 +iq +whistled +##class +282 +classify +tariffs +temperament +355 +folly +liszt +##yles +immersed +jordanian +ceasefire +apparel +extras +maru +fished +##bio +harta +stockport +assortment +craftsman +paralysis +transmitters +##cola +blindness +##wk +fatally +proficiency +solemnly +##orno +repairing +amore +groceries +ultraviolet +##chase +schoolhouse +##tua +resurgence +nailed +##otype +##× +ruse +saliva +diagrams +##tructing +albans +rann +thirties +1b +antennas +hilarious +cougars +paddington +stats +##eger +breakaway +ipod +reza +authorship +prohibiting +scoffed +##etz +##ttle +conscription +defected +trondheim +##fires +ivanov +keenan +##adan +##ciful +##fb +##slow +locating +##ials +##tford +cadiz +basalt +blankly +interned +rags +rattling +##tick +carpathian +reassured +sync +bum +guildford +iss +staunch +##onga +astronomers +sera +sofie +emergencies +susquehanna +##heard +duc +mastery +vh1 +williamsburg +bayer +buckled +craving +##khan +##rdes +bloomington +##write +alton +barbecue +##bians +justine +##hri +##ndt +delightful +smartphone +newtown +photon +retrieval +peugeot +hissing +##monium +##orough +flavors +lighted +relaunched +tainted +##games +##lysis +anarchy +microscopic +hopping +adept +evade +evie +##beau +inhibit +sinn +adjustable +hurst +intuition +wilton +cisco +44th +lawful +lowlands +stockings +thierry +##dalen +##hila +##nai +fates +prank +tb +maison +lobbied +provocative +1724 +4a +utopia +##qual +carbonate +gujarati +purcell +##rford +curtiss +##mei +overgrown +arenas +mediation +swallows +##rnik +respectful +turnbull +##hedron +##hope +alyssa +ozone +##ʻi +ami +gestapo +johansson +snooker +canteen +cuff +declines +empathy +stigma +##ags +##iner +##raine +taxpayers +gui +volga +##wright +##copic +lifespan +overcame +tattooed +enactment +giggles +##ador +##camp +barrington +bribe +obligatory +orbiting +peng +##enas +elusive +sucker +##vating +cong +hardship +empowered +anticipating +estrada +cryptic +greasy +detainees +planck +sudbury +plaid +dod +marriott +kayla +##ears +##vb +##zd +mortally +##hein +cognition +radha +319 +liechtenstein +meade +richly +argyle +harpsichord +liberalism +trumpets +lauded +tyrant +salsa +tiled +lear +promoters +reused +slicing +trident +##chuk +##gami +##lka +cantor +checkpoint +##points +gaul +leger +mammalian +##tov +##aar +##schaft +doha +frenchman +nirvana +##vino +delgado +headlining +##eron +##iography +jug +tko +1649 +naga +intersections +##jia +benfica +nawab +##suka +ashford +gulp +##deck +##vill +##rug +brentford +frazier +pleasures +dunne +potsdam +shenzhen +dentistry +##tec +flanagan +##dorff +##hear +chorale +dinah +prem +quezon +##rogated +relinquished +sutra +terri +##pani +flaps +##rissa +poly +##rnet +homme +aback +##eki +linger +womb +##kson +##lewood +doorstep +orthodoxy +threaded +westfield +##rval +dioceses +fridays +subsided +##gata +loyalists +##biotic +##ettes +letterman +lunatic +prelate +tenderly +invariably +souza +thug +winslow +##otide +furlongs +gogh +jeopardy +##runa +pegasus +##umble +humiliated +standalone +tagged +##roller +freshmen +klan +##bright +attaining +initiating +transatlantic +logged +viz +##uance +1723 +combatants +intervening +stephane +chieftain +despised +grazed +317 +cdc +galveston +godzilla +macro +simulate +##planes +parades +##esses +960 +##ductive +##unes +equator +overdose +##cans +##hosh +##lifting +joshi +epstein +sonora +treacherous +aquatics +manchu +responsive +##sation +supervisory +##christ +##llins +##ibar +##balance +##uso +kimball +karlsruhe +mab +##emy +ignores +phonetic +reuters +spaghetti +820 +almighty +danzig +rumbling +tombstone +designations +lured +outset +##felt +supermarkets +##wt +grupo +kei +kraft +susanna +##blood +comprehension +genealogy +##aghan +##verted +redding +##ythe +1722 +bowing +##pore +##roi +lest +sharpened +fulbright +valkyrie +sikhs +##unds +swans +bouquet +merritt +##tage +##venting +commuted +redhead +clerks +leasing +cesare +dea +hazy +##vances +fledged +greenfield +servicemen +##gical +armando +blackout +dt +sagged +downloadable +intra +potion +pods +##4th +##mism +xp +attendants +gambia +stale +##ntine +plump +asteroids +rediscovered +buds +flea +hive +##neas +1737 +classifications +debuts +##eles +olympus +scala +##eurs +##gno +##mute +hummed +sigismund +visuals +wiggled +await +pilasters +clench +sulfate +##ances +bellevue +enigma +trainee +snort +##sw +clouded +denim +##rank +##rder +churning +hartman +lodges +riches +sima +##missible +accountable +socrates +regulates +mueller +##cr +1702 +avoids +solids +himalayas +nutrient +pup +##jevic +squat +fades +nec +##lates +##pina +##rona +##ου +privateer +tequila +##gative +##mpton +apt +hornet +immortals +##dou +asturias +cleansing +dario +##rries +##anta +etymology +servicing +zhejiang +##venor +##nx +horned +erasmus +rayon +relocating +£10 +##bags +escalated +promenade +stubble +2010s +artisans +axial +liquids +mora +sho +yoo +##tsky +bundles +oldies +##nally +notification +bastion +##ths +sparkle +##lved +1728 +leash +pathogen +highs +##hmi +immature +880 +gonzaga +ignatius +mansions +monterrey +sweets +bryson +##loe +polled +regatta +brightest +pei +rosy +squid +hatfield +payroll +addict +meath +cornerback +heaviest +lodging +##mage +capcom +rippled +##sily +barnet +mayhem +ymca +snuggled +rousseau +##cute +blanchard +284 +fragmented +leighton +chromosomes +risking +##md +##strel +##utter +corinne +coyotes +cynical +hiroshi +yeomanry +##ractive +ebook +grading +mandela +plume +agustin +magdalene +##rkin +bea +femme +trafford +##coll +##lun +##tance +52nd +fourier +upton +##mental +camilla +gust +iihf +islamabad +longevity +##kala +feldman +netting +##rization +endeavour +foraging +mfa +orr +##open +greyish +contradiction +graz +##ruff +handicapped +marlene +tweed +oaxaca +spp +campos +miocene +pri +configured +cooks +pluto +cozy +pornographic +##entes +70th +fairness +glided +jonny +lynne +rounding +sired +##emon +##nist +remade +uncover +##mack +complied +lei +newsweek +##jured +##parts +##enting +##pg +293 +finer +guerrillas +athenian +deng +disused +stepmother +accuse +gingerly +seduction +521 +confronting +##walker +##going +gora +nostalgia +sabres +virginity +wrenched +##minated +syndication +wielding +eyre +##56 +##gnon +##igny +behaved +taxpayer +sweeps +##growth +childless +gallant +##ywood +amplified +geraldine +scrape +##ffi +babylonian +fresco +##rdan +##kney +##position +1718 +restricting +tack +fukuoka +osborn +selector +partnering +##dlow +318 +gnu +kia +tak +whitley +gables +##54 +##mania +mri +softness +immersion +##bots +##evsky +1713 +chilling +insignificant +pcs +##uis +elites +lina +purported +supplemental +teaming +##americana +##dding +##inton +proficient +rouen +##nage +##rret +niccolo +selects +##bread +fluffy +1621 +gruff +knotted +mukherjee +polgara +thrash +nicholls +secluded +smoothing +thru +corsica +loaf +whitaker +inquiries +##rrier +##kam +indochina +289 +marlins +myles +peking +##tea +extracts +pastry +superhuman +connacht +vogel +##ditional +##het +##udged +##lash +gloss +quarries +refit +teaser +##alic +##gaon +20s +materialized +sling +camped +pickering +tung +tracker +pursuant +##cide +cranes +soc +##cini +##typical +##viere +anhalt +overboard +workout +chores +fares +orphaned +stains +##logie +fenton +surpassing +joyah +triggers +##itte +grandmaster +##lass +##lists +clapping +fraudulent +ledger +nagasaki +##cor +##nosis +##tsa +eucalyptus +tun +##icio +##rney +##tara +dax +heroism +ina +wrexham +onboard +unsigned +##dates +moshe +galley +winnie +droplets +exiles +praises +watered +noodles +##aia +fein +adi +leland +multicultural +stink +bingo +comets +erskine +modernized +canned +constraint +domestically +chemotherapy +featherweight +stifled +##mum +darkly +irresistible +refreshing +hasty +isolate +##oys +kitchener +planners +##wehr +cages +yarn +implant +toulon +elects +childbirth +yue +##lind +##lone +cn +rightful +sportsman +junctions +remodeled +specifies +##rgh +291 +##oons +complimented +##urgent +lister +ot +##logic +bequeathed +cheekbones +fontana +gabby +##dial +amadeus +corrugated +maverick +resented +triangles +##hered +##usly +nazareth +tyrol +1675 +assent +poorer +sectional +aegean +##cous +296 +nylon +ghanaian +##egorical +##weig +cushions +forbid +fusiliers +obstruction +somerville +##scia +dime +earrings +elliptical +leyte +oder +polymers +timmy +atm +midtown +piloted +settles +continual +externally +mayfield +##uh +enrichment +henson +keane +persians +1733 +benji +braden +pep +324 +##efe +contenders +pepsi +valet +##isches +298 +##asse +##earing +goofy +stroll +##amen +authoritarian +occurrences +adversary +ahmedabad +tangent +toppled +dorchester +1672 +modernism +marxism +islamist +charlemagne +exponential +racks +unicode +brunette +mbc +pic +skirmish +##bund +##lad +##powered +##yst +hoisted +messina +shatter +##ctum +jedi +vantage +##music +##neil +clemens +mahmoud +corrupted +authentication +lowry +nils +##washed +omnibus +wounding +jillian +##itors +##opped +serialized +narcotics +handheld +##arm +##plicity +intersecting +stimulating +##onis +crate +fellowships +hemingway +casinos +climatic +fordham +copeland +drip +beatty +leaflets +robber +brothel +madeira +##hedral +sphinx +ultrasound +##vana +valor +forbade +leonid +villas +##aldo +duane +marquez +##cytes +disadvantaged +forearms +kawasaki +reacts +consular +lax +uncles +uphold +##hopper +concepcion +dorsey +lass +##izan +arching +passageway +1708 +researches +tia +internationals +##graphs +##opers +distinguishes +javanese +divert +##uven +plotted +##listic +##rwin +##erik +##tify +affirmative +signifies +validation +##bson +kari +felicity +georgina +zulu +##eros +##rained +##rath +overcoming +##dot +argyll +##rbin +1734 +chiba +ratification +windy +earls +parapet +##marks +hunan +pristine +astrid +punta +##gart +brodie +##kota +##oder +malaga +minerva +rouse +##phonic +bellowed +pagoda +portals +reclamation +##gur +##odies +##⁄₄ +parentheses +quoting +allergic +palette +showcases +benefactor +heartland +nonlinear +##tness +bladed +cheerfully +scans +##ety +##hone +1666 +girlfriends +pedersen +hiram +sous +##liche +##nator +1683 +##nery +##orio +##umen +bobo +primaries +smiley +##cb +unearthed +uniformly +fis +metadata +1635 +ind +##oted +recoil +##titles +##tura +##ια +406 +hilbert +jamestown +mcmillan +tulane +seychelles +##frid +antics +coli +fated +stucco +##grants +1654 +bulky +accolades +arrays +caledonian +carnage +optimism +puebla +##tative +##cave +enforcing +rotherham +seo +dunlop +aeronautics +chimed +incline +zoning +archduke +hellenistic +##oses +##sions +candi +thong +##ople +magnate +rustic +##rsk +projective +slant +##offs +danes +hollis +vocalists +##ammed +congenital +contend +gesellschaft +##ocating +##pressive +douglass +quieter +##cm +##kshi +howled +salim +spontaneously +townsville +buena +southport +##bold +kato +1638 +faerie +stiffly +##vus +##rled +297 +flawless +realising +taboo +##7th +bytes +straightening +356 +jena +##hid +##rmin +cartwright +berber +bertram +soloists +411 +noses +417 +coping +fission +hardin +inca +##cen +1717 +mobilized +vhf +##raf +biscuits +curate +##85 +##anial +331 +gaunt +neighbourhoods +1540 +##abas +blanca +bypassed +sockets +behold +coincidentally +##bane +nara +shave +splinter +terrific +##arion +##erian +commonplace +juris +redwood +waistband +boxed +caitlin +fingerprints +jennie +naturalized +##ired +balfour +craters +jody +bungalow +hugely +quilt +glitter +pigeons +undertaker +bulging +constrained +goo +##sil +##akh +assimilation +reworked +##person +persuasion +##pants +felicia +##cliff +##ulent +1732 +explodes +##dun +##inium +##zic +lyman +vulture +hog +overlook +begs +northwards +ow +spoil +##urer +fatima +favorably +accumulate +sargent +sorority +corresponded +dispersal +kochi +toned +##imi +##lita +internacional +newfound +##agger +##lynn +##rigue +booths +peanuts +##eborg +medicare +muriel +nur +##uram +crates +millennia +pajamas +worsened +##breakers +jimi +vanuatu +yawned +##udeau +carousel +##hony +hurdle +##ccus +##mounted +##pod +rv +##eche +airship +ambiguity +compulsion +recapture +##claiming +arthritis +##osomal +1667 +asserting +ngc +sniffing +dade +discontent +glendale +ported +##amina +defamation +rammed +##scent +fling +livingstone +##fleet +875 +##ppy +apocalyptic +comrade +lcd +##lowe +cessna +eine +persecuted +subsistence +demi +hoop +reliefs +710 +coptic +progressing +stemmed +perpetrators +1665 +priestess +##nio +dobson +ebony +rooster +itf +tortricidae +##bbon +##jian +cleanup +##jean +##øy +1721 +eighties +taxonomic +holiness +##hearted +##spar +antilles +showcasing +stabilized +##nb +gia +mascara +michelangelo +dawned +##uria +##vinsky +extinguished +fitz +grotesque +£100 +##fera +##loid +##mous +barges +neue +throbbed +cipher +johnnie +##a1 +##mpt +outburst +##swick +spearheaded +administrations +c1 +heartbreak +pixels +pleasantly +##enay +lombardy +plush +##nsed +bobbie +##hly +reapers +tremor +xiang +minogue +substantive +hitch +barak +##wyl +kwan +##encia +910 +obscene +elegance +indus +surfer +bribery +conserve +##hyllum +##masters +horatio +##fat +apes +rebound +psychotic +##pour +iteration +##mium +##vani +botanic +horribly +antiques +dispose +paxton +##hli +##wg +timeless +1704 +disregard +engraver +hounds +##bau +##version +looted +uno +facilitates +groans +masjid +rutland +antibody +disqualification +decatur +footballers +quake +slacks +48th +rein +scribe +stabilize +commits +exemplary +tho +##hort +##chison +pantry +traversed +##hiti +disrepair +identifiable +vibrated +baccalaureate +##nnis +csa +interviewing +##iensis +##raße +greaves +wealthiest +343 +classed +jogged +£5 +##58 +##atal +illuminating +knicks +respecting +##uno +scrubbed +##iji +##dles +kruger +moods +growls +raider +silvia +chefs +kam +vr +cree +percival +##terol +gunter +counterattack +defiant +henan +ze +##rasia +##riety +equivalence +submissions +##fra +##thor +bautista +mechanically +##heater +cornice +herbal +templar +##mering +outputs +ruining +ligand +renumbered +extravagant +mika +blockbuster +eta +insurrection +##ilia +darkening +ferocious +pianos +strife +kinship +##aer +melee +##anor +##iste +##may +##oue +decidedly +weep +##jad +##missive +##ppel +354 +puget +unease +##gnant +1629 +hammering +kassel +ob +wessex +##lga +bromwich +egan +paranoia +utilization +##atable +##idad +contradictory +provoke +##ols +##ouring +##tangled +knesset +##very +##lette +plumbing +##sden +##¹ +greensboro +occult +sniff +338 +zev +beaming +gamer +haggard +mahal +##olt +##pins +mendes +utmost +briefing +gunnery +##gut +##pher +##zh +##rok +1679 +khalifa +sonya +##boot +principals +urbana +wiring +##liffe +##minating +##rrado +dahl +nyu +skepticism +np +townspeople +ithaca +lobster +somethin +##fur +##arina +##−1 +freighter +zimmerman +biceps +contractual +##herton +amend +hurrying +subconscious +##anal +336 +meng +clermont +spawning +##eia +##lub +dignitaries +impetus +snacks +spotting +twigs +##bilis +##cz +##ouk +libertadores +nic +skylar +##aina +##firm +gustave +asean +##anum +dieter +legislatures +flirt +bromley +trolls +umar +##bbies +##tyle +blah +parc +bridgeport +crank +negligence +##nction +46th +constantin +molded +bandages +seriousness +00pm +siegel +carpets +compartments +upbeat +statehood +##dner +##edging +marko +730 +platt +##hane +paving +##iy +1738 +abbess +impatience +limousine +nbl +##talk +441 +lucille +mojo +nightfall +robbers +##nais +karel +brisk +calves +replicate +ascribed +telescopes +##olf +intimidated +##reen +ballast +specialization +##sit +aerodynamic +caliphate +rainer +visionary +##arded +epsilon +##aday +##onte +aggregation +auditory +boosted +reunification +kathmandu +loco +robyn +402 +acknowledges +appointing +humanoid +newell +redeveloped +restraints +##tained +barbarians +chopper +1609 +italiana +##lez +##lho +investigates +wrestlemania +##anies +##bib +690 +##falls +creaked +dragoons +gravely +minions +stupidity +volley +##harat +##week +musik +##eries +##uously +fungal +massimo +semantics +malvern +##ahl +##pee +discourage +embryo +imperialism +1910s +profoundly +##ddled +jiangsu +sparkled +stat +##holz +sweatshirt +tobin +##iction +sneered +##cheon +##oit +brit +causal +smyth +##neuve +diffuse +perrin +silvio +##ipes +##recht +detonated +iqbal +selma +##nism +##zumi +roasted +##riders +tay +##ados +##mament +##mut +##rud +840 +completes +nipples +cfa +flavour +hirsch +##laus +calderon +sneakers +moravian +##ksha +1622 +rq +294 +##imeters +bodo +##isance +##pre +##ronia +anatomical +excerpt +##lke +dh +kunst +##tablished +##scoe +biomass +panted +unharmed +gael +housemates +montpellier +##59 +coa +rodents +tonic +hickory +singleton +##taro +451 +1719 +aldo +breaststroke +dempsey +och +rocco +##cuit +merton +dissemination +midsummer +serials +##idi +haji +polynomials +##rdon +gs +enoch +prematurely +shutter +taunton +£3 +##grating +##inates +archangel +harassed +##asco +326 +archway +dazzling +##ecin +1736 +sumo +wat +##kovich +1086 +honneur +##ently +##nostic +##ttal +##idon +1605 +403 +1716 +blogger +rents +##gnan +hires +##ikh +##dant +howie +##rons +handler +retracted +shocks +1632 +arun +duluth +kepler +trumpeter +##lary +peeking +seasoned +trooper +##mara +laszlo +##iciencies +##rti +heterosexual +##inatory +##ssion +indira +jogging +##inga +##lism +beit +dissatisfaction +malice +##ately +nedra +peeling +##rgeon +47th +stadiums +475 +vertigo +##ains +iced +restroom +##plify +##tub +illustrating +pear +##chner +##sibility +inorganic +rappers +receipts +watery +##kura +lucinda +##oulos +reintroduced +##8th +##tched +gracefully +saxons +nutritional +wastewater +rained +favourites +bedrock +fisted +hallways +likeness +upscale +##lateral +1580 +blinds +prequel +##pps +##tama +deter +humiliating +restraining +tn +vents +1659 +laundering +recess +rosary +tractors +coulter +federer +##ifiers +##plin +persistence +##quitable +geschichte +pendulum +quakers +##beam +bassett +pictorial +buffet +koln +##sitor +drills +reciprocal +shooters +##57 +##cton +##tees +converge +pip +dmitri +donnelly +yamamoto +aqua +azores +demographics +hypnotic +spitfire +suspend +wryly +roderick +##rran +sebastien +##asurable +mavericks +##fles +##200 +himalayan +prodigy +##iance +transvaal +demonstrators +handcuffs +dodged +mcnamara +sublime +1726 +crazed +##efined +##till +ivo +pondered +reconciled +shrill +sava +##duk +bal +cad +heresy +jaipur +goran +##nished +341 +lux +shelly +whitehall +##hre +israelis +peacekeeping +##wled +1703 +demetrius +ousted +##arians +##zos +beale +anwar +backstroke +raged +shrinking +cremated +##yck +benign +towing +wadi +darmstadt +landfill +parana +soothe +colleen +sidewalks +mayfair +tumble +hepatitis +ferrer +superstructure +##gingly +##urse +##wee +anthropological +translators +##mies +closeness +hooves +##pw +mondays +##roll +##vita +landscaping +##urized +purification +sock +thorns +thwarted +jalan +tiberius +##taka +saline +##rito +confidently +khyber +sculptors +##ij +brahms +hammersmith +inspectors +battista +fivb +fragmentation +hackney +##uls +arresting +exercising +antoinette +bedfordshire +##zily +dyed +##hema +1656 +racetrack +variability +##tique +1655 +austrians +deteriorating +madman +theorists +aix +lehman +weathered +1731 +decreed +eruptions +1729 +flaw +quinlan +sorbonne +flutes +nunez +1711 +adored +downwards +fable +rasped +1712 +moritz +mouthful +renegade +shivers +stunts +dysfunction +restrain +translit +327 +pancakes +##avio +##cision +##tray +351 +vial +##lden +bain +##maid +##oxide +chihuahua +malacca +vimes +##rba +##rnier +1664 +donnie +plaques +##ually +337 +bangs +floppy +huntsville +loretta +nikolay +##otte +eater +handgun +ubiquitous +##hett +eras +zodiac +1634 +##omorphic +1820s +##zog +cochran +##bula +##lithic +warring +##rada +dalai +excused +blazers +mcconnell +reeling +bot +este +##abi +geese +hoax +taxon +##bla +guitarists +##icon +condemning +hunts +inversion +moffat +taekwondo +##lvis +1624 +stammered +##rest +##rzy +sousa +fundraiser +marylebone +navigable +uptown +cabbage +daniela +salman +shitty +whimper +##kian +##utive +programmers +protections +rm +##rmi +##rued +forceful +##enes +fuss +##tao +##wash +brat +oppressive +reykjavik +spartak +ticking +##inkles +##kiewicz +adolph +horst +maui +protege +straighten +cpc +landau +concourse +clements +resultant +##ando +imaginative +joo +reactivated +##rem +##ffled +##uising +consultative +##guide +flop +kaitlyn +mergers +parenting +somber +##vron +supervise +vidhan +##imum +courtship +exemplified +harmonies +medallist +refining +##rrow +##ка +amara +##hum +780 +goalscorer +sited +overshadowed +rohan +displeasure +secretive +multiplied +osman +##orth +engravings +padre +##kali +##veda +miniatures +mis +##yala +clap +pali +rook +##cana +1692 +57th +antennae +astro +oskar +1628 +bulldog +crotch +hackett +yucatan +##sure +amplifiers +brno +ferrara +migrating +##gree +thanking +turing +##eza +mccann +ting +andersson +onslaught +gaines +ganga +incense +standardization +##mation +sentai +scuba +stuffing +turquoise +waivers +alloys +##vitt +regaining +vaults +##clops +##gizing +digger +furry +memorabilia +probing +##iad +payton +rec +deutschland +filippo +opaque +seamen +zenith +afrikaans +##filtration +disciplined +inspirational +##merie +banco +confuse +grafton +tod +##dgets +championed +simi +anomaly +biplane +##ceptive +electrode +##para +1697 +cleavage +crossbow +swirl +informant +##lars +##osta +afi +bonfire +spec +##oux +lakeside +slump +##culus +##lais +##qvist +##rrigan +1016 +facades +borg +inwardly +cervical +xl +pointedly +050 +stabilization +##odon +chests +1699 +hacked +ctv +orthogonal +suzy +##lastic +gaulle +jacobite +rearview +##cam +##erted +ashby +##drik +##igate +##mise +##zbek +affectionately +canine +disperse +latham +##istles +##ivar +spielberg +##orin +##idium +ezekiel +cid +##sg +durga +middletown +##cina +customized +frontiers +harden +##etano +##zzy +1604 +bolsheviks +##66 +coloration +yoko +##bedo +briefs +slabs +debra +liquidation +plumage +##oin +blossoms +dementia +subsidy +1611 +proctor +relational +jerseys +parochial +ter +##ici +esa +peshawar +cavalier +loren +cpi +idiots +shamrock +1646 +dutton +malabar +mustache +##endez +##ocytes +referencing +terminates +marche +yarmouth +##sop +acton +mated +seton +subtly +baptised +beige +extremes +jolted +kristina +telecast +##actic +safeguard +waldo +##baldi +##bular +endeavors +sloppy +subterranean +##ensburg +##itung +delicately +pigment +tq +##scu +1626 +##ound +collisions +coveted +herds +##personal +##meister +##nberger +chopra +##ricting +abnormalities +defective +galician +lucie +##dilly +alligator +likened +##genase +burundi +clears +complexion +derelict +deafening +diablo +fingered +champaign +dogg +enlist +isotope +labeling +mrna +##erre +brilliance +marvelous +##ayo +1652 +crawley +ether +footed +dwellers +deserts +hamish +rubs +warlock +skimmed +##lizer +870 +buick +embark +heraldic +irregularities +##ajan +kiara +##kulam +##ieg +antigen +kowalski +##lge +oakley +visitation +##mbit +vt +##suit +1570 +murderers +##miento +##rites +chimneys +##sling +condemn +custer +exchequer +havre +##ghi +fluctuations +##rations +dfb +hendricks +vaccines +##tarian +nietzsche +biking +juicy +##duced +brooding +scrolling +selangor +##ragan +352 +annum +boomed +seminole +sugarcane +##dna +departmental +dismissing +innsbruck +arteries +ashok +batavia +daze +kun +overtook +##rga +##tlan +beheaded +gaddafi +holm +electronically +faulty +galilee +fractures +kobayashi +##lized +gunmen +magma +aramaic +mala +eastenders +inference +messengers +bf +##qu +407 +bathrooms +##vere +1658 +flashbacks +ideally +misunderstood +##jali +##weather +mendez +##grounds +505 +uncanny +##iii +1709 +friendships +##nbc +sacrament +accommodated +reiterated +logistical +pebbles +thumped +##escence +administering +decrees +drafts +##flight +##cased +##tula +futuristic +picket +intimidation +winthrop +##fahan +interfered +339 +afar +francoise +morally +uta +cochin +croft +dwarfs +##bruck +##dents +##nami +biker +##hner +##meral +nano +##isen +##ometric +##pres +##ан +brightened +meek +parcels +securely +gunners +##jhl +##zko +agile +hysteria +##lten +##rcus +bukit +champs +chevy +cuckoo +leith +sadler +theologians +welded +##section +1663 +jj +plurality +xander +##rooms +##formed +shredded +temps +intimately +pau +tormented +##lok +##stellar +1618 +charred +ems +essen +##mmel +alarms +spraying +ascot +blooms +twinkle +##abia +##apes +internment +obsidian +##chaft +snoop +##dav +##ooping +malibu +##tension +quiver +##itia +hays +mcintosh +travers +walsall +##ffie +1623 +beverley +schwarz +plunging +structurally +m3 +rosenthal +vikram +##tsk +770 +ghz +##onda +##tiv +chalmers +groningen +pew +reckon +unicef +##rvis +55th +##gni +1651 +sulawesi +avila +cai +metaphysical +screwing +turbulence +##mberg +augusto +samba +56th +baffled +momentary +toxin +##urian +##wani +aachen +condoms +dali +steppe +##3d +##app +##oed +##year +adolescence +dauphin +electrically +inaccessible +microscopy +nikita +##ega +atv +##cel +##enter +##oles +##oteric +##ы +accountants +punishments +wrongly +bribes +adventurous +clinch +flinders +southland +##hem +##kata +gough +##ciency +lads +soared +##ה +undergoes +deformation +outlawed +rubbish +##arus +##mussen +##nidae +##rzburg +arcs +##ingdon +##tituted +1695 +wheelbase +wheeling +bombardier +campground +zebra +##lices +##oj +##bain +lullaby +##ecure +donetsk +wylie +grenada +##arding +##ης +squinting +eireann +opposes +##andra +maximal +runes +##broken +##cuting +##iface +##ror +##rosis +additive +britney +adultery +triggering +##drome +detrimental +aarhus +containment +jc +swapped +vichy +##ioms +madly +##oric +##rag +brant +##ckey +##trix +1560 +1612 +broughton +rustling +##stems +##uder +asbestos +mentoring +##nivorous +finley +leaps +##isan +apical +pry +slits +substitutes +##dict +intuitive +fantasia +insistent +unreasonable +##igen +##vna +domed +hannover +margot +ponder +##zziness +impromptu +jian +lc +rampage +stemming +##eft +andrey +gerais +whichever +amnesia +appropriated +anzac +clicks +modifying +ultimatum +cambrian +maids +verve +yellowstone +##mbs +conservatoire +##scribe +adherence +dinners +spectra +imperfect +mysteriously +sidekick +tatar +tuba +##aks +##ifolia +distrust +##athan +##zle +c2 +ronin +zac +##pse +celaena +instrumentalist +scents +skopje +##mbling +comical +compensated +vidal +condor +intersect +jingle +wavelengths +##urrent +mcqueen +##izzly +carp +weasel +422 +kanye +militias +postdoctoral +eugen +gunslinger +##ɛ +faux +hospice +##for +appalled +derivation +dwarves +##elis +dilapidated +##folk +astoria +philology +##lwyn +##otho +##saka +inducing +philanthropy +##bf +##itative +geek +markedly +sql +##yce +bessie +indices +rn +##flict +495 +frowns +resolving +weightlifting +tugs +cleric +contentious +1653 +mania +rms +##miya +##reate +##ruck +##tucket +bien +eels +marek +##ayton +##cence +discreet +unofficially +##ife +leaks +##bber +1705 +332 +dung +compressor +hillsborough +pandit +shillings +distal +##skin +381 +##tat +##you +nosed +##nir +mangrove +undeveloped +##idia +textures +##inho +##500 +##rise +ae +irritating +nay +amazingly +bancroft +apologetic +compassionate +kata +symphonies +##lovic +airspace +##lch +930 +gifford +precautions +fulfillment +sevilla +vulgar +martinique +##urities +looting +piccolo +tidy +##dermott +quadrant +armchair +incomes +mathematicians +stampede +nilsson +##inking +##scan +foo +quarterfinal +##ostal +shang +shouldered +squirrels +##owe +344 +vinegar +##bner +##rchy +##systems +delaying +##trics +ars +dwyer +rhapsody +sponsoring +##gration +bipolar +cinder +starters +##olio +##urst +421 +signage +##nty +aground +figurative +mons +acquaintances +duets +erroneously +soyuz +elliptic +recreated +##cultural +##quette +##ssed +##tma +##zcz +moderator +scares +##itaire +##stones +##udence +juniper +sighting +##just +##nsen +britten +calabria +ry +bop +cramer +forsyth +stillness +##л +airmen +gathers +unfit +##umber +##upt +taunting +##rip +seeker +streamlined +##bution +holster +schumann +tread +vox +##gano +##onzo +strive +dil +reforming +covent +newbury +predicting +##orro +decorate +tre +##puted +andover +ie +asahi +dept +dunkirk +gills +##tori +buren +huskies +##stis +##stov +abstracts +bets +loosen +##opa +1682 +yearning +##glio +##sir +berman +effortlessly +enamel +napoli +persist +##peration +##uez +attache +elisa +b1 +invitations +##kic +accelerating +reindeer +boardwalk +clutches +nelly +polka +starbucks +##kei +adamant +huey +lough +unbroken +adventurer +embroidery +inspecting +stanza +##ducted +naia +taluka +##pone +##roids +chases +deprivation +florian +##jing +##ppet +earthly +##lib +##ssee +colossal +foreigner +vet +freaks +patrice +rosewood +triassic +upstate +##pkins +dominates +ata +chants +ks +vo +##400 +##bley +##raya +##rmed +555 +agra +infiltrate +##ailing +##ilation +##tzer +##uppe +##werk +binoculars +enthusiast +fujian +squeak +##avs +abolitionist +almeida +boredom +hampstead +marsden +rations +##ands +inflated +334 +bonuses +rosalie +patna +##rco +329 +detachments +penitentiary +54th +flourishing +woolf +##dion +##etched +papyrus +##lster +##nsor +##toy +bobbed +dismounted +endelle +inhuman +motorola +tbs +wince +wreath +##ticus +hideout +inspections +sanjay +disgrace +infused +pudding +stalks +##urbed +arsenic +leases +##hyl +##rrard +collarbone +##waite +##wil +dowry +##bant +##edance +genealogical +nitrate +salamanca +scandals +thyroid +necessitated +##! +##" +### +##$ +##% +##& +##' +##( +##) +##* +##+ +##, +##- +##. +##/ +##: +##; +##< +##= +##> +##? +##@ +##[ +##\ +##] +##^ +##_ +##` +##{ +##| +##} +##~ +##¡ +##¢ +##£ +##¤ +##¥ +##¦ +##§ +##¨ +##© +##ª +##« +##¬ +##® +##± +##´ +##µ +##¶ +##· +##º +##» +##¼ +##¾ +##¿ +##æ +##ð +##÷ +##þ +##đ +##ħ +##ŋ +##œ +##ƒ +##ɐ +##ɑ +##ɒ +##ɔ +##ɕ +##ə +##ɡ +##ɣ +##ɨ +##ɪ +##ɫ +##ɬ +##ɯ +##ɲ +##ɴ +##ɹ +##ɾ +##ʀ +##ʁ +##ʂ +##ʃ +##ʉ +##ʊ +##ʋ +##ʌ +##ʎ +##ʐ +##ʑ +##ʒ +##ʔ +##ʰ +##ʲ +##ʳ +##ʷ +##ʸ +##ʻ +##ʼ +##ʾ +##ʿ +##ˈ +##ˡ +##ˢ +##ˣ +##ˤ +##β +##γ +##δ +##ε +##ζ +##θ +##κ +##λ +##μ +##ξ +##ο +##π +##ρ +##σ +##τ +##υ +##φ +##χ +##ψ +##ω +##б +##г +##д +##ж +##з +##м +##п +##с +##у +##ф +##х +##ц +##ч +##ш +##щ +##ъ +##э +##ю +##ђ +##є +##і +##ј +##љ +##њ +##ћ +##ӏ +##ա +##բ +##գ +##դ +##ե +##թ +##ի +##լ +##կ +##հ +##մ +##յ +##ն +##ո +##պ +##ս +##վ +##տ +##ր +##ւ +##ք +##־ +##א +##ב +##ג +##ד +##ו +##ז +##ח +##ט +##י +##ך +##כ +##ל +##ם +##מ +##ן +##נ +##ס +##ע +##ף +##פ +##ץ +##צ +##ק +##ר +##ש +##ת +##، +##ء +##ب +##ت +##ث +##ج +##ح +##خ +##ذ +##ز +##س +##ش +##ص +##ض +##ط +##ظ +##ع +##غ +##ـ +##ف +##ق +##ك +##و +##ى +##ٹ +##پ +##چ +##ک +##گ +##ں +##ھ +##ہ +##ے +##अ +##आ +##उ +##ए +##क +##ख +##ग +##च +##ज +##ट +##ड +##ण +##त +##थ +##द +##ध +##न +##प +##ब +##भ +##म +##य +##र +##ल +##व +##श +##ष +##स +##ह +##ा +##ि +##ी +##ो +##। +##॥ +##ং +##অ +##আ +##ই +##উ +##এ +##ও +##ক +##খ +##গ +##চ +##ছ +##জ +##ট +##ড +##ণ +##ত +##থ +##দ +##ধ +##ন +##প +##ব +##ভ +##ম +##য +##র +##ল +##শ +##ষ +##স +##হ +##া +##ি +##ী +##ে +##க +##ச +##ட +##த +##ந +##ன +##ப +##ம +##ய +##ர +##ல +##ள +##வ +##ா +##ி +##ு +##ே +##ை +##ನ +##ರ +##ಾ +##ක +##ය +##ර +##ල +##ව +##ා +##ก +##ง +##ต +##ท +##น +##พ +##ม +##ย +##ร +##ล +##ว +##ส +##อ +##า +##เ +##་ +##། +##ག +##ང +##ད +##ན +##པ +##བ +##མ +##འ +##ར +##ལ +##ས +##မ +##ა +##ბ +##გ +##დ +##ე +##ვ +##თ +##ი +##კ +##ლ +##მ +##ნ +##ო +##რ +##ს +##ტ +##უ +##ᄀ +##ᄂ +##ᄃ +##ᄅ +##ᄆ +##ᄇ +##ᄉ +##ᄊ +##ᄋ +##ᄌ +##ᄎ +##ᄏ +##ᄐ +##ᄑ +##ᄒ +##ᅡ +##ᅢ +##ᅥ +##ᅦ +##ᅧ +##ᅩ +##ᅪ +##ᅭ +##ᅮ +##ᅯ +##ᅲ +##ᅳ +##ᅴ +##ᅵ +##ᆨ +##ᆫ +##ᆯ +##ᆷ +##ᆸ +##ᆼ +##ᴬ +##ᴮ +##ᴰ +##ᴵ +##ᴺ +##ᵀ +##ᵃ +##ᵇ +##ᵈ +##ᵉ +##ᵍ +##ᵏ +##ᵐ +##ᵒ +##ᵖ +##ᵗ +##ᵘ +##ᵣ +##ᵤ +##ᵥ +##ᶜ +##ᶠ +##‐ +##‑ +##‒ +##– +##— +##― +##‖ +##‘ +##’ +##‚ +##“ +##” +##„ +##† +##‡ +##• +##… +##‰ +##′ +##″ +##› +##‿ +##⁄ +##⁰ +##ⁱ +##⁴ +##⁵ +##⁶ +##⁷ +##⁸ +##⁹ +##⁻ +##ⁿ +##₅ +##₆ +##₇ +##₈ +##₉ +##₊ +##₍ +##₎ +##ₐ +##ₑ +##ₒ +##ₓ +##ₕ +##ₖ +##ₗ +##ₘ +##ₚ +##ₛ +##ₜ +##₤ +##₩ +##€ +##₱ +##₹ +##ℓ +##№ +##ℝ +##™ +##⅓ +##⅔ +##← +##↑ +##→ +##↓ +##↔ +##↦ +##⇄ +##⇌ +##⇒ +##∂ +##∅ +##∆ +##∇ +##∈ +##∗ +##∘ +##√ +##∞ +##∧ +##∨ +##∩ +##∪ +##≈ +##≡ +##≤ +##≥ +##⊂ +##⊆ +##⊕ +##⊗ +##⋅ +##─ +##│ +##■ +##▪ +##● +##★ +##☆ +##☉ +##♠ +##♣ +##♥ +##♦ +##♯ +##⟨ +##⟩ +##ⱼ +##⺩ +##⺼ +##⽥ +##、 +##。 +##〈 +##〉 +##《 +##》 +##「 +##」 +##『 +##』 +##〜 +##あ +##い +##う +##え +##お +##か +##き +##く +##け +##こ +##さ +##し +##す +##せ +##そ +##た +##ち +##っ +##つ +##て +##と +##な +##に +##ぬ +##ね +##の +##は +##ひ +##ふ +##へ +##ほ +##ま +##み +##む +##め +##も +##や +##ゆ +##よ +##ら +##り +##る +##れ +##ろ +##を +##ん +##ァ +##ア +##ィ +##イ +##ウ +##ェ +##エ +##オ +##カ +##キ +##ク +##ケ +##コ +##サ +##シ +##ス +##セ +##タ +##チ +##ッ +##ツ +##テ +##ト +##ナ +##ニ +##ノ +##ハ +##ヒ +##フ +##ヘ +##ホ +##マ +##ミ +##ム +##メ +##モ +##ャ +##ュ +##ョ +##ラ +##リ +##ル +##レ +##ロ +##ワ +##ン +##・ +##ー +##一 +##三 +##上 +##下 +##不 +##世 +##中 +##主 +##久 +##之 +##也 +##事 +##二 +##五 +##井 +##京 +##人 +##亻 +##仁 +##介 +##代 +##仮 +##伊 +##会 +##佐 +##侍 +##保 +##信 +##健 +##元 +##光 +##八 +##公 +##内 +##出 +##分 +##前 +##劉 +##力 +##加 +##勝 +##北 +##区 +##十 +##千 +##南 +##博 +##原 +##口 +##古 +##史 +##司 +##合 +##吉 +##同 +##名 +##和 +##囗 +##四 +##国 +##國 +##土 +##地 +##坂 +##城 +##堂 +##場 +##士 +##夏 +##外 +##大 +##天 +##太 +##夫 +##奈 +##女 +##子 +##学 +##宀 +##宇 +##安 +##宗 +##定 +##宣 +##宮 +##家 +##宿 +##寺 +##將 +##小 +##尚 +##山 +##岡 +##島 +##崎 +##川 +##州 +##巿 +##帝 +##平 +##年 +##幸 +##广 +##弘 +##張 +##彳 +##後 +##御 +##德 +##心 +##忄 +##志 +##忠 +##愛 +##成 +##我 +##戦 +##戸 +##手 +##扌 +##政 +##文 +##新 +##方 +##日 +##明 +##星 +##春 +##昭 +##智 +##曲 +##書 +##月 +##有 +##朝 +##木 +##本 +##李 +##村 +##東 +##松 +##林 +##森 +##楊 +##樹 +##橋 +##歌 +##止 +##正 +##武 +##比 +##氏 +##民 +##水 +##氵 +##氷 +##永 +##江 +##沢 +##河 +##治 +##法 +##海 +##清 +##漢 +##瀬 +##火 +##版 +##犬 +##王 +##生 +##田 +##男 +##疒 +##発 +##白 +##的 +##皇 +##目 +##相 +##省 +##真 +##石 +##示 +##社 +##神 +##福 +##禾 +##秀 +##秋 +##空 +##立 +##章 +##竹 +##糹 +##美 +##義 +##耳 +##良 +##艹 +##花 +##英 +##華 +##葉 +##藤 +##行 +##街 +##西 +##見 +##訁 +##語 +##谷 +##貝 +##貴 +##車 +##軍 +##辶 +##道 +##郎 +##郡 +##部 +##都 +##里 +##野 +##金 +##鈴 +##镇 +##長 +##門 +##間 +##阝 +##阿 +##陳 +##陽 +##雄 +##青 +##面 +##風 +##食 +##香 +##馬 +##高 +##龍 +##龸 +##fi +##fl +##! +##( +##) +##, +##- +##. +##/ +##: +##? +##~ diff --git a/models/intel/bert-small-uncased-whole-word-masking-squad-int8-0002/accuracy-check.yml b/models/intel/bert-small-uncased-whole-word-masking-squad-int8-0002/accuracy-check.yml new file mode 100644 index 00000000000..1798e8814e5 --- /dev/null +++ b/models/intel/bert-small-uncased-whole-word-masking-squad-int8-0002/accuracy-check.yml @@ -0,0 +1,40 @@ +models: + - name: bert-small-uncased-whole-word-masking-squad-int8-0002 + launchers: + - framework: dlsdk + adapter: + type: bert_question_answering + start_token_logits_output: "output_s" + end_token_logits_output: "output_e" + inputs: + - name: "input_ids" + type: INPUT + value: "input_ids" + - name: "attention_mask" + type: INPUT + value: 'input_mask' + - name: 'token_type_ids' + type: INPUT + value: 'segment_ids' + - name: 'position_ids' + type: INPUT + value: 'position_ids' + + datasets: + - name: squad_v1_1_msl384_mql64_ds128_lowercase + reader: + type: annotation_features_extractor + features: + - input_ids + - input_mask + - segment_ids + - position_ids + postprocessing: + - type: extract_answers_tokens + max_answer: 30 + n_best_size: 20 + metrics: + - name: 'F1' + type: 'f1' + - name: 'EM' + type: 'exact_match' diff --git a/models/intel/bert-small-uncased-whole-word-masking-squad-int8-0002/description/bert-small-uncased-whole-word-masking-squad-int8-0002.md b/models/intel/bert-small-uncased-whole-word-masking-squad-int8-0002/description/bert-small-uncased-whole-word-masking-squad-int8-0002.md new file mode 100644 index 00000000000..72047c177de --- /dev/null +++ b/models/intel/bert-small-uncased-whole-word-masking-squad-int8-0002/description/bert-small-uncased-whole-word-masking-squad-int8-0002.md @@ -0,0 +1,77 @@ +# bert-small-uncased-whole-word-masking-squad-int8-0002 + +## Use Case and High-Level Description + +This is a small BERT-large like model distilled and quantized to INT8 on SQuAD v1.1 training set from larger BERT-large model +(bert-large-uncased-whole-word-masking) provided by the [Transformers](https://github.com/huggingface/transformers) library) and tuned on SQuAD v1.1 training set. +The model performs question answering for English language; +the input is a concatenated premise and question for the premise, +and the output is the location of the answer to the question inside the premise. +For details about the original model, check out +[BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://arxiv.org/abs/1810.04805), +[HuggingFace's Transformers: State-of-the-art Natural Language Processing](https://arxiv.org/abs/1910.03771). + +Tokenization occurs using the BERT tokenizer (see the demo code for implementation details) and the enclosed `vocab.txt` dictionary file. Input is to be lower-cased before tokenizing. + +## Specification + +| Metric | Value | +|-------------------|-----------------------| +| GOps | 23.9 | +| MParams | 41.1 | +| Source framework | PyTorch\* | + +Despite number of parameters is the same as for +[FP32 version of the model](../../bert-small-uncased-whole-word-masking-squad-0002/description/bert-small-uncased-whole-word-masking-squad-0002.md) +the model occupied 4x times less memory due to it uses INT8 weights instead of FP32. + +## Accuracy + +The quality metrics were calculated on the SQuAD v1.1 dataset ("dev" split). Maximum sequence length is 384, input is lower-cased. + +| Metric | Value | +|---------------------------|---------------| +| F1 | 91.4% | +| Exact match (EM) | 84.4% | + +## Input + +1. Token IDs, name: `input_ids`, shape: [1x384]. +Token IDs is sequence of integer values that is representing the tokenized premise and question. +The sequence structure is as follows (`[CLS]`, `[SEP]` and `[PAD]` should be replaced by corresponding token IDs +as specified by the dictionary): +`[CLS]` + *tokenized question* + `[SEP]` + *tokenized premise of the question* + `[SEP]` + (`[PAD]` tokens to pad to the maximum sequence length of 384) + +2. Input mask, name: `attention_mask`, shape: [1x384]. +Input mask is a sequence of integer values representing the mask of valid values in the input. +The values of this input are equal to: + * `1` at positions corresponding to the `[CLS]` + *tokenized question* + `[SEP]` + *tokenized premise of the question* + `[SEP]` part of the `input_ids` (i.e. all positions except those containing the `[PAD]` tokens), and + * `0` at all other positions + +3. Token types, name: `token_type_ids`, shape: [1x384]. +Token types is sequence of integer values representing the segmentation of the `input_ids` into question and premise. +The values are equal to: + * `1` at positions corresponding to the *tokenized premise of the question* + `[SEP]` part of the `input_ids`, and + * `0` at all other positions + +* `[CLS]` is a special symbol added in front of the question. +* `[SEP]` is a special separator token inserted between the question and premise of the question. +* `[PAD]` is a special token used to fill the rest of the input to get given input length (384). + +4. Position indexes, name: `position_ids`, shape: [1x384]. +Position indexes is sequence of integer values from 0 to 383 representing the position index for each input token. The `position_ids` is always the same for any input tokens set + +## Output + +The outputs of the net are two `1, 384` floating point-valued logit scores vectors that after soft-max operation are probabilities for start and end positions of answer in the premise of the question. + +1. Start position: name: `output_s`, shape: [1x384]. +Start position is floating point-valued logit scores for start position. + +2. End position: name: `output_e`, shape: [1x384]. +End position is floating point-valued logit scores for end position. + +## Legal Information +[*] Other names and brands may be claimed as the property of others. + +The original `bert-large-uncased-whole-word-masking` model is taken from [Transformers](https://github.com/huggingface/transformers) library, which is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/huggingface/transformers/master/LICENSE). diff --git a/models/intel/bert-small-uncased-whole-word-masking-squad-int8-0002/model.yml b/models/intel/bert-small-uncased-whole-word-masking-squad-int8-0002/model.yml new file mode 100644 index 00000000000..bae55c7680e --- /dev/null +++ b/models/intel/bert-small-uncased-whole-word-masking-squad-int8-0002/model.yml @@ -0,0 +1,39 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + BERT like small symmetrically quantized to INT8 model distilled on the SQuAD v1.1 + train set from the BERT-large pretrained on lower-cased English text using Whole-Word-Masking + (transformers's bert-large-uncased-whole-word-masking) that is fine-tuned on the + SQuAD v1.1 training. (91.4% F1 - 84.4% EM on the v1.1 dev set). +task_type: question_answering +files: + - name: FP32-INT8/bert-small-uncased-whole-word-masking-squad-int8-0002.xml + size: 1356129 + sha256: 5d3877ad74385b981adf59de721ba530b099c8f7b05a1975b4a6db6178b81fd5 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-small-uncased-whole-word-masking-squad-int8-0002/FP32-INT8/bert-small-uncased-whole-word-masking-squad-int8-0002.xml + - name: FP32-INT8/bert-small-uncased-whole-word-masking-squad-int8-0002.bin + size: 41358384 + sha256: 45b57abefd1440e16849a338b4f8b69ded1edfb49f4d0043ede2838f59aad3c5 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-small-uncased-whole-word-masking-squad-int8-0002/FP32-INT8/bert-small-uncased-whole-word-masking-squad-int8-0002.bin + - name: FP16-INT8/bert-small-uncased-whole-word-masking-squad-int8-0002.xml + size: 1356129 + sha256: c44e54bb491d866651324d7b910cf5a57ddccd84fc39ccedc2e7124a1379a0fd + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-small-uncased-whole-word-masking-squad-int8-0002/FP16-INT8/bert-small-uncased-whole-word-masking-squad-int8-0002.xml + - name: FP16-INT8/bert-small-uncased-whole-word-masking-squad-int8-0002.bin + size: 41208002 + sha256: 739e0bb26c4f4b778497fb0702a974afc013589d60ae70421512c968f2dd69ff + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/bert-small-uncased-whole-word-masking-squad-int8-0002/FP16-INT8/bert-small-uncased-whole-word-masking-squad-int8-0002.bin +framework: dldt +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/bert-small-uncased-whole-word-masking-squad-int8-0002/vocab.txt b/models/intel/bert-small-uncased-whole-word-masking-squad-int8-0002/vocab.txt new file mode 100644 index 00000000000..fb140275c15 --- /dev/null +++ b/models/intel/bert-small-uncased-whole-word-masking-squad-int8-0002/vocab.txt @@ -0,0 +1,30522 @@ +[PAD] +[unused0] +[unused1] +[unused2] +[unused3] +[unused4] +[unused5] +[unused6] +[unused7] +[unused8] +[unused9] +[unused10] +[unused11] +[unused12] +[unused13] +[unused14] +[unused15] +[unused16] +[unused17] +[unused18] +[unused19] +[unused20] +[unused21] +[unused22] +[unused23] +[unused24] +[unused25] +[unused26] +[unused27] +[unused28] +[unused29] +[unused30] +[unused31] +[unused32] +[unused33] +[unused34] +[unused35] +[unused36] +[unused37] +[unused38] +[unused39] +[unused40] +[unused41] +[unused42] +[unused43] +[unused44] +[unused45] +[unused46] +[unused47] +[unused48] +[unused49] +[unused50] +[unused51] +[unused52] +[unused53] +[unused54] +[unused55] +[unused56] +[unused57] +[unused58] +[unused59] +[unused60] +[unused61] +[unused62] +[unused63] +[unused64] +[unused65] +[unused66] +[unused67] +[unused68] +[unused69] +[unused70] +[unused71] +[unused72] +[unused73] +[unused74] +[unused75] +[unused76] +[unused77] +[unused78] +[unused79] +[unused80] +[unused81] +[unused82] +[unused83] +[unused84] +[unused85] +[unused86] +[unused87] +[unused88] +[unused89] +[unused90] +[unused91] +[unused92] +[unused93] +[unused94] +[unused95] +[unused96] +[unused97] +[unused98] +[UNK] +[CLS] +[SEP] +[MASK] +[unused99] +[unused100] +[unused101] +[unused102] +[unused103] +[unused104] +[unused105] +[unused106] +[unused107] +[unused108] +[unused109] +[unused110] +[unused111] +[unused112] +[unused113] +[unused114] +[unused115] +[unused116] +[unused117] +[unused118] +[unused119] +[unused120] +[unused121] +[unused122] +[unused123] +[unused124] +[unused125] +[unused126] +[unused127] +[unused128] +[unused129] +[unused130] +[unused131] +[unused132] +[unused133] +[unused134] +[unused135] +[unused136] +[unused137] +[unused138] +[unused139] +[unused140] +[unused141] +[unused142] +[unused143] +[unused144] +[unused145] +[unused146] +[unused147] +[unused148] +[unused149] +[unused150] +[unused151] +[unused152] +[unused153] +[unused154] +[unused155] +[unused156] +[unused157] +[unused158] +[unused159] +[unused160] +[unused161] +[unused162] +[unused163] +[unused164] +[unused165] +[unused166] +[unused167] +[unused168] +[unused169] +[unused170] +[unused171] +[unused172] +[unused173] +[unused174] +[unused175] +[unused176] +[unused177] +[unused178] +[unused179] +[unused180] +[unused181] +[unused182] +[unused183] +[unused184] +[unused185] +[unused186] +[unused187] +[unused188] +[unused189] +[unused190] +[unused191] +[unused192] +[unused193] +[unused194] +[unused195] +[unused196] +[unused197] +[unused198] +[unused199] +[unused200] +[unused201] +[unused202] +[unused203] +[unused204] +[unused205] +[unused206] +[unused207] +[unused208] +[unused209] +[unused210] +[unused211] +[unused212] +[unused213] +[unused214] +[unused215] +[unused216] +[unused217] +[unused218] +[unused219] +[unused220] +[unused221] +[unused222] +[unused223] +[unused224] +[unused225] +[unused226] +[unused227] +[unused228] +[unused229] +[unused230] +[unused231] +[unused232] +[unused233] +[unused234] +[unused235] +[unused236] +[unused237] +[unused238] +[unused239] +[unused240] +[unused241] +[unused242] +[unused243] +[unused244] +[unused245] +[unused246] +[unused247] +[unused248] +[unused249] +[unused250] +[unused251] +[unused252] +[unused253] +[unused254] +[unused255] +[unused256] +[unused257] +[unused258] +[unused259] +[unused260] +[unused261] +[unused262] +[unused263] +[unused264] +[unused265] +[unused266] +[unused267] +[unused268] +[unused269] +[unused270] +[unused271] +[unused272] +[unused273] +[unused274] +[unused275] +[unused276] +[unused277] +[unused278] +[unused279] +[unused280] +[unused281] +[unused282] +[unused283] +[unused284] +[unused285] +[unused286] +[unused287] +[unused288] +[unused289] +[unused290] +[unused291] +[unused292] +[unused293] +[unused294] +[unused295] +[unused296] +[unused297] +[unused298] +[unused299] +[unused300] +[unused301] +[unused302] +[unused303] +[unused304] +[unused305] +[unused306] +[unused307] +[unused308] +[unused309] +[unused310] +[unused311] +[unused312] +[unused313] +[unused314] +[unused315] +[unused316] +[unused317] +[unused318] +[unused319] +[unused320] +[unused321] +[unused322] +[unused323] +[unused324] +[unused325] +[unused326] +[unused327] +[unused328] +[unused329] +[unused330] +[unused331] +[unused332] +[unused333] +[unused334] +[unused335] +[unused336] +[unused337] +[unused338] +[unused339] +[unused340] +[unused341] +[unused342] +[unused343] +[unused344] +[unused345] +[unused346] +[unused347] +[unused348] +[unused349] +[unused350] +[unused351] +[unused352] +[unused353] +[unused354] +[unused355] +[unused356] +[unused357] +[unused358] +[unused359] +[unused360] +[unused361] +[unused362] +[unused363] +[unused364] +[unused365] +[unused366] +[unused367] +[unused368] +[unused369] +[unused370] +[unused371] +[unused372] +[unused373] +[unused374] +[unused375] +[unused376] +[unused377] +[unused378] +[unused379] +[unused380] +[unused381] +[unused382] +[unused383] +[unused384] +[unused385] +[unused386] +[unused387] +[unused388] +[unused389] +[unused390] +[unused391] +[unused392] +[unused393] +[unused394] +[unused395] +[unused396] +[unused397] +[unused398] +[unused399] +[unused400] +[unused401] +[unused402] +[unused403] +[unused404] +[unused405] +[unused406] +[unused407] +[unused408] +[unused409] +[unused410] +[unused411] +[unused412] +[unused413] +[unused414] +[unused415] +[unused416] +[unused417] +[unused418] +[unused419] +[unused420] +[unused421] +[unused422] +[unused423] +[unused424] +[unused425] +[unused426] +[unused427] +[unused428] +[unused429] +[unused430] +[unused431] +[unused432] +[unused433] +[unused434] +[unused435] +[unused436] +[unused437] +[unused438] +[unused439] +[unused440] +[unused441] +[unused442] +[unused443] +[unused444] +[unused445] +[unused446] +[unused447] +[unused448] +[unused449] +[unused450] +[unused451] +[unused452] +[unused453] +[unused454] +[unused455] +[unused456] +[unused457] +[unused458] +[unused459] +[unused460] +[unused461] +[unused462] +[unused463] +[unused464] +[unused465] +[unused466] +[unused467] +[unused468] +[unused469] +[unused470] +[unused471] +[unused472] +[unused473] +[unused474] +[unused475] +[unused476] +[unused477] +[unused478] +[unused479] +[unused480] +[unused481] +[unused482] +[unused483] +[unused484] +[unused485] +[unused486] +[unused487] +[unused488] +[unused489] +[unused490] +[unused491] +[unused492] +[unused493] +[unused494] +[unused495] +[unused496] +[unused497] +[unused498] +[unused499] +[unused500] +[unused501] +[unused502] +[unused503] +[unused504] +[unused505] +[unused506] +[unused507] +[unused508] +[unused509] +[unused510] +[unused511] +[unused512] +[unused513] +[unused514] +[unused515] +[unused516] +[unused517] +[unused518] +[unused519] +[unused520] +[unused521] +[unused522] +[unused523] +[unused524] +[unused525] +[unused526] +[unused527] +[unused528] +[unused529] +[unused530] +[unused531] +[unused532] +[unused533] +[unused534] +[unused535] +[unused536] +[unused537] +[unused538] +[unused539] +[unused540] +[unused541] +[unused542] +[unused543] +[unused544] +[unused545] +[unused546] +[unused547] +[unused548] +[unused549] +[unused550] +[unused551] +[unused552] +[unused553] +[unused554] +[unused555] +[unused556] +[unused557] +[unused558] +[unused559] +[unused560] +[unused561] +[unused562] +[unused563] +[unused564] +[unused565] +[unused566] +[unused567] +[unused568] +[unused569] +[unused570] +[unused571] +[unused572] +[unused573] +[unused574] +[unused575] +[unused576] +[unused577] +[unused578] +[unused579] +[unused580] +[unused581] +[unused582] +[unused583] +[unused584] +[unused585] +[unused586] +[unused587] +[unused588] +[unused589] +[unused590] +[unused591] +[unused592] +[unused593] +[unused594] +[unused595] +[unused596] +[unused597] +[unused598] +[unused599] +[unused600] +[unused601] +[unused602] +[unused603] +[unused604] +[unused605] +[unused606] +[unused607] +[unused608] +[unused609] +[unused610] +[unused611] +[unused612] +[unused613] +[unused614] +[unused615] +[unused616] +[unused617] +[unused618] +[unused619] +[unused620] +[unused621] +[unused622] +[unused623] +[unused624] +[unused625] +[unused626] +[unused627] +[unused628] +[unused629] +[unused630] +[unused631] +[unused632] +[unused633] +[unused634] +[unused635] +[unused636] +[unused637] +[unused638] +[unused639] +[unused640] +[unused641] +[unused642] +[unused643] +[unused644] +[unused645] +[unused646] +[unused647] +[unused648] +[unused649] +[unused650] +[unused651] +[unused652] +[unused653] +[unused654] +[unused655] +[unused656] +[unused657] +[unused658] +[unused659] +[unused660] +[unused661] +[unused662] +[unused663] +[unused664] +[unused665] +[unused666] +[unused667] +[unused668] +[unused669] +[unused670] +[unused671] +[unused672] +[unused673] +[unused674] +[unused675] +[unused676] +[unused677] +[unused678] +[unused679] +[unused680] +[unused681] +[unused682] +[unused683] +[unused684] +[unused685] +[unused686] +[unused687] +[unused688] +[unused689] +[unused690] +[unused691] +[unused692] +[unused693] +[unused694] +[unused695] +[unused696] +[unused697] +[unused698] +[unused699] +[unused700] +[unused701] +[unused702] +[unused703] +[unused704] +[unused705] +[unused706] +[unused707] +[unused708] +[unused709] +[unused710] +[unused711] +[unused712] +[unused713] +[unused714] +[unused715] +[unused716] +[unused717] +[unused718] +[unused719] +[unused720] +[unused721] +[unused722] +[unused723] +[unused724] +[unused725] +[unused726] +[unused727] +[unused728] +[unused729] +[unused730] +[unused731] +[unused732] +[unused733] +[unused734] +[unused735] +[unused736] +[unused737] +[unused738] +[unused739] +[unused740] +[unused741] +[unused742] +[unused743] +[unused744] +[unused745] +[unused746] +[unused747] +[unused748] +[unused749] +[unused750] +[unused751] +[unused752] +[unused753] +[unused754] +[unused755] +[unused756] +[unused757] +[unused758] +[unused759] +[unused760] +[unused761] +[unused762] +[unused763] +[unused764] +[unused765] +[unused766] +[unused767] +[unused768] +[unused769] +[unused770] +[unused771] +[unused772] +[unused773] +[unused774] +[unused775] +[unused776] +[unused777] +[unused778] +[unused779] +[unused780] +[unused781] +[unused782] +[unused783] +[unused784] +[unused785] +[unused786] +[unused787] +[unused788] +[unused789] +[unused790] +[unused791] +[unused792] +[unused793] +[unused794] +[unused795] +[unused796] +[unused797] +[unused798] +[unused799] +[unused800] +[unused801] +[unused802] +[unused803] +[unused804] +[unused805] +[unused806] +[unused807] +[unused808] +[unused809] +[unused810] +[unused811] +[unused812] +[unused813] +[unused814] +[unused815] +[unused816] +[unused817] +[unused818] +[unused819] +[unused820] +[unused821] +[unused822] +[unused823] +[unused824] +[unused825] +[unused826] +[unused827] +[unused828] +[unused829] +[unused830] +[unused831] +[unused832] +[unused833] +[unused834] +[unused835] +[unused836] +[unused837] +[unused838] +[unused839] +[unused840] +[unused841] +[unused842] +[unused843] +[unused844] +[unused845] +[unused846] +[unused847] +[unused848] +[unused849] +[unused850] +[unused851] +[unused852] +[unused853] +[unused854] +[unused855] +[unused856] +[unused857] +[unused858] +[unused859] +[unused860] +[unused861] +[unused862] +[unused863] +[unused864] +[unused865] +[unused866] +[unused867] +[unused868] +[unused869] +[unused870] +[unused871] +[unused872] +[unused873] +[unused874] +[unused875] +[unused876] +[unused877] +[unused878] +[unused879] +[unused880] +[unused881] +[unused882] +[unused883] +[unused884] +[unused885] +[unused886] +[unused887] +[unused888] +[unused889] +[unused890] +[unused891] +[unused892] +[unused893] +[unused894] +[unused895] +[unused896] +[unused897] +[unused898] +[unused899] +[unused900] +[unused901] +[unused902] +[unused903] +[unused904] +[unused905] +[unused906] +[unused907] +[unused908] +[unused909] +[unused910] +[unused911] +[unused912] +[unused913] +[unused914] +[unused915] +[unused916] +[unused917] +[unused918] +[unused919] +[unused920] +[unused921] +[unused922] +[unused923] +[unused924] +[unused925] +[unused926] +[unused927] +[unused928] +[unused929] +[unused930] +[unused931] +[unused932] +[unused933] +[unused934] +[unused935] +[unused936] +[unused937] +[unused938] +[unused939] +[unused940] +[unused941] +[unused942] +[unused943] +[unused944] +[unused945] +[unused946] +[unused947] +[unused948] +[unused949] +[unused950] +[unused951] +[unused952] +[unused953] +[unused954] +[unused955] +[unused956] +[unused957] +[unused958] +[unused959] +[unused960] +[unused961] +[unused962] +[unused963] +[unused964] +[unused965] +[unused966] +[unused967] +[unused968] +[unused969] +[unused970] +[unused971] +[unused972] +[unused973] +[unused974] +[unused975] +[unused976] +[unused977] +[unused978] +[unused979] +[unused980] +[unused981] +[unused982] +[unused983] +[unused984] +[unused985] +[unused986] +[unused987] +[unused988] +[unused989] +[unused990] +[unused991] +[unused992] +[unused993] +! +" +# +$ +% +& +' +( +) +* ++ +, +- +. +/ +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +: +; +< += +> +? +@ +[ +\ +] +^ +_ +` +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +p +q +r +s +t +u +v +w +x +y +z +{ +| +} +~ +¡ +¢ +£ +¤ +¥ +¦ +§ +¨ +© +ª +« +¬ +® +° +± +² +³ +´ +µ +¶ +· +¹ +º +» +¼ +½ +¾ +¿ +× +ß +æ +ð +÷ +ø +þ +đ +ħ +ı +ł +ŋ +œ +ƒ +ɐ +ɑ +ɒ +ɔ +ɕ +ə +ɛ +ɡ +ɣ +ɨ +ɪ +ɫ +ɬ +ɯ +ɲ +ɴ +ɹ +ɾ +ʀ +ʁ +ʂ +ʃ +ʉ +ʊ +ʋ +ʌ +ʎ +ʐ +ʑ +ʒ +ʔ +ʰ +ʲ +ʳ +ʷ +ʸ +ʻ +ʼ +ʾ +ʿ +ˈ +ː +ˡ +ˢ +ˣ +ˤ +α +β +γ +δ +ε +ζ +η +θ +ι +κ +λ +μ +ν +ξ +ο +π +ρ +ς +σ +τ +υ +φ +χ +ψ +ω +а +б +в +г +д +е +ж +з +и +к +л +м +н +о +п +р +с +т +у +ф +х +ц +ч +ш +щ +ъ +ы +ь +э +ю +я +ђ +є +і +ј +љ +њ +ћ +ӏ +ա +բ +գ +դ +ե +թ +ի +լ +կ +հ +մ +յ +ն +ո +պ +ս +վ +տ +ր +ւ +ք +־ +א +ב +ג +ד +ה +ו +ז +ח +ט +י +ך +כ +ל +ם +מ +ן +נ +ס +ע +ף +פ +ץ +צ +ק +ר +ש +ת +، +ء +ا +ب +ة +ت +ث +ج +ح +خ +د +ذ +ر +ز +س +ش +ص +ض +ط +ظ +ع +غ +ـ +ف +ق +ك +ل +م +ن +ه +و +ى +ي +ٹ +پ +چ +ک +گ +ں +ھ +ہ +ی +ے +अ +आ +उ +ए +क +ख +ग +च +ज +ट +ड +ण +त +थ +द +ध +न +प +ब +भ +म +य +र +ल +व +श +ष +स +ह +ा +ि +ी +ो +। +॥ +ং +অ +আ +ই +উ +এ +ও +ক +খ +গ +চ +ছ +জ +ট +ড +ণ +ত +থ +দ +ধ +ন +প +ব +ভ +ম +য +র +ল +শ +ষ +স +হ +া +ি +ী +ে +க +ச +ட +த +ந +ன +ப +ம +ய +ர +ல +ள +வ +ா +ி +ு +ே +ை +ನ +ರ +ಾ +ක +ය +ර +ල +ව +ා +ก +ง +ต +ท +น +พ +ม +ย +ร +ล +ว +ส +อ +า +เ +་ +། +ག +ང +ད +ན +པ +བ +མ +འ +ར +ལ +ས +မ +ა +ბ +გ +დ +ე +ვ +თ +ი +კ +ლ +მ +ნ +ო +რ +ს +ტ +უ +ᄀ +ᄂ +ᄃ +ᄅ +ᄆ +ᄇ +ᄉ +ᄊ +ᄋ +ᄌ +ᄎ +ᄏ +ᄐ +ᄑ +ᄒ +ᅡ +ᅢ +ᅥ +ᅦ +ᅧ +ᅩ +ᅪ +ᅭ +ᅮ +ᅯ +ᅲ +ᅳ +ᅴ +ᅵ +ᆨ +ᆫ +ᆯ +ᆷ +ᆸ +ᆼ +ᴬ +ᴮ +ᴰ +ᴵ +ᴺ +ᵀ +ᵃ +ᵇ +ᵈ +ᵉ +ᵍ +ᵏ +ᵐ +ᵒ +ᵖ +ᵗ +ᵘ +ᵢ +ᵣ +ᵤ +ᵥ +ᶜ +ᶠ +‐ +‑ +‒ +– +— +― +‖ +‘ +’ +‚ +“ +” +„ +† +‡ +• +… +‰ +′ +″ +› +‿ +⁄ +⁰ +ⁱ +⁴ +⁵ +⁶ +⁷ +⁸ +⁹ +⁺ +⁻ +ⁿ +₀ +₁ +₂ +₃ +₄ +₅ +₆ +₇ +₈ +₉ +₊ +₍ +₎ +ₐ +ₑ +ₒ +ₓ +ₕ +ₖ +ₗ +ₘ +ₙ +ₚ +ₛ +ₜ +₤ +₩ +€ +₱ +₹ +ℓ +№ +ℝ +™ +⅓ +⅔ +← +↑ +→ +↓ +↔ +↦ +⇄ +⇌ +⇒ +∂ +∅ +∆ +∇ +∈ +− +∗ +∘ +√ +∞ +∧ +∨ +∩ +∪ +≈ +≡ +≤ +≥ +⊂ +⊆ +⊕ +⊗ +⋅ +─ +│ +■ +▪ +● +★ +☆ +☉ +♠ +♣ +♥ +♦ +♭ +♯ +⟨ +⟩ +ⱼ +⺩ +⺼ +⽥ +、 +。 +〈 +〉 +《 +》 +「 +」 +『 +』 +〜 +あ +い +う +え +お +か +き +く +け +こ +さ +し +す +せ +そ +た +ち +っ +つ +て +と +な +に +ぬ +ね +の +は +ひ +ふ +へ +ほ +ま +み +む +め +も +や +ゆ +よ +ら +り +る +れ +ろ +を +ん +ァ +ア +ィ +イ +ウ +ェ +エ +オ +カ +キ +ク +ケ +コ +サ +シ +ス +セ +タ +チ +ッ +ツ +テ +ト +ナ +ニ +ノ +ハ +ヒ +フ +ヘ +ホ +マ +ミ +ム +メ +モ +ャ +ュ +ョ +ラ +リ +ル +レ +ロ +ワ +ン +・ +ー +一 +三 +上 +下 +不 +世 +中 +主 +久 +之 +也 +事 +二 +五 +井 +京 +人 +亻 +仁 +介 +代 +仮 +伊 +会 +佐 +侍 +保 +信 +健 +元 +光 +八 +公 +内 +出 +分 +前 +劉 +力 +加 +勝 +北 +区 +十 +千 +南 +博 +原 +口 +古 +史 +司 +合 +吉 +同 +名 +和 +囗 +四 +国 +國 +土 +地 +坂 +城 +堂 +場 +士 +夏 +外 +大 +天 +太 +夫 +奈 +女 +子 +学 +宀 +宇 +安 +宗 +定 +宣 +宮 +家 +宿 +寺 +將 +小 +尚 +山 +岡 +島 +崎 +川 +州 +巿 +帝 +平 +年 +幸 +广 +弘 +張 +彳 +後 +御 +德 +心 +忄 +志 +忠 +愛 +成 +我 +戦 +戸 +手 +扌 +政 +文 +新 +方 +日 +明 +星 +春 +昭 +智 +曲 +書 +月 +有 +朝 +木 +本 +李 +村 +東 +松 +林 +森 +楊 +樹 +橋 +歌 +止 +正 +武 +比 +氏 +民 +水 +氵 +氷 +永 +江 +沢 +河 +治 +法 +海 +清 +漢 +瀬 +火 +版 +犬 +王 +生 +田 +男 +疒 +発 +白 +的 +皇 +目 +相 +省 +真 +石 +示 +社 +神 +福 +禾 +秀 +秋 +空 +立 +章 +竹 +糹 +美 +義 +耳 +良 +艹 +花 +英 +華 +葉 +藤 +行 +街 +西 +見 +訁 +語 +谷 +貝 +貴 +車 +軍 +辶 +道 +郎 +郡 +部 +都 +里 +野 +金 +鈴 +镇 +長 +門 +間 +阝 +阿 +陳 +陽 +雄 +青 +面 +風 +食 +香 +馬 +高 +龍 +龸 +fi +fl +! +( +) +, +- +. +/ +: +? +~ +the +of +and +in +to +was +he +is +as +for +on +with +that +it +his +by +at +from +her +##s +she +you +had +an +were +but +be +this +are +not +my +they +one +which +or +have +him +me +first +all +also +their +has +up +who +out +been +when +after +there +into +new +two +its +##a +time +would +no +what +about +said +we +over +then +other +so +more +##e +can +if +like +back +them +only +some +could +##i +where +just +##ing +during +before +##n +do +##o +made +school +through +than +now +years +most +world +may +between +down +well +three +##d +year +while +will +##ed +##r +##y +later +##t +city +under +around +did +such +being +used +state +people +part +know +against +your +many +second +university +both +national +##er +these +don +known +off +way +until +re +how +even +get +head +... +didn +##ly +team +american +because +de +##l +born +united +film +since +still +long +work +south +us +became +any +high +again +day +family +see +right +man +eyes +house +season +war +states +including +took +life +north +same +each +called +name +much +place +however +go +four +group +another +found +won +area +here +going +10 +away +series +left +home +music +best +make +hand +number +company +several +never +last +john +000 +very +album +take +end +good +too +following +released +game +played +little +began +district +##m +old +want +those +side +held +own +early +county +ll +league +use +west +##u +face +think +##es +2010 +government +##h +march +came +small +general +town +june +##on +line +based +something +##k +september +thought +looked +along +international +2011 +air +july +club +went +january +october +our +august +april +york +12 +few +2012 +2008 +east +show +member +college +2009 +father +public +##us +come +men +five +set +station +church +##c +next +former +november +room +party +located +december +2013 +age +got +2007 +##g +system +let +love +2006 +though +every +2014 +look +song +water +century +without +body +black +night +within +great +women +single +ve +building +large +population +river +named +band +white +started +##an +once +15 +20 +should +18 +2015 +service +top +built +british +open +death +king +moved +local +times +children +february +book +why +11 +door +need +president +order +final +road +wasn +although +due +major +died +village +third +knew +2016 +asked +turned +st +wanted +say +##p +together +received +main +son +served +different +##en +behind +himself +felt +members +power +football +law +voice +play +##in +near +park +history +30 +having +2005 +16 +##man +saw +mother +##al +army +point +front +help +english +street +art +late +hands +games +award +##ia +young +14 +put +published +country +division +across +told +13 +often +ever +french +london +center +six +red +2017 +led +days +include +light +25 +find +tell +among +species +really +according +central +half +2004 +form +original +gave +office +making +enough +lost +full +opened +must +included +live +given +german +player +run +business +woman +community +cup +might +million +land +2000 +court +development +17 +short +round +ii +km +seen +class +story +always +become +sure +research +almost +director +council +la +##2 +career +things +using +island +##z +couldn +car +##is +24 +close +force +##1 +better +free +support +control +field +students +2003 +education +married +##b +nothing +worked +others +record +big +inside +level +anything +continued +give +james +##3 +military +established +non +returned +feel +does +title +written +thing +feet +william +far +co +association +hard +already +2002 +##ra +championship +human +western +100 +##na +department +hall +role +various +production +21 +19 +heart +2001 +living +fire +version +##ers +##f +television +royal +##4 +produced +working +act +case +society +region +present +radio +period +looking +least +total +keep +england +wife +program +per +brother +mind +special +22 +##le +am +works +soon +##6 +political +george +services +taken +created +##7 +further +able +reached +david +union +joined +upon +done +important +social +information +either +##ic +##x +appeared +position +ground +lead +rock +dark +election +23 +board +france +hair +course +arms +site +police +girl +instead +real +sound +##v +words +moment +##te +someone +##8 +summer +project +announced +san +less +wrote +past +followed +##5 +blue +founded +al +finally +india +taking +records +america +##ne +1999 +design +considered +northern +god +stop +battle +toward +european +outside +described +track +today +playing +language +28 +call +26 +heard +professional +low +australia +miles +california +win +yet +green +##ie +trying +blood +##ton +southern +science +maybe +everything +match +square +27 +mouth +video +race +recorded +leave +above +##9 +daughter +points +space +1998 +museum +change +middle +common +##0 +move +tv +post +##ta +lake +seven +tried +elected +closed +ten +paul +minister +##th +months +start +chief +return +canada +person +sea +release +similar +modern +brought +rest +hit +formed +mr +##la +1997 +floor +event +doing +thomas +1996 +robert +care +killed +training +star +week +needed +turn +finished +railway +rather +news +health +sent +example +ran +term +michael +coming +currently +yes +forces +despite +gold +areas +50 +stage +fact +29 +dead +says +popular +2018 +originally +germany +probably +developed +result +pulled +friend +stood +money +running +mi +signed +word +songs +child +eventually +met +tour +average +teams +minutes +festival +current +deep +kind +1995 +decided +usually +eastern +seemed +##ness +episode +bed +added +table +indian +private +charles +route +available +idea +throughout +centre +addition +appointed +style +1994 +books +eight +construction +press +mean +wall +friends +remained +schools +study +##ch +##um +institute +oh +chinese +sometimes +events +possible +1992 +australian +type +brown +forward +talk +process +food +debut +seat +performance +committee +features +character +arts +herself +else +lot +strong +russian +range +hours +peter +arm +##da +morning +dr +sold +##ry +quickly +directed +1993 +guitar +china +##w +31 +list +##ma +performed +media +uk +players +smile +##rs +myself +40 +placed +coach +province +towards +wouldn +leading +whole +boy +official +designed +grand +census +##el +europe +attack +japanese +henry +1991 +##re +##os +cross +getting +alone +action +lower +network +wide +washington +japan +1990 +hospital +believe +changed +sister +##ar +hold +gone +sir +hadn +ship +##ka +studies +academy +shot +rights +below +base +bad +involved +kept +largest +##ist +bank +future +especially +beginning +mark +movement +section +female +magazine +plan +professor +lord +longer +##ian +sat +walked +hill +actually +civil +energy +model +families +size +thus +aircraft +completed +includes +data +captain +##or +fight +vocals +featured +richard +bridge +fourth +1989 +officer +stone +hear +##ism +means +medical +groups +management +self +lips +competition +entire +lived +technology +leaving +federal +tournament +bit +passed +hot +independent +awards +kingdom +mary +spent +fine +doesn +reported +##ling +jack +fall +raised +itself +stay +true +studio +1988 +sports +replaced +paris +systems +saint +leader +theatre +whose +market +capital +parents +spanish +canadian +earth +##ity +cut +degree +writing +bay +christian +awarded +natural +higher +bill +##as +coast +provided +previous +senior +ft +valley +organization +stopped +onto +countries +parts +conference +queen +security +interest +saying +allowed +master +earlier +phone +matter +smith +winning +try +happened +moving +campaign +los +##ley +breath +nearly +mid +1987 +certain +girls +date +italian +african +standing +fell +artist +##ted +shows +deal +mine +industry +1986 +##ng +everyone +republic +provide +collection +library +student +##ville +primary +owned +older +via +heavy +1st +makes +##able +attention +anyone +africa +##ri +stated +length +ended +fingers +command +staff +skin +foreign +opening +governor +okay +medal +kill +sun +cover +job +1985 +introduced +chest +hell +feeling +##ies +success +meet +reason +standard +meeting +novel +1984 +trade +source +buildings +##land +rose +guy +goal +##ur +chapter +native +husband +previously +unit +limited +entered +weeks +producer +operations +mountain +takes +covered +forced +related +roman +complete +successful +key +texas +cold +##ya +channel +1980 +traditional +films +dance +clear +approximately +500 +nine +van +prince +question +active +tracks +ireland +regional +silver +author +personal +sense +operation +##ine +economic +1983 +holding +twenty +isbn +additional +speed +hour +edition +regular +historic +places +whom +shook +movie +km² +secretary +prior +report +chicago +read +foundation +view +engine +scored +1982 +units +ask +airport +property +ready +immediately +lady +month +listed +contract +##de +manager +themselves +lines +##ki +navy +writer +meant +##ts +runs +##ro +practice +championships +singer +glass +commission +required +forest +starting +culture +generally +giving +access +attended +test +couple +stand +catholic +martin +caught +executive +##less +eye +##ey +thinking +chair +quite +shoulder +1979 +hope +decision +plays +defeated +municipality +whether +structure +offered +slowly +pain +ice +direction +##ion +paper +mission +1981 +mostly +200 +noted +individual +managed +nature +lives +plant +##ha +helped +except +studied +computer +figure +relationship +issue +significant +loss +die +smiled +gun +ago +highest +1972 +##am +male +bring +goals +mexico +problem +distance +commercial +completely +location +annual +famous +drive +1976 +neck +1978 +surface +caused +italy +understand +greek +highway +wrong +hotel +comes +appearance +joseph +double +issues +musical +companies +castle +income +review +assembly +bass +initially +parliament +artists +experience +1974 +particular +walk +foot +engineering +talking +window +dropped +##ter +miss +baby +boys +break +1975 +stars +edge +remember +policy +carried +train +stadium +bar +sex +angeles +evidence +##ge +becoming +assistant +soviet +1977 +upper +step +wing +1970 +youth +financial +reach +##ll +actor +numerous +##se +##st +nodded +arrived +##ation +minute +##nt +believed +sorry +complex +beautiful +victory +associated +temple +1968 +1973 +chance +perhaps +metal +##son +1945 +bishop +##et +lee +launched +particularly +tree +le +retired +subject +prize +contains +yeah +theory +empire +##ce +suddenly +waiting +trust +recording +##to +happy +terms +camp +champion +1971 +religious +pass +zealand +names +2nd +port +ancient +tom +corner +represented +watch +legal +anti +justice +cause +watched +brothers +45 +material +changes +simply +response +louis +fast +##ting +answer +60 +historical +1969 +stories +straight +create +feature +increased +rate +administration +virginia +el +activities +cultural +overall +winner +programs +basketball +legs +guard +beyond +cast +doctor +mm +flight +results +remains +cost +effect +winter +##ble +larger +islands +problems +chairman +grew +commander +isn +1967 +pay +failed +selected +hurt +fort +box +regiment +majority +journal +35 +edward +plans +##ke +##ni +shown +pretty +irish +characters +directly +scene +likely +operated +allow +spring +##j +junior +matches +looks +mike +houses +fellow +##tion +beach +marriage +##ham +##ive +rules +oil +65 +florida +expected +nearby +congress +sam +peace +recent +iii +wait +subsequently +cell +##do +variety +serving +agreed +please +poor +joe +pacific +attempt +wood +democratic +piece +prime +##ca +rural +mile +touch +appears +township +1964 +1966 +soldiers +##men +##ized +1965 +pennsylvania +closer +fighting +claimed +score +jones +physical +editor +##ous +filled +genus +specific +sitting +super +mom +##va +therefore +supported +status +fear +cases +store +meaning +wales +minor +spain +tower +focus +vice +frank +follow +parish +separate +golden +horse +fifth +remaining +branch +32 +presented +stared +##id +uses +secret +forms +##co +baseball +exactly +##ck +choice +note +discovered +travel +composed +truth +russia +ball +color +kiss +dad +wind +continue +ring +referred +numbers +digital +greater +##ns +metres +slightly +direct +increase +1960 +responsible +crew +rule +trees +troops +##no +broke +goes +individuals +hundred +weight +creek +sleep +memory +defense +provides +ordered +code +value +jewish +windows +1944 +safe +judge +whatever +corps +realized +growing +pre +##ga +cities +alexander +gaze +lies +spread +scott +letter +showed +situation +mayor +transport +watching +workers +extended +##li +expression +normal +##ment +chart +multiple +border +##ba +host +##ner +daily +mrs +walls +piano +##ko +heat +cannot +##ate +earned +products +drama +era +authority +seasons +join +grade +##io +sign +difficult +machine +1963 +territory +mainly +##wood +stations +squadron +1962 +stepped +iron +19th +##led +serve +appear +sky +speak +broken +charge +knowledge +kilometres +removed +ships +article +campus +simple +##ty +pushed +britain +##ve +leaves +recently +cd +soft +boston +latter +easy +acquired +poland +##sa +quality +officers +presence +planned +nations +mass +broadcast +jean +share +image +influence +wild +offer +emperor +electric +reading +headed +ability +promoted +yellow +ministry +1942 +throat +smaller +politician +##by +latin +spoke +cars +williams +males +lack +pop +80 +##ier +acting +seeing +consists +##ti +estate +1961 +pressure +johnson +newspaper +jr +chris +olympics +online +conditions +beat +elements +walking +vote +##field +needs +carolina +text +featuring +global +block +shirt +levels +francisco +purpose +females +et +dutch +duke +ahead +gas +twice +safety +serious +turning +highly +lieutenant +firm +maria +amount +mixed +daniel +proposed +perfect +agreement +affairs +3rd +seconds +contemporary +paid +1943 +prison +save +kitchen +label +administrative +intended +constructed +academic +nice +teacher +races +1956 +formerly +corporation +ben +nation +issued +shut +1958 +drums +housing +victoria +seems +opera +1959 +graduated +function +von +mentioned +picked +build +recognized +shortly +protection +picture +notable +exchange +elections +1980s +loved +percent +racing +fish +elizabeth +garden +volume +hockey +1941 +beside +settled +##ford +1940 +competed +replied +drew +1948 +actress +marine +scotland +steel +glanced +farm +steve +1957 +risk +tonight +positive +magic +singles +effects +gray +screen +dog +##ja +residents +bus +sides +none +secondary +literature +polish +destroyed +flying +founder +households +1939 +lay +reserve +usa +gallery +##ler +1946 +industrial +younger +approach +appearances +urban +ones +1950 +finish +avenue +powerful +fully +growth +page +honor +jersey +projects +advanced +revealed +basic +90 +infantry +pair +equipment +visit +33 +evening +search +grant +effort +solo +treatment +buried +republican +primarily +bottom +owner +1970s +israel +gives +jim +dream +bob +remain +spot +70 +notes +produce +champions +contact +ed +soul +accepted +ways +del +##ally +losing +split +price +capacity +basis +trial +questions +##ina +1955 +20th +guess +officially +memorial +naval +initial +##ization +whispered +median +engineer +##ful +sydney +##go +columbia +strength +300 +1952 +tears +senate +00 +card +asian +agent +1947 +software +44 +draw +warm +supposed +com +pro +##il +transferred +leaned +##at +candidate +escape +mountains +asia +potential +activity +entertainment +seem +traffic +jackson +murder +36 +slow +product +orchestra +haven +agency +bbc +taught +website +comedy +unable +storm +planning +albums +rugby +environment +scientific +grabbed +protect +##hi +boat +typically +1954 +1953 +damage +principal +divided +dedicated +mount +ohio +##berg +pick +fought +driver +##der +empty +shoulders +sort +thank +berlin +prominent +account +freedom +necessary +efforts +alex +headquarters +follows +alongside +des +simon +andrew +suggested +operating +learning +steps +1949 +sweet +technical +begin +easily +34 +teeth +speaking +settlement +scale +##sh +renamed +ray +max +enemy +semi +joint +compared +##rd +scottish +leadership +analysis +offers +georgia +pieces +captured +animal +deputy +guest +organized +##lin +tony +combined +method +challenge +1960s +huge +wants +battalion +sons +rise +crime +types +facilities +telling +path +1951 +platform +sit +1990s +##lo +tells +assigned +rich +pull +##ot +commonly +alive +##za +letters +concept +conducted +wearing +happen +bought +becomes +holy +gets +ocean +defeat +languages +purchased +coffee +occurred +titled +##q +declared +applied +sciences +concert +sounds +jazz +brain +##me +painting +fleet +tax +nick +##ius +michigan +count +animals +leaders +episodes +##line +content +##den +birth +##it +clubs +64 +palace +critical +refused +fair +leg +laughed +returning +surrounding +participated +formation +lifted +pointed +connected +rome +medicine +laid +taylor +santa +powers +adam +tall +shared +focused +knowing +yards +entrance +falls +##wa +calling +##ad +sources +chosen +beneath +resources +yard +##ite +nominated +silence +zone +defined +##que +gained +thirty +38 +bodies +moon +##ard +adopted +christmas +widely +register +apart +iran +premier +serves +du +unknown +parties +##les +generation +##ff +continues +quick +fields +brigade +quiet +teaching +clothes +impact +weapons +partner +flat +theater +supreme +1938 +37 +relations +##tor +plants +suffered +1936 +wilson +kids +begins +##age +1918 +seats +armed +internet +models +worth +laws +400 +communities +classes +background +knows +thanks +quarter +reaching +humans +carry +killing +format +kong +hong +setting +75 +architecture +disease +railroad +inc +possibly +wish +arthur +thoughts +harry +doors +density +##di +crowd +illinois +stomach +tone +unique +reports +anyway +##ir +liberal +der +vehicle +thick +dry +drug +faced +largely +facility +theme +holds +creation +strange +colonel +##mi +revolution +bell +politics +turns +silent +rail +relief +independence +combat +shape +write +determined +sales +learned +4th +finger +oxford +providing +1937 +heritage +fiction +situated +designated +allowing +distribution +hosted +##est +sight +interview +estimated +reduced +##ria +toronto +footballer +keeping +guys +damn +claim +motion +sport +sixth +stayed +##ze +en +rear +receive +handed +twelve +dress +audience +granted +brazil +##well +spirit +##ated +noticed +etc +olympic +representative +eric +tight +trouble +reviews +drink +vampire +missing +roles +ranked +newly +household +finals +wave +critics +##ee +phase +massachusetts +pilot +unlike +philadelphia +bright +guns +crown +organizations +roof +42 +respectively +clearly +tongue +marked +circle +fox +korea +bronze +brian +expanded +sexual +supply +yourself +inspired +labour +fc +##ah +reference +vision +draft +connection +brand +reasons +1935 +classic +driving +trip +jesus +cells +entry +1920 +neither +trail +claims +atlantic +orders +labor +nose +afraid +identified +intelligence +calls +cancer +attacked +passing +stephen +positions +imperial +grey +jason +39 +sunday +48 +swedish +avoid +extra +uncle +message +covers +allows +surprise +materials +fame +hunter +##ji +1930 +citizens +figures +davis +environmental +confirmed +shit +titles +di +performing +difference +acts +attacks +##ov +existing +votes +opportunity +nor +shop +entirely +trains +opposite +pakistan +##pa +develop +resulted +representatives +actions +reality +pressed +##ish +barely +wine +conversation +faculty +northwest +ends +documentary +nuclear +stock +grace +sets +eat +alternative +##ps +bag +resulting +creating +surprised +cemetery +1919 +drop +finding +sarah +cricket +streets +tradition +ride +1933 +exhibition +target +ear +explained +rain +composer +injury +apartment +municipal +educational +occupied +netherlands +clean +billion +constitution +learn +1914 +maximum +classical +francis +lose +opposition +jose +ontario +bear +core +hills +rolled +ending +drawn +permanent +fun +##tes +##lla +lewis +sites +chamber +ryan +##way +scoring +height +1934 +##house +lyrics +staring +55 +officials +1917 +snow +oldest +##tic +orange +##ger +qualified +interior +apparently +succeeded +thousand +dinner +lights +existence +fans +heavily +41 +greatest +conservative +send +bowl +plus +enter +catch +##un +economy +duty +1929 +speech +authorities +princess +performances +versions +shall +graduate +pictures +effective +remembered +poetry +desk +crossed +starring +starts +passenger +sharp +##ant +acres +ass +weather +falling +rank +fund +supporting +check +adult +publishing +heads +cm +southeast +lane +##burg +application +bc +##ura +les +condition +transfer +prevent +display +ex +regions +earl +federation +cool +relatively +answered +besides +1928 +obtained +portion +##town +mix +##ding +reaction +liked +dean +express +peak +1932 +##tte +counter +religion +chain +rare +miller +convention +aid +lie +vehicles +mobile +perform +squad +wonder +lying +crazy +sword +##ping +attempted +centuries +weren +philosophy +category +##ize +anna +interested +47 +sweden +wolf +frequently +abandoned +kg +literary +alliance +task +entitled +##ay +threw +promotion +factory +tiny +soccer +visited +matt +fm +achieved +52 +defence +internal +persian +43 +methods +##ging +arrested +otherwise +cambridge +programming +villages +elementary +districts +rooms +criminal +conflict +worry +trained +1931 +attempts +waited +signal +bird +truck +subsequent +programme +##ol +ad +49 +communist +details +faith +sector +patrick +carrying +laugh +##ss +controlled +korean +showing +origin +fuel +evil +1927 +##ent +brief +identity +darkness +address +pool +missed +publication +web +planet +ian +anne +wings +invited +##tt +briefly +standards +kissed +##be +ideas +climate +causing +walter +worse +albert +articles +winners +desire +aged +northeast +dangerous +gate +doubt +1922 +wooden +multi +##ky +poet +rising +funding +46 +communications +communication +violence +copies +prepared +ford +investigation +skills +1924 +pulling +electronic +##ak +##ial +##han +containing +ultimately +offices +singing +understanding +restaurant +tomorrow +fashion +christ +ward +da +pope +stands +5th +flow +studios +aired +commissioned +contained +exist +fresh +americans +##per +wrestling +approved +kid +employed +respect +suit +1925 +angel +asking +increasing +frame +angry +selling +1950s +thin +finds +##nd +temperature +statement +ali +explain +inhabitants +towns +extensive +narrow +51 +jane +flowers +images +promise +somewhere +object +fly +closely +##ls +1912 +bureau +cape +1926 +weekly +presidential +legislative +1921 +##ai +##au +launch +founding +##ny +978 +##ring +artillery +strike +un +institutions +roll +writers +landing +chose +kevin +anymore +pp +##ut +attorney +fit +dan +billboard +receiving +agricultural +breaking +sought +dave +admitted +lands +mexican +##bury +charlie +specifically +hole +iv +howard +credit +moscow +roads +accident +1923 +proved +wear +struck +hey +guards +stuff +slid +expansion +1915 +cat +anthony +##kin +melbourne +opposed +sub +southwest +architect +failure +plane +1916 +##ron +map +camera +tank +listen +regarding +wet +introduction +metropolitan +link +ep +fighter +inch +grown +gene +anger +fixed +buy +dvd +khan +domestic +worldwide +chapel +mill +functions +examples +##head +developing +1910 +turkey +hits +pocket +antonio +papers +grow +unless +circuit +18th +concerned +attached +journalist +selection +journey +converted +provincial +painted +hearing +aren +bands +negative +aside +wondered +knight +lap +survey +ma +##ow +noise +billy +##ium +shooting +guide +bedroom +priest +resistance +motor +homes +sounded +giant +##mer +150 +scenes +equal +comic +patients +hidden +solid +actual +bringing +afternoon +touched +funds +wedding +consisted +marie +canal +sr +kim +treaty +turkish +recognition +residence +cathedral +broad +knees +incident +shaped +fired +norwegian +handle +cheek +contest +represent +##pe +representing +beauty +##sen +birds +advantage +emergency +wrapped +drawing +notice +pink +broadcasting +##ong +somehow +bachelor +seventh +collected +registered +establishment +alan +assumed +chemical +personnel +roger +retirement +jeff +portuguese +wore +tied +device +threat +progress +advance +##ised +banks +hired +manchester +nfl +teachers +structures +forever +##bo +tennis +helping +saturday +sale +applications +junction +hip +incorporated +neighborhood +dressed +ceremony +##ds +influenced +hers +visual +stairs +decades +inner +kansas +hung +hoped +gain +scheduled +downtown +engaged +austria +clock +norway +certainly +pale +protected +1913 +victor +employees +plate +putting +surrounded +##ists +finishing +blues +tropical +##ries +minnesota +consider +philippines +accept +54 +retrieved +1900 +concern +anderson +properties +institution +gordon +successfully +vietnam +##dy +backing +outstanding +muslim +crossing +folk +producing +usual +demand +occurs +observed +lawyer +educated +##ana +kelly +string +pleasure +budget +items +quietly +colorado +philip +typical +##worth +derived +600 +survived +asks +mental +##ide +56 +jake +jews +distinguished +ltd +1911 +sri +extremely +53 +athletic +loud +thousands +worried +shadow +transportation +horses +weapon +arena +importance +users +tim +objects +contributed +dragon +douglas +aware +senator +johnny +jordan +sisters +engines +flag +investment +samuel +shock +capable +clark +row +wheel +refers +session +familiar +biggest +wins +hate +maintained +drove +hamilton +request +expressed +injured +underground +churches +walker +wars +tunnel +passes +stupid +agriculture +softly +cabinet +regarded +joining +indiana +##ea +##ms +push +dates +spend +behavior +woods +protein +gently +chase +morgan +mention +burning +wake +combination +occur +mirror +leads +jimmy +indeed +impossible +singapore +paintings +covering +##nes +soldier +locations +attendance +sell +historian +wisconsin +invasion +argued +painter +diego +changing +egypt +##don +experienced +inches +##ku +missouri +vol +grounds +spoken +switzerland +##gan +reform +rolling +ha +forget +massive +resigned +burned +allen +tennessee +locked +values +improved +##mo +wounded +universe +sick +dating +facing +pack +purchase +user +##pur +moments +##ul +merged +anniversary +1908 +coal +brick +understood +causes +dynasty +queensland +establish +stores +crisis +promote +hoping +views +cards +referee +extension +##si +raise +arizona +improve +colonial +formal +charged +##rt +palm +lucky +hide +rescue +faces +95 +feelings +candidates +juan +##ell +goods +6th +courses +weekend +59 +luke +cash +fallen +##om +delivered +affected +installed +carefully +tries +swiss +hollywood +costs +lincoln +responsibility +##he +shore +file +proper +normally +maryland +assistance +jump +constant +offering +friendly +waters +persons +realize +contain +trophy +800 +partnership +factor +58 +musicians +cry +bound +oregon +indicated +hero +houston +medium +##ure +consisting +somewhat +##ara +57 +cycle +##che +beer +moore +frederick +gotten +eleven +worst +weak +approached +arranged +chin +loan +universal +bond +fifteen +pattern +disappeared +##ney +translated +##zed +lip +arab +capture +interests +insurance +##chi +shifted +cave +prix +warning +sections +courts +coat +plot +smell +feed +golf +favorite +maintain +knife +vs +voted +degrees +finance +quebec +opinion +translation +manner +ruled +operate +productions +choose +musician +discovery +confused +tired +separated +stream +techniques +committed +attend +ranking +kings +throw +passengers +measure +horror +fan +mining +sand +danger +salt +calm +decade +dam +require +runner +##ik +rush +associate +greece +##ker +rivers +consecutive +matthew +##ski +sighed +sq +documents +steam +edited +closing +tie +accused +1905 +##ini +islamic +distributed +directors +organisation +bruce +7th +breathing +mad +lit +arrival +concrete +taste +08 +composition +shaking +faster +amateur +adjacent +stating +1906 +twin +flew +##ran +tokyo +publications +##tone +obviously +ridge +storage +1907 +carl +pages +concluded +desert +driven +universities +ages +terminal +sequence +borough +250 +constituency +creative +cousin +economics +dreams +margaret +notably +reduce +montreal +mode +17th +ears +saved +jan +vocal +##ica +1909 +andy +##jo +riding +roughly +threatened +##ise +meters +meanwhile +landed +compete +repeated +grass +czech +regularly +charges +tea +sudden +appeal +##ung +solution +describes +pierre +classification +glad +parking +##ning +belt +physics +99 +rachel +add +hungarian +participate +expedition +damaged +gift +childhood +85 +fifty +##red +mathematics +jumped +letting +defensive +mph +##ux +##gh +testing +##hip +hundreds +shoot +owners +matters +smoke +israeli +kentucky +dancing +mounted +grandfather +emma +designs +profit +argentina +##gs +truly +li +lawrence +cole +begun +detroit +willing +branches +smiling +decide +miami +enjoyed +recordings +##dale +poverty +ethnic +gay +##bi +gary +arabic +09 +accompanied +##one +##ons +fishing +determine +residential +acid +##ary +alice +returns +starred +mail +##ang +jonathan +strategy +##ue +net +forty +cook +businesses +equivalent +commonwealth +distinct +ill +##cy +seriously +##ors +##ped +shift +harris +replace +rio +imagine +formula +ensure +##ber +additionally +scheme +conservation +occasionally +purposes +feels +favor +##and +##ore +1930s +contrast +hanging +hunt +movies +1904 +instruments +victims +danish +christopher +busy +demon +sugar +earliest +colony +studying +balance +duties +##ks +belgium +slipped +carter +05 +visible +stages +iraq +fifa +##im +commune +forming +zero +07 +continuing +talked +counties +legend +bathroom +option +tail +clay +daughters +afterwards +severe +jaw +visitors +##ded +devices +aviation +russell +kate +##vi +entering +subjects +##ino +temporary +swimming +forth +smooth +ghost +audio +bush +operates +rocks +movements +signs +eddie +##tz +ann +voices +honorary +06 +memories +dallas +pure +measures +racial +promised +66 +harvard +ceo +16th +parliamentary +indicate +benefit +flesh +dublin +louisiana +1902 +1901 +patient +sleeping +1903 +membership +coastal +medieval +wanting +element +scholars +rice +62 +limit +survive +makeup +rating +definitely +collaboration +obvious +##tan +boss +ms +baron +birthday +linked +soil +diocese +##lan +ncaa +##mann +offensive +shell +shouldn +waist +##tus +plain +ross +organ +resolution +manufacturing +adding +relative +kennedy +98 +whilst +moth +marketing +gardens +crash +72 +heading +partners +credited +carlos +moves +cable +##zi +marshall +##out +depending +bottle +represents +rejected +responded +existed +04 +jobs +denmark +lock +##ating +treated +graham +routes +talent +commissioner +drugs +secure +tests +reign +restored +photography +##gi +contributions +oklahoma +designer +disc +grin +seattle +robin +paused +atlanta +unusual +##gate +praised +las +laughing +satellite +hungary +visiting +##sky +interesting +factors +deck +poems +norman +##water +stuck +speaker +rifle +domain +premiered +##her +dc +comics +actors +01 +reputation +eliminated +8th +ceiling +prisoners +script +##nce +leather +austin +mississippi +rapidly +admiral +parallel +charlotte +guilty +tools +gender +divisions +fruit +##bs +laboratory +nelson +fantasy +marry +rapid +aunt +tribe +requirements +aspects +suicide +amongst +adams +bone +ukraine +abc +kick +sees +edinburgh +clothing +column +rough +gods +hunting +broadway +gathered +concerns +##ek +spending +ty +12th +snapped +requires +solar +bones +cavalry +##tta +iowa +drinking +waste +index +franklin +charity +thompson +stewart +tip +flash +landscape +friday +enjoy +singh +poem +listening +##back +eighth +fred +differences +adapted +bomb +ukrainian +surgery +corporate +masters +anywhere +##more +waves +odd +sean +portugal +orleans +dick +debate +kent +eating +puerto +cleared +96 +expect +cinema +97 +guitarist +blocks +electrical +agree +involving +depth +dying +panel +struggle +##ged +peninsula +adults +novels +emerged +vienna +metro +debuted +shoes +tamil +songwriter +meets +prove +beating +instance +heaven +scared +sending +marks +artistic +passage +superior +03 +significantly +shopping +##tive +retained +##izing +malaysia +technique +cheeks +##ola +warren +maintenance +destroy +extreme +allied +120 +appearing +##yn +fill +advice +alabama +qualifying +policies +cleveland +hat +battery +smart +authors +10th +soundtrack +acted +dated +lb +glance +equipped +coalition +funny +outer +ambassador +roy +possibility +couples +campbell +dna +loose +ethan +supplies +1898 +gonna +88 +monster +##res +shake +agents +frequency +springs +dogs +practices +61 +gang +plastic +easier +suggests +gulf +blade +exposed +colors +industries +markets +pan +nervous +electoral +charts +legislation +ownership +##idae +mac +appointment +shield +copy +assault +socialist +abbey +monument +license +throne +employment +jay +93 +replacement +charter +cloud +powered +suffering +accounts +oak +connecticut +strongly +wright +colour +crystal +13th +context +welsh +networks +voiced +gabriel +jerry +##cing +forehead +mp +##ens +manage +schedule +totally +remix +##ii +forests +occupation +print +nicholas +brazilian +strategic +vampires +engineers +76 +roots +seek +correct +instrumental +und +alfred +backed +hop +##des +stanley +robinson +traveled +wayne +welcome +austrian +achieve +67 +exit +rates +1899 +strip +whereas +##cs +sing +deeply +adventure +bobby +rick +jamie +careful +components +cap +useful +personality +knee +##shi +pushing +hosts +02 +protest +ca +ottoman +symphony +##sis +63 +boundary +1890 +processes +considering +considerable +tons +##work +##ft +##nia +cooper +trading +dear +conduct +91 +illegal +apple +revolutionary +holiday +definition +harder +##van +jacob +circumstances +destruction +##lle +popularity +grip +classified +liverpool +donald +baltimore +flows +seeking +honour +approval +92 +mechanical +till +happening +statue +critic +increasingly +immediate +describe +commerce +stare +##ster +indonesia +meat +rounds +boats +baker +orthodox +depression +formally +worn +naked +claire +muttered +sentence +11th +emily +document +77 +criticism +wished +vessel +spiritual +bent +virgin +parker +minimum +murray +lunch +danny +printed +compilation +keyboards +false +blow +belonged +68 +raising +78 +cutting +##board +pittsburgh +##up +9th +shadows +81 +hated +indigenous +jon +15th +barry +scholar +ah +##zer +oliver +##gy +stick +susan +meetings +attracted +spell +romantic +##ver +ye +1895 +photo +demanded +customers +##ac +1896 +logan +revival +keys +modified +commanded +jeans +##ious +upset +raw +phil +detective +hiding +resident +vincent +##bly +experiences +diamond +defeating +coverage +lucas +external +parks +franchise +helen +bible +successor +percussion +celebrated +il +lift +profile +clan +romania +##ied +mills +##su +nobody +achievement +shrugged +fault +1897 +rhythm +initiative +breakfast +carbon +700 +69 +lasted +violent +74 +wound +ken +killer +gradually +filmed +°c +dollars +processing +94 +remove +criticized +guests +sang +chemistry +##vin +legislature +disney +##bridge +uniform +escaped +integrated +proposal +purple +denied +liquid +karl +influential +morris +nights +stones +intense +experimental +twisted +71 +84 +##ld +pace +nazi +mitchell +ny +blind +reporter +newspapers +14th +centers +burn +basin +forgotten +surviving +filed +collections +monastery +losses +manual +couch +description +appropriate +merely +tag +missions +sebastian +restoration +replacing +triple +73 +elder +julia +warriors +benjamin +julian +convinced +stronger +amazing +declined +versus +merchant +happens +output +finland +bare +barbara +absence +ignored +dawn +injuries +##port +producers +##ram +82 +luis +##ities +kw +admit +expensive +electricity +nba +exception +symbol +##ving +ladies +shower +sheriff +characteristics +##je +aimed +button +ratio +effectively +summit +angle +jury +bears +foster +vessels +pants +executed +evans +dozen +advertising +kicked +patrol +1889 +competitions +lifetime +principles +athletics +##logy +birmingham +sponsored +89 +rob +nomination +1893 +acoustic +##sm +creature +longest +##tra +credits +harbor +dust +josh +##so +territories +milk +infrastructure +completion +thailand +indians +leon +archbishop +##sy +assist +pitch +blake +arrangement +girlfriend +serbian +operational +hence +sad +scent +fur +dj +sessions +hp +refer +rarely +##ora +exists +1892 +##ten +scientists +dirty +penalty +burst +portrait +seed +79 +pole +limits +rival +1894 +stable +alpha +grave +constitutional +alcohol +arrest +flower +mystery +devil +architectural +relationships +greatly +habitat +##istic +larry +progressive +remote +cotton +##ics +##ok +preserved +reaches +##ming +cited +86 +vast +scholarship +decisions +cbs +joy +teach +1885 +editions +knocked +eve +searching +partly +participation +gap +animated +fate +excellent +##ett +na +87 +alternate +saints +youngest +##ily +climbed +##ita +##tors +suggest +##ct +discussion +staying +choir +lakes +jacket +revenue +nevertheless +peaked +instrument +wondering +annually +managing +neil +1891 +signing +terry +##ice +apply +clinical +brooklyn +aim +catherine +fuck +farmers +figured +ninth +pride +hugh +evolution +ordinary +involvement +comfortable +shouted +tech +encouraged +taiwan +representation +sharing +##lia +##em +panic +exact +cargo +competing +fat +cried +83 +1920s +occasions +pa +cabin +borders +utah +marcus +##isation +badly +muscles +##ance +victorian +transition +warner +bet +permission +##rin +slave +terrible +similarly +shares +seth +uefa +possession +medals +benefits +colleges +lowered +perfectly +mall +transit +##ye +##kar +publisher +##ened +harrison +deaths +elevation +##ae +asleep +machines +sigh +ash +hardly +argument +occasion +parent +leo +decline +1888 +contribution +##ua +concentration +1000 +opportunities +hispanic +guardian +extent +emotions +hips +mason +volumes +bloody +controversy +diameter +steady +mistake +phoenix +identify +violin +##sk +departure +richmond +spin +funeral +enemies +1864 +gear +literally +connor +random +sergeant +grab +confusion +1865 +transmission +informed +op +leaning +sacred +suspended +thinks +gates +portland +luck +agencies +yours +hull +expert +muscle +layer +practical +sculpture +jerusalem +latest +lloyd +statistics +deeper +recommended +warrior +arkansas +mess +supports +greg +eagle +1880 +recovered +rated +concerts +rushed +##ano +stops +eggs +files +premiere +keith +##vo +delhi +turner +pit +affair +belief +paint +##zing +mate +##ach +##ev +victim +##ology +withdrew +bonus +styles +fled +##ud +glasgow +technologies +funded +nbc +adaptation +##ata +portrayed +cooperation +supporters +judges +bernard +justin +hallway +ralph +##ick +graduating +controversial +distant +continental +spider +bite +##ho +recognize +intention +mixing +##ese +egyptian +bow +tourism +suppose +claiming +tiger +dominated +participants +vi +##ru +nurse +partially +tape +##rum +psychology +##rn +essential +touring +duo +voting +civilian +emotional +channels +##king +apparent +hebrew +1887 +tommy +carrier +intersection +beast +hudson +##gar +##zo +lab +nova +bench +discuss +costa +##ered +detailed +behalf +drivers +unfortunately +obtain +##lis +rocky +##dae +siege +friendship +honey +##rian +1861 +amy +hang +posted +governments +collins +respond +wildlife +preferred +operator +##po +laura +pregnant +videos +dennis +suspected +boots +instantly +weird +automatic +businessman +alleged +placing +throwing +ph +mood +1862 +perry +venue +jet +remainder +##lli +##ci +passion +biological +boyfriend +1863 +dirt +buffalo +ron +segment +fa +abuse +##era +genre +thrown +stroke +colored +stress +exercise +displayed +##gen +struggled +##tti +abroad +dramatic +wonderful +thereafter +madrid +component +widespread +##sed +tale +citizen +todd +monday +1886 +vancouver +overseas +forcing +crying +descent +##ris +discussed +substantial +ranks +regime +1870 +provinces +switch +drum +zane +ted +tribes +proof +lp +cream +researchers +volunteer +manor +silk +milan +donated +allies +venture +principle +delivery +enterprise +##ves +##ans +bars +traditionally +witch +reminded +copper +##uk +pete +inter +links +colin +grinned +elsewhere +competitive +frequent +##oy +scream +##hu +tension +texts +submarine +finnish +defending +defend +pat +detail +1884 +affiliated +stuart +themes +villa +periods +tool +belgian +ruling +crimes +answers +folded +licensed +resort +demolished +hans +lucy +1881 +lion +traded +photographs +writes +craig +##fa +trials +generated +beth +noble +debt +percentage +yorkshire +erected +ss +viewed +grades +confidence +ceased +islam +telephone +retail +##ible +chile +m² +roberts +sixteen +##ich +commented +hampshire +innocent +dual +pounds +checked +regulations +afghanistan +sung +rico +liberty +assets +bigger +options +angels +relegated +tribute +wells +attending +leaf +##yan +butler +romanian +forum +monthly +lisa +patterns +gmina +##tory +madison +hurricane +rev +##ians +bristol +##ula +elite +valuable +disaster +democracy +awareness +germans +freyja +##ins +loop +absolutely +paying +populations +maine +sole +prayer +spencer +releases +doorway +bull +##ani +lover +midnight +conclusion +##sson +thirteen +lily +mediterranean +##lt +nhl +proud +sample +##hill +drummer +guinea +##ova +murphy +climb +##ston +instant +attributed +horn +ain +railways +steven +##ao +autumn +ferry +opponent +root +traveling +secured +corridor +stretched +tales +sheet +trinity +cattle +helps +indicates +manhattan +murdered +fitted +1882 +gentle +grandmother +mines +shocked +vegas +produces +##light +caribbean +##ou +belong +continuous +desperate +drunk +historically +trio +waved +raf +dealing +nathan +bat +murmured +interrupted +residing +scientist +pioneer +harold +aaron +##net +delta +attempting +minority +mini +believes +chorus +tend +lots +eyed +indoor +load +shots +updated +jail +##llo +concerning +connecting +wealth +##ved +slaves +arrive +rangers +sufficient +rebuilt +##wick +cardinal +flood +muhammad +whenever +relation +runners +moral +repair +viewers +arriving +revenge +punk +assisted +bath +fairly +breathe +lists +innings +illustrated +whisper +nearest +voters +clinton +ties +ultimate +screamed +beijing +lions +andre +fictional +gathering +comfort +radar +suitable +dismissed +hms +ban +pine +wrist +atmosphere +voivodeship +bid +timber +##ned +##nan +giants +##ane +cameron +recovery +uss +identical +categories +switched +serbia +laughter +noah +ensemble +therapy +peoples +touching +##off +locally +pearl +platforms +everywhere +ballet +tables +lanka +herbert +outdoor +toured +derek +1883 +spaces +contested +swept +1878 +exclusive +slight +connections +##dra +winds +prisoner +collective +bangladesh +tube +publicly +wealthy +thai +##ys +isolated +select +##ric +insisted +pen +fortune +ticket +spotted +reportedly +animation +enforcement +tanks +110 +decides +wider +lowest +owen +##time +nod +hitting +##hn +gregory +furthermore +magazines +fighters +solutions +##ery +pointing +requested +peru +reed +chancellor +knights +mask +worker +eldest +flames +reduction +1860 +volunteers +##tis +reporting +##hl +wire +advisory +endemic +origins +settlers +pursue +knock +consumer +1876 +eu +compound +creatures +mansion +sentenced +ivan +deployed +guitars +frowned +involves +mechanism +kilometers +perspective +shops +maps +terminus +duncan +alien +fist +bridges +##pers +heroes +fed +derby +swallowed +##ros +patent +sara +illness +characterized +adventures +slide +hawaii +jurisdiction +##op +organised +##side +adelaide +walks +biology +se +##ties +rogers +swing +tightly +boundaries +##rie +prepare +implementation +stolen +##sha +certified +colombia +edwards +garage +##mm +recalled +##ball +rage +harm +nigeria +breast +##ren +furniture +pupils +settle +##lus +cuba +balls +client +alaska +21st +linear +thrust +celebration +latino +genetic +terror +##cia +##ening +lightning +fee +witness +lodge +establishing +skull +##ique +earning +hood +##ei +rebellion +wang +sporting +warned +missile +devoted +activist +porch +worship +fourteen +package +1871 +decorated +##shire +housed +##ock +chess +sailed +doctors +oscar +joan +treat +garcia +harbour +jeremy +##ire +traditions +dominant +jacques +##gon +##wan +relocated +1879 +amendment +sized +companion +simultaneously +volleyball +spun +acre +increases +stopping +loves +belongs +affect +drafted +tossed +scout +battles +1875 +filming +shoved +munich +tenure +vertical +romance +pc +##cher +argue +##ical +craft +ranging +www +opens +honest +tyler +yesterday +virtual +##let +muslims +reveal +snake +immigrants +radical +screaming +speakers +firing +saving +belonging +ease +lighting +prefecture +blame +farmer +hungry +grows +rubbed +beam +sur +subsidiary +##cha +armenian +sao +dropping +conventional +##fer +microsoft +reply +qualify +spots +1867 +sweat +festivals +##ken +immigration +physician +discover +exposure +sandy +explanation +isaac +implemented +##fish +hart +initiated +connect +stakes +presents +heights +householder +pleased +tourist +regardless +slip +closest +##ction +surely +sultan +brings +riley +preparation +aboard +slammed +baptist +experiment +ongoing +interstate +organic +playoffs +##ika +1877 +130 +##tar +hindu +error +tours +tier +plenty +arrangements +talks +trapped +excited +sank +ho +athens +1872 +denver +welfare +suburb +athletes +trick +diverse +belly +exclusively +yelled +1868 +##med +conversion +##ette +1874 +internationally +computers +conductor +abilities +sensitive +hello +dispute +measured +globe +rocket +prices +amsterdam +flights +tigers +inn +municipalities +emotion +references +3d +##mus +explains +airlines +manufactured +pm +archaeological +1873 +interpretation +devon +comment +##ites +settlements +kissing +absolute +improvement +suite +impressed +barcelona +sullivan +jefferson +towers +jesse +julie +##tin +##lu +grandson +hi +gauge +regard +rings +interviews +trace +raymond +thumb +departments +burns +serial +bulgarian +scores +demonstrated +##ix +1866 +kyle +alberta +underneath +romanized +##ward +relieved +acquisition +phrase +cliff +reveals +han +cuts +merger +custom +##dar +nee +gilbert +graduation +##nts +assessment +cafe +difficulty +demands +swung +democrat +jennifer +commons +1940s +grove +##yo +completing +focuses +sum +substitute +bearing +stretch +reception +##py +reflected +essentially +destination +pairs +##ched +survival +resource +##bach +promoting +doubles +messages +tear +##down +##fully +parade +florence +harvey +incumbent +partial +framework +900 +pedro +frozen +procedure +olivia +controls +##mic +shelter +personally +temperatures +##od +brisbane +tested +sits +marble +comprehensive +oxygen +leonard +##kov +inaugural +iranian +referring +quarters +attitude +##ivity +mainstream +lined +mars +dakota +norfolk +unsuccessful +##° +explosion +helicopter +congressional +##sing +inspector +bitch +seal +departed +divine +##ters +coaching +examination +punishment +manufacturer +sink +columns +unincorporated +signals +nevada +squeezed +dylan +dining +photos +martial +manuel +eighteen +elevator +brushed +plates +ministers +ivy +congregation +##len +slept +specialized +taxes +curve +restricted +negotiations +likes +statistical +arnold +inspiration +execution +bold +intermediate +significance +margin +ruler +wheels +gothic +intellectual +dependent +listened +eligible +buses +widow +syria +earn +cincinnati +collapsed +recipient +secrets +accessible +philippine +maritime +goddess +clerk +surrender +breaks +playoff +database +##ified +##lon +ideal +beetle +aspect +soap +regulation +strings +expand +anglo +shorter +crosses +retreat +tough +coins +wallace +directions +pressing +##oon +shipping +locomotives +comparison +topics +nephew +##mes +distinction +honors +travelled +sierra +ibn +##over +fortress +sa +recognised +carved +1869 +clients +##dan +intent +##mar +coaches +describing +bread +##ington +beaten +northwestern +##ona +merit +youtube +collapse +challenges +em +historians +objective +submitted +virus +attacking +drake +assume +##ere +diseases +marc +stem +leeds +##cus +##ab +farming +glasses +##lock +visits +nowhere +fellowship +relevant +carries +restaurants +experiments +101 +constantly +bases +targets +shah +tenth +opponents +verse +territorial +##ira +writings +corruption +##hs +instruction +inherited +reverse +emphasis +##vic +employee +arch +keeps +rabbi +watson +payment +uh +##ala +nancy +##tre +venice +fastest +sexy +banned +adrian +properly +ruth +touchdown +dollar +boards +metre +circles +edges +favour +comments +ok +travels +liberation +scattered +firmly +##ular +holland +permitted +diesel +kenya +den +originated +##ral +demons +resumed +dragged +rider +##rus +servant +blinked +extend +torn +##ias +##sey +input +meal +everybody +cylinder +kinds +camps +##fe +bullet +logic +##wn +croatian +evolved +healthy +fool +chocolate +wise +preserve +pradesh +##ess +respective +1850 +##ew +chicken +artificial +gross +corresponding +convicted +cage +caroline +dialogue +##dor +narrative +stranger +mario +br +christianity +failing +trent +commanding +buddhist +1848 +maurice +focusing +yale +bike +altitude +##ering +mouse +revised +##sley +veteran +##ig +pulls +theology +crashed +campaigns +legion +##ability +drag +excellence +customer +cancelled +intensity +excuse +##lar +liga +participating +contributing +printing +##burn +variable +##rk +curious +bin +legacy +renaissance +##my +symptoms +binding +vocalist +dancer +##nie +grammar +gospel +democrats +ya +enters +sc +diplomatic +hitler +##ser +clouds +mathematical +quit +defended +oriented +##heim +fundamental +hardware +impressive +equally +convince +confederate +guilt +chuck +sliding +##ware +magnetic +narrowed +petersburg +bulgaria +otto +phd +skill +##ama +reader +hopes +pitcher +reservoir +hearts +automatically +expecting +mysterious +bennett +extensively +imagined +seeds +monitor +fix +##ative +journalism +struggling +signature +ranch +encounter +photographer +observation +protests +##pin +influences +##hr +calendar +##all +cruz +croatia +locomotive +hughes +naturally +shakespeare +basement +hook +uncredited +faded +theories +approaches +dare +phillips +filling +fury +obama +##ain +efficient +arc +deliver +min +raid +breeding +inducted +leagues +efficiency +axis +montana +eagles +##ked +supplied +instructions +karen +picking +indicating +trap +anchor +practically +christians +tomb +vary +occasional +electronics +lords +readers +newcastle +faint +innovation +collect +situations +engagement +160 +claude +mixture +##feld +peer +tissue +logo +lean +##ration +°f +floors +##ven +architects +reducing +##our +##ments +rope +1859 +ottawa +##har +samples +banking +declaration +proteins +resignation +francois +saudi +advocate +exhibited +armor +twins +divorce +##ras +abraham +reviewed +jo +temporarily +matrix +physically +pulse +curled +##ena +difficulties +bengal +usage +##ban +annie +riders +certificate +##pi +holes +warsaw +distinctive +jessica +##mon +mutual +1857 +customs +circular +eugene +removal +loaded +mere +vulnerable +depicted +generations +dame +heir +enormous +lightly +climbing +pitched +lessons +pilots +nepal +ram +google +preparing +brad +louise +renowned +##₂ +liam +##ably +plaza +shaw +sophie +brilliant +bills +##bar +##nik +fucking +mainland +server +pleasant +seized +veterans +jerked +fail +beta +brush +radiation +stored +warmth +southeastern +nate +sin +raced +berkeley +joke +athlete +designation +trunk +##low +roland +qualification +archives +heels +artwork +receives +judicial +reserves +##bed +woke +installation +abu +floating +fake +lesser +excitement +interface +concentrated +addressed +characteristic +amanda +saxophone +monk +auto +##bus +releasing +egg +dies +interaction +defender +ce +outbreak +glory +loving +##bert +sequel +consciousness +http +awake +ski +enrolled +##ress +handling +rookie +brow +somebody +biography +warfare +amounts +contracts +presentation +fabric +dissolved +challenged +meter +psychological +lt +elevated +rally +accurate +##tha +hospitals +undergraduate +specialist +venezuela +exhibit +shed +nursing +protestant +fluid +structural +footage +jared +consistent +prey +##ska +succession +reflect +exile +lebanon +wiped +suspect +shanghai +resting +integration +preservation +marvel +variant +pirates +sheep +rounded +capita +sailing +colonies +manuscript +deemed +variations +clarke +functional +emerging +boxing +relaxed +curse +azerbaijan +heavyweight +nickname +editorial +rang +grid +tightened +earthquake +flashed +miguel +rushing +##ches +improvements +boxes +brooks +180 +consumption +molecular +felix +societies +repeatedly +variation +aids +civic +graphics +professionals +realm +autonomous +receiver +delayed +workshop +militia +chairs +trump +canyon +##point +harsh +extending +lovely +happiness +##jan +stake +eyebrows +embassy +wellington +hannah +##ella +sony +corners +bishops +swear +cloth +contents +xi +namely +commenced +1854 +stanford +nashville +courage +graphic +commitment +garrison +##bin +hamlet +clearing +rebels +attraction +literacy +cooking +ruins +temples +jenny +humanity +celebrate +hasn +freight +sixty +rebel +bastard +##art +newton +##ada +deer +##ges +##ching +smiles +delaware +singers +##ets +approaching +assists +flame +##ph +boulevard +barrel +planted +##ome +pursuit +##sia +consequences +posts +shallow +invitation +rode +depot +ernest +kane +rod +concepts +preston +topic +chambers +striking +blast +arrives +descendants +montgomery +ranges +worlds +##lay +##ari +span +chaos +praise +##ag +fewer +1855 +sanctuary +mud +fbi +##ions +programmes +maintaining +unity +harper +bore +handsome +closure +tournaments +thunder +nebraska +linda +facade +puts +satisfied +argentine +dale +cork +dome +panama +##yl +1858 +tasks +experts +##ates +feeding +equation +##las +##ida +##tu +engage +bryan +##ax +um +quartet +melody +disbanded +sheffield +blocked +gasped +delay +kisses +maggie +connects +##non +sts +poured +creator +publishers +##we +guided +ellis +extinct +hug +gaining +##ord +complicated +##bility +poll +clenched +investigate +##use +thereby +quantum +spine +cdp +humor +kills +administered +semifinals +##du +encountered +ignore +##bu +commentary +##maker +bother +roosevelt +140 +plains +halfway +flowing +cultures +crack +imprisoned +neighboring +airline +##ses +##view +##mate +##ec +gather +wolves +marathon +transformed +##ill +cruise +organisations +carol +punch +exhibitions +numbered +alarm +ratings +daddy +silently +##stein +queens +colours +impression +guidance +liu +tactical +##rat +marshal +della +arrow +##ings +rested +feared +tender +owns +bitter +advisor +escort +##ides +spare +farms +grants +##ene +dragons +encourage +colleagues +cameras +##und +sucked +pile +spirits +prague +statements +suspension +landmark +fence +torture +recreation +bags +permanently +survivors +pond +spy +predecessor +bombing +coup +##og +protecting +transformation +glow +##lands +##book +dug +priests +andrea +feat +barn +jumping +##chen +##ologist +##con +casualties +stern +auckland +pipe +serie +revealing +ba +##bel +trevor +mercy +spectrum +yang +consist +governing +collaborated +possessed +epic +comprises +blew +shane +##ack +lopez +honored +magical +sacrifice +judgment +perceived +hammer +mtv +baronet +tune +das +missionary +sheets +350 +neutral +oral +threatening +attractive +shade +aims +seminary +##master +estates +1856 +michel +wounds +refugees +manufacturers +##nic +mercury +syndrome +porter +##iya +##din +hamburg +identification +upstairs +purse +widened +pause +cared +breathed +affiliate +santiago +prevented +celtic +fisher +125 +recruited +byzantine +reconstruction +farther +##mp +diet +sake +au +spite +sensation +##ert +blank +separation +105 +##hon +vladimir +armies +anime +##lie +accommodate +orbit +cult +sofia +archive +##ify +##box +founders +sustained +disorder +honours +northeastern +mia +crops +violet +threats +blanket +fires +canton +followers +southwestern +prototype +voyage +assignment +altered +moderate +protocol +pistol +##eo +questioned +brass +lifting +1852 +math +authored +##ual +doug +dimensional +dynamic +##san +1851 +pronounced +grateful +quest +uncomfortable +boom +presidency +stevens +relating +politicians +chen +barrier +quinn +diana +mosque +tribal +cheese +palmer +portions +sometime +chester +treasure +wu +bend +download +millions +reforms +registration +##osa +consequently +monitoring +ate +preliminary +brandon +invented +ps +eaten +exterior +intervention +ports +documented +log +displays +lecture +sally +favourite +##itz +vermont +lo +invisible +isle +breed +##ator +journalists +relay +speaks +backward +explore +midfielder +actively +stefan +procedures +cannon +blond +kenneth +centered +servants +chains +libraries +malcolm +essex +henri +slavery +##hal +facts +fairy +coached +cassie +cats +washed +cop +##fi +announcement +item +2000s +vinyl +activated +marco +frontier +growled +curriculum +##das +loyal +accomplished +leslie +ritual +kenny +##00 +vii +napoleon +hollow +hybrid +jungle +stationed +friedrich +counted +##ulated +platinum +theatrical +seated +col +rubber +glen +1840 +diversity +healing +extends +id +provisions +administrator +columbus +##oe +tributary +te +assured +org +##uous +prestigious +examined +lectures +grammy +ronald +associations +bailey +allan +essays +flute +believing +consultant +proceedings +travelling +1853 +kit +kerala +yugoslavia +buddy +methodist +##ith +burial +centres +batman +##nda +discontinued +bo +dock +stockholm +lungs +severely +##nk +citing +manga +##ugh +steal +mumbai +iraqi +robot +celebrity +bride +broadcasts +abolished +pot +joel +overhead +franz +packed +reconnaissance +johann +acknowledged +introduce +handled +doctorate +developments +drinks +alley +palestine +##nis +##aki +proceeded +recover +bradley +grain +patch +afford +infection +nationalist +legendary +##ath +interchange +virtually +gen +gravity +exploration +amber +vital +wishes +powell +doctrine +elbow +screenplay +##bird +contribute +indonesian +pet +creates +##com +enzyme +kylie +discipline +drops +manila +hunger +##ien +layers +suffer +fever +bits +monica +keyboard +manages +##hood +searched +appeals +##bad +testament +grande +reid +##war +beliefs +congo +##ification +##dia +si +requiring +##via +casey +1849 +regret +streak +rape +depends +syrian +sprint +pound +tourists +upcoming +pub +##xi +tense +##els +practiced +echo +nationwide +guild +motorcycle +liz +##zar +chiefs +desired +elena +bye +precious +absorbed +relatives +booth +pianist +##mal +citizenship +exhausted +wilhelm +##ceae +##hed +noting +quarterback +urge +hectares +##gue +ace +holly +##tal +blonde +davies +parked +sustainable +stepping +twentieth +airfield +galaxy +nest +chip +##nell +tan +shaft +paulo +requirement +##zy +paradise +tobacco +trans +renewed +vietnamese +##cker +##ju +suggesting +catching +holmes +enjoying +md +trips +colt +holder +butterfly +nerve +reformed +cherry +bowling +trailer +carriage +goodbye +appreciate +toy +joshua +interactive +enabled +involve +##kan +collar +determination +bunch +facebook +recall +shorts +superintendent +episcopal +frustration +giovanni +nineteenth +laser +privately +array +circulation +##ovic +armstrong +deals +painful +permit +discrimination +##wi +aires +retiring +cottage +ni +##sta +horizon +ellen +jamaica +ripped +fernando +chapters +playstation +patron +lecturer +navigation +behaviour +genes +georgian +export +solomon +rivals +swift +seventeen +rodriguez +princeton +independently +sox +1847 +arguing +entity +casting +hank +criteria +oakland +geographic +milwaukee +reflection +expanding +conquest +dubbed +##tv +halt +brave +brunswick +doi +arched +curtis +divorced +predominantly +somerset +streams +ugly +zoo +horrible +curved +buenos +fierce +dictionary +vector +theological +unions +handful +stability +chan +punjab +segments +##lly +altar +ignoring +gesture +monsters +pastor +##stone +thighs +unexpected +operators +abruptly +coin +compiled +associates +improving +migration +pin +##ose +compact +collegiate +reserved +##urs +quarterfinals +roster +restore +assembled +hurry +oval +##cies +1846 +flags +martha +##del +victories +sharply +##rated +argues +deadly +neo +drawings +symbols +performer +##iel +griffin +restrictions +editing +andrews +java +journals +arabia +compositions +dee +pierce +removing +hindi +casino +runway +civilians +minds +nasa +hotels +##zation +refuge +rent +retain +potentially +conferences +suburban +conducting +##tto +##tions +##tle +descended +massacre +##cal +ammunition +terrain +fork +souls +counts +chelsea +durham +drives +cab +##bank +perth +realizing +palestinian +finn +simpson +##dal +betty +##ule +moreover +particles +cardinals +tent +evaluation +extraordinary +##oid +inscription +##works +wednesday +chloe +maintains +panels +ashley +trucks +##nation +cluster +sunlight +strikes +zhang +##wing +dialect +canon +##ap +tucked +##ws +collecting +##mas +##can +##sville +maker +quoted +evan +franco +aria +buying +cleaning +eva +closet +provision +apollo +clinic +rat +##ez +necessarily +ac +##gle +##ising +venues +flipped +cent +spreading +trustees +checking +authorized +##sco +disappointed +##ado +notion +duration +trumpet +hesitated +topped +brussels +rolls +theoretical +hint +define +aggressive +repeat +wash +peaceful +optical +width +allegedly +mcdonald +strict +copyright +##illa +investors +mar +jam +witnesses +sounding +miranda +michelle +privacy +hugo +harmony +##pp +valid +lynn +glared +nina +102 +headquartered +diving +boarding +gibson +##ncy +albanian +marsh +routine +dealt +enhanced +er +intelligent +substance +targeted +enlisted +discovers +spinning +observations +pissed +smoking +rebecca +capitol +visa +varied +costume +seemingly +indies +compensation +surgeon +thursday +arsenal +westminster +suburbs +rid +anglican +##ridge +knots +foods +alumni +lighter +fraser +whoever +portal +scandal +##ray +gavin +advised +instructor +flooding +terrorist +##ale +teenage +interim +senses +duck +teen +thesis +abby +eager +overcome +##ile +newport +glenn +rises +shame +##cc +prompted +priority +forgot +bomber +nicolas +protective +360 +cartoon +katherine +breeze +lonely +trusted +henderson +richardson +relax +banner +candy +palms +remarkable +##rio +legends +cricketer +essay +ordained +edmund +rifles +trigger +##uri +##away +sail +alert +1830 +audiences +penn +sussex +siblings +pursued +indianapolis +resist +rosa +consequence +succeed +avoided +1845 +##ulation +inland +##tie +##nna +counsel +profession +chronicle +hurried +##una +eyebrow +eventual +bleeding +innovative +cure +##dom +committees +accounting +con +scope +hardy +heather +tenor +gut +herald +codes +tore +scales +wagon +##oo +luxury +tin +prefer +fountain +triangle +bonds +darling +convoy +dried +traced +beings +troy +accidentally +slam +findings +smelled +joey +lawyers +outcome +steep +bosnia +configuration +shifting +toll +brook +performers +lobby +philosophical +construct +shrine +aggregate +boot +cox +phenomenon +savage +insane +solely +reynolds +lifestyle +##ima +nationally +holdings +consideration +enable +edgar +mo +mama +##tein +fights +relegation +chances +atomic +hub +conjunction +awkward +reactions +currency +finale +kumar +underwent +steering +elaborate +gifts +comprising +melissa +veins +reasonable +sunshine +chi +solve +trails +inhabited +elimination +ethics +huh +ana +molly +consent +apartments +layout +marines +##ces +hunters +bulk +##oma +hometown +##wall +##mont +cracked +reads +neighbouring +withdrawn +admission +wingspan +damned +anthology +lancashire +brands +batting +forgive +cuban +awful +##lyn +104 +dimensions +imagination +##ade +dante +##ship +tracking +desperately +goalkeeper +##yne +groaned +workshops +confident +burton +gerald +milton +circus +uncertain +slope +copenhagen +sophia +fog +philosopher +portraits +accent +cycling +varying +gripped +larvae +garrett +specified +scotia +mature +luther +kurt +rap +##kes +aerial +750 +ferdinand +heated +es +transported +##shan +safely +nonetheless +##orn +##gal +motors +demanding +##sburg +startled +##brook +ally +generate +caps +ghana +stained +demo +mentions +beds +ap +afterward +diary +##bling +utility +##iro +richards +1837 +conspiracy +conscious +shining +footsteps +observer +cyprus +urged +loyalty +developer +probability +olive +upgraded +gym +miracle +insects +graves +1844 +ourselves +hydrogen +amazon +katie +tickets +poets +##pm +planes +##pan +prevention +witnessed +dense +jin +randy +tang +warehouse +monroe +bang +archived +elderly +investigations +alec +granite +mineral +conflicts +controlling +aboriginal +carlo +##zu +mechanics +stan +stark +rhode +skirt +est +##berry +bombs +respected +##horn +imposed +limestone +deny +nominee +memphis +grabbing +disabled +##als +amusement +aa +frankfurt +corn +referendum +varies +slowed +disk +firms +unconscious +incredible +clue +sue +##zhou +twist +##cio +joins +idaho +chad +developers +computing +destroyer +103 +mortal +tucker +kingston +choices +yu +carson +1800 +os +whitney +geneva +pretend +dimension +staged +plateau +maya +##une +freestyle +##bc +rovers +hiv +##ids +tristan +classroom +prospect +##hus +honestly +diploma +lied +thermal +auxiliary +feast +unlikely +iata +##tel +morocco +pounding +treasury +lithuania +considerably +1841 +dish +1812 +geological +matching +stumbled +destroying +marched +brien +advances +cake +nicole +belle +settling +measuring +directing +##mie +tuesday +bassist +capabilities +stunned +fraud +torpedo +##list +##phone +anton +wisdom +surveillance +ruined +##ulate +lawsuit +healthcare +theorem +halls +trend +aka +horizontal +dozens +acquire +lasting +swim +hawk +gorgeous +fees +vicinity +decrease +adoption +tactics +##ography +pakistani +##ole +draws +##hall +willie +burke +heath +algorithm +integral +powder +elliott +brigadier +jackie +tate +varieties +darker +##cho +lately +cigarette +specimens +adds +##ree +##ensis +##inger +exploded +finalist +cia +murders +wilderness +arguments +nicknamed +acceptance +onwards +manufacture +robertson +jets +tampa +enterprises +blog +loudly +composers +nominations +1838 +ai +malta +inquiry +automobile +hosting +viii +rays +tilted +grief +museums +strategies +furious +euro +equality +cohen +poison +surrey +wireless +governed +ridiculous +moses +##esh +##room +vanished +##ito +barnes +attract +morrison +istanbul +##iness +absent +rotation +petition +janet +##logical +satisfaction +custody +deliberately +observatory +comedian +surfaces +pinyin +novelist +strictly +canterbury +oslo +monks +embrace +ibm +jealous +photograph +continent +dorothy +marina +doc +excess +holden +allegations +explaining +stack +avoiding +lance +storyline +majesty +poorly +spike +dos +bradford +raven +travis +classics +proven +voltage +pillow +fists +butt +1842 +interpreted +##car +1839 +gage +telegraph +lens +promising +expelled +casual +collector +zones +##min +silly +nintendo +##kh +##bra +downstairs +chef +suspicious +afl +flies +vacant +uganda +pregnancy +condemned +lutheran +estimates +cheap +decree +saxon +proximity +stripped +idiot +deposits +contrary +presenter +magnus +glacier +im +offense +edwin +##ori +upright +##long +bolt +##ois +toss +geographical +##izes +environments +delicate +marking +abstract +xavier +nails +windsor +plantation +occurring +equity +saskatchewan +fears +drifted +sequences +vegetation +revolt +##stic +1843 +sooner +fusion +opposing +nato +skating +1836 +secretly +ruin +lease +##oc +edit +##nne +flora +anxiety +ruby +##ological +##mia +tel +bout +taxi +emmy +frost +rainbow +compounds +foundations +rainfall +assassination +nightmare +dominican +##win +achievements +deserve +orlando +intact +armenia +##nte +calgary +valentine +106 +marion +proclaimed +theodore +bells +courtyard +thigh +gonzalez +console +troop +minimal +monte +everyday +##ence +##if +supporter +terrorism +buck +openly +presbyterian +activists +carpet +##iers +rubbing +uprising +##yi +cute +conceived +legally +##cht +millennium +cello +velocity +ji +rescued +cardiff +1835 +rex +concentrate +senators +beard +rendered +glowing +battalions +scouts +competitors +sculptor +catalogue +arctic +ion +raja +bicycle +wow +glancing +lawn +##woman +gentleman +lighthouse +publish +predicted +calculated +##val +variants +##gne +strain +##ui +winston +deceased +##nus +touchdowns +brady +caleb +sinking +echoed +crush +hon +blessed +protagonist +hayes +endangered +magnitude +editors +##tine +estimate +responsibilities +##mel +backup +laying +consumed +sealed +zurich +lovers +frustrated +##eau +ahmed +kicking +mit +treasurer +1832 +biblical +refuse +terrified +pump +agrees +genuine +imprisonment +refuses +plymouth +##hen +lou +##nen +tara +trembling +antarctic +ton +learns +##tas +crap +crucial +faction +atop +##borough +wrap +lancaster +odds +hopkins +erik +lyon +##eon +bros +##ode +snap +locality +tips +empress +crowned +cal +acclaimed +chuckled +##ory +clara +sends +mild +towel +##fl +##day +##а +wishing +assuming +interviewed +##bal +##die +interactions +eden +cups +helena +##lf +indie +beck +##fire +batteries +filipino +wizard +parted +##lam +traces +##born +rows +idol +albany +delegates +##ees +##sar +discussions +##ex +notre +instructed +belgrade +highways +suggestion +lauren +possess +orientation +alexandria +abdul +beats +salary +reunion +ludwig +alright +wagner +intimate +pockets +slovenia +hugged +brighton +merchants +cruel +stole +trek +slopes +repairs +enrollment +politically +underlying +promotional +counting +boeing +##bb +isabella +naming +##и +keen +bacteria +listing +separately +belfast +ussr +450 +lithuanian +anybody +ribs +sphere +martinez +cock +embarrassed +proposals +fragments +nationals +##fs +##wski +premises +fin +1500 +alpine +matched +freely +bounded +jace +sleeve +##af +gaming +pier +populated +evident +##like +frances +flooded +##dle +frightened +pour +trainer +framed +visitor +challenging +pig +wickets +##fold +infected +email +##pes +arose +##aw +reward +ecuador +oblast +vale +ch +shuttle +##usa +bach +rankings +forbidden +cornwall +accordance +salem +consumers +bruno +fantastic +toes +machinery +resolved +julius +remembering +propaganda +iceland +bombardment +tide +contacts +wives +##rah +concerto +macdonald +albania +implement +daisy +tapped +sudan +helmet +angela +mistress +##lic +crop +sunk +finest +##craft +hostile +##ute +##tsu +boxer +fr +paths +adjusted +habit +ballot +supervision +soprano +##zen +bullets +wicked +sunset +regiments +disappear +lamp +performs +app +##gia +##oa +rabbit +digging +incidents +entries +##cion +dishes +##oi +introducing +##ati +##fied +freshman +slot +jill +tackles +baroque +backs +##iest +lone +sponsor +destiny +altogether +convert +##aro +consensus +shapes +demonstration +basically +feminist +auction +artifacts +##bing +strongest +twitter +halifax +2019 +allmusic +mighty +smallest +precise +alexandra +viola +##los +##ille +manuscripts +##illo +dancers +ari +managers +monuments +blades +barracks +springfield +maiden +consolidated +electron +##end +berry +airing +wheat +nobel +inclusion +blair +payments +geography +bee +cc +eleanor +react +##hurst +afc +manitoba +##yu +su +lineup +fitness +recreational +investments +airborne +disappointment +##dis +edmonton +viewing +##row +renovation +##cast +infant +bankruptcy +roses +aftermath +pavilion +##yer +carpenter +withdrawal +ladder +##hy +discussing +popped +reliable +agreements +rochester +##abad +curves +bombers +220 +rao +reverend +decreased +choosing +107 +stiff +consulting +naples +crawford +tracy +ka +ribbon +cops +##lee +crushed +deciding +unified +teenager +accepting +flagship +explorer +poles +sanchez +inspection +revived +skilled +induced +exchanged +flee +locals +tragedy +swallow +loading +hanna +demonstrate +##ela +salvador +flown +contestants +civilization +##ines +wanna +rhodes +fletcher +hector +knocking +considers +##ough +nash +mechanisms +sensed +mentally +walt +unclear +##eus +renovated +madame +##cks +crews +governmental +##hin +undertaken +monkey +##ben +##ato +fatal +armored +copa +caves +governance +grasp +perception +certification +froze +damp +tugged +wyoming +##rg +##ero +newman +##lor +nerves +curiosity +graph +115 +##ami +withdraw +tunnels +dull +meredith +moss +exhibits +neighbors +communicate +accuracy +explored +raiders +republicans +secular +kat +superman +penny +criticised +##tch +freed +update +conviction +wade +ham +likewise +delegation +gotta +doll +promises +technological +myth +nationality +resolve +convent +##mark +sharon +dig +sip +coordinator +entrepreneur +fold +##dine +capability +councillor +synonym +blown +swan +cursed +1815 +jonas +haired +sofa +canvas +keeper +rivalry +##hart +rapper +speedway +swords +postal +maxwell +estonia +potter +recurring +##nn +##ave +errors +##oni +cognitive +1834 +##² +claws +nadu +roberto +bce +wrestler +ellie +##ations +infinite +ink +##tia +presumably +finite +staircase +108 +noel +patricia +nacional +##cation +chill +eternal +tu +preventing +prussia +fossil +limbs +##logist +ernst +frog +perez +rene +##ace +pizza +prussian +##ios +##vy +molecules +regulatory +answering +opinions +sworn +lengths +supposedly +hypothesis +upward +habitats +seating +ancestors +drank +yield +hd +synthesis +researcher +modest +##var +mothers +peered +voluntary +homeland +##the +acclaim +##igan +static +valve +luxembourg +alto +carroll +fe +receptor +norton +ambulance +##tian +johnston +catholics +depicting +jointly +elephant +gloria +mentor +badge +ahmad +distinguish +remarked +councils +precisely +allison +advancing +detection +crowded +##10 +cooperative +ankle +mercedes +dagger +surrendered +pollution +commit +subway +jeffrey +lesson +sculptures +provider +##fication +membrane +timothy +rectangular +fiscal +heating +teammate +basket +particle +anonymous +deployment +##ple +missiles +courthouse +proportion +shoe +sec +##ller +complaints +forbes +blacks +abandon +remind +sizes +overwhelming +autobiography +natalie +##awa +risks +contestant +countryside +babies +scorer +invaded +enclosed +proceed +hurling +disorders +##cu +reflecting +continuously +cruiser +graduates +freeway +investigated +ore +deserved +maid +blocking +phillip +jorge +shakes +dove +mann +variables +lacked +burden +accompanying +que +consistently +organizing +provisional +complained +endless +##rm +tubes +juice +georges +krishna +mick +labels +thriller +##uch +laps +arcade +sage +snail +##table +shannon +fi +laurence +seoul +vacation +presenting +hire +churchill +surprisingly +prohibited +savannah +technically +##oli +170 +##lessly +testimony +suited +speeds +toys +romans +mlb +flowering +measurement +talented +kay +settings +charleston +expectations +shattered +achieving +triumph +ceremonies +portsmouth +lanes +mandatory +loser +stretching +cologne +realizes +seventy +cornell +careers +webb +##ulating +americas +budapest +ava +suspicion +##ison +yo +conrad +##hai +sterling +jessie +rector +##az +1831 +transform +organize +loans +christine +volcanic +warrant +slender +summers +subfamily +newer +danced +dynamics +rhine +proceeds +heinrich +gastropod +commands +sings +facilitate +easter +ra +positioned +responses +expense +fruits +yanked +imported +25th +velvet +vic +primitive +tribune +baldwin +neighbourhood +donna +rip +hay +pr +##uro +1814 +espn +welcomed +##aria +qualifier +glare +highland +timing +##cted +shells +eased +geometry +louder +exciting +slovakia +##sion +##iz +##lot +savings +prairie +##ques +marching +rafael +tonnes +##lled +curtain +preceding +shy +heal +greene +worthy +##pot +detachment +bury +sherman +##eck +reinforced +seeks +bottles +contracted +duchess +outfit +walsh +##sc +mickey +##ase +geoffrey +archer +squeeze +dawson +eliminate +invention +##enberg +neal +##eth +stance +dealer +coral +maple +retire +polo +simplified +##ht +1833 +hid +watts +backwards +jules +##oke +genesis +mt +frames +rebounds +burma +woodland +moist +santos +whispers +drained +subspecies +##aa +streaming +ulster +burnt +correspondence +maternal +gerard +denis +stealing +##load +genius +duchy +##oria +inaugurated +momentum +suits +placement +sovereign +clause +thames +##hara +confederation +reservation +sketch +yankees +lets +rotten +charm +hal +verses +ultra +commercially +dot +salon +citation +adopt +winnipeg +mist +allocated +cairo +##boy +jenkins +interference +objectives +##wind +1820 +portfolio +armoured +sectors +##eh +initiatives +##world +integrity +exercises +robe +tap +ab +gazed +##tones +distracted +rulers +111 +favorable +jerome +tended +cart +factories +##eri +diplomat +valued +gravel +charitable +##try +calvin +exploring +chang +shepherd +terrace +pdf +pupil +##ural +reflects +ups +##rch +governors +shelf +depths +##nberg +trailed +crest +tackle +##nian +##ats +hatred +##kai +clare +makers +ethiopia +longtime +detected +embedded +lacking +slapped +rely +thomson +anticipation +iso +morton +successive +agnes +screenwriter +straightened +philippe +playwright +haunted +licence +iris +intentions +sutton +112 +logical +correctly +##weight +branded +licked +tipped +silva +ricky +narrator +requests +##ents +greeted +supernatural +cow +##wald +lung +refusing +employer +strait +gaelic +liner +##piece +zoe +sabha +##mba +driveway +harvest +prints +bates +reluctantly +threshold +algebra +ira +wherever +coupled +240 +assumption +picks +##air +designers +raids +gentlemen +##ean +roller +blowing +leipzig +locks +screw +dressing +strand +##lings +scar +dwarf +depicts +##nu +nods +##mine +differ +boris +##eur +yuan +flip +##gie +mob +invested +questioning +applying +##ture +shout +##sel +gameplay +blamed +illustrations +bothered +weakness +rehabilitation +##of +##zes +envelope +rumors +miners +leicester +subtle +kerry +##ico +ferguson +##fu +premiership +ne +##cat +bengali +prof +catches +remnants +dana +##rily +shouting +presidents +baltic +ought +ghosts +dances +sailors +shirley +fancy +dominic +##bie +madonna +##rick +bark +buttons +gymnasium +ashes +liver +toby +oath +providence +doyle +evangelical +nixon +cement +carnegie +embarked +hatch +surroundings +guarantee +needing +pirate +essence +##bee +filter +crane +hammond +projected +immune +percy +twelfth +##ult +regent +doctoral +damon +mikhail +##ichi +lu +critically +elect +realised +abortion +acute +screening +mythology +steadily +##fc +frown +nottingham +kirk +wa +minneapolis +##rra +module +algeria +mc +nautical +encounters +surprising +statues +availability +shirts +pie +alma +brows +munster +mack +soup +crater +tornado +sanskrit +cedar +explosive +bordered +dixon +planets +stamp +exam +happily +##bble +carriers +kidnapped +##vis +accommodation +emigrated +##met +knockout +correspondent +violation +profits +peaks +lang +specimen +agenda +ancestry +pottery +spelling +equations +obtaining +ki +linking +1825 +debris +asylum +##20 +buddhism +teddy +##ants +gazette +##nger +##sse +dental +eligibility +utc +fathers +averaged +zimbabwe +francesco +coloured +hissed +translator +lynch +mandate +humanities +mackenzie +uniforms +lin +##iana +##gio +asset +mhz +fitting +samantha +genera +wei +rim +beloved +shark +riot +entities +expressions +indo +carmen +slipping +owing +abbot +neighbor +sidney +##av +rats +recommendations +encouraging +squadrons +anticipated +commanders +conquered +##oto +donations +diagnosed +##mond +divide +##iva +guessed +decoration +vernon +auditorium +revelation +conversations +##kers +##power +herzegovina +dash +alike +protested +lateral +herman +accredited +mg +##gent +freeman +mel +fiji +crow +crimson +##rine +livestock +##pped +humanitarian +bored +oz +whip +##lene +##ali +legitimate +alter +grinning +spelled +anxious +oriental +wesley +##nin +##hole +carnival +controller +detect +##ssa +bowed +educator +kosovo +macedonia +##sin +occupy +mastering +stephanie +janeiro +para +unaware +nurses +noon +135 +cam +hopefully +ranger +combine +sociology +polar +rica +##eer +neill +##sman +holocaust +##ip +doubled +lust +1828 +109 +decent +cooling +unveiled +##card +1829 +nsw +homer +chapman +meyer +##gin +dive +mae +reagan +expertise +##gled +darwin +brooke +sided +prosecution +investigating +comprised +petroleum +genres +reluctant +differently +trilogy +johns +vegetables +corpse +highlighted +lounge +pension +unsuccessfully +elegant +aided +ivory +beatles +amelia +cain +dubai +sunny +immigrant +babe +click +##nder +underwater +pepper +combining +mumbled +atlas +horns +accessed +ballad +physicians +homeless +gestured +rpm +freak +louisville +corporations +patriots +prizes +rational +warn +modes +decorative +overnight +din +troubled +phantom +##ort +monarch +sheer +##dorf +generals +guidelines +organs +addresses +##zon +enhance +curling +parishes +cord +##kie +linux +caesar +deutsche +bavaria +##bia +coleman +cyclone +##eria +bacon +petty +##yama +##old +hampton +diagnosis +1824 +throws +complexity +rita +disputed +##₃ +pablo +##sch +marketed +trafficking +##ulus +examine +plague +formats +##oh +vault +faithful +##bourne +webster +##ox +highlights +##ient +##ann +phones +vacuum +sandwich +modeling +##gated +bolivia +clergy +qualities +isabel +##nas +##ars +wears +screams +reunited +annoyed +bra +##ancy +##rate +differential +transmitter +tattoo +container +poker +##och +excessive +resides +cowboys +##tum +augustus +trash +providers +statute +retreated +balcony +reversed +void +storey +preceded +masses +leap +laughs +neighborhoods +wards +schemes +falcon +santo +battlefield +pad +ronnie +thread +lesbian +venus +##dian +beg +sandstone +daylight +punched +gwen +analog +stroked +wwe +acceptable +measurements +dec +toxic +##kel +adequate +surgical +economist +parameters +varsity +##sberg +quantity +ella +##chy +##rton +countess +generating +precision +diamonds +expressway +ga +##ı +1821 +uruguay +talents +galleries +expenses +scanned +colleague +outlets +ryder +lucien +##ila +paramount +##bon +syracuse +dim +fangs +gown +sweep +##sie +toyota +missionaries +websites +##nsis +sentences +adviser +val +trademark +spells +##plane +patience +starter +slim +##borg +toe +incredibly +shoots +elliot +nobility +##wyn +cowboy +endorsed +gardner +tendency +persuaded +organisms +emissions +kazakhstan +amused +boring +chips +themed +##hand +llc +constantinople +chasing +systematic +guatemala +borrowed +erin +carey +##hard +highlands +struggles +1810 +##ifying +##ced +wong +exceptions +develops +enlarged +kindergarten +castro +##ern +##rina +leigh +zombie +juvenile +##most +consul +##nar +sailor +hyde +clarence +intensive +pinned +nasty +useless +jung +clayton +stuffed +exceptional +ix +apostolic +230 +transactions +##dge +exempt +swinging +cove +religions +##ash +shields +dairy +bypass +190 +pursuing +bug +joyce +bombay +chassis +southampton +chat +interact +redesignated +##pen +nascar +pray +salmon +rigid +regained +malaysian +grim +publicity +constituted +capturing +toilet +delegate +purely +tray +drift +loosely +striker +weakened +trinidad +mitch +itv +defines +transmitted +ming +scarlet +nodding +fitzgerald +fu +narrowly +sp +tooth +standings +virtue +##₁ +##wara +##cting +chateau +gloves +lid +##nel +hurting +conservatory +##pel +sinclair +reopened +sympathy +nigerian +strode +advocated +optional +chronic +discharge +##rc +suck +compatible +laurel +stella +shi +fails +wage +dodge +128 +informal +sorts +levi +buddha +villagers +##aka +chronicles +heavier +summoned +gateway +3000 +eleventh +jewelry +translations +accordingly +seas +##ency +fiber +pyramid +cubic +dragging +##ista +caring +##ops +android +contacted +lunar +##dt +kai +lisbon +patted +1826 +sacramento +theft +madagascar +subtropical +disputes +ta +holidays +piper +willow +mare +cane +itunes +newfoundland +benny +companions +dong +raj +observe +roar +charming +plaque +tibetan +fossils +enacted +manning +bubble +tina +tanzania +##eda +##hir +funk +swamp +deputies +cloak +ufc +scenario +par +scratch +metals +anthem +guru +engaging +specially +##boat +dialects +nineteen +cecil +duet +disability +messenger +unofficial +##lies +defunct +eds +moonlight +drainage +surname +puzzle +honda +switching +conservatives +mammals +knox +broadcaster +sidewalk +cope +##ried +benson +princes +peterson +##sal +bedford +sharks +eli +wreck +alberto +gasp +archaeology +lgbt +teaches +securities +madness +compromise +waving +coordination +davidson +visions +leased +possibilities +eighty +jun +fernandez +enthusiasm +assassin +sponsorship +reviewer +kingdoms +estonian +laboratories +##fy +##nal +applies +verb +celebrations +##zzo +rowing +lightweight +sadness +submit +mvp +balanced +dude +##vas +explicitly +metric +magnificent +mound +brett +mohammad +mistakes +irregular +##hing +##ass +sanders +betrayed +shipped +surge +##enburg +reporters +termed +georg +pity +verbal +bulls +abbreviated +enabling +appealed +##are +##atic +sicily +sting +heel +sweetheart +bart +spacecraft +brutal +monarchy +##tter +aberdeen +cameo +diane +##ub +survivor +clyde +##aries +complaint +##makers +clarinet +delicious +chilean +karnataka +coordinates +1818 +panties +##rst +pretending +ar +dramatically +kiev +bella +tends +distances +113 +catalog +launching +instances +telecommunications +portable +lindsay +vatican +##eim +angles +aliens +marker +stint +screens +bolton +##rne +judy +wool +benedict +plasma +europa +spark +imaging +filmmaker +swiftly +##een +contributor +##nor +opted +stamps +apologize +financing +butter +gideon +sophisticated +alignment +avery +chemicals +yearly +speculation +prominence +professionally +##ils +immortal +institutional +inception +wrists +identifying +tribunal +derives +gains +##wo +papal +preference +linguistic +vince +operative +brewery +##ont +unemployment +boyd +##ured +##outs +albeit +prophet +1813 +bi +##rr +##face +##rad +quarterly +asteroid +cleaned +radius +temper +##llen +telugu +jerk +viscount +menu +##ote +glimpse +##aya +yacht +hawaiian +baden +##rl +laptop +readily +##gu +monetary +offshore +scots +watches +##yang +##arian +upgrade +needle +xbox +lea +encyclopedia +flank +fingertips +##pus +delight +teachings +confirm +roth +beaches +midway +winters +##iah +teasing +daytime +beverly +gambling +bonnie +##backs +regulated +clement +hermann +tricks +knot +##shing +##uring +##vre +detached +ecological +owed +specialty +byron +inventor +bats +stays +screened +unesco +midland +trim +affection +##ander +##rry +jess +thoroughly +feedback +##uma +chennai +strained +heartbeat +wrapping +overtime +pleaded +##sworth +mon +leisure +oclc +##tate +##ele +feathers +angelo +thirds +nuts +surveys +clever +gill +commentator +##dos +darren +rides +gibraltar +##nc +##mu +dissolution +dedication +shin +meals +saddle +elvis +reds +chaired +taller +appreciation +functioning +niece +favored +advocacy +robbie +criminals +suffolk +yugoslav +passport +constable +congressman +hastings +vera +##rov +consecrated +sparks +ecclesiastical +confined +##ovich +muller +floyd +nora +1822 +paved +1827 +cumberland +ned +saga +spiral +##flow +appreciated +yi +collaborative +treating +similarities +feminine +finishes +##ib +jade +import +##nse +##hot +champagne +mice +securing +celebrities +helsinki +attributes +##gos +cousins +phases +ache +lucia +gandhi +submission +vicar +spear +shine +tasmania +biting +detention +constitute +tighter +seasonal +##gus +terrestrial +matthews +##oka +effectiveness +parody +philharmonic +##onic +1816 +strangers +encoded +consortium +guaranteed +regards +shifts +tortured +collision +supervisor +inform +broader +insight +theaters +armour +emeritus +blink +incorporates +mapping +##50 +##ein +handball +flexible +##nta +substantially +generous +thief +##own +carr +loses +1793 +prose +ucla +romeo +generic +metallic +realization +damages +mk +commissioners +zach +default +##ther +helicopters +lengthy +stems +spa +partnered +spectators +rogue +indication +penalties +teresa +1801 +sen +##tric +dalton +##wich +irving +photographic +##vey +dell +deaf +peters +excluded +unsure +##vable +patterson +crawled +##zio +resided +whipped +latvia +slower +ecole +pipes +employers +maharashtra +comparable +va +textile +pageant +##gel +alphabet +binary +irrigation +chartered +choked +antoine +offs +waking +supplement +##wen +quantities +demolition +regain +locate +urdu +folks +alt +114 +##mc +scary +andreas +whites +##ava +classrooms +mw +aesthetic +publishes +valleys +guides +cubs +johannes +bryant +conventions +affecting +##itt +drain +awesome +isolation +prosecutor +ambitious +apology +captive +downs +atmospheric +lorenzo +aisle +beef +foul +##onia +kidding +composite +disturbed +illusion +natives +##ffer +emi +rockets +riverside +wartime +painters +adolf +melted +##ail +uncertainty +simulation +hawks +progressed +meantime +builder +spray +breach +unhappy +regina +russians +##urg +determining +##tation +tram +1806 +##quin +aging +##12 +1823 +garion +rented +mister +diaz +terminated +clip +1817 +depend +nervously +disco +owe +defenders +shiva +notorious +disbelief +shiny +worcester +##gation +##yr +trailing +undertook +islander +belarus +limitations +watershed +fuller +overlooking +utilized +raphael +1819 +synthetic +breakdown +klein +##nate +moaned +memoir +lamb +practicing +##erly +cellular +arrows +exotic +##graphy +witches +117 +charted +rey +hut +hierarchy +subdivision +freshwater +giuseppe +aloud +reyes +qatar +marty +sideways +utterly +sexually +jude +prayers +mccarthy +softball +blend +damien +##gging +##metric +wholly +erupted +lebanese +negro +revenues +tasted +comparative +teamed +transaction +labeled +maori +sovereignty +parkway +trauma +gran +malay +121 +advancement +descendant +2020 +buzz +salvation +inventory +symbolic +##making +antarctica +mps +##gas +##bro +mohammed +myanmar +holt +submarines +tones +##lman +locker +patriarch +bangkok +emerson +remarks +predators +kin +afghan +confession +norwich +rental +emerge +advantages +##zel +rca +##hold +shortened +storms +aidan +##matic +autonomy +compliance +##quet +dudley +atp +##osis +1803 +motto +documentation +summary +professors +spectacular +christina +archdiocese +flashing +innocence +remake +##dell +psychic +reef +scare +employ +rs +sticks +meg +gus +leans +##ude +accompany +bergen +tomas +##iko +doom +wages +pools +##nch +##bes +breasts +scholarly +alison +outline +brittany +breakthrough +willis +realistic +##cut +##boro +competitor +##stan +pike +picnic +icon +designing +commercials +washing +villain +skiing +micro +costumes +auburn +halted +executives +##hat +logistics +cycles +vowel +applicable +barrett +exclaimed +eurovision +eternity +ramon +##umi +##lls +modifications +sweeping +disgust +##uck +torch +aviv +ensuring +rude +dusty +sonic +donovan +outskirts +cu +pathway +##band +##gun +##lines +disciplines +acids +cadet +paired +##40 +sketches +##sive +marriages +##⁺ +folding +peers +slovak +implies +admired +##beck +1880s +leopold +instinct +attained +weston +megan +horace +##ination +dorsal +ingredients +evolutionary +##its +complications +deity +lethal +brushing +levy +deserted +institutes +posthumously +delivering +telescope +coronation +motivated +rapids +luc +flicked +pays +volcano +tanner +weighed +##nica +crowds +frankie +gifted +addressing +granddaughter +winding +##rna +constantine +gomez +##front +landscapes +rudolf +anthropology +slate +werewolf +##lio +astronomy +circa +rouge +dreaming +sack +knelt +drowned +naomi +prolific +tracked +freezing +herb +##dium +agony +randall +twisting +wendy +deposit +touches +vein +wheeler +##bbled +##bor +batted +retaining +tire +presently +compare +specification +daemon +nigel +##grave +merry +recommendation +czechoslovakia +sandra +ng +roma +##sts +lambert +inheritance +sheikh +winchester +cries +examining +##yle +comeback +cuisine +nave +##iv +ko +retrieve +tomatoes +barker +polished +defining +irene +lantern +personalities +begging +tract +swore +1809 +175 +##gic +omaha +brotherhood +##rley +haiti +##ots +exeter +##ete +##zia +steele +dumb +pearson +210 +surveyed +elisabeth +trends +##ef +fritz +##rf +premium +bugs +fraction +calmly +viking +##birds +tug +inserted +unusually +##ield +confronted +distress +crashing +brent +turks +resign +##olo +cambodia +gabe +sauce +##kal +evelyn +116 +extant +clusters +quarry +teenagers +luna +##lers +##ister +affiliation +drill +##ashi +panthers +scenic +libya +anita +strengthen +inscriptions +##cated +lace +sued +judith +riots +##uted +mint +##eta +preparations +midst +dub +challenger +##vich +mock +cf +displaced +wicket +breaths +enables +schmidt +analyst +##lum +ag +highlight +automotive +axe +josef +newark +sufficiently +resembles +50th +##pal +flushed +mum +traits +##ante +commodore +incomplete +warming +titular +ceremonial +ethical +118 +celebrating +eighteenth +cao +lima +medalist +mobility +strips +snakes +##city +miniature +zagreb +barton +escapes +umbrella +automated +doubted +differs +cooled +georgetown +dresden +cooked +fade +wyatt +rna +jacobs +carlton +abundant +stereo +boost +madras +inning +##hia +spur +ip +malayalam +begged +osaka +groan +escaping +charging +dose +vista +##aj +bud +papa +communists +advocates +edged +tri +##cent +resemble +peaking +necklace +fried +montenegro +saxony +goose +glances +stuttgart +curator +recruit +grocery +sympathetic +##tting +##fort +127 +lotus +randolph +ancestor +##rand +succeeding +jupiter +1798 +macedonian +##heads +hiking +1808 +handing +fischer +##itive +garbage +node +##pies +prone +singular +papua +inclined +attractions +italia +pouring +motioned +grandma +garnered +jacksonville +corp +ego +ringing +aluminum +##hausen +ordering +##foot +drawer +traders +synagogue +##play +##kawa +resistant +wandering +fragile +fiona +teased +var +hardcore +soaked +jubilee +decisive +exposition +mercer +poster +valencia +hale +kuwait +1811 +##ises +##wr +##eed +tavern +gamma +122 +johan +##uer +airways +amino +gil +##ury +vocational +domains +torres +##sp +generator +folklore +outcomes +##keeper +canberra +shooter +fl +beams +confrontation +##lling +##gram +feb +aligned +forestry +pipeline +jax +motorway +conception +decay +##tos +coffin +##cott +stalin +1805 +escorted +minded +##nam +sitcom +purchasing +twilight +veronica +additions +passive +tensions +straw +123 +frequencies +1804 +refugee +cultivation +##iate +christie +clary +bulletin +crept +disposal +##rich +##zong +processor +crescent +##rol +bmw +emphasized +whale +nazis +aurora +##eng +dwelling +hauled +sponsors +toledo +mega +ideology +theatres +tessa +cerambycidae +saves +turtle +cone +suspects +kara +rusty +yelling +greeks +mozart +shades +cocked +participant +##tro +shire +spit +freeze +necessity +##cos +inmates +nielsen +councillors +loaned +uncommon +omar +peasants +botanical +offspring +daniels +formations +jokes +1794 +pioneers +sigma +licensing +##sus +wheelchair +polite +1807 +liquor +pratt +trustee +##uta +forewings +balloon +##zz +kilometre +camping +explicit +casually +shawn +foolish +teammates +nm +hassan +carrie +judged +satisfy +vanessa +knives +selective +cnn +flowed +##lice +eclipse +stressed +eliza +mathematician +cease +cultivated +##roy +commissions +browns +##ania +destroyers +sheridan +meadow +##rius +minerals +##cial +downstream +clash +gram +memoirs +ventures +baha +seymour +archie +midlands +edith +fare +flynn +invite +canceled +tiles +stabbed +boulder +incorporate +amended +camden +facial +mollusk +unreleased +descriptions +yoga +grabs +550 +raises +ramp +shiver +##rose +coined +pioneering +tunes +qing +warwick +tops +119 +melanie +giles +##rous +wandered +##inal +annexed +nov +30th +unnamed +##ished +organizational +airplane +normandy +stoke +whistle +blessing +violations +chased +holders +shotgun +##ctic +outlet +reactor +##vik +tires +tearing +shores +fortified +mascot +constituencies +nc +columnist +productive +tibet +##rta +lineage +hooked +oct +tapes +judging +cody +##gger +hansen +kashmir +triggered +##eva +solved +cliffs +##tree +resisted +anatomy +protesters +transparent +implied +##iga +injection +mattress +excluding +##mbo +defenses +helpless +devotion +##elli +growl +liberals +weber +phenomena +atoms +plug +##iff +mortality +apprentice +howe +convincing +aaa +swimmer +barber +leone +promptly +sodium +def +nowadays +arise +##oning +gloucester +corrected +dignity +norm +erie +##ders +elders +evacuated +sylvia +compression +##yar +hartford +pose +backpack +reasoning +accepts +24th +wipe +millimetres +marcel +##oda +dodgers +albion +1790 +overwhelmed +aerospace +oaks +1795 +showcase +acknowledge +recovering +nolan +ashe +hurts +geology +fashioned +disappearance +farewell +swollen +shrug +marquis +wimbledon +124 +rue +1792 +commemorate +reduces +experiencing +inevitable +calcutta +intel +##court +murderer +sticking +fisheries +imagery +bloom +280 +brake +##inus +gustav +hesitation +memorable +po +viral +beans +accidents +tunisia +antenna +spilled +consort +treatments +aye +perimeter +##gard +donation +hostage +migrated +banker +addiction +apex +lil +trout +##ously +conscience +##nova +rams +sands +genome +passionate +troubles +##lets +##set +amid +##ibility +##ret +higgins +exceed +vikings +##vie +payne +##zan +muscular +##ste +defendant +sucking +##wal +ibrahim +fuselage +claudia +vfl +europeans +snails +interval +##garh +preparatory +statewide +tasked +lacrosse +viktor +##lation +angola +##hra +flint +implications +employs +teens +patrons +stall +weekends +barriers +scrambled +nucleus +tehran +jenna +parsons +lifelong +robots +displacement +5000 +##bles +precipitation +##gt +knuckles +clutched +1802 +marrying +ecology +marx +accusations +declare +scars +kolkata +mat +meadows +bermuda +skeleton +finalists +vintage +crawl +coordinate +affects +subjected +orchestral +mistaken +##tc +mirrors +dipped +relied +260 +arches +candle +##nick +incorporating +wildly +fond +basilica +owl +fringe +rituals +whispering +stirred +feud +tertiary +slick +goat +honorable +whereby +skip +ricardo +stripes +parachute +adjoining +submerged +synthesizer +##gren +intend +positively +ninety +phi +beaver +partition +fellows +alexis +prohibition +carlisle +bizarre +fraternity +##bre +doubts +icy +cbc +aquatic +sneak +sonny +combines +airports +crude +supervised +spatial +merge +alfonso +##bic +corrupt +scan +undergo +##ams +disabilities +colombian +comparing +dolphins +perkins +##lish +reprinted +unanimous +bounced +hairs +underworld +midwest +semester +bucket +paperback +miniseries +coventry +demise +##leigh +demonstrations +sensor +rotating +yan +##hler +arrange +soils +##idge +hyderabad +labs +##dr +brakes +grandchildren +##nde +negotiated +rover +ferrari +continuation +directorate +augusta +stevenson +counterpart +gore +##rda +nursery +rican +ave +collectively +broadly +pastoral +repertoire +asserted +discovering +nordic +styled +fiba +cunningham +harley +middlesex +survives +tumor +tempo +zack +aiming +lok +urgent +##rade +##nto +devils +##ement +contractor +turin +##wl +##ool +bliss +repaired +simmons +moan +astronomical +cr +negotiate +lyric +1890s +lara +bred +clad +angus +pbs +##ience +engineered +posed +##lk +hernandez +possessions +elbows +psychiatric +strokes +confluence +electorate +lifts +campuses +lava +alps +##ep +##ution +##date +physicist +woody +##page +##ographic +##itis +juliet +reformation +sparhawk +320 +complement +suppressed +jewel +##½ +floated +##kas +continuity +sadly +##ische +inability +melting +scanning +paula +flour +judaism +safer +vague +##lm +solving +curb +##stown +financially +gable +bees +expired +miserable +cassidy +dominion +1789 +cupped +145 +robbery +facto +amos +warden +resume +tallest +marvin +ing +pounded +usd +declaring +gasoline +##aux +darkened +270 +650 +sophomore +##mere +erection +gossip +televised +risen +dial +##eu +pillars +##link +passages +profound +##tina +arabian +ashton +silicon +nail +##ead +##lated +##wer +##hardt +fleming +firearms +ducked +circuits +blows +waterloo +titans +##lina +atom +fireplace +cheshire +financed +activation +algorithms +##zzi +constituent +catcher +cherokee +partnerships +sexuality +platoon +tragic +vivian +guarded +whiskey +meditation +poetic +##late +##nga +##ake +porto +listeners +dominance +kendra +mona +chandler +factions +22nd +salisbury +attitudes +derivative +##ido +##haus +intake +paced +javier +illustrator +barrels +bias +cockpit +burnett +dreamed +ensuing +##anda +receptors +someday +hawkins +mattered +##lal +slavic +1799 +jesuit +cameroon +wasted +tai +wax +lowering +victorious +freaking +outright +hancock +librarian +sensing +bald +calcium +myers +tablet +announcing +barack +shipyard +pharmaceutical +##uan +greenwich +flush +medley +patches +wolfgang +pt +speeches +acquiring +exams +nikolai +##gg +hayden +kannada +##type +reilly +##pt +waitress +abdomen +devastated +capped +pseudonym +pharmacy +fulfill +paraguay +1796 +clicked +##trom +archipelago +syndicated +##hman +lumber +orgasm +rejection +clifford +lorraine +advent +mafia +rodney +brock +##ght +##used +##elia +cassette +chamberlain +despair +mongolia +sensors +developmental +upstream +##eg +##alis +spanning +165 +trombone +basque +seeded +interred +renewable +rhys +leapt +revision +molecule +##ages +chord +vicious +nord +shivered +23rd +arlington +debts +corpus +sunrise +bays +blackburn +centimetres +##uded +shuddered +gm +strangely +gripping +cartoons +isabelle +orbital +##ppa +seals +proving +##lton +refusal +strengthened +bust +assisting +baghdad +batsman +portrayal +mara +pushes +spears +og +##cock +reside +nathaniel +brennan +1776 +confirmation +caucus +##worthy +markings +yemen +nobles +ku +lazy +viewer +catalan +encompasses +sawyer +##fall +sparked +substances +patents +braves +arranger +evacuation +sergio +persuade +dover +tolerance +penguin +cum +jockey +insufficient +townships +occupying +declining +plural +processed +projection +puppet +flanders +introduces +liability +##yon +gymnastics +antwerp +taipei +hobart +candles +jeep +wes +observers +126 +chaplain +bundle +glorious +##hine +hazel +flung +sol +excavations +dumped +stares +sh +bangalore +triangular +icelandic +intervals +expressing +turbine +##vers +songwriting +crafts +##igo +jasmine +ditch +rite +##ways +entertaining +comply +sorrow +wrestlers +basel +emirates +marian +rivera +helpful +##some +caution +downward +networking +##atory +##tered +darted +genocide +emergence +replies +specializing +spokesman +convenient +unlocked +fading +augustine +concentrations +resemblance +elijah +investigator +andhra +##uda +promotes +bean +##rrell +fleeing +wan +simone +announcer +##ame +##bby +lydia +weaver +132 +residency +modification +##fest +stretches +##ast +alternatively +nat +lowe +lacks +##ented +pam +tile +concealed +inferior +abdullah +residences +tissues +vengeance +##ided +moisture +peculiar +groove +zip +bologna +jennings +ninja +oversaw +zombies +pumping +batch +livingston +emerald +installations +1797 +peel +nitrogen +rama +##fying +##star +schooling +strands +responding +werner +##ost +lime +casa +accurately +targeting +##rod +underway +##uru +hemisphere +lester +##yard +occupies +2d +griffith +angrily +reorganized +##owing +courtney +deposited +##dd +##30 +estadio +##ifies +dunn +exiled +##ying +checks +##combe +##о +##fly +successes +unexpectedly +blu +assessed +##flower +##ه +observing +sacked +spiders +kn +##tail +mu +nodes +prosperity +audrey +divisional +155 +broncos +tangled +adjust +feeds +erosion +paolo +surf +directory +snatched +humid +admiralty +screwed +gt +reddish +##nese +modules +trench +lamps +bind +leah +bucks +competes +##nz +##form +transcription +##uc +isles +violently +clutching +pga +cyclist +inflation +flats +ragged +unnecessary +##hian +stubborn +coordinated +harriet +baba +disqualified +330 +insect +wolfe +##fies +reinforcements +rocked +duel +winked +embraced +bricks +##raj +hiatus +defeats +pending +brightly +jealousy +##xton +##hm +##uki +lena +gdp +colorful +##dley +stein +kidney +##shu +underwear +wanderers +##haw +##icus +guardians +m³ +roared +habits +##wise +permits +gp +uranium +punished +disguise +bundesliga +elise +dundee +erotic +partisan +pi +collectors +float +individually +rendering +behavioral +bucharest +ser +hare +valerie +corporal +nutrition +proportional +##isa +immense +##kis +pavement +##zie +##eld +sutherland +crouched +1775 +##lp +suzuki +trades +endurance +operas +crosby +prayed +priory +rory +socially +##urn +gujarat +##pu +walton +cube +pasha +privilege +lennon +floods +thorne +waterfall +nipple +scouting +approve +##lov +minorities +voter +dwight +extensions +assure +ballroom +slap +dripping +privileges +rejoined +confessed +demonstrating +patriotic +yell +investor +##uth +pagan +slumped +squares +##cle +##kins +confront +bert +embarrassment +##aid +aston +urging +sweater +starr +yuri +brains +williamson +commuter +mortar +structured +selfish +exports +##jon +cds +##him +unfinished +##rre +mortgage +destinations +##nagar +canoe +solitary +buchanan +delays +magistrate +fk +##pling +motivation +##lier +##vier +recruiting +assess +##mouth +malik +antique +1791 +pius +rahman +reich +tub +zhou +smashed +airs +galway +xii +conditioning +honduras +discharged +dexter +##pf +lionel +129 +debates +lemon +tiffany +volunteered +dom +dioxide +procession +devi +sic +tremendous +advertisements +colts +transferring +verdict +hanover +decommissioned +utter +relate +pac +racism +##top +beacon +limp +similarity +terra +occurrence +ant +##how +becky +capt +updates +armament +richie +pal +##graph +halloween +mayo +##ssen +##bone +cara +serena +fcc +dolls +obligations +##dling +violated +lafayette +jakarta +exploitation +##ime +infamous +iconic +##lah +##park +kitty +moody +reginald +dread +spill +crystals +olivier +modeled +bluff +equilibrium +separating +notices +ordnance +extinction +onset +cosmic +attachment +sammy +expose +privy +anchored +##bil +abbott +admits +bending +baritone +emmanuel +policeman +vaughan +winged +climax +dresses +denny +polytechnic +mohamed +burmese +authentic +nikki +genetics +grandparents +homestead +gaza +postponed +metacritic +una +##sby +##bat +unstable +dissertation +##rial +##cian +curls +obscure +uncovered +bronx +praying +disappearing +##hoe +prehistoric +coke +turret +mutations +nonprofit +pits +monaco +##ي +##usion +prominently +dispatched +podium +##mir +uci +##uation +133 +fortifications +birthplace +kendall +##lby +##oll +preacher +rack +goodman +##rman +persistent +##ott +countless +jaime +recorder +lexington +persecution +jumps +renewal +wagons +##11 +crushing +##holder +decorations +##lake +abundance +wrath +laundry +£1 +garde +##rp +jeanne +beetles +peasant +##sl +splitting +caste +sergei +##rer +##ema +scripts +##ively +rub +satellites +##vor +inscribed +verlag +scrapped +gale +packages +chick +potato +slogan +kathleen +arabs +##culture +counterparts +reminiscent +choral +##tead +rand +retains +bushes +dane +accomplish +courtesy +closes +##oth +slaughter +hague +krakow +lawson +tailed +elias +ginger +##ttes +canopy +betrayal +rebuilding +turf +##hof +frowning +allegiance +brigades +kicks +rebuild +polls +alias +nationalism +td +rowan +audition +bowie +fortunately +recognizes +harp +dillon +horrified +##oro +renault +##tics +ropes +##α +presumed +rewarded +infrared +wiping +accelerated +illustration +##rid +presses +practitioners +badminton +##iard +detained +##tera +recognizing +relates +misery +##sies +##tly +reproduction +piercing +potatoes +thornton +esther +manners +hbo +##aan +ours +bullshit +ernie +perennial +sensitivity +illuminated +rupert +##jin +##iss +##ear +rfc +nassau +##dock +staggered +socialism +##haven +appointments +nonsense +prestige +sharma +haul +##tical +solidarity +gps +##ook +##rata +igor +pedestrian +##uit +baxter +tenants +wires +medication +unlimited +guiding +impacts +diabetes +##rama +sasha +pas +clive +extraction +131 +continually +constraints +##bilities +sonata +hunted +sixteenth +chu +planting +quote +mayer +pretended +abs +spat +##hua +ceramic +##cci +curtains +pigs +pitching +##dad +latvian +sore +dayton +##sted +##qi +patrols +slice +playground +##nted +shone +stool +apparatus +inadequate +mates +treason +##ija +desires +##liga +##croft +somalia +laurent +mir +leonardo +oracle +grape +obliged +chevrolet +thirteenth +stunning +enthusiastic +##ede +accounted +concludes +currents +basil +##kovic +drought +##rica +mai +##aire +shove +posting +##shed +pilgrimage +humorous +packing +fry +pencil +wines +smells +144 +marilyn +aching +newest +clung +bon +neighbours +sanctioned +##pie +mug +##stock +drowning +##mma +hydraulic +##vil +hiring +reminder +lilly +investigators +##ncies +sour +##eous +compulsory +packet +##rion +##graphic +##elle +cannes +##inate +depressed +##rit +heroic +importantly +theresa +##tled +conway +saturn +marginal +rae +##xia +corresponds +royce +pact +jasper +explosives +packaging +aluminium +##ttered +denotes +rhythmic +spans +assignments +hereditary +outlined +originating +sundays +lad +reissued +greeting +beatrice +##dic +pillar +marcos +plots +handbook +alcoholic +judiciary +avant +slides +extract +masculine +blur +##eum +##force +homage +trembled +owens +hymn +trey +omega +signaling +socks +accumulated +reacted +attic +theo +lining +angie +distraction +primera +talbot +##key +1200 +ti +creativity +billed +##hey +deacon +eduardo +identifies +proposition +dizzy +gunner +hogan +##yam +##pping +##hol +ja +##chan +jensen +reconstructed +##berger +clearance +darius +##nier +abe +harlem +plea +dei +circled +emotionally +notation +fascist +neville +exceeded +upwards +viable +ducks +##fo +workforce +racer +limiting +shri +##lson +possesses +1600 +kerr +moths +devastating +laden +disturbing +locking +##cture +gal +fearing +accreditation +flavor +aide +1870s +mountainous +##baum +melt +##ures +motel +texture +servers +soda +##mb +herd +##nium +erect +puzzled +hum +peggy +examinations +gould +testified +geoff +ren +devised +sacks +##law +denial +posters +grunted +cesar +tutor +ec +gerry +offerings +byrne +falcons +combinations +ct +incoming +pardon +rocking +26th +avengers +flared +mankind +seller +uttar +loch +nadia +stroking +exposing +##hd +fertile +ancestral +instituted +##has +noises +prophecy +taxation +eminent +vivid +pol +##bol +dart +indirect +multimedia +notebook +upside +displaying +adrenaline +referenced +geometric +##iving +progression +##ddy +blunt +announce +##far +implementing +##lav +aggression +liaison +cooler +cares +headache +plantations +gorge +dots +impulse +thickness +ashamed +averaging +kathy +obligation +precursor +137 +fowler +symmetry +thee +225 +hears +##rai +undergoing +ads +butcher +bowler +##lip +cigarettes +subscription +goodness +##ically +browne +##hos +##tech +kyoto +donor +##erty +damaging +friction +drifting +expeditions +hardened +prostitution +152 +fauna +blankets +claw +tossing +snarled +butterflies +recruits +investigative +coated +healed +138 +communal +hai +xiii +academics +boone +psychologist +restless +lahore +stephens +mba +brendan +foreigners +printer +##pc +ached +explode +27th +deed +scratched +dared +##pole +cardiac +1780 +okinawa +proto +commando +compelled +oddly +electrons +##base +replica +thanksgiving +##rist +sheila +deliberate +stafford +tidal +representations +hercules +ou +##path +##iated +kidnapping +lenses +##tling +deficit +samoa +mouths +consuming +computational +maze +granting +smirk +razor +fixture +ideals +inviting +aiden +nominal +##vs +issuing +julio +pitt +ramsey +docks +##oss +exhaust +##owed +bavarian +draped +anterior +mating +ethiopian +explores +noticing +##nton +discarded +convenience +hoffman +endowment +beasts +cartridge +mormon +paternal +probe +sleeves +interfere +lump +deadline +##rail +jenks +bulldogs +scrap +alternating +justified +reproductive +nam +seize +descending +secretariat +kirby +coupe +grouped +smash +panther +sedan +tapping +##18 +lola +cheer +germanic +unfortunate +##eter +unrelated +##fan +subordinate +##sdale +suzanne +advertisement +##ility +horsepower +##lda +cautiously +discourse +luigi +##mans +##fields +noun +prevalent +mao +schneider +everett +surround +governorate +kira +##avia +westward +##take +misty +rails +sustainability +134 +unused +##rating +packs +toast +unwilling +regulate +thy +suffrage +nile +awe +assam +definitions +travelers +affordable +##rb +conferred +sells +undefeated +beneficial +torso +basal +repeating +remixes +##pass +bahrain +cables +fang +##itated +excavated +numbering +statutory +##rey +deluxe +##lian +forested +ramirez +derbyshire +zeus +slamming +transfers +astronomer +banana +lottery +berg +histories +bamboo +##uchi +resurrection +posterior +bowls +vaguely +##thi +thou +preserving +tensed +offence +##inas +meyrick +callum +ridden +watt +langdon +tying +lowland +snorted +daring +truman +##hale +##girl +aura +overly +filing +weighing +goa +infections +philanthropist +saunders +eponymous +##owski +latitude +perspectives +reviewing +mets +commandant +radial +##kha +flashlight +reliability +koch +vowels +amazed +ada +elaine +supper +##rth +##encies +predator +debated +soviets +cola +##boards +##nah +compartment +crooked +arbitrary +fourteenth +##ctive +havana +majors +steelers +clips +profitable +ambush +exited +packers +##tile +nude +cracks +fungi +##е +limb +trousers +josie +shelby +tens +frederic +##ος +definite +smoothly +constellation +insult +baton +discs +lingering +##nco +conclusions +lent +staging +becker +grandpa +shaky +##tron +einstein +obstacles +sk +adverse +elle +economically +##moto +mccartney +thor +dismissal +motions +readings +nostrils +treatise +##pace +squeezing +evidently +prolonged +1783 +venezuelan +je +marguerite +beirut +takeover +shareholders +##vent +denise +digit +airplay +norse +##bbling +imaginary +pills +hubert +blaze +vacated +eliminating +##ello +vine +mansfield +##tty +retrospective +barrow +borne +clutch +bail +forensic +weaving +##nett +##witz +desktop +citadel +promotions +worrying +dorset +ieee +subdivided +##iating +manned +expeditionary +pickup +synod +chuckle +185 +barney +##rz +##ffin +functionality +karachi +litigation +meanings +uc +lick +turbo +anders +##ffed +execute +curl +oppose +ankles +typhoon +##د +##ache +##asia +linguistics +compassion +pressures +grazing +perfection +##iting +immunity +monopoly +muddy +backgrounds +136 +namibia +francesca +monitors +attracting +stunt +tuition +##ии +vegetable +##mates +##quent +mgm +jen +complexes +forts +##ond +cellar +bites +seventeenth +royals +flemish +failures +mast +charities +##cular +peruvian +capitals +macmillan +ipswich +outward +frigate +postgraduate +folds +employing +##ouse +concurrently +fiery +##tai +contingent +nightmares +monumental +nicaragua +##kowski +lizard +mal +fielding +gig +reject +##pad +harding +##ipe +coastline +##cin +##nos +beethoven +humphrey +innovations +##tam +##nge +norris +doris +solicitor +huang +obey +141 +##lc +niagara +##tton +shelves +aug +bourbon +curry +nightclub +specifications +hilton +##ndo +centennial +dispersed +worm +neglected +briggs +sm +font +kuala +uneasy +plc +##nstein +##bound +##aking +##burgh +awaiting +pronunciation +##bbed +##quest +eh +optimal +zhu +raped +greens +presided +brenda +worries +##life +venetian +marxist +turnout +##lius +refined +braced +sins +grasped +sunderland +nickel +speculated +lowell +cyrillic +communism +fundraising +resembling +colonists +mutant +freddie +usc +##mos +gratitude +##run +mural +##lous +chemist +wi +reminds +28th +steals +tess +pietro +##ingen +promoter +ri +microphone +honoured +rai +sant +##qui +feather +##nson +burlington +kurdish +terrorists +deborah +sickness +##wed +##eet +hazard +irritated +desperation +veil +clarity +##rik +jewels +xv +##gged +##ows +##cup +berkshire +unfair +mysteries +orchid +winced +exhaustion +renovations +stranded +obe +infinity +##nies +adapt +redevelopment +thanked +registry +olga +domingo +noir +tudor +ole +##atus +commenting +behaviors +##ais +crisp +pauline +probable +stirling +wigan +##bian +paralympics +panting +surpassed +##rew +luca +barred +pony +famed +##sters +cassandra +waiter +carolyn +exported +##orted +andres +destructive +deeds +jonah +castles +vacancy +suv +##glass +1788 +orchard +yep +famine +belarusian +sprang +##forth +skinny +##mis +administrators +rotterdam +zambia +zhao +boiler +discoveries +##ride +##physics +lucius +disappointing +outreach +spoon +##frame +qualifications +unanimously +enjoys +regency +##iidae +stade +realism +veterinary +rodgers +dump +alain +chestnut +castile +censorship +rumble +gibbs +##itor +communion +reggae +inactivated +logs +loads +##houses +homosexual +##iano +ale +informs +##cas +phrases +plaster +linebacker +ambrose +kaiser +fascinated +850 +limerick +recruitment +forge +mastered +##nding +leinster +rooted +threaten +##strom +borneo +##hes +suggestions +scholarships +propeller +documentaries +patronage +coats +constructing +invest +neurons +comet +entirety +shouts +identities +annoying +unchanged +wary +##antly +##ogy +neat +oversight +##kos +phillies +replay +constance +##kka +incarnation +humble +skies +minus +##acy +smithsonian +##chel +guerrilla +jar +cadets +##plate +surplus +audit +##aru +cracking +joanna +louisa +pacing +##lights +intentionally +##iri +diner +nwa +imprint +australians +tong +unprecedented +bunker +naive +specialists +ark +nichols +railing +leaked +pedal +##uka +shrub +longing +roofs +v8 +captains +neural +tuned +##ntal +##jet +emission +medina +frantic +codex +definitive +sid +abolition +intensified +stocks +enrique +sustain +genoa +oxide +##written +clues +cha +##gers +tributaries +fragment +venom +##rity +##ente +##sca +muffled +vain +sire +laos +##ingly +##hana +hastily +snapping +surfaced +sentiment +motive +##oft +contests +approximate +mesa +luckily +dinosaur +exchanges +propelled +accord +bourne +relieve +tow +masks +offended +##ues +cynthia +##mmer +rains +bartender +zinc +reviewers +lois +##sai +legged +arrogant +rafe +rosie +comprise +handicap +blockade +inlet +lagoon +copied +drilling +shelley +petals +##inian +mandarin +obsolete +##inated +onward +arguably +productivity +cindy +praising +seldom +busch +discusses +raleigh +shortage +ranged +stanton +encouragement +firstly +conceded +overs +temporal +##uke +cbe +##bos +woo +certainty +pumps +##pton +stalked +##uli +lizzie +periodic +thieves +weaker +##night +gases +shoving +chooses +wc +##chemical +prompting +weights +##kill +robust +flanked +sticky +hu +tuberculosis +##eb +##eal +christchurch +resembled +wallet +reese +inappropriate +pictured +distract +fixing +fiddle +giggled +burger +heirs +hairy +mechanic +torque +apache +obsessed +chiefly +cheng +logging +##tag +extracted +meaningful +numb +##vsky +gloucestershire +reminding +##bay +unite +##lit +breeds +diminished +clown +glove +1860s +##ن +##ug +archibald +focal +freelance +sliced +depiction +##yk +organism +switches +sights +stray +crawling +##ril +lever +leningrad +interpretations +loops +anytime +reel +alicia +delighted +##ech +inhaled +xiv +suitcase +bernie +vega +licenses +northampton +exclusion +induction +monasteries +racecourse +homosexuality +##right +##sfield +##rky +dimitri +michele +alternatives +ions +commentators +genuinely +objected +pork +hospitality +fencing +stephan +warships +peripheral +wit +drunken +wrinkled +quentin +spends +departing +chung +numerical +spokesperson +##zone +johannesburg +caliber +killers +##udge +assumes +neatly +demographic +abigail +bloc +##vel +mounting +##lain +bentley +slightest +xu +recipients +##jk +merlin +##writer +seniors +prisons +blinking +hindwings +flickered +kappa +##hel +80s +strengthening +appealing +brewing +gypsy +mali +lashes +hulk +unpleasant +harassment +bio +treaties +predict +instrumentation +pulp +troupe +boiling +mantle +##ffe +ins +##vn +dividing +handles +verbs +##onal +coconut +senegal +340 +thorough +gum +momentarily +##sto +cocaine +panicked +destined +##turing +teatro +denying +weary +captained +mans +##hawks +##code +wakefield +bollywood +thankfully +##16 +cyril +##wu +amendments +##bahn +consultation +stud +reflections +kindness +1787 +internally +##ovo +tex +mosaic +distribute +paddy +seeming +143 +##hic +piers +##15 +##mura +##verse +popularly +winger +kang +sentinel +mccoy +##anza +covenant +##bag +verge +fireworks +suppress +thrilled +dominate +##jar +swansea +##60 +142 +reconciliation +##ndi +stiffened +cue +dorian +##uf +damascus +amor +ida +foremost +##aga +porsche +unseen +dir +##had +##azi +stony +lexi +melodies +##nko +angular +integer +podcast +ants +inherent +jaws +justify +persona +##olved +josephine +##nr +##ressed +customary +flashes +gala +cyrus +glaring +backyard +ariel +physiology +greenland +html +stir +avon +atletico +finch +methodology +ked +##lent +mas +catholicism +townsend +branding +quincy +fits +containers +1777 +ashore +aragon +##19 +forearm +poisoning +##sd +adopting +conquer +grinding +amnesty +keller +finances +evaluate +forged +lankan +instincts +##uto +guam +bosnian +photographed +workplace +desirable +protector +##dog +allocation +intently +encourages +willy +##sten +bodyguard +electro +brighter +##ν +bihar +##chev +lasts +opener +amphibious +sal +verde +arte +##cope +captivity +vocabulary +yields +##tted +agreeing +desmond +pioneered +##chus +strap +campaigned +railroads +##ович +emblem +##dre +stormed +501 +##ulous +marijuana +northumberland +##gn +##nath +bowen +landmarks +beaumont +##qua +danube +##bler +attorneys +th +ge +flyers +critique +villains +cass +mutation +acc +##0s +colombo +mckay +motif +sampling +concluding +syndicate +##rell +neon +stables +ds +warnings +clint +mourning +wilkinson +##tated +merrill +leopard +evenings +exhaled +emil +sonia +ezra +discrete +stove +farrell +fifteenth +prescribed +superhero +##rier +worms +helm +wren +##duction +##hc +expo +##rator +hq +unfamiliar +antony +prevents +acceleration +fiercely +mari +painfully +calculations +cheaper +ign +clifton +irvine +davenport +mozambique +##np +pierced +##evich +wonders +##wig +##cate +##iling +crusade +ware +##uel +enzymes +reasonably +mls +##coe +mater +ambition +bunny +eliot +kernel +##fin +asphalt +headmaster +torah +aden +lush +pins +waived +##care +##yas +joao +substrate +enforce +##grad +##ules +alvarez +selections +epidemic +tempted +##bit +bremen +translates +ensured +waterfront +29th +forrest +manny +malone +kramer +reigning +cookies +simpler +absorption +205 +engraved +##ffy +evaluated +1778 +haze +146 +comforting +crossover +##abe +thorn +##rift +##imo +##pop +suppression +fatigue +cutter +##tr +201 +wurttemberg +##orf +enforced +hovering +proprietary +gb +samurai +syllable +ascent +lacey +tick +lars +tractor +merchandise +rep +bouncing +defendants +##yre +huntington +##ground +##oko +standardized +##hor +##hima +assassinated +nu +predecessors +rainy +liar +assurance +lyrical +##uga +secondly +flattened +ios +parameter +undercover +##mity +bordeaux +punish +ridges +markers +exodus +inactive +hesitate +debbie +nyc +pledge +savoy +nagar +offset +organist +##tium +hesse +marin +converting +##iver +diagram +propulsion +pu +validity +reverted +supportive +##dc +ministries +clans +responds +proclamation +##inae +##ø +##rea +ein +pleading +patriot +sf +birch +islanders +strauss +hates +##dh +brandenburg +concession +rd +##ob +1900s +killings +textbook +antiquity +cinematography +wharf +embarrassing +setup +creed +farmland +inequality +centred +signatures +fallon +370 +##ingham +##uts +ceylon +gazing +directive +laurie +##tern +globally +##uated +##dent +allah +excavation +threads +##cross +148 +frantically +icc +utilize +determines +respiratory +thoughtful +receptions +##dicate +merging +chandra +seine +147 +builders +builds +diagnostic +dev +visibility +goddamn +analyses +dhaka +cho +proves +chancel +concurrent +curiously +canadians +pumped +restoring +1850s +turtles +jaguar +sinister +spinal +traction +declan +vows +1784 +glowed +capitalism +swirling +install +universidad +##lder +##oat +soloist +##genic +##oor +coincidence +beginnings +nissan +dip +resorts +caucasus +combustion +infectious +##eno +pigeon +serpent +##itating +conclude +masked +salad +jew +##gr +surreal +toni +##wc +harmonica +151 +##gins +##etic +##coat +fishermen +intending +bravery +##wave +klaus +titan +wembley +taiwanese +ransom +40th +incorrect +hussein +eyelids +jp +cooke +dramas +utilities +##etta +##print +eisenhower +principally +granada +lana +##rak +openings +concord +##bl +bethany +connie +morality +sega +##mons +##nard +earnings +##kara +##cine +wii +communes +##rel +coma +composing +softened +severed +grapes +##17 +nguyen +analyzed +warlord +hubbard +heavenly +behave +slovenian +##hit +##ony +hailed +filmmakers +trance +caldwell +skye +unrest +coward +likelihood +##aging +bern +sci +taliban +honolulu +propose +##wang +1700 +browser +imagining +cobra +contributes +dukes +instinctively +conan +violinist +##ores +accessories +gradual +##amp +quotes +sioux +##dating +undertake +intercepted +sparkling +compressed +139 +fungus +tombs +haley +imposing +rests +degradation +lincolnshire +retailers +wetlands +tulsa +distributor +dungeon +nun +greenhouse +convey +atlantis +aft +exits +oman +dresser +lyons +##sti +joking +eddy +judgement +omitted +digits +##cts +##game +juniors +##rae +cents +stricken +une +##ngo +wizards +weir +breton +nan +technician +fibers +liking +royalty +##cca +154 +persia +terribly +magician +##rable +##unt +vance +cafeteria +booker +camille +warmer +##static +consume +cavern +gaps +compass +contemporaries +foyer +soothing +graveyard +maj +plunged +blush +##wear +cascade +demonstrates +ordinance +##nov +boyle +##lana +rockefeller +shaken +banjo +izzy +##ense +breathless +vines +##32 +##eman +alterations +chromosome +dwellings +feudal +mole +153 +catalonia +relics +tenant +mandated +##fm +fridge +hats +honesty +patented +raul +heap +cruisers +accusing +enlightenment +infants +wherein +chatham +contractors +zen +affinity +hc +osborne +piston +156 +traps +maturity +##rana +lagos +##zal +peering +##nay +attendant +dealers +protocols +subset +prospects +biographical +##cre +artery +##zers +insignia +nuns +endured +##eration +recommend +schwartz +serbs +berger +cromwell +crossroads +##ctor +enduring +clasped +grounded +##bine +marseille +twitched +abel +choke +https +catalyst +moldova +italians +##tist +disastrous +wee +##oured +##nti +wwf +nope +##piration +##asa +expresses +thumbs +167 +##nza +coca +1781 +cheating +##ption +skipped +sensory +heidelberg +spies +satan +dangers +semifinal +202 +bohemia +whitish +confusing +shipbuilding +relies +surgeons +landings +ravi +baku +moor +suffix +alejandro +##yana +litre +upheld +##unk +rajasthan +##rek +coaster +insists +posture +scenarios +etienne +favoured +appoint +transgender +elephants +poked +greenwood +defences +fulfilled +militant +somali +1758 +chalk +potent +##ucci +migrants +wink +assistants +nos +restriction +activism +niger +##ario +colon +shaun +##sat +daphne +##erated +swam +congregations +reprise +considerations +magnet +playable +xvi +##р +overthrow +tobias +knob +chavez +coding +##mers +propped +katrina +orient +newcomer +##suke +temperate +##pool +farmhouse +interrogation +##vd +committing +##vert +forthcoming +strawberry +joaquin +macau +ponds +shocking +siberia +##cellular +chant +contributors +##nant +##ologists +sped +absorb +hail +1782 +spared +##hore +barbados +karate +opus +originates +saul +##xie +evergreen +leaped +##rock +correlation +exaggerated +weekday +unification +bump +tracing +brig +afb +pathways +utilizing +##ners +mod +mb +disturbance +kneeling +##stad +##guchi +100th +pune +##thy +decreasing +168 +manipulation +miriam +academia +ecosystem +occupational +rbi +##lem +rift +##14 +rotary +stacked +incorporation +awakening +generators +guerrero +racist +##omy +cyber +derivatives +culminated +allie +annals +panzer +sainte +wikipedia +pops +zu +austro +##vate +algerian +politely +nicholson +mornings +educate +tastes +thrill +dartmouth +##gating +db +##jee +regan +differing +concentrating +choreography +divinity +##media +pledged +alexandre +routing +gregor +madeline +##idal +apocalypse +##hora +gunfire +culminating +elves +fined +liang +lam +programmed +tar +guessing +transparency +gabrielle +##gna +cancellation +flexibility +##lining +accession +shea +stronghold +nets +specializes +##rgan +abused +hasan +sgt +ling +exceeding +##₄ +admiration +supermarket +##ark +photographers +specialised +tilt +resonance +hmm +perfume +380 +sami +threatens +garland +botany +guarding +boiled +greet +puppy +russo +supplier +wilmington +vibrant +vijay +##bius +paralympic +grumbled +paige +faa +licking +margins +hurricanes +##gong +fest +grenade +ripping +##uz +counseling +weigh +##sian +needles +wiltshire +edison +costly +##not +fulton +tramway +redesigned +staffordshire +cache +gasping +watkins +sleepy +candidacy +##group +monkeys +timeline +throbbing +##bid +##sos +berth +uzbekistan +vanderbilt +bothering +overturned +ballots +gem +##iger +sunglasses +subscribers +hooker +compelling +ang +exceptionally +saloon +stab +##rdi +carla +terrifying +rom +##vision +coil +##oids +satisfying +vendors +31st +mackay +deities +overlooked +ambient +bahamas +felipe +olympia +whirled +botanist +advertised +tugging +##dden +disciples +morales +unionist +rites +foley +morse +motives +creepy +##₀ +soo +##sz +bargain +highness +frightening +turnpike +tory +reorganization +##cer +depict +biographer +##walk +unopposed +manifesto +##gles +institut +emile +accidental +kapoor +##dam +kilkenny +cortex +lively +##13 +romanesque +jain +shan +cannons +##ood +##ske +petrol +echoing +amalgamated +disappears +cautious +proposes +sanctions +trenton +##ر +flotilla +aus +contempt +tor +canary +cote +theirs +##hun +conceptual +deleted +fascinating +paso +blazing +elf +honourable +hutchinson +##eiro +##outh +##zin +surveyor +tee +amidst +wooded +reissue +intro +##ono +cobb +shelters +newsletter +hanson +brace +encoding +confiscated +dem +caravan +marino +scroll +melodic +cows +imam +##adi +##aneous +northward +searches +biodiversity +cora +310 +roaring +##bers +connell +theologian +halo +compose +pathetic +unmarried +dynamo +##oot +az +calculation +toulouse +deserves +humour +nr +forgiveness +tam +undergone +martyr +pamela +myths +whore +counselor +hicks +290 +heavens +battleship +electromagnetic +##bbs +stellar +establishments +presley +hopped +##chin +temptation +90s +wills +nas +##yuan +nhs +##nya +seminars +##yev +adaptations +gong +asher +lex +indicator +sikh +tobago +cites +goin +##yte +satirical +##gies +characterised +correspond +bubbles +lure +participates +##vid +eruption +skate +therapeutic +1785 +canals +wholesale +defaulted +sac +460 +petit +##zzled +virgil +leak +ravens +256 +portraying +##yx +ghetto +creators +dams +portray +vicente +##rington +fae +namesake +bounty +##arium +joachim +##ota +##iser +aforementioned +axle +snout +depended +dismantled +reuben +480 +##ibly +gallagher +##lau +##pd +earnest +##ieu +##iary +inflicted +objections +##llar +asa +gritted +##athy +jericho +##sea +##was +flick +underside +ceramics +undead +substituted +195 +eastward +undoubtedly +wheeled +chimney +##iche +guinness +cb +##ager +siding +##bell +traitor +baptiste +disguised +inauguration +149 +tipperary +choreographer +perched +warmed +stationary +eco +##ike +##ntes +bacterial +##aurus +flores +phosphate +##core +attacker +invaders +alvin +intersects +a1 +indirectly +immigrated +businessmen +cornelius +valves +narrated +pill +sober +ul +nationale +monastic +applicants +scenery +##jack +161 +motifs +constitutes +cpu +##osh +jurisdictions +sd +tuning +irritation +woven +##uddin +fertility +gao +##erie +antagonist +impatient +glacial +hides +boarded +denominations +interception +##jas +cookie +nicola +##tee +algebraic +marquess +bahn +parole +buyers +bait +turbines +paperwork +bestowed +natasha +renee +oceans +purchases +157 +vaccine +215 +##tock +fixtures +playhouse +integrate +jai +oswald +intellectuals +##cky +booked +nests +mortimer +##isi +obsession +sept +##gler +##sum +440 +scrutiny +simultaneous +squinted +##shin +collects +oven +shankar +penned +remarkably +##я +slips +luggage +spectral +1786 +collaborations +louie +consolidation +##ailed +##ivating +420 +hoover +blackpool +harness +ignition +vest +tails +belmont +mongol +skinner +##nae +visually +mage +derry +##tism +##unce +stevie +transitional +##rdy +redskins +drying +prep +prospective +##21 +annoyance +oversee +##loaded +fills +##books +##iki +announces +fda +scowled +respects +prasad +mystic +tucson +##vale +revue +springer +bankrupt +1772 +aristotle +salvatore +habsburg +##geny +dal +natal +nut +pod +chewing +darts +moroccan +walkover +rosario +lenin +punjabi +##ße +grossed +scattering +wired +invasive +hui +polynomial +corridors +wakes +gina +portrays +##cratic +arid +retreating +erich +irwin +sniper +##dha +linen +lindsey +maneuver +butch +shutting +socio +bounce +commemorative +postseason +jeremiah +pines +275 +mystical +beads +bp +abbas +furnace +bidding +consulted +assaulted +empirical +rubble +enclosure +sob +weakly +cancel +polly +yielded +##emann +curly +prediction +battered +70s +vhs +jacqueline +render +sails +barked +detailing +grayson +riga +sloane +raging +##yah +herbs +bravo +##athlon +alloy +giggle +imminent +suffers +assumptions +waltz +##itate +accomplishments +##ited +bathing +remixed +deception +prefix +##emia +deepest +##tier +##eis +balkan +frogs +##rong +slab +##pate +philosophers +peterborough +grains +imports +dickinson +rwanda +##atics +1774 +dirk +lan +tablets +##rove +clone +##rice +caretaker +hostilities +mclean +##gre +regimental +treasures +norms +impose +tsar +tango +diplomacy +variously +complain +192 +recognise +arrests +1779 +celestial +pulitzer +##dus +bing +libretto +##moor +adele +splash +##rite +expectation +lds +confronts +##izer +spontaneous +harmful +wedge +entrepreneurs +buyer +##ope +bilingual +translate +rugged +conner +circulated +uae +eaton +##gra +##zzle +lingered +lockheed +vishnu +reelection +alonso +##oom +joints +yankee +headline +cooperate +heinz +laureate +invading +##sford +echoes +scandinavian +##dham +hugging +vitamin +salute +micah +hind +trader +##sper +radioactive +##ndra +militants +poisoned +ratified +remark +campeonato +deprived +wander +prop +##dong +outlook +##tani +##rix +##eye +chiang +darcy +##oping +mandolin +spice +statesman +babylon +182 +walled +forgetting +afro +##cap +158 +giorgio +buffer +##polis +planetary +##gis +overlap +terminals +kinda +centenary +##bir +arising +manipulate +elm +ke +1770 +ak +##tad +chrysler +mapped +moose +pomeranian +quad +macarthur +assemblies +shoreline +recalls +stratford +##rted +noticeable +##evic +imp +##rita +##sque +accustomed +supplying +tents +disgusted +vogue +sipped +filters +khz +reno +selecting +luftwaffe +mcmahon +tyne +masterpiece +carriages +collided +dunes +exercised +flare +remembers +muzzle +##mobile +heck +##rson +burgess +lunged +middleton +boycott +bilateral +##sity +hazardous +lumpur +multiplayer +spotlight +jackets +goldman +liege +porcelain +rag +waterford +benz +attracts +hopeful +battling +ottomans +kensington +baked +hymns +cheyenne +lattice +levine +borrow +polymer +clashes +michaels +monitored +commitments +denounced +##25 +##von +cavity +##oney +hobby +akin +##holders +futures +intricate +cornish +patty +##oned +illegally +dolphin +##lag +barlow +yellowish +maddie +apologized +luton +plagued +##puram +nana +##rds +sway +fanny +łodz +##rino +psi +suspicions +hanged +##eding +initiate +charlton +##por +nak +competent +235 +analytical +annex +wardrobe +reservations +##rma +sect +162 +fairfax +hedge +piled +buckingham +uneven +bauer +simplicity +snyder +interpret +accountability +donors +moderately +byrd +continents +##cite +##max +disciple +hr +jamaican +ping +nominees +##uss +mongolian +diver +attackers +eagerly +ideological +pillows +miracles +apartheid +revolver +sulfur +clinics +moran +163 +##enko +ile +katy +rhetoric +##icated +chronology +recycling +##hrer +elongated +mughal +pascal +profiles +vibration +databases +domination +##fare +##rant +matthias +digest +rehearsal +polling +weiss +initiation +reeves +clinging +flourished +impress +ngo +##hoff +##ume +buckley +symposium +rhythms +weed +emphasize +transforming +##taking +##gence +##yman +accountant +analyze +flicker +foil +priesthood +voluntarily +decreases +##80 +##hya +slater +sv +charting +mcgill +##lde +moreno +##iu +besieged +zur +robes +##phic +admitting +api +deported +turmoil +peyton +earthquakes +##ares +nationalists +beau +clair +brethren +interrupt +welch +curated +galerie +requesting +164 +##ested +impending +steward +viper +##vina +complaining +beautifully +brandy +foam +nl +1660 +##cake +alessandro +punches +laced +explanations +##lim +attribute +clit +reggie +discomfort +##cards +smoothed +whales +##cene +adler +countered +duffy +disciplinary +widening +recipe +reliance +conducts +goats +gradient +preaching +##shaw +matilda +quasi +striped +meridian +cannabis +cordoba +certificates +##agh +##tering +graffiti +hangs +pilgrims +repeats +##ych +revive +urine +etat +##hawk +fueled +belts +fuzzy +susceptible +##hang +mauritius +salle +sincere +beers +hooks +##cki +arbitration +entrusted +advise +sniffed +seminar +junk +donnell +processors +principality +strapped +celia +mendoza +everton +fortunes +prejudice +starving +reassigned +steamer +##lund +tuck +evenly +foreman +##ffen +dans +375 +envisioned +slit +##xy +baseman +liberia +rosemary +##weed +electrified +periodically +potassium +stride +contexts +sperm +slade +mariners +influx +bianca +subcommittee +##rane +spilling +icao +estuary +##nock +delivers +iphone +##ulata +isa +mira +bohemian +dessert +##sbury +welcoming +proudly +slowing +##chs +musee +ascension +russ +##vian +waits +##psy +africans +exploit +##morphic +gov +eccentric +crab +peck +##ull +entrances +formidable +marketplace +groom +bolted +metabolism +patton +robbins +courier +payload +endure +##ifier +andes +refrigerator +##pr +ornate +##uca +ruthless +illegitimate +masonry +strasbourg +bikes +adobe +##³ +apples +quintet +willingly +niche +bakery +corpses +energetic +##cliffe +##sser +##ards +177 +centimeters +centro +fuscous +cretaceous +rancho +##yde +andrei +telecom +tottenham +oasis +ordination +vulnerability +presiding +corey +cp +penguins +sims +##pis +malawi +piss +##48 +correction +##cked +##ffle +##ryn +countdown +detectives +psychiatrist +psychedelic +dinosaurs +blouse +##get +choi +vowed +##oz +randomly +##pol +49ers +scrub +blanche +bruins +dusseldorf +##using +unwanted +##ums +212 +dominique +elevations +headlights +om +laguna +##oga +1750 +famously +ignorance +shrewsbury +##aine +ajax +breuning +che +confederacy +greco +overhaul +##screen +paz +skirts +disagreement +cruelty +jagged +phoebe +shifter +hovered +viruses +##wes +mandy +##lined +##gc +landlord +squirrel +dashed +##ι +ornamental +gag +wally +grange +literal +spurs +undisclosed +proceeding +yin +##text +billie +orphan +spanned +humidity +indy +weighted +presentations +explosions +lucian +##tary +vaughn +hindus +##anga +##hell +psycho +171 +daytona +protects +efficiently +rematch +sly +tandem +##oya +rebranded +impaired +hee +metropolis +peach +godfrey +diaspora +ethnicity +prosperous +gleaming +dar +grossing +playback +##rden +stripe +pistols +##tain +births +labelled +##cating +172 +rudy +alba +##onne +aquarium +hostility +##gb +##tase +shudder +sumatra +hardest +lakers +consonant +creeping +demos +homicide +capsule +zeke +liberties +expulsion +pueblo +##comb +trait +transporting +##ddin +##neck +##yna +depart +gregg +mold +ledge +hangar +oldham +playboy +termination +analysts +gmbh +romero +##itic +insist +cradle +filthy +brightness +slash +shootout +deposed +bordering +##truct +isis +microwave +tumbled +sheltered +cathy +werewolves +messy +andersen +convex +clapped +clinched +satire +wasting +edo +vc +rufus +##jak +mont +##etti +poznan +##keeping +restructuring +transverse +##rland +azerbaijani +slovene +gestures +roommate +choking +shear +##quist +vanguard +oblivious +##hiro +disagreed +baptism +##lich +coliseum +##aceae +salvage +societe +cory +locke +relocation +relying +versailles +ahl +swelling +##elo +cheerful +##word +##edes +gin +sarajevo +obstacle +diverted +##nac +messed +thoroughbred +fluttered +utrecht +chewed +acquaintance +assassins +dispatch +mirza +##wart +nike +salzburg +swell +yen +##gee +idle +ligue +samson +##nds +##igh +playful +spawned +##cise +tease +##case +burgundy +##bot +stirring +skeptical +interceptions +marathi +##dies +bedrooms +aroused +pinch +##lik +preferences +tattoos +buster +digitally +projecting +rust +##ital +kitten +priorities +addison +pseudo +##guard +dusk +icons +sermon +##psis +##iba +bt +##lift +##xt +ju +truce +rink +##dah +##wy +defects +psychiatry +offences +calculate +glucose +##iful +##rized +##unda +francaise +##hari +richest +warwickshire +carly +1763 +purity +redemption +lending +##cious +muse +bruises +cerebral +aero +carving +##name +preface +terminology +invade +monty +##int +anarchist +blurred +##iled +rossi +treats +guts +shu +foothills +ballads +undertaking +premise +cecilia +affiliates +blasted +conditional +wilder +minors +drone +rudolph +buffy +swallowing +horton +attested +##hop +rutherford +howell +primetime +livery +penal +##bis +minimize +hydro +wrecked +wrought +palazzo +##gling +cans +vernacular +friedman +nobleman +shale +walnut +danielle +##ection +##tley +sears +##kumar +chords +lend +flipping +streamed +por +dracula +gallons +sacrifices +gamble +orphanage +##iman +mckenzie +##gible +boxers +daly +##balls +##ان +208 +##ific +##rative +##iq +exploited +slated +##uity +circling +hillary +pinched +goldberg +provost +campaigning +lim +piles +ironically +jong +mohan +successors +usaf +##tem +##ught +autobiographical +haute +preserves +##ending +acquitted +comparisons +203 +hydroelectric +gangs +cypriot +torpedoes +rushes +chrome +derive +bumps +instability +fiat +pets +##mbe +silas +dye +reckless +settler +##itation +info +heats +##writing +176 +canonical +maltese +fins +mushroom +stacy +aspen +avid +##kur +##loading +vickers +gaston +hillside +statutes +wilde +gail +kung +sabine +comfortably +motorcycles +##rgo +169 +pneumonia +fetch +##sonic +axel +faintly +parallels +##oop +mclaren +spouse +compton +interdisciplinary +miner +##eni +181 +clamped +##chal +##llah +separates +versa +##mler +scarborough +labrador +##lity +##osing +rutgers +hurdles +como +166 +burt +divers +##100 +wichita +cade +coincided +##erson +bruised +mla +##pper +vineyard +##ili +##brush +notch +mentioning +jase +hearted +kits +doe +##acle +pomerania +##ady +ronan +seizure +pavel +problematic +##zaki +domenico +##ulin +catering +penelope +dependence +parental +emilio +ministerial +atkinson +##bolic +clarkson +chargers +colby +grill +peeked +arises +summon +##aged +fools +##grapher +faculties +qaeda +##vial +garner +refurbished +##hwa +geelong +disasters +nudged +bs +shareholder +lori +algae +reinstated +rot +##ades +##nous +invites +stainless +183 +inclusive +##itude +diocesan +til +##icz +denomination +##xa +benton +floral +registers +##ider +##erman +##kell +absurd +brunei +guangzhou +hitter +retaliation +##uled +##eve +blanc +nh +consistency +contamination +##eres +##rner +dire +palermo +broadcasters +diaries +inspire +vols +brewer +tightening +ky +mixtape +hormone +##tok +stokes +##color +##dly +##ssi +pg +##ometer +##lington +sanitation +##tility +intercontinental +apps +##adt +¹⁄₂ +cylinders +economies +favourable +unison +croix +gertrude +odyssey +vanity +dangling +##logists +upgrades +dice +middleweight +practitioner +##ight +206 +henrik +parlor +orion +angered +lac +python +blurted +##rri +sensual +intends +swings +angled +##phs +husky +attain +peerage +precinct +textiles +cheltenham +shuffled +dai +confess +tasting +bhutan +##riation +tyrone +segregation +abrupt +ruiz +##rish +smirked +blackwell +confidential +browning +amounted +##put +vase +scarce +fabulous +raided +staple +guyana +unemployed +glider +shay +##tow +carmine +troll +intervene +squash +superstar +##uce +cylindrical +len +roadway +researched +handy +##rium +##jana +meta +lao +declares +##rring +##tadt +##elin +##kova +willem +shrubs +napoleonic +realms +skater +qi +volkswagen +##ł +tad +hara +archaeologist +awkwardly +eerie +##kind +wiley +##heimer +##24 +titus +organizers +cfl +crusaders +lama +usb +vent +enraged +thankful +occupants +maximilian +##gaard +possessing +textbooks +##oran +collaborator +quaker +##ulo +avalanche +mono +silky +straits +isaiah +mustang +surged +resolutions +potomac +descend +cl +kilograms +plato +strains +saturdays +##olin +bernstein +##ype +holstein +ponytail +##watch +belize +conversely +heroine +perpetual +##ylus +charcoal +piedmont +glee +negotiating +backdrop +prologue +##jah +##mmy +pasadena +climbs +ramos +sunni +##holm +##tner +##tri +anand +deficiency +hertfordshire +stout +##avi +aperture +orioles +##irs +doncaster +intrigued +bombed +coating +otis +##mat +cocktail +##jit +##eto +amir +arousal +sar +##proof +##act +##ories +dixie +pots +##bow +whereabouts +159 +##fted +drains +bullying +cottages +scripture +coherent +fore +poe +appetite +##uration +sampled +##ators +##dp +derrick +rotor +jays +peacock +installment +##rro +advisors +##coming +rodeo +scotch +##mot +##db +##fen +##vant +ensued +rodrigo +dictatorship +martyrs +twenties +##н +towed +incidence +marta +rainforest +sai +scaled +##cles +oceanic +qualifiers +symphonic +mcbride +dislike +generalized +aubrey +colonization +##iation +##lion +##ssing +disliked +lublin +salesman +##ulates +spherical +whatsoever +sweating +avalon +contention +punt +severity +alderman +atari +##dina +##grant +##rop +scarf +seville +vertices +annexation +fairfield +fascination +inspiring +launches +palatinate +regretted +##rca +feral +##iom +elk +nap +olsen +reddy +yong +##leader +##iae +garment +transports +feng +gracie +outrage +viceroy +insides +##esis +breakup +grady +organizer +softer +grimaced +222 +murals +galicia +arranging +vectors +##rsten +bas +##sb +##cens +sloan +##eka +bitten +ara +fender +nausea +bumped +kris +banquet +comrades +detector +persisted +##llan +adjustment +endowed +cinemas +##shot +sellers +##uman +peek +epa +kindly +neglect +simpsons +talon +mausoleum +runaway +hangul +lookout +##cic +rewards +coughed +acquainted +chloride +##ald +quicker +accordion +neolithic +##qa +artemis +coefficient +lenny +pandora +tx +##xed +ecstasy +litter +segunda +chairperson +gemma +hiss +rumor +vow +nasal +antioch +compensate +patiently +transformers +##eded +judo +morrow +penis +posthumous +philips +bandits +husbands +denote +flaming +##any +##phones +langley +yorker +1760 +walters +##uo +##kle +gubernatorial +fatty +samsung +leroy +outlaw +##nine +unpublished +poole +jakob +##ᵢ +##ₙ +crete +distorted +superiority +##dhi +intercept +crust +mig +claus +crashes +positioning +188 +stallion +301 +frontal +armistice +##estinal +elton +aj +encompassing +camel +commemorated +malaria +woodward +calf +cigar +penetrate +##oso +willard +##rno +##uche +illustrate +amusing +convergence +noteworthy +##lma +##rva +journeys +realise +manfred +##sable +410 +##vocation +hearings +fiance +##posed +educators +provoked +adjusting +##cturing +modular +stockton +paterson +vlad +rejects +electors +selena +maureen +##tres +uber +##rce +swirled +##num +proportions +nanny +pawn +naturalist +parma +apostles +awoke +ethel +wen +##bey +monsoon +overview +##inating +mccain +rendition +risky +adorned +##ih +equestrian +germain +nj +conspicuous +confirming +##yoshi +shivering +##imeter +milestone +rumours +flinched +bounds +smacked +token +##bei +lectured +automobiles +##shore +impacted +##iable +nouns +nero +##leaf +ismail +prostitute +trams +##lace +bridget +sud +stimulus +impressions +reins +revolves +##oud +##gned +giro +honeymoon +##swell +criterion +##sms +##uil +libyan +prefers +##osition +211 +preview +sucks +accusation +bursts +metaphor +diffusion +tolerate +faye +betting +cinematographer +liturgical +specials +bitterly +humboldt +##ckle +flux +rattled +##itzer +archaeologists +odor +authorised +marshes +discretion +##ов +alarmed +archaic +inverse +##leton +explorers +##pine +drummond +tsunami +woodlands +##minate +##tland +booklet +insanity +owning +insert +crafted +calculus +##tore +receivers +##bt +stung +##eca +##nched +prevailing +travellers +eyeing +lila +graphs +##borne +178 +julien +##won +morale +adaptive +therapist +erica +cw +libertarian +bowman +pitches +vita +##ional +crook +##ads +##entation +caledonia +mutiny +##sible +1840s +automation +##ß +flock +##pia +ironic +pathology +##imus +remarried +##22 +joker +withstand +energies +##att +shropshire +hostages +madeleine +tentatively +conflicting +mateo +recipes +euros +ol +mercenaries +nico +##ndon +albuquerque +augmented +mythical +bel +freud +##child +cough +##lica +365 +freddy +lillian +genetically +nuremberg +calder +209 +bonn +outdoors +paste +suns +urgency +vin +restraint +tyson +##cera +##selle +barrage +bethlehem +kahn +##par +mounts +nippon +barony +happier +ryu +makeshift +sheldon +blushed +castillo +barking +listener +taped +bethel +fluent +headlines +pornography +rum +disclosure +sighing +mace +doubling +gunther +manly +##plex +rt +interventions +physiological +forwards +emerges +##tooth +##gny +compliment +rib +recession +visibly +barge +faults +connector +exquisite +prefect +##rlin +patio +##cured +elevators +brandt +italics +pena +173 +wasp +satin +ea +botswana +graceful +respectable +##jima +##rter +##oic +franciscan +generates +##dl +alfredo +disgusting +##olate +##iously +sherwood +warns +cod +promo +cheryl +sino +##ة +##escu +twitch +##zhi +brownish +thom +ortiz +##dron +densely +##beat +carmel +reinforce +##bana +187 +anastasia +downhill +vertex +contaminated +remembrance +harmonic +homework +##sol +fiancee +gears +olds +angelica +loft +ramsay +quiz +colliery +sevens +##cape +autism +##hil +walkway +##boats +ruben +abnormal +ounce +khmer +##bbe +zachary +bedside +morphology +punching +##olar +sparrow +convinces +##35 +hewitt +queer +remastered +rods +mabel +solemn +notified +lyricist +symmetric +##xide +174 +encore +passports +wildcats +##uni +baja +##pac +mildly +##ease +bleed +commodity +mounds +glossy +orchestras +##omo +damian +prelude +ambitions +##vet +awhile +remotely +##aud +asserts +imply +##iques +distinctly +modelling +remedy +##dded +windshield +dani +xiao +##endra +audible +powerplant +1300 +invalid +elemental +acquisitions +##hala +immaculate +libby +plata +smuggling +ventilation +denoted +minh +##morphism +430 +differed +dion +kelley +lore +mocking +sabbath +spikes +hygiene +drown +runoff +stylized +tally +liberated +aux +interpreter +righteous +aba +siren +reaper +pearce +millie +##cier +##yra +gaius +##iso +captures +##ttering +dorm +claudio +##sic +benches +knighted +blackness +##ored +discount +fumble +oxidation +routed +##ς +novak +perpendicular +spoiled +fracture +splits +##urt +pads +topology +##cats +axes +fortunate +offenders +protestants +esteem +221 +broadband +convened +frankly +hound +prototypes +isil +facilitated +keel +##sher +sahara +awaited +bubba +orb +prosecutors +186 +hem +520 +##xing +relaxing +remnant +romney +sorted +slalom +stefano +ulrich +##active +exemption +folder +pauses +foliage +hitchcock +epithet +204 +criticisms +##aca +ballistic +brody +hinduism +chaotic +youths +equals +##pala +pts +thicker +analogous +capitalist +improvised +overseeing +sinatra +ascended +beverage +##tl +straightforward +##kon +curran +##west +bois +325 +induce +surveying +emperors +sax +unpopular +##kk +cartoonist +fused +##mble +unto +##yuki +localities +##cko +##ln +darlington +slain +academie +lobbying +sediment +puzzles +##grass +defiance +dickens +manifest +tongues +alumnus +arbor +coincide +184 +appalachian +mustafa +examiner +cabaret +traumatic +yves +bracelet +draining +heroin +magnum +baths +odessa +consonants +mitsubishi +##gua +kellan +vaudeville +##fr +joked +null +straps +probation +##ław +ceded +interfaces +##pas +##zawa +blinding +viet +224 +rothschild +museo +640 +huddersfield +##vr +tactic +##storm +brackets +dazed +incorrectly +##vu +reg +glazed +fearful +manifold +benefited +irony +##sun +stumbling +##rte +willingness +balkans +mei +wraps +##aba +injected +##lea +gu +syed +harmless +##hammer +bray +takeoff +poppy +timor +cardboard +astronaut +purdue +weeping +southbound +cursing +stalls +diagonal +##neer +lamar +bryce +comte +weekdays +harrington +##uba +negatively +##see +lays +grouping +##cken +##henko +affirmed +halle +modernist +##lai +hodges +smelling +aristocratic +baptized +dismiss +justification +oilers +##now +coupling +qin +snack +healer +##qing +gardener +layla +battled +formulated +stephenson +gravitational +##gill +##jun +1768 +granny +coordinating +suites +##cd +##ioned +monarchs +##cote +##hips +sep +blended +apr +barrister +deposition +fia +mina +policemen +paranoid +##pressed +churchyard +covert +crumpled +creep +abandoning +tr +transmit +conceal +barr +understands +readiness +spire +##cology +##enia +##erry +610 +startling +unlock +vida +bowled +slots +##nat +##islav +spaced +trusting +admire +rig +##ink +slack +##70 +mv +207 +casualty +##wei +classmates +##odes +##rar +##rked +amherst +furnished +evolve +foundry +menace +mead +##lein +flu +wesleyan +##kled +monterey +webber +##vos +wil +##mith +##на +bartholomew +justices +restrained +##cke +amenities +191 +mediated +sewage +trenches +ml +mainz +##thus +1800s +##cula +##inski +caine +bonding +213 +converts +spheres +superseded +marianne +crypt +sweaty +ensign +historia +##br +spruce +##post +##ask +forks +thoughtfully +yukon +pamphlet +ames +##uter +karma +##yya +bryn +negotiation +sighs +incapable +##mbre +##ntial +actresses +taft +##mill +luce +prevailed +##amine +1773 +motionless +envoy +testify +investing +sculpted +instructors +provence +kali +cullen +horseback +##while +goodwin +##jos +gaa +norte +##ldon +modify +wavelength +abd +214 +skinned +sprinter +forecast +scheduling +marries +squared +tentative +##chman +boer +##isch +bolts +swap +fisherman +assyrian +impatiently +guthrie +martins +murdoch +194 +tanya +nicely +dolly +lacy +med +##45 +syn +decks +fashionable +millionaire +##ust +surfing +##ml +##ision +heaved +tammy +consulate +attendees +routinely +197 +fuse +saxophonist +backseat +malaya +##lord +scowl +tau +##ishly +193 +sighted +steaming +##rks +303 +911 +##holes +##hong +ching +##wife +bless +conserved +jurassic +stacey +unix +zion +chunk +rigorous +blaine +198 +peabody +slayer +dismay +brewers +nz +##jer +det +##glia +glover +postwar +int +penetration +sylvester +imitation +vertically +airlift +heiress +knoxville +viva +##uin +390 +macon +##rim +##fighter +##gonal +janice +##orescence +##wari +marius +belongings +leicestershire +196 +blanco +inverted +preseason +sanity +sobbing +##due +##elt +##dled +collingwood +regeneration +flickering +shortest +##mount +##osi +feminism +##lat +sherlock +cabinets +fumbled +northbound +precedent +snaps +##mme +researching +##akes +guillaume +insights +manipulated +vapor +neighbour +sap +gangster +frey +f1 +stalking +scarcely +callie +barnett +tendencies +audi +doomed +assessing +slung +panchayat +ambiguous +bartlett +##etto +distributing +violating +wolverhampton +##hetic +swami +histoire +##urus +liable +pounder +groin +hussain +larsen +popping +surprises +##atter +vie +curt +##station +mute +relocate +musicals +authorization +richter +##sef +immortality +tna +bombings +##press +deteriorated +yiddish +##acious +robbed +colchester +cs +pmid +ao +verified +balancing +apostle +swayed +recognizable +oxfordshire +retention +nottinghamshire +contender +judd +invitational +shrimp +uhf +##icient +cleaner +longitudinal +tanker +##mur +acronym +broker +koppen +sundance +suppliers +##gil +4000 +clipped +fuels +petite +##anne +landslide +helene +diversion +populous +landowners +auspices +melville +quantitative +##xes +ferries +nicky +##llus +doo +haunting +roche +carver +downed +unavailable +##pathy +approximation +hiroshima +##hue +garfield +valle +comparatively +keyboardist +traveler +##eit +congestion +calculating +subsidiaries +##bate +serb +modernization +fairies +deepened +ville +averages +##lore +inflammatory +tonga +##itch +co₂ +squads +##hea +gigantic +serum +enjoyment +retailer +verona +35th +cis +##phobic +magna +technicians +##vati +arithmetic +##sport +levin +##dation +amtrak +chow +sienna +##eyer +backstage +entrepreneurship +##otic +learnt +tao +##udy +worcestershire +formulation +baggage +hesitant +bali +sabotage +##kari +barren +enhancing +murmur +pl +freshly +putnam +syntax +aces +medicines +resentment +bandwidth +##sier +grins +chili +guido +##sei +framing +implying +gareth +lissa +genevieve +pertaining +admissions +geo +thorpe +proliferation +sato +bela +analyzing +parting +##gor +awakened +##isman +huddled +secrecy +##kling +hush +gentry +540 +dungeons +##ego +coasts +##utz +sacrificed +##chule +landowner +mutually +prevalence +programmer +adolescent +disrupted +seaside +gee +trusts +vamp +georgie +##nesian +##iol +schedules +sindh +##market +etched +hm +sparse +bey +beaux +scratching +gliding +unidentified +216 +collaborating +gems +jesuits +oro +accumulation +shaping +mbe +anal +##xin +231 +enthusiasts +newscast +##egan +janata +dewey +parkinson +179 +ankara +biennial +towering +dd +inconsistent +950 +##chet +thriving +terminate +cabins +furiously +eats +advocating +donkey +marley +muster +phyllis +leiden +##user +grassland +glittering +iucn +loneliness +217 +memorandum +armenians +##ddle +popularized +rhodesia +60s +lame +##illon +sans +bikini +header +orbits +##xx +##finger +##ulator +sharif +spines +biotechnology +strolled +naughty +yates +##wire +fremantle +milo +##mour +abducted +removes +##atin +humming +wonderland +##chrome +##ester +hume +pivotal +##rates +armand +grams +believers +elector +rte +apron +bis +scraped +##yria +endorsement +initials +##llation +eps +dotted +hints +buzzing +emigration +nearer +##tom +indicators +##ulu +coarse +neutron +protectorate +##uze +directional +exploits +pains +loire +1830s +proponents +guggenheim +rabbits +ritchie +305 +hectare +inputs +hutton +##raz +verify +##ako +boilers +longitude +##lev +skeletal +yer +emilia +citrus +compromised +##gau +pokemon +prescription +paragraph +eduard +cadillac +attire +categorized +kenyan +weddings +charley +##bourg +entertain +monmouth +##lles +nutrients +davey +mesh +incentive +practised +ecosystems +kemp +subdued +overheard +##rya +bodily +maxim +##nius +apprenticeship +ursula +##fight +lodged +rug +silesian +unconstitutional +patel +inspected +coyote +unbeaten +##hak +34th +disruption +convict +parcel +##cl +##nham +collier +implicated +mallory +##iac +##lab +susannah +winkler +##rber +shia +phelps +sediments +graphical +robotic +##sner +adulthood +mart +smoked +##isto +kathryn +clarified +##aran +divides +convictions +oppression +pausing +burying +##mt +federico +mathias +eileen +##tana +kite +hunched +##acies +189 +##atz +disadvantage +liza +kinetic +greedy +paradox +yokohama +dowager +trunks +ventured +##gement +gupta +vilnius +olaf +##thest +crimean +hopper +##ej +progressively +arturo +mouthed +arrondissement +##fusion +rubin +simulcast +oceania +##orum +##stra +##rred +busiest +intensely +navigator +cary +##vine +##hini +##bies +fife +rowe +rowland +posing +insurgents +shafts +lawsuits +activate +conor +inward +culturally +garlic +265 +##eering +eclectic +##hui +##kee +##nl +furrowed +vargas +meteorological +rendezvous +##aus +culinary +commencement +##dition +quota +##notes +mommy +salaries +overlapping +mule +##iology +##mology +sums +wentworth +##isk +##zione +mainline +subgroup +##illy +hack +plaintiff +verdi +bulb +differentiation +engagements +multinational +supplemented +bertrand +caller +regis +##naire +##sler +##arts +##imated +blossom +propagation +kilometer +viaduct +vineyards +##uate +beckett +optimization +golfer +songwriters +seminal +semitic +thud +volatile +evolving +ridley +##wley +trivial +distributions +scandinavia +jiang +##ject +wrestled +insistence +##dio +emphasizes +napkin +##ods +adjunct +rhyme +##ricted +##eti +hopeless +surrounds +tremble +32nd +smoky +##ntly +oils +medicinal +padded +steer +wilkes +219 +255 +concessions +hue +uniquely +blinded +landon +yahoo +##lane +hendrix +commemorating +dex +specify +chicks +##ggio +intercity +1400 +morley +##torm +highlighting +##oting +pang +oblique +stalled +##liner +flirting +newborn +1769 +bishopric +shaved +232 +currie +##ush +dharma +spartan +##ooped +favorites +smug +novella +sirens +abusive +creations +espana +##lage +paradigm +semiconductor +sheen +##rdo +##yen +##zak +nrl +renew +##pose +##tur +adjutant +marches +norma +##enity +ineffective +weimar +grunt +##gat +lordship +plotting +expenditure +infringement +lbs +refrain +av +mimi +mistakenly +postmaster +1771 +##bara +ras +motorsports +tito +199 +subjective +##zza +bully +stew +##kaya +prescott +1a +##raphic +##zam +bids +styling +paranormal +reeve +sneaking +exploding +katz +akbar +migrant +syllables +indefinitely +##ogical +destroys +replaces +applause +##phine +pest +##fide +218 +articulated +bertie +##thing +##cars +##ptic +courtroom +crowley +aesthetics +cummings +tehsil +hormones +titanic +dangerously +##ibe +stadion +jaenelle +auguste +ciudad +##chu +mysore +partisans +##sio +lucan +philipp +##aly +debating +henley +interiors +##rano +##tious +homecoming +beyonce +usher +henrietta +prepares +weeds +##oman +ely +plucked +##pire +##dable +luxurious +##aq +artifact +password +pasture +juno +maddy +minsk +##dder +##ologies +##rone +assessments +martian +royalist +1765 +examines +##mani +##rge +nino +223 +parry +scooped +relativity +##eli +##uting +##cao +congregational +noisy +traverse +##agawa +strikeouts +nickelodeon +obituary +transylvania +binds +depictions +polk +trolley +##yed +##lard +breeders +##under +dryly +hokkaido +1762 +strengths +stacks +bonaparte +connectivity +neared +prostitutes +stamped +anaheim +gutierrez +sinai +##zzling +bram +fresno +madhya +##86 +proton +##lena +##llum +##phon +reelected +wanda +##anus +##lb +ample +distinguishing +##yler +grasping +sermons +tomato +bland +stimulation +avenues +##eux +spreads +scarlett +fern +pentagon +assert +baird +chesapeake +ir +calmed +distortion +fatalities +##olis +correctional +pricing +##astic +##gina +prom +dammit +ying +collaborate +##chia +welterweight +33rd +pointer +substitution +bonded +umpire +communicating +multitude +paddle +##obe +federally +intimacy +##insky +betray +ssr +##lett +##lean +##lves +##therapy +airbus +##tery +functioned +ud +bearer +biomedical +netflix +##hire +##nca +condom +brink +ik +##nical +macy +##bet +flap +gma +experimented +jelly +lavender +##icles +##ulia +munro +##mian +##tial +rye +##rle +60th +gigs +hottest +rotated +predictions +fuji +bu +##erence +##omi +barangay +##fulness +##sas +clocks +##rwood +##liness +cereal +roe +wight +decker +uttered +babu +onion +xml +forcibly +##df +petra +sarcasm +hartley +peeled +storytelling +##42 +##xley +##ysis +##ffa +fibre +kiel +auditor +fig +harald +greenville +##berries +geographically +nell +quartz +##athic +cemeteries +##lr +crossings +nah +holloway +reptiles +chun +sichuan +snowy +660 +corrections +##ivo +zheng +ambassadors +blacksmith +fielded +fluids +hardcover +turnover +medications +melvin +academies +##erton +ro +roach +absorbing +spaniards +colton +##founded +outsider +espionage +kelsey +245 +edible +##ulf +dora +establishes +##sham +##tries +contracting +##tania +cinematic +costello +nesting +##uron +connolly +duff +##nology +mma +##mata +fergus +sexes +gi +optics +spectator +woodstock +banning +##hee +##fle +differentiate +outfielder +refinery +226 +312 +gerhard +horde +lair +drastically +##udi +landfall +##cheng +motorsport +odi +##achi +predominant +quay +skins +##ental +edna +harshly +complementary +murdering +##aves +wreckage +##90 +ono +outstretched +lennox +munitions +galen +reconcile +470 +scalp +bicycles +gillespie +questionable +rosenberg +guillermo +hostel +jarvis +kabul +volvo +opium +yd +##twined +abuses +decca +outpost +##cino +sensible +neutrality +##64 +ponce +anchorage +atkins +turrets +inadvertently +disagree +libre +vodka +reassuring +weighs +##yal +glide +jumper +ceilings +repertory +outs +stain +##bial +envy +##ucible +smashing +heightened +policing +hyun +mixes +lai +prima +##ples +celeste +##bina +lucrative +intervened +kc +manually +##rned +stature +staffed +bun +bastards +nairobi +priced +##auer +thatcher +##kia +tripped +comune +##ogan +##pled +brasil +incentives +emanuel +hereford +musica +##kim +benedictine +biennale +##lani +eureka +gardiner +rb +knocks +sha +##ael +##elled +##onate +efficacy +ventura +masonic +sanford +maize +leverage +##feit +capacities +santana +##aur +novelty +vanilla +##cter +##tour +benin +##oir +##rain +neptune +drafting +tallinn +##cable +humiliation +##boarding +schleswig +fabian +bernardo +liturgy +spectacle +sweeney +pont +routledge +##tment +cosmos +ut +hilt +sleek +universally +##eville +##gawa +typed +##dry +favors +allegheny +glaciers +##rly +recalling +aziz +##log +parasite +requiem +auf +##berto +##llin +illumination +##breaker +##issa +festivities +bows +govern +vibe +vp +333 +sprawled +larson +pilgrim +bwf +leaping +##rts +##ssel +alexei +greyhound +hoarse +##dler +##oration +seneca +##cule +gaping +##ulously +##pura +cinnamon +##gens +##rricular +craven +fantasies +houghton +engined +reigned +dictator +supervising +##oris +bogota +commentaries +unnatural +fingernails +spirituality +tighten +##tm +canadiens +protesting +intentional +cheers +sparta +##ytic +##iere +##zine +widen +belgarath +controllers +dodd +iaaf +navarre +##ication +defect +squire +steiner +whisky +##mins +560 +inevitably +tome +##gold +chew +##uid +##lid +elastic +##aby +streaked +alliances +jailed +regal +##ined +##phy +czechoslovak +narration +absently +##uld +bluegrass +guangdong +quran +criticizing +hose +hari +##liest +##owa +skier +streaks +deploy +##lom +raft +bose +dialed +huff +##eira +haifa +simplest +bursting +endings +ib +sultanate +##titled +franks +whitman +ensures +sven +##ggs +collaborators +forster +organising +ui +banished +napier +injustice +teller +layered +thump +##otti +roc +battleships +evidenced +fugitive +sadie +robotics +##roud +equatorial +geologist +##iza +yielding +##bron +##sr +internationale +mecca +##diment +sbs +skyline +toad +uploaded +reflective +undrafted +lal +leafs +bayern +##dai +lakshmi +shortlisted +##stick +##wicz +camouflage +donate +af +christi +lau +##acio +disclosed +nemesis +1761 +assemble +straining +northamptonshire +tal +##asi +bernardino +premature +heidi +42nd +coefficients +galactic +reproduce +buzzed +sensations +zionist +monsieur +myrtle +##eme +archery +strangled +musically +viewpoint +antiquities +bei +trailers +seahawks +cured +pee +preferring +tasmanian +lange +sul +##mail +##working +colder +overland +lucivar +massey +gatherings +haitian +##smith +disapproval +flaws +##cco +##enbach +1766 +npr +##icular +boroughs +creole +forums +techno +1755 +dent +abdominal +streetcar +##eson +##stream +procurement +gemini +predictable +##tya +acheron +christoph +feeder +fronts +vendor +bernhard +jammu +tumors +slang +##uber +goaltender +twists +curving +manson +vuelta +mer +peanut +confessions +pouch +unpredictable +allowance +theodor +vascular +##factory +bala +authenticity +metabolic +coughing +nanjing +##cea +pembroke +##bard +splendid +36th +ff +hourly +##ahu +elmer +handel +##ivate +awarding +thrusting +dl +experimentation +##hesion +##46 +caressed +entertained +steak +##rangle +biologist +orphans +baroness +oyster +stepfather +##dridge +mirage +reefs +speeding +##31 +barons +1764 +227 +inhabit +preached +repealed +##tral +honoring +boogie +captives +administer +johanna +##imate +gel +suspiciously +1767 +sobs +##dington +backbone +hayward +garry +##folding +##nesia +maxi +##oof +##ppe +ellison +galileo +##stand +crimea +frenzy +amour +bumper +matrices +natalia +baking +garth +palestinians +##grove +smack +conveyed +ensembles +gardening +##manship +##rup +##stituting +1640 +harvesting +topography +jing +shifters +dormitory +##carriage +##lston +ist +skulls +##stadt +dolores +jewellery +sarawak +##wai +##zier +fences +christy +confinement +tumbling +credibility +fir +stench +##bria +##plication +##nged +##sam +virtues +##belt +marjorie +pba +##eem +##made +celebrates +schooner +agitated +barley +fulfilling +anthropologist +##pro +restrict +novi +regulating +##nent +padres +##rani +##hesive +loyola +tabitha +milky +olson +proprietor +crambidae +guarantees +intercollegiate +ljubljana +hilda +##sko +ignorant +hooded +##lts +sardinia +##lidae +##vation +frontman +privileged +witchcraft +##gp +jammed +laude +poking +##than +bracket +amazement +yunnan +##erus +maharaja +linnaeus +264 +commissioning +milano +peacefully +##logies +akira +rani +regulator +##36 +grasses +##rance +luzon +crows +compiler +gretchen +seaman +edouard +tab +buccaneers +ellington +hamlets +whig +socialists +##anto +directorial +easton +mythological +##kr +##vary +rhineland +semantic +taut +dune +inventions +succeeds +##iter +replication +branched +##pired +jul +prosecuted +kangaroo +penetrated +##avian +middlesbrough +doses +bleak +madam +predatory +relentless +##vili +reluctance +##vir +hailey +crore +silvery +1759 +monstrous +swimmers +transmissions +hawthorn +informing +##eral +toilets +caracas +crouch +kb +##sett +295 +cartel +hadley +##aling +alexia +yvonne +##biology +cinderella +eton +superb +blizzard +stabbing +industrialist +maximus +##gm +##orus +groves +maud +clade +oversized +comedic +##bella +rosen +nomadic +fulham +montane +beverages +galaxies +redundant +swarm +##rot +##folia +##llis +buckinghamshire +fen +bearings +bahadur +##rom +gilles +phased +dynamite +faber +benoit +vip +##ount +##wd +booking +fractured +tailored +anya +spices +westwood +cairns +auditions +inflammation +steamed +##rocity +##acion +##urne +skyla +thereof +watford +torment +archdeacon +transforms +lulu +demeanor +fucked +serge +##sor +mckenna +minas +entertainer +##icide +caress +originate +residue +##sty +1740 +##ilised +##org +beech +##wana +subsidies +##ghton +emptied +gladstone +ru +firefighters +voodoo +##rcle +het +nightingale +tamara +edmond +ingredient +weaknesses +silhouette +285 +compatibility +withdrawing +hampson +##mona +anguish +giggling +##mber +bookstore +##jiang +southernmost +tilting +##vance +bai +economical +rf +briefcase +dreadful +hinted +projections +shattering +totaling +##rogate +analogue +indicted +periodical +fullback +##dman +haynes +##tenberg +##ffs +##ishment +1745 +thirst +stumble +penang +vigorous +##ddling +##kor +##lium +octave +##ove +##enstein +##inen +##ones +siberian +##uti +cbn +repeal +swaying +##vington +khalid +tanaka +unicorn +otago +plastered +lobe +riddle +##rella +perch +##ishing +croydon +filtered +graeme +tripoli +##ossa +crocodile +##chers +sufi +mined +##tung +inferno +lsu +##phi +swelled +utilizes +£2 +cale +periodicals +styx +hike +informally +coop +lund +##tidae +ala +hen +qui +transformations +disposed +sheath +chickens +##cade +fitzroy +sas +silesia +unacceptable +odisha +1650 +sabrina +pe +spokane +ratios +athena +massage +shen +dilemma +##drum +##riz +##hul +corona +doubtful +niall +##pha +##bino +fines +cite +acknowledging +bangor +ballard +bathurst +##resh +huron +mustered +alzheimer +garments +kinase +tyre +warship +##cp +flashback +pulmonary +braun +cheat +kamal +cyclists +constructions +grenades +ndp +traveller +excuses +stomped +signalling +trimmed +futsal +mosques +relevance +##wine +wta +##23 +##vah +##lter +hoc +##riding +optimistic +##´s +deco +sim +interacting +rejecting +moniker +waterways +##ieri +##oku +mayors +gdansk +outnumbered +pearls +##ended +##hampton +fairs +totals +dominating +262 +notions +stairway +compiling +pursed +commodities +grease +yeast +##jong +carthage +griffiths +residual +amc +contraction +laird +sapphire +##marine +##ivated +amalgamation +dissolve +inclination +lyle +packaged +altitudes +suez +canons +graded +lurched +narrowing +boasts +guise +wed +enrico +##ovsky +rower +scarred +bree +cub +iberian +protagonists +bargaining +proposing +trainers +voyages +vans +fishes +##aea +##ivist +##verance +encryption +artworks +kazan +sabre +cleopatra +hepburn +rotting +supremacy +mecklenburg +##brate +burrows +hazards +outgoing +flair +organizes +##ctions +scorpion +##usions +boo +234 +chevalier +dunedin +slapping +##34 +ineligible +pensions +##38 +##omic +manufactures +emails +bismarck +238 +weakening +blackish +ding +mcgee +quo +##rling +northernmost +xx +manpower +greed +sampson +clicking +##ange +##horpe +##inations +##roving +torre +##eptive +##moral +symbolism +38th +asshole +meritorious +outfits +splashed +biographies +sprung +astros +##tale +302 +737 +filly +raoul +nw +tokugawa +linden +clubhouse +##apa +tracts +romano +##pio +putin +tags +##note +chained +dickson +gunshot +moe +gunn +rashid +##tails +zipper +##bas +##nea +contrasted +##ply +##udes +plum +pharaoh +##pile +aw +comedies +ingrid +sandwiches +subdivisions +1100 +mariana +nokia +kamen +hz +delaney +veto +herring +##words +possessive +outlines +##roup +siemens +stairwell +rc +gallantry +messiah +palais +yells +233 +zeppelin +##dm +bolivar +##cede +smackdown +mckinley +##mora +##yt +muted +geologic +finely +unitary +avatar +hamas +maynard +rees +bog +contrasting +##rut +liv +chico +disposition +pixel +##erate +becca +dmitry +yeshiva +narratives +##lva +##ulton +mercenary +sharpe +tempered +navigate +stealth +amassed +keynes +##lini +untouched +##rrie +havoc +lithium +##fighting +abyss +graf +southward +wolverine +balloons +implements +ngos +transitions +##icum +ambushed +concacaf +dormant +economists +##dim +costing +csi +rana +universite +boulders +verity +##llon +collin +mellon +misses +cypress +fluorescent +lifeless +spence +##ulla +crewe +shepard +pak +revelations +##م +jolly +gibbons +paw +##dro +##quel +freeing +##test +shack +fries +palatine +##51 +##hiko +accompaniment +cruising +recycled +##aver +erwin +sorting +synthesizers +dyke +realities +sg +strides +enslaved +wetland +##ghan +competence +gunpowder +grassy +maroon +reactors +objection +##oms +carlson +gearbox +macintosh +radios +shelton +##sho +clergyman +prakash +254 +mongols +trophies +oricon +228 +stimuli +twenty20 +cantonese +cortes +mirrored +##saurus +bhp +cristina +melancholy +##lating +enjoyable +nuevo +##wny +downfall +schumacher +##ind +banging +lausanne +rumbled +paramilitary +reflex +ax +amplitude +migratory +##gall +##ups +midi +barnard +lastly +sherry +##hp +##nall +keystone +##kra +carleton +slippery +##53 +coloring +foe +socket +otter +##rgos +mats +##tose +consultants +bafta +bison +topping +##km +490 +primal +abandonment +transplant +atoll +hideous +mort +pained +reproduced +tae +howling +##turn +unlawful +billionaire +hotter +poised +lansing +##chang +dinamo +retro +messing +nfc +domesday +##mina +blitz +timed +##athing +##kley +ascending +gesturing +##izations +signaled +tis +chinatown +mermaid +savanna +jameson +##aint +catalina +##pet +##hers +cochrane +cy +chatting +##kus +alerted +computation +mused +noelle +majestic +mohawk +campo +octagonal +##sant +##hend +241 +aspiring +##mart +comprehend +iona +paralyzed +shimmering +swindon +rhone +##eley +reputed +configurations +pitchfork +agitation +francais +gillian +lipstick +##ilo +outsiders +pontifical +resisting +bitterness +sewer +rockies +##edd +##ucher +misleading +1756 +exiting +galloway +##nging +risked +##heart +246 +commemoration +schultz +##rka +integrating +##rsa +poses +shrieked +##weiler +guineas +gladys +jerking +owls +goldsmith +nightly +penetrating +##unced +lia +##33 +ignited +betsy +##aring +##thorpe +follower +vigorously +##rave +coded +kiran +knit +zoology +tbilisi +##28 +##bered +repository +govt +deciduous +dino +growling +##bba +enhancement +unleashed +chanting +pussy +biochemistry +##eric +kettle +repression +toxicity +nrhp +##arth +##kko +##bush +ernesto +commended +outspoken +242 +mca +parchment +sms +kristen +##aton +bisexual +raked +glamour +navajo +a2 +conditioned +showcased +##hma +spacious +youthful +##esa +usl +appliances +junta +brest +layne +conglomerate +enchanted +chao +loosened +picasso +circulating +inspect +montevideo +##centric +##kti +piazza +spurred +##aith +bari +freedoms +poultry +stamford +lieu +##ect +indigo +sarcastic +bahia +stump +attach +dvds +frankenstein +lille +approx +scriptures +pollen +##script +nmi +overseen +##ivism +tides +proponent +newmarket +inherit +milling +##erland +centralized +##rou +distributors +credentials +drawers +abbreviation +##lco +##xon +downing +uncomfortably +ripe +##oes +erase +franchises +##ever +populace +##bery +##khar +decomposition +pleas +##tet +daryl +sabah +##stle +##wide +fearless +genie +lesions +annette +##ogist +oboe +appendix +nair +dripped +petitioned +maclean +mosquito +parrot +rpg +hampered +1648 +operatic +reservoirs +##tham +irrelevant +jolt +summarized +##fp +medallion +##taff +##− +clawed +harlow +narrower +goddard +marcia +bodied +fremont +suarez +altering +tempest +mussolini +porn +##isms +sweetly +oversees +walkers +solitude +grimly +shrines +hk +ich +supervisors +hostess +dietrich +legitimacy +brushes +expressive +##yp +dissipated +##rse +localized +systemic +##nikov +gettysburg +##js +##uaries +dialogues +muttering +251 +housekeeper +sicilian +discouraged +##frey +beamed +kaladin +halftime +kidnap +##amo +##llet +1754 +synonymous +depleted +instituto +insulin +reprised +##opsis +clashed +##ctric +interrupting +radcliffe +insisting +medici +1715 +ejected +playfully +turbulent +##47 +starvation +##rini +shipment +rebellious +petersen +verification +merits +##rified +cakes +##charged +1757 +milford +shortages +spying +fidelity +##aker +emitted +storylines +harvested +seismic +##iform +cheung +kilda +theoretically +barbie +lynx +##rgy +##tius +goblin +mata +poisonous +##nburg +reactive +residues +obedience +##евич +conjecture +##rac +401 +hating +sixties +kicker +moaning +motown +##bha +emancipation +neoclassical +##hering +consoles +ebert +professorship +##tures +sustaining +assaults +obeyed +affluent +incurred +tornadoes +##eber +##zow +emphasizing +highlanders +cheated +helmets +##ctus +internship +terence +bony +executions +legislators +berries +peninsular +tinged +##aco +1689 +amplifier +corvette +ribbons +lavish +pennant +##lander +worthless +##chfield +##forms +mariano +pyrenees +expenditures +##icides +chesterfield +mandir +tailor +39th +sergey +nestled +willed +aristocracy +devotees +goodnight +raaf +rumored +weaponry +remy +appropriations +harcourt +burr +riaa +##lence +limitation +unnoticed +guo +soaking +swamps +##tica +collapsing +tatiana +descriptive +brigham +psalm +##chment +maddox +##lization +patti +caliph +##aja +akron +injuring +serra +##ganj +basins +##sari +astonished +launcher +##church +hilary +wilkins +sewing +##sf +stinging +##fia +##ncia +underwood +startup +##ition +compilations +vibrations +embankment +jurist +##nity +bard +juventus +groundwater +kern +palaces +helium +boca +cramped +marissa +soto +##worm +jae +princely +##ggy +faso +bazaar +warmly +##voking +229 +pairing +##lite +##grate +##nets +wien +freaked +ulysses +rebirth +##alia +##rent +mummy +guzman +jimenez +stilled +##nitz +trajectory +tha +woken +archival +professions +##pts +##pta +hilly +shadowy +shrink +##bolt +norwood +glued +migrate +stereotypes +devoid +##pheus +625 +evacuate +horrors +infancy +gotham +knowles +optic +downloaded +sachs +kingsley +parramatta +darryl +mor +##onale +shady +commence +confesses +kan +##meter +##placed +marlborough +roundabout +regents +frigates +io +##imating +gothenburg +revoked +carvings +clockwise +convertible +intruder +##sche +banged +##ogo +vicky +bourgeois +##mony +dupont +footing +##gum +pd +##real +buckle +yun +penthouse +sane +720 +serviced +stakeholders +neumann +bb +##eers +comb +##gam +catchment +pinning +rallies +typing +##elles +forefront +freiburg +sweetie +giacomo +widowed +goodwill +worshipped +aspirations +midday +##vat +fishery +##trick +bournemouth +turk +243 +hearth +ethanol +guadalajara +murmurs +sl +##uge +afforded +scripted +##hta +wah +##jn +coroner +translucent +252 +memorials +puck +progresses +clumsy +##race +315 +candace +recounted +##27 +##slin +##uve +filtering +##mac +howl +strata +heron +leveled +##ays +dubious +##oja +##т +##wheel +citations +exhibiting +##laya +##mics +##pods +turkic +##lberg +injunction +##ennial +##mit +antibodies +##44 +organise +##rigues +cardiovascular +cushion +inverness +##zquez +dia +cocoa +sibling +##tman +##roid +expanse +feasible +tunisian +algiers +##relli +rus +bloomberg +dso +westphalia +bro +tacoma +281 +downloads +##ours +konrad +duran +##hdi +continuum +jett +compares +legislator +secession +##nable +##gues +##zuka +translating +reacher +##gley +##ła +aleppo +##agi +tc +orchards +trapping +linguist +versatile +drumming +postage +calhoun +superiors +##mx +barefoot +leary +##cis +ignacio +alfa +kaplan +##rogen +bratislava +mori +##vot +disturb +haas +313 +cartridges +gilmore +radiated +salford +tunic +hades +##ulsive +archeological +delilah +magistrates +auditioned +brewster +charters +empowerment +blogs +cappella +dynasties +iroquois +whipping +##krishna +raceway +truths +myra +weaken +judah +mcgregor +##horse +mic +refueling +37th +burnley +bosses +markus +premio +query +##gga +dunbar +##economic +darkest +lyndon +sealing +commendation +reappeared +##mun +addicted +ezio +slaughtered +satisfactory +shuffle +##eves +##thic +##uj +fortification +warrington +##otto +resurrected +fargo +mane +##utable +##lei +##space +foreword +ox +##aris +##vern +abrams +hua +##mento +sakura +##alo +uv +sentimental +##skaya +midfield +##eses +sturdy +scrolls +macleod +##kyu +entropy +##lance +mitochondrial +cicero +excelled +thinner +convoys +perceive +##oslav +##urable +systematically +grind +burkina +287 +##tagram +ops +##aman +guantanamo +##cloth +##tite +forcefully +wavy +##jou +pointless +##linger +##tze +layton +portico +superficial +clerical +outlaws +##hism +burials +muir +##inn +creditors +hauling +rattle +##leg +calais +monde +archers +reclaimed +dwell +wexford +hellenic +falsely +remorse +##tek +dough +furnishings +##uttered +gabon +neurological +novice +##igraphy +contemplated +pulpit +nightstand +saratoga +##istan +documenting +pulsing +taluk +##firmed +busted +marital +##rien +disagreements +wasps +##yes +hodge +mcdonnell +mimic +fran +pendant +dhabi +musa +##nington +congratulations +argent +darrell +concussion +losers +regrets +thessaloniki +reversal +donaldson +hardwood +thence +achilles +ritter +##eran +demonic +jurgen +prophets +goethe +eki +classmate +buff +##cking +yank +irrational +##inging +perished +seductive +qur +sourced +##crat +##typic +mustard +ravine +barre +horizontally +characterization +phylogenetic +boise +##dit +##runner +##tower +brutally +intercourse +seduce +##bbing +fay +ferris +ogden +amar +nik +unarmed +##inator +evaluating +kyrgyzstan +sweetness +##lford +##oki +mccormick +meiji +notoriety +stimulate +disrupt +figuring +instructional +mcgrath +##zoo +groundbreaking +##lto +flinch +khorasan +agrarian +bengals +mixer +radiating +##sov +ingram +pitchers +nad +tariff +##cript +tata +##codes +##emi +##ungen +appellate +lehigh +##bled +##giri +brawl +duct +texans +##ciation +##ropolis +skipper +speculative +vomit +doctrines +stresses +253 +davy +graders +whitehead +jozef +timely +cumulative +haryana +paints +appropriately +boon +cactus +##ales +##pid +dow +legions +##pit +perceptions +1730 +picturesque +##yse +periphery +rune +wr +##aha +celtics +sentencing +whoa +##erin +confirms +variance +425 +moines +mathews +spade +rave +m1 +fronted +fx +blending +alleging +reared +##gl +237 +##paper +grassroots +eroded +##free +##physical +directs +ordeal +##sław +accelerate +hacker +rooftop +##inia +lev +buys +cebu +devote +##lce +specialising +##ulsion +choreographed +repetition +warehouses +##ryl +paisley +tuscany +analogy +sorcerer +hash +huts +shards +descends +exclude +nix +chaplin +gaga +ito +vane +##drich +causeway +misconduct +limo +orchestrated +glands +jana +##kot +u2 +##mple +##sons +branching +contrasts +scoop +longed +##virus +chattanooga +##75 +syrup +cornerstone +##tized +##mind +##iaceae +careless +precedence +frescoes +##uet +chilled +consult +modelled +snatch +peat +##thermal +caucasian +humane +relaxation +spins +temperance +##lbert +occupations +lambda +hybrids +moons +mp3 +##oese +247 +rolf +societal +yerevan +ness +##ssler +befriended +mechanized +nominate +trough +boasted +cues +seater +##hom +bends +##tangle +conductors +emptiness +##lmer +eurasian +adriatic +tian +##cie +anxiously +lark +propellers +chichester +jock +ev +2a +##holding +credible +recounts +tori +loyalist +abduction +##hoot +##redo +nepali +##mite +ventral +tempting +##ango +##crats +steered +##wice +javelin +dipping +laborers +prentice +looming +titanium +##ː +badges +emir +tensor +##ntation +egyptians +rash +denies +hawthorne +lombard +showers +wehrmacht +dietary +trojan +##reus +welles +executing +horseshoe +lifeboat +##lak +elsa +infirmary +nearing +roberta +boyer +mutter +trillion +joanne +##fine +##oked +sinks +vortex +uruguayan +clasp +sirius +##block +accelerator +prohibit +sunken +byu +chronological +diplomats +ochreous +510 +symmetrical +1644 +maia +##tology +salts +reigns +atrocities +##ия +hess +bared +issn +##vyn +cater +saturated +##cycle +##isse +sable +voyager +dyer +yusuf +##inge +fountains +wolff +##39 +##nni +engraving +rollins +atheist +ominous +##ault +herr +chariot +martina +strung +##fell +##farlane +horrific +sahib +gazes +saetan +erased +ptolemy +##olic +flushing +lauderdale +analytic +##ices +530 +navarro +beak +gorilla +herrera +broom +guadalupe +raiding +sykes +311 +bsc +deliveries +1720 +invasions +carmichael +tajikistan +thematic +ecumenical +sentiments +onstage +##rians +##brand +##sume +catastrophic +flanks +molten +##arns +waller +aimee +terminating +##icing +alternately +##oche +nehru +printers +outraged +##eving +empires +template +banners +repetitive +za +##oise +vegetarian +##tell +guiana +opt +cavendish +lucknow +synthesized +##hani +##mada +finalized +##ctable +fictitious +mayoral +unreliable +##enham +embracing +peppers +rbis +##chio +##neo +inhibition +slashed +togo +orderly +embroidered +safari +salty +236 +barron +benito +totaled +##dak +pubs +simulated +caden +devin +tolkien +momma +welding +sesame +##ept +gottingen +hardness +630 +shaman +temeraire +620 +adequately +pediatric +##kit +ck +assertion +radicals +composure +cadence +seafood +beaufort +lazarus +mani +warily +cunning +kurdistan +249 +cantata +##kir +ares +##41 +##clusive +nape +townland +geared +insulted +flutter +boating +violate +draper +dumping +malmo +##hh +##romatic +firearm +alta +bono +obscured +##clave +exceeds +panorama +unbelievable +##train +preschool +##essed +disconnected +installing +rescuing +secretaries +accessibility +##castle +##drive +##ifice +##film +bouts +slug +waterway +mindanao +##buro +##ratic +halves +##ل +calming +liter +maternity +adorable +bragg +electrification +mcc +##dote +roxy +schizophrenia +##body +munoz +kaye +whaling +239 +mil +tingling +tolerant +##ago +unconventional +volcanoes +##finder +deportivo +##llie +robson +kaufman +neuroscience +wai +deportation +masovian +scraping +converse +##bh +hacking +bulge +##oun +administratively +yao +580 +amp +mammoth +booster +claremont +hooper +nomenclature +pursuits +mclaughlin +melinda +##sul +catfish +barclay +substrates +taxa +zee +originals +kimberly +packets +padma +##ality +borrowing +ostensibly +solvent +##bri +##genesis +##mist +lukas +shreveport +veracruz +##ь +##lou +##wives +cheney +tt +anatolia +hobbs +##zyn +cyclic +radiant +alistair +greenish +siena +dat +independents +##bation +conform +pieter +hyper +applicant +bradshaw +spores +telangana +vinci +inexpensive +nuclei +322 +jang +nme +soho +spd +##ign +cradled +receptionist +pow +##43 +##rika +fascism +##ifer +experimenting +##ading +##iec +##region +345 +jocelyn +maris +stair +nocturnal +toro +constabulary +elgin +##kker +msc +##giving +##schen +##rase +doherty +doping +sarcastically +batter +maneuvers +##cano +##apple +##gai +##git +intrinsic +##nst +##stor +1753 +showtime +cafes +gasps +lviv +ushered +##thed +fours +restart +astonishment +transmitting +flyer +shrugs +##sau +intriguing +cones +dictated +mushrooms +medial +##kovsky +##elman +escorting +gaped +##26 +godfather +##door +##sell +djs +recaptured +timetable +vila +1710 +3a +aerodrome +mortals +scientology +##orne +angelina +mag +convection +unpaid +insertion +intermittent +lego +##nated +endeavor +kota +pereira +##lz +304 +bwv +glamorgan +insults +agatha +fey +##cend +fleetwood +mahogany +protruding +steamship +zeta +##arty +mcguire +suspense +##sphere +advising +urges +##wala +hurriedly +meteor +gilded +inline +arroyo +stalker +##oge +excitedly +revered +##cure +earle +introductory +##break +##ilde +mutants +puff +pulses +reinforcement +##haling +curses +lizards +stalk +correlated +##fixed +fallout +macquarie +##unas +bearded +denton +heaving +802 +##ocation +winery +assign +dortmund +##lkirk +everest +invariant +charismatic +susie +##elling +bled +lesley +telegram +sumner +bk +##ogen +##к +wilcox +needy +colbert +duval +##iferous +##mbled +allotted +attends +imperative +##hita +replacements +hawker +##inda +insurgency +##zee +##eke +casts +##yla +680 +ives +transitioned +##pack +##powering +authoritative +baylor +flex +cringed +plaintiffs +woodrow +##skie +drastic +ape +aroma +unfolded +commotion +nt +preoccupied +theta +routines +lasers +privatization +wand +domino +ek +clenching +nsa +strategically +showered +bile +handkerchief +pere +storing +christophe +insulting +316 +nakamura +romani +asiatic +magdalena +palma +cruises +stripping +405 +konstantin +soaring +##berman +colloquially +forerunner +havilland +incarcerated +parasites +sincerity +##utus +disks +plank +saigon +##ining +corbin +homo +ornaments +powerhouse +##tlement +chong +fastened +feasibility +idf +morphological +usable +##nish +##zuki +aqueduct +jaguars +keepers +##flies +aleksandr +faust +assigns +ewing +bacterium +hurled +tricky +hungarians +integers +wallis +321 +yamaha +##isha +hushed +oblivion +aviator +evangelist +friars +##eller +monograph +ode +##nary +airplanes +labourers +charms +##nee +1661 +hagen +tnt +rudder +fiesta +transcript +dorothea +ska +inhibitor +maccabi +retorted +raining +encompassed +clauses +menacing +1642 +lineman +##gist +vamps +##ape +##dick +gloom +##rera +dealings +easing +seekers +##nut +##pment +helens +unmanned +##anu +##isson +basics +##amy +##ckman +adjustments +1688 +brutality +horne +##zell +sui +##55 +##mable +aggregator +##thal +rhino +##drick +##vira +counters +zoom +##01 +##rting +mn +montenegrin +packard +##unciation +##♭ +##kki +reclaim +scholastic +thugs +pulsed +##icia +syriac +quan +saddam +banda +kobe +blaming +buddies +dissent +##lusion +##usia +corbett +jaya +delle +erratic +lexie +##hesis +435 +amiga +hermes +##pressing +##leen +chapels +gospels +jamal +##uating +compute +revolving +warp +##sso +##thes +armory +##eras +##gol +antrim +loki +##kow +##asian +##good +##zano +braid +handwriting +subdistrict +funky +pantheon +##iculate +concurrency +estimation +improper +juliana +##his +newcomers +johnstone +staten +communicated +##oco +##alle +sausage +stormy +##stered +##tters +superfamily +##grade +acidic +collateral +tabloid +##oped +##rza +bladder +austen +##ellant +mcgraw +##hay +hannibal +mein +aquino +lucifer +wo +badger +boar +cher +christensen +greenberg +interruption +##kken +jem +244 +mocked +bottoms +cambridgeshire +##lide +sprawling +##bbly +eastwood +ghent +synth +##buck +advisers +##bah +nominally +hapoel +qu +daggers +estranged +fabricated +towels +vinnie +wcw +misunderstanding +anglia +nothin +unmistakable +##dust +##lova +chilly +marquette +truss +##edge +##erine +reece +##lty +##chemist +##connected +272 +308 +41st +bash +raion +waterfalls +##ump +##main +labyrinth +queue +theorist +##istle +bharatiya +flexed +soundtracks +rooney +leftist +patrolling +wharton +plainly +alleviate +eastman +schuster +topographic +engages +immensely +unbearable +fairchild +1620 +dona +lurking +parisian +oliveira +ia +indictment +hahn +bangladeshi +##aster +vivo +##uming +##ential +antonia +expects +indoors +kildare +harlan +##logue +##ogenic +##sities +forgiven +##wat +childish +tavi +##mide +##orra +plausible +grimm +successively +scooted +##bola +##dget +##rith +spartans +emery +flatly +azure +epilogue +##wark +flourish +##iny +##tracted +##overs +##oshi +bestseller +distressed +receipt +spitting +hermit +topological +##cot +drilled +subunit +francs +##layer +eel +##fk +##itas +octopus +footprint +petitions +ufo +##say +##foil +interfering +leaking +palo +##metry +thistle +valiant +##pic +narayan +mcpherson +##fast +gonzales +##ym +##enne +dustin +novgorod +solos +##zman +doin +##raph +##patient +##meyer +soluble +ashland +cuffs +carole +pendleton +whistling +vassal +##river +deviation +revisited +constituents +rallied +rotate +loomed +##eil +##nting +amateurs +augsburg +auschwitz +crowns +skeletons +##cona +bonnet +257 +dummy +globalization +simeon +sleeper +mandal +differentiated +##crow +##mare +milne +bundled +exasperated +talmud +owes +segregated +##feng +##uary +dentist +piracy +props +##rang +devlin +##torium +malicious +paws +##laid +dependency +##ergy +##fers +##enna +258 +pistons +rourke +jed +grammatical +tres +maha +wig +512 +ghostly +jayne +##achal +##creen +##ilis +##lins +##rence +designate +##with +arrogance +cambodian +clones +showdown +throttle +twain +##ception +lobes +metz +nagoya +335 +braking +##furt +385 +roaming +##minster +amin +crippled +##37 +##llary +indifferent +hoffmann +idols +intimidating +1751 +261 +influenza +memo +onions +1748 +bandage +consciously +##landa +##rage +clandestine +observes +swiped +tangle +##ener +##jected +##trum +##bill +##lta +hugs +congresses +josiah +spirited +##dek +humanist +managerial +filmmaking +inmate +rhymes +debuting +grimsby +ur +##laze +duplicate +vigor +##tf +republished +bolshevik +refurbishment +antibiotics +martini +methane +newscasts +royale +horizons +levant +iain +visas +##ischen +paler +##around +manifestation +snuck +alf +chop +futile +pedestal +rehab +##kat +bmg +kerman +res +fairbanks +jarrett +abstraction +saharan +##zek +1746 +procedural +clearer +kincaid +sash +luciano +##ffey +crunch +helmut +##vara +revolutionaries +##tute +creamy +leach +##mmon +1747 +permitting +nes +plight +wendell +##lese +contra +ts +clancy +ipa +mach +staples +autopsy +disturbances +nueva +karin +pontiac +##uding +proxy +venerable +haunt +leto +bergman +expands +##helm +wal +##pipe +canning +celine +cords +obesity +##enary +intrusion +planner +##phate +reasoned +sequencing +307 +harrow +##chon +##dora +marred +mcintyre +repay +tarzan +darting +248 +harrisburg +margarita +repulsed +##hur +##lding +belinda +hamburger +novo +compliant +runways +bingham +registrar +skyscraper +ic +cuthbert +improvisation +livelihood +##corp +##elial +admiring +##dened +sporadic +believer +casablanca +popcorn +##29 +asha +shovel +##bek +##dice +coiled +tangible +##dez +casper +elsie +resin +tenderness +rectory +##ivision +avail +sonar +##mori +boutique +##dier +guerre +bathed +upbringing +vaulted +sandals +blessings +##naut +##utnant +1680 +306 +foxes +pia +corrosion +hesitantly +confederates +crystalline +footprints +shapiro +tirana +valentin +drones +45th +microscope +shipments +texted +inquisition +wry +guernsey +unauthorized +resigning +760 +ripple +schubert +stu +reassure +felony +##ardo +brittle +koreans +##havan +##ives +dun +implicit +tyres +##aldi +##lth +magnolia +##ehan +##puri +##poulos +aggressively +fei +gr +familiarity +##poo +indicative +##trust +fundamentally +jimmie +overrun +395 +anchors +moans +##opus +britannia +armagh +##ggle +purposely +seizing +##vao +bewildered +mundane +avoidance +cosmopolitan +geometridae +quartermaster +caf +415 +chatter +engulfed +gleam +purge +##icate +juliette +jurisprudence +guerra +revisions +##bn +casimir +brew +##jm +1749 +clapton +cloudy +conde +hermitage +278 +simulations +torches +vincenzo +matteo +##rill +hidalgo +booming +westbound +accomplishment +tentacles +unaffected +##sius +annabelle +flopped +sloping +##litz +dreamer +interceptor +vu +##loh +consecration +copying +messaging +breaker +climates +hospitalized +1752 +torino +afternoons +winfield +witnessing +##teacher +breakers +choirs +sawmill +coldly +##ege +sipping +haste +uninhabited +conical +bibliography +pamphlets +severn +edict +##oca +deux +illnesses +grips +##pl +rehearsals +sis +thinkers +tame +##keepers +1690 +acacia +reformer +##osed +##rys +shuffling +##iring +##shima +eastbound +ionic +rhea +flees +littered +##oum +rocker +vomiting +groaning +champ +overwhelmingly +civilizations +paces +sloop +adoptive +##tish +skaters +##vres +aiding +mango +##joy +nikola +shriek +##ignon +pharmaceuticals +##mg +tuna +calvert +gustavo +stocked +yearbook +##urai +##mana +computed +subsp +riff +hanoi +kelvin +hamid +moors +pastures +summons +jihad +nectar +##ctors +bayou +untitled +pleasing +vastly +republics +intellect +##η +##ulio +##tou +crumbling +stylistic +sb +##ی +consolation +frequented +h₂o +walden +widows +##iens +404 +##ignment +chunks +improves +288 +grit +recited +##dev +snarl +sociological +##arte +##gul +inquired +##held +bruise +clube +consultancy +homogeneous +hornets +multiplication +pasta +prick +savior +##grin +##kou +##phile +yoon +##gara +grimes +vanishing +cheering +reacting +bn +distillery +##quisite +##vity +coe +dockyard +massif +##jord +escorts +voss +##valent +byte +chopped +hawke +illusions +workings +floats +##koto +##vac +kv +annapolis +madden +##onus +alvaro +noctuidae +##cum +##scopic +avenge +steamboat +forte +illustrates +erika +##trip +570 +dew +nationalities +bran +manifested +thirsty +diversified +muscled +reborn +##standing +arson +##lessness +##dran +##logram +##boys +##kushima +##vious +willoughby +##phobia +286 +alsace +dashboard +yuki +##chai +granville +myspace +publicized +tricked +##gang +adjective +##ater +relic +reorganisation +enthusiastically +indications +saxe +##lassified +consolidate +iec +padua +helplessly +ramps +renaming +regulars +pedestrians +accents +convicts +inaccurate +lowers +mana +##pati +barrie +bjp +outta +someplace +berwick +flanking +invoked +marrow +sparsely +excerpts +clothed +rei +##ginal +wept +##straße +##vish +alexa +excel +##ptive +membranes +aquitaine +creeks +cutler +sheppard +implementations +ns +##dur +fragrance +budge +concordia +magnesium +marcelo +##antes +gladly +vibrating +##rral +##ggles +montrose +##omba +lew +seamus +1630 +cocky +##ament +##uen +bjorn +##rrick +fielder +fluttering +##lase +methyl +kimberley +mcdowell +reductions +barbed +##jic +##tonic +aeronautical +condensed +distracting +##promising +huffed +##cala +##sle +claudius +invincible +missy +pious +balthazar +ci +##lang +butte +combo +orson +##dication +myriad +1707 +silenced +##fed +##rh +coco +netball +yourselves +##oza +clarify +heller +peg +durban +etudes +offender +roast +blackmail +curvature +##woods +vile +309 +illicit +suriname +##linson +overture +1685 +bubbling +gymnast +tucking +##mming +##ouin +maldives +##bala +gurney +##dda +##eased +##oides +backside +pinto +jars +racehorse +tending +##rdial +baronetcy +wiener +duly +##rke +barbarian +cupping +flawed +##thesis +bertha +pleistocene +puddle +swearing +##nob +##tically +fleeting +prostate +amulet +educating +##mined +##iti +##tler +75th +jens +respondents +analytics +cavaliers +papacy +raju +##iente +##ulum +##tip +funnel +271 +disneyland +##lley +sociologist +##iam +2500 +faulkner +louvre +menon +##dson +276 +##ower +afterlife +mannheim +peptide +referees +comedians +meaningless +##anger +##laise +fabrics +hurley +renal +sleeps +##bour +##icle +breakout +kristin +roadside +animator +clover +disdain +unsafe +redesign +##urity +firth +barnsley +portage +reset +narrows +268 +commandos +expansive +speechless +tubular +##lux +essendon +eyelashes +smashwords +##yad +##bang +##claim +craved +sprinted +chet +somme +astor +wrocław +orton +266 +bane +##erving +##uing +mischief +##amps +##sund +scaling +terre +##xious +impairment +offenses +undermine +moi +soy +contiguous +arcadia +inuit +seam +##tops +macbeth +rebelled +##icative +##iot +590 +elaborated +frs +uniformed +##dberg +259 +powerless +priscilla +stimulated +980 +qc +arboretum +frustrating +trieste +bullock +##nified +enriched +glistening +intern +##adia +locus +nouvelle +ollie +ike +lash +starboard +ee +tapestry +headlined +hove +rigged +##vite +pollock +##yme +thrive +clustered +cas +roi +gleamed +olympiad +##lino +pressured +regimes +##hosis +##lick +ripley +##ophone +kickoff +gallon +rockwell +##arable +crusader +glue +revolutions +scrambling +1714 +grover +##jure +englishman +aztec +263 +contemplating +coven +ipad +preach +triumphant +tufts +##esian +rotational +##phus +328 +falkland +##brates +strewn +clarissa +rejoin +environmentally +glint +banded +drenched +moat +albanians +johor +rr +maestro +malley +nouveau +shaded +taxonomy +v6 +adhere +bunk +airfields +##ritan +1741 +encompass +remington +tran +##erative +amelie +mazda +friar +morals +passions +##zai +breadth +vis +##hae +argus +burnham +caressing +insider +rudd +##imov +##mini +##rso +italianate +murderous +textual +wainwright +armada +bam +weave +timer +##taken +##nh +fra +##crest +ardent +salazar +taps +tunis +##ntino +allegro +gland +philanthropic +##chester +implication +##optera +esq +judas +noticeably +wynn +##dara +inched +indexed +crises +villiers +bandit +royalties +patterned +cupboard +interspersed +accessory +isla +kendrick +entourage +stitches +##esthesia +headwaters +##ior +interlude +distraught +draught +1727 +##basket +biased +sy +transient +triad +subgenus +adapting +kidd +shortstop +##umatic +dimly +spiked +mcleod +reprint +nellie +pretoria +windmill +##cek +singled +##mps +273 +reunite +##orous +747 +bankers +outlying +##omp +##ports +##tream +apologies +cosmetics +patsy +##deh +##ocks +##yson +bender +nantes +serene +##nad +lucha +mmm +323 +##cius +##gli +cmll +coinage +nestor +juarez +##rook +smeared +sprayed +twitching +sterile +irina +embodied +juveniles +enveloped +miscellaneous +cancers +dq +gulped +luisa +crested +swat +donegal +ref +##anov +##acker +hearst +mercantile +##lika +doorbell +ua +vicki +##alla +##som +bilbao +psychologists +stryker +sw +horsemen +turkmenistan +wits +##national +anson +mathew +screenings +##umb +rihanna +##agne +##nessy +aisles +##iani +##osphere +hines +kenton +saskatoon +tasha +truncated +##champ +##itan +mildred +advises +fredrik +interpreting +inhibitors +##athi +spectroscopy +##hab +##kong +karim +panda +##oia +##nail +##vc +conqueror +kgb +leukemia +##dity +arrivals +cheered +pisa +phosphorus +shielded +##riated +mammal +unitarian +urgently +chopin +sanitary +##mission +spicy +drugged +hinges +##tort +tipping +trier +impoverished +westchester +##caster +267 +epoch +nonstop +##gman +##khov +aromatic +centrally +cerro +##tively +##vio +billions +modulation +sedimentary +283 +facilitating +outrageous +goldstein +##eak +##kt +ld +maitland +penultimate +pollard +##dance +fleets +spaceship +vertebrae +##nig +alcoholism +als +recital +##bham +##ference +##omics +m2 +##bm +trois +##tropical +##в +commemorates +##meric +marge +##raction +1643 +670 +cosmetic +ravaged +##ige +catastrophe +eng +##shida +albrecht +arterial +bellamy +decor +harmon +##rde +bulbs +synchronized +vito +easiest +shetland +shielding +wnba +##glers +##ssar +##riam +brianna +cumbria +##aceous +##rard +cores +thayer +##nsk +brood +hilltop +luminous +carts +keynote +larkin +logos +##cta +##ا +##mund +##quay +lilith +tinted +277 +wrestle +mobilization +##uses +sequential +siam +bloomfield +takahashi +274 +##ieving +presenters +ringo +blazed +witty +##oven +##ignant +devastation +haydn +harmed +newt +therese +##peed +gershwin +molina +rabbis +sudanese +001 +innate +restarted +##sack +##fus +slices +wb +##shah +enroll +hypothetical +hysterical +1743 +fabio +indefinite +warped +##hg +exchanging +525 +unsuitable +##sboro +gallo +1603 +bret +cobalt +homemade +##hunter +mx +operatives +##dhar +terraces +durable +latch +pens +whorls +##ctuated +##eaux +billing +ligament +succumbed +##gly +regulators +spawn +##brick +##stead +filmfare +rochelle +##nzo +1725 +circumstance +saber +supplements +##nsky +##tson +crowe +wellesley +carrot +##9th +##movable +primate +drury +sincerely +topical +##mad +##rao +callahan +kyiv +smarter +tits +undo +##yeh +announcements +anthologies +barrio +nebula +##islaus +##shaft +##tyn +bodyguards +2021 +assassinate +barns +emmett +scully +##mah +##yd +##eland +##tino +##itarian +demoted +gorman +lashed +prized +adventist +writ +##gui +alla +invertebrates +##ausen +1641 +amman +1742 +align +healy +redistribution +##gf +##rize +insulation +##drop +adherents +hezbollah +vitro +ferns +yanking +269 +php +registering +uppsala +cheerleading +confines +mischievous +tully +##ross +49th +docked +roam +stipulated +pumpkin +##bry +prompt +##ezer +blindly +shuddering +craftsmen +frail +scented +katharine +scramble +shaggy +sponge +helix +zaragoza +279 +##52 +43rd +backlash +fontaine +seizures +posse +cowan +nonfiction +telenovela +wwii +hammered +undone +##gpur +encircled +irs +##ivation +artefacts +oneself +searing +smallpox +##belle +##osaurus +shandong +breached +upland +blushing +rankin +infinitely +psyche +tolerated +docking +evicted +##col +unmarked +##lving +gnome +lettering +litres +musique +##oint +benevolent +##jal +blackened +##anna +mccall +racers +tingle +##ocene +##orestation +introductions +radically +292 +##hiff +##باد +1610 +1739 +munchen +plead +##nka +condo +scissors +##sight +##tens +apprehension +##cey +##yin +hallmark +watering +formulas +sequels +##llas +aggravated +bae +commencing +##building +enfield +prohibits +marne +vedic +civilized +euclidean +jagger +beforehand +blasts +dumont +##arney +##nem +740 +conversions +hierarchical +rios +simulator +##dya +##lellan +hedges +oleg +thrusts +shadowed +darby +maximize +1744 +gregorian +##nded +##routed +sham +unspecified +##hog +emory +factual +##smo +##tp +fooled +##rger +ortega +wellness +marlon +##oton +##urance +casket +keating +ley +enclave +##ayan +char +influencing +jia +##chenko +412 +ammonia +erebidae +incompatible +violins +cornered +##arat +grooves +astronauts +columbian +rampant +fabrication +kyushu +mahmud +vanish +##dern +mesopotamia +##lete +ict +##rgen +caspian +kenji +pitted +##vered +999 +grimace +roanoke +tchaikovsky +twinned +##analysis +##awan +xinjiang +arias +clemson +kazakh +sizable +1662 +##khand +##vard +plunge +tatum +vittorio +##nden +cholera +##dana +##oper +bracing +indifference +projectile +superliga +##chee +realises +upgrading +299 +porte +retribution +##vies +nk +stil +##resses +ama +bureaucracy +blackberry +bosch +testosterone +collapses +greer +##pathic +ioc +fifties +malls +##erved +bao +baskets +adolescents +siegfried +##osity +##tosis +mantra +detecting +existent +fledgling +##cchi +dissatisfied +gan +telecommunication +mingled +sobbed +6000 +controversies +outdated +taxis +##raus +fright +slams +##lham +##fect +##tten +detectors +fetal +tanned +##uw +fray +goth +olympian +skipping +mandates +scratches +sheng +unspoken +hyundai +tracey +hotspur +restrictive +##buch +americana +mundo +##bari +burroughs +diva +vulcan +##6th +distinctions +thumping +##ngen +mikey +sheds +fide +rescues +springsteen +vested +valuation +##ece +##ely +pinnacle +rake +sylvie +##edo +almond +quivering +##irus +alteration +faltered +##wad +51st +hydra +ticked +##kato +recommends +##dicated +antigua +arjun +stagecoach +wilfred +trickle +pronouns +##pon +aryan +nighttime +##anian +gall +pea +stitch +##hei +leung +milos +##dini +eritrea +nexus +starved +snowfall +kant +parasitic +cot +discus +hana +strikers +appleton +kitchens +##erina +##partisan +##itha +##vius +disclose +metis +##channel +1701 +tesla +##vera +fitch +1735 +blooded +##tila +decimal +##tang +##bai +cyclones +eun +bottled +peas +pensacola +basha +bolivian +crabs +boil +lanterns +partridge +roofed +1645 +necks +##phila +opined +patting +##kla +##lland +chuckles +volta +whereupon +##nche +devout +euroleague +suicidal +##dee +inherently +involuntary +knitting +nasser +##hide +puppets +colourful +courageous +southend +stills +miraculous +hodgson +richer +rochdale +ethernet +greta +uniting +prism +umm +##haya +##itical +##utation +deterioration +pointe +prowess +##ropriation +lids +scranton +billings +subcontinent +##koff +##scope +brute +kellogg +psalms +degraded +##vez +stanisław +##ructured +ferreira +pun +astonishing +gunnar +##yat +arya +prc +gottfried +##tight +excursion +##ographer +dina +##quil +##nare +huffington +illustrious +wilbur +gundam +verandah +##zard +naacp +##odle +constructive +fjord +kade +##naud +generosity +thrilling +baseline +cayman +frankish +plastics +accommodations +zoological +##fting +cedric +qb +motorized +##dome +##otted +squealed +tackled +canucks +budgets +situ +asthma +dail +gabled +grasslands +whimpered +writhing +judgments +##65 +minnie +pv +##carbon +bananas +grille +domes +monique +odin +maguire +markham +tierney +##estra +##chua +libel +poke +speedy +atrium +laval +notwithstanding +##edly +fai +kala +##sur +robb +##sma +listings +luz +supplementary +tianjin +##acing +enzo +jd +ric +scanner +croats +transcribed +##49 +arden +cv +##hair +##raphy +##lver +##uy +357 +seventies +staggering +alam +horticultural +hs +regression +timbers +blasting +##ounded +montagu +manipulating +##cit +catalytic +1550 +troopers +##meo +condemnation +fitzpatrick +##oire +##roved +inexperienced +1670 +castes +##lative +outing +314 +dubois +flicking +quarrel +ste +learners +1625 +iq +whistled +##class +282 +classify +tariffs +temperament +355 +folly +liszt +##yles +immersed +jordanian +ceasefire +apparel +extras +maru +fished +##bio +harta +stockport +assortment +craftsman +paralysis +transmitters +##cola +blindness +##wk +fatally +proficiency +solemnly +##orno +repairing +amore +groceries +ultraviolet +##chase +schoolhouse +##tua +resurgence +nailed +##otype +##× +ruse +saliva +diagrams +##tructing +albans +rann +thirties +1b +antennas +hilarious +cougars +paddington +stats +##eger +breakaway +ipod +reza +authorship +prohibiting +scoffed +##etz +##ttle +conscription +defected +trondheim +##fires +ivanov +keenan +##adan +##ciful +##fb +##slow +locating +##ials +##tford +cadiz +basalt +blankly +interned +rags +rattling +##tick +carpathian +reassured +sync +bum +guildford +iss +staunch +##onga +astronomers +sera +sofie +emergencies +susquehanna +##heard +duc +mastery +vh1 +williamsburg +bayer +buckled +craving +##khan +##rdes +bloomington +##write +alton +barbecue +##bians +justine +##hri +##ndt +delightful +smartphone +newtown +photon +retrieval +peugeot +hissing +##monium +##orough +flavors +lighted +relaunched +tainted +##games +##lysis +anarchy +microscopic +hopping +adept +evade +evie +##beau +inhibit +sinn +adjustable +hurst +intuition +wilton +cisco +44th +lawful +lowlands +stockings +thierry +##dalen +##hila +##nai +fates +prank +tb +maison +lobbied +provocative +1724 +4a +utopia +##qual +carbonate +gujarati +purcell +##rford +curtiss +##mei +overgrown +arenas +mediation +swallows +##rnik +respectful +turnbull +##hedron +##hope +alyssa +ozone +##ʻi +ami +gestapo +johansson +snooker +canteen +cuff +declines +empathy +stigma +##ags +##iner +##raine +taxpayers +gui +volga +##wright +##copic +lifespan +overcame +tattooed +enactment +giggles +##ador +##camp +barrington +bribe +obligatory +orbiting +peng +##enas +elusive +sucker +##vating +cong +hardship +empowered +anticipating +estrada +cryptic +greasy +detainees +planck +sudbury +plaid +dod +marriott +kayla +##ears +##vb +##zd +mortally +##hein +cognition +radha +319 +liechtenstein +meade +richly +argyle +harpsichord +liberalism +trumpets +lauded +tyrant +salsa +tiled +lear +promoters +reused +slicing +trident +##chuk +##gami +##lka +cantor +checkpoint +##points +gaul +leger +mammalian +##tov +##aar +##schaft +doha +frenchman +nirvana +##vino +delgado +headlining +##eron +##iography +jug +tko +1649 +naga +intersections +##jia +benfica +nawab +##suka +ashford +gulp +##deck +##vill +##rug +brentford +frazier +pleasures +dunne +potsdam +shenzhen +dentistry +##tec +flanagan +##dorff +##hear +chorale +dinah +prem +quezon +##rogated +relinquished +sutra +terri +##pani +flaps +##rissa +poly +##rnet +homme +aback +##eki +linger +womb +##kson +##lewood +doorstep +orthodoxy +threaded +westfield +##rval +dioceses +fridays +subsided +##gata +loyalists +##biotic +##ettes +letterman +lunatic +prelate +tenderly +invariably +souza +thug +winslow +##otide +furlongs +gogh +jeopardy +##runa +pegasus +##umble +humiliated +standalone +tagged +##roller +freshmen +klan +##bright +attaining +initiating +transatlantic +logged +viz +##uance +1723 +combatants +intervening +stephane +chieftain +despised +grazed +317 +cdc +galveston +godzilla +macro +simulate +##planes +parades +##esses +960 +##ductive +##unes +equator +overdose +##cans +##hosh +##lifting +joshi +epstein +sonora +treacherous +aquatics +manchu +responsive +##sation +supervisory +##christ +##llins +##ibar +##balance +##uso +kimball +karlsruhe +mab +##emy +ignores +phonetic +reuters +spaghetti +820 +almighty +danzig +rumbling +tombstone +designations +lured +outset +##felt +supermarkets +##wt +grupo +kei +kraft +susanna +##blood +comprehension +genealogy +##aghan +##verted +redding +##ythe +1722 +bowing +##pore +##roi +lest +sharpened +fulbright +valkyrie +sikhs +##unds +swans +bouquet +merritt +##tage +##venting +commuted +redhead +clerks +leasing +cesare +dea +hazy +##vances +fledged +greenfield +servicemen +##gical +armando +blackout +dt +sagged +downloadable +intra +potion +pods +##4th +##mism +xp +attendants +gambia +stale +##ntine +plump +asteroids +rediscovered +buds +flea +hive +##neas +1737 +classifications +debuts +##eles +olympus +scala +##eurs +##gno +##mute +hummed +sigismund +visuals +wiggled +await +pilasters +clench +sulfate +##ances +bellevue +enigma +trainee +snort +##sw +clouded +denim +##rank +##rder +churning +hartman +lodges +riches +sima +##missible +accountable +socrates +regulates +mueller +##cr +1702 +avoids +solids +himalayas +nutrient +pup +##jevic +squat +fades +nec +##lates +##pina +##rona +##ου +privateer +tequila +##gative +##mpton +apt +hornet +immortals +##dou +asturias +cleansing +dario +##rries +##anta +etymology +servicing +zhejiang +##venor +##nx +horned +erasmus +rayon +relocating +£10 +##bags +escalated +promenade +stubble +2010s +artisans +axial +liquids +mora +sho +yoo +##tsky +bundles +oldies +##nally +notification +bastion +##ths +sparkle +##lved +1728 +leash +pathogen +highs +##hmi +immature +880 +gonzaga +ignatius +mansions +monterrey +sweets +bryson +##loe +polled +regatta +brightest +pei +rosy +squid +hatfield +payroll +addict +meath +cornerback +heaviest +lodging +##mage +capcom +rippled +##sily +barnet +mayhem +ymca +snuggled +rousseau +##cute +blanchard +284 +fragmented +leighton +chromosomes +risking +##md +##strel +##utter +corinne +coyotes +cynical +hiroshi +yeomanry +##ractive +ebook +grading +mandela +plume +agustin +magdalene +##rkin +bea +femme +trafford +##coll +##lun +##tance +52nd +fourier +upton +##mental +camilla +gust +iihf +islamabad +longevity +##kala +feldman +netting +##rization +endeavour +foraging +mfa +orr +##open +greyish +contradiction +graz +##ruff +handicapped +marlene +tweed +oaxaca +spp +campos +miocene +pri +configured +cooks +pluto +cozy +pornographic +##entes +70th +fairness +glided +jonny +lynne +rounding +sired +##emon +##nist +remade +uncover +##mack +complied +lei +newsweek +##jured +##parts +##enting +##pg +293 +finer +guerrillas +athenian +deng +disused +stepmother +accuse +gingerly +seduction +521 +confronting +##walker +##going +gora +nostalgia +sabres +virginity +wrenched +##minated +syndication +wielding +eyre +##56 +##gnon +##igny +behaved +taxpayer +sweeps +##growth +childless +gallant +##ywood +amplified +geraldine +scrape +##ffi +babylonian +fresco +##rdan +##kney +##position +1718 +restricting +tack +fukuoka +osborn +selector +partnering +##dlow +318 +gnu +kia +tak +whitley +gables +##54 +##mania +mri +softness +immersion +##bots +##evsky +1713 +chilling +insignificant +pcs +##uis +elites +lina +purported +supplemental +teaming +##americana +##dding +##inton +proficient +rouen +##nage +##rret +niccolo +selects +##bread +fluffy +1621 +gruff +knotted +mukherjee +polgara +thrash +nicholls +secluded +smoothing +thru +corsica +loaf +whitaker +inquiries +##rrier +##kam +indochina +289 +marlins +myles +peking +##tea +extracts +pastry +superhuman +connacht +vogel +##ditional +##het +##udged +##lash +gloss +quarries +refit +teaser +##alic +##gaon +20s +materialized +sling +camped +pickering +tung +tracker +pursuant +##cide +cranes +soc +##cini +##typical +##viere +anhalt +overboard +workout +chores +fares +orphaned +stains +##logie +fenton +surpassing +joyah +triggers +##itte +grandmaster +##lass +##lists +clapping +fraudulent +ledger +nagasaki +##cor +##nosis +##tsa +eucalyptus +tun +##icio +##rney +##tara +dax +heroism +ina +wrexham +onboard +unsigned +##dates +moshe +galley +winnie +droplets +exiles +praises +watered +noodles +##aia +fein +adi +leland +multicultural +stink +bingo +comets +erskine +modernized +canned +constraint +domestically +chemotherapy +featherweight +stifled +##mum +darkly +irresistible +refreshing +hasty +isolate +##oys +kitchener +planners +##wehr +cages +yarn +implant +toulon +elects +childbirth +yue +##lind +##lone +cn +rightful +sportsman +junctions +remodeled +specifies +##rgh +291 +##oons +complimented +##urgent +lister +ot +##logic +bequeathed +cheekbones +fontana +gabby +##dial +amadeus +corrugated +maverick +resented +triangles +##hered +##usly +nazareth +tyrol +1675 +assent +poorer +sectional +aegean +##cous +296 +nylon +ghanaian +##egorical +##weig +cushions +forbid +fusiliers +obstruction +somerville +##scia +dime +earrings +elliptical +leyte +oder +polymers +timmy +atm +midtown +piloted +settles +continual +externally +mayfield +##uh +enrichment +henson +keane +persians +1733 +benji +braden +pep +324 +##efe +contenders +pepsi +valet +##isches +298 +##asse +##earing +goofy +stroll +##amen +authoritarian +occurrences +adversary +ahmedabad +tangent +toppled +dorchester +1672 +modernism +marxism +islamist +charlemagne +exponential +racks +unicode +brunette +mbc +pic +skirmish +##bund +##lad +##powered +##yst +hoisted +messina +shatter +##ctum +jedi +vantage +##music +##neil +clemens +mahmoud +corrupted +authentication +lowry +nils +##washed +omnibus +wounding +jillian +##itors +##opped +serialized +narcotics +handheld +##arm +##plicity +intersecting +stimulating +##onis +crate +fellowships +hemingway +casinos +climatic +fordham +copeland +drip +beatty +leaflets +robber +brothel +madeira +##hedral +sphinx +ultrasound +##vana +valor +forbade +leonid +villas +##aldo +duane +marquez +##cytes +disadvantaged +forearms +kawasaki +reacts +consular +lax +uncles +uphold +##hopper +concepcion +dorsey +lass +##izan +arching +passageway +1708 +researches +tia +internationals +##graphs +##opers +distinguishes +javanese +divert +##uven +plotted +##listic +##rwin +##erik +##tify +affirmative +signifies +validation +##bson +kari +felicity +georgina +zulu +##eros +##rained +##rath +overcoming +##dot +argyll +##rbin +1734 +chiba +ratification +windy +earls +parapet +##marks +hunan +pristine +astrid +punta +##gart +brodie +##kota +##oder +malaga +minerva +rouse +##phonic +bellowed +pagoda +portals +reclamation +##gur +##odies +##⁄₄ +parentheses +quoting +allergic +palette +showcases +benefactor +heartland +nonlinear +##tness +bladed +cheerfully +scans +##ety +##hone +1666 +girlfriends +pedersen +hiram +sous +##liche +##nator +1683 +##nery +##orio +##umen +bobo +primaries +smiley +##cb +unearthed +uniformly +fis +metadata +1635 +ind +##oted +recoil +##titles +##tura +##ια +406 +hilbert +jamestown +mcmillan +tulane +seychelles +##frid +antics +coli +fated +stucco +##grants +1654 +bulky +accolades +arrays +caledonian +carnage +optimism +puebla +##tative +##cave +enforcing +rotherham +seo +dunlop +aeronautics +chimed +incline +zoning +archduke +hellenistic +##oses +##sions +candi +thong +##ople +magnate +rustic +##rsk +projective +slant +##offs +danes +hollis +vocalists +##ammed +congenital +contend +gesellschaft +##ocating +##pressive +douglass +quieter +##cm +##kshi +howled +salim +spontaneously +townsville +buena +southport +##bold +kato +1638 +faerie +stiffly +##vus +##rled +297 +flawless +realising +taboo +##7th +bytes +straightening +356 +jena +##hid +##rmin +cartwright +berber +bertram +soloists +411 +noses +417 +coping +fission +hardin +inca +##cen +1717 +mobilized +vhf +##raf +biscuits +curate +##85 +##anial +331 +gaunt +neighbourhoods +1540 +##abas +blanca +bypassed +sockets +behold +coincidentally +##bane +nara +shave +splinter +terrific +##arion +##erian +commonplace +juris +redwood +waistband +boxed +caitlin +fingerprints +jennie +naturalized +##ired +balfour +craters +jody +bungalow +hugely +quilt +glitter +pigeons +undertaker +bulging +constrained +goo +##sil +##akh +assimilation +reworked +##person +persuasion +##pants +felicia +##cliff +##ulent +1732 +explodes +##dun +##inium +##zic +lyman +vulture +hog +overlook +begs +northwards +ow +spoil +##urer +fatima +favorably +accumulate +sargent +sorority +corresponded +dispersal +kochi +toned +##imi +##lita +internacional +newfound +##agger +##lynn +##rigue +booths +peanuts +##eborg +medicare +muriel +nur +##uram +crates +millennia +pajamas +worsened +##breakers +jimi +vanuatu +yawned +##udeau +carousel +##hony +hurdle +##ccus +##mounted +##pod +rv +##eche +airship +ambiguity +compulsion +recapture +##claiming +arthritis +##osomal +1667 +asserting +ngc +sniffing +dade +discontent +glendale +ported +##amina +defamation +rammed +##scent +fling +livingstone +##fleet +875 +##ppy +apocalyptic +comrade +lcd +##lowe +cessna +eine +persecuted +subsistence +demi +hoop +reliefs +710 +coptic +progressing +stemmed +perpetrators +1665 +priestess +##nio +dobson +ebony +rooster +itf +tortricidae +##bbon +##jian +cleanup +##jean +##øy +1721 +eighties +taxonomic +holiness +##hearted +##spar +antilles +showcasing +stabilized +##nb +gia +mascara +michelangelo +dawned +##uria +##vinsky +extinguished +fitz +grotesque +£100 +##fera +##loid +##mous +barges +neue +throbbed +cipher +johnnie +##a1 +##mpt +outburst +##swick +spearheaded +administrations +c1 +heartbreak +pixels +pleasantly +##enay +lombardy +plush +##nsed +bobbie +##hly +reapers +tremor +xiang +minogue +substantive +hitch +barak +##wyl +kwan +##encia +910 +obscene +elegance +indus +surfer +bribery +conserve +##hyllum +##masters +horatio +##fat +apes +rebound +psychotic +##pour +iteration +##mium +##vani +botanic +horribly +antiques +dispose +paxton +##hli +##wg +timeless +1704 +disregard +engraver +hounds +##bau +##version +looted +uno +facilitates +groans +masjid +rutland +antibody +disqualification +decatur +footballers +quake +slacks +48th +rein +scribe +stabilize +commits +exemplary +tho +##hort +##chison +pantry +traversed +##hiti +disrepair +identifiable +vibrated +baccalaureate +##nnis +csa +interviewing +##iensis +##raße +greaves +wealthiest +343 +classed +jogged +£5 +##58 +##atal +illuminating +knicks +respecting +##uno +scrubbed +##iji +##dles +kruger +moods +growls +raider +silvia +chefs +kam +vr +cree +percival +##terol +gunter +counterattack +defiant +henan +ze +##rasia +##riety +equivalence +submissions +##fra +##thor +bautista +mechanically +##heater +cornice +herbal +templar +##mering +outputs +ruining +ligand +renumbered +extravagant +mika +blockbuster +eta +insurrection +##ilia +darkening +ferocious +pianos +strife +kinship +##aer +melee +##anor +##iste +##may +##oue +decidedly +weep +##jad +##missive +##ppel +354 +puget +unease +##gnant +1629 +hammering +kassel +ob +wessex +##lga +bromwich +egan +paranoia +utilization +##atable +##idad +contradictory +provoke +##ols +##ouring +##tangled +knesset +##very +##lette +plumbing +##sden +##¹ +greensboro +occult +sniff +338 +zev +beaming +gamer +haggard +mahal +##olt +##pins +mendes +utmost +briefing +gunnery +##gut +##pher +##zh +##rok +1679 +khalifa +sonya +##boot +principals +urbana +wiring +##liffe +##minating +##rrado +dahl +nyu +skepticism +np +townspeople +ithaca +lobster +somethin +##fur +##arina +##−1 +freighter +zimmerman +biceps +contractual +##herton +amend +hurrying +subconscious +##anal +336 +meng +clermont +spawning +##eia +##lub +dignitaries +impetus +snacks +spotting +twigs +##bilis +##cz +##ouk +libertadores +nic +skylar +##aina +##firm +gustave +asean +##anum +dieter +legislatures +flirt +bromley +trolls +umar +##bbies +##tyle +blah +parc +bridgeport +crank +negligence +##nction +46th +constantin +molded +bandages +seriousness +00pm +siegel +carpets +compartments +upbeat +statehood +##dner +##edging +marko +730 +platt +##hane +paving +##iy +1738 +abbess +impatience +limousine +nbl +##talk +441 +lucille +mojo +nightfall +robbers +##nais +karel +brisk +calves +replicate +ascribed +telescopes +##olf +intimidated +##reen +ballast +specialization +##sit +aerodynamic +caliphate +rainer +visionary +##arded +epsilon +##aday +##onte +aggregation +auditory +boosted +reunification +kathmandu +loco +robyn +402 +acknowledges +appointing +humanoid +newell +redeveloped +restraints +##tained +barbarians +chopper +1609 +italiana +##lez +##lho +investigates +wrestlemania +##anies +##bib +690 +##falls +creaked +dragoons +gravely +minions +stupidity +volley +##harat +##week +musik +##eries +##uously +fungal +massimo +semantics +malvern +##ahl +##pee +discourage +embryo +imperialism +1910s +profoundly +##ddled +jiangsu +sparkled +stat +##holz +sweatshirt +tobin +##iction +sneered +##cheon +##oit +brit +causal +smyth +##neuve +diffuse +perrin +silvio +##ipes +##recht +detonated +iqbal +selma +##nism +##zumi +roasted +##riders +tay +##ados +##mament +##mut +##rud +840 +completes +nipples +cfa +flavour +hirsch +##laus +calderon +sneakers +moravian +##ksha +1622 +rq +294 +##imeters +bodo +##isance +##pre +##ronia +anatomical +excerpt +##lke +dh +kunst +##tablished +##scoe +biomass +panted +unharmed +gael +housemates +montpellier +##59 +coa +rodents +tonic +hickory +singleton +##taro +451 +1719 +aldo +breaststroke +dempsey +och +rocco +##cuit +merton +dissemination +midsummer +serials +##idi +haji +polynomials +##rdon +gs +enoch +prematurely +shutter +taunton +£3 +##grating +##inates +archangel +harassed +##asco +326 +archway +dazzling +##ecin +1736 +sumo +wat +##kovich +1086 +honneur +##ently +##nostic +##ttal +##idon +1605 +403 +1716 +blogger +rents +##gnan +hires +##ikh +##dant +howie +##rons +handler +retracted +shocks +1632 +arun +duluth +kepler +trumpeter +##lary +peeking +seasoned +trooper +##mara +laszlo +##iciencies +##rti +heterosexual +##inatory +##ssion +indira +jogging +##inga +##lism +beit +dissatisfaction +malice +##ately +nedra +peeling +##rgeon +47th +stadiums +475 +vertigo +##ains +iced +restroom +##plify +##tub +illustrating +pear +##chner +##sibility +inorganic +rappers +receipts +watery +##kura +lucinda +##oulos +reintroduced +##8th +##tched +gracefully +saxons +nutritional +wastewater +rained +favourites +bedrock +fisted +hallways +likeness +upscale +##lateral +1580 +blinds +prequel +##pps +##tama +deter +humiliating +restraining +tn +vents +1659 +laundering +recess +rosary +tractors +coulter +federer +##ifiers +##plin +persistence +##quitable +geschichte +pendulum +quakers +##beam +bassett +pictorial +buffet +koln +##sitor +drills +reciprocal +shooters +##57 +##cton +##tees +converge +pip +dmitri +donnelly +yamamoto +aqua +azores +demographics +hypnotic +spitfire +suspend +wryly +roderick +##rran +sebastien +##asurable +mavericks +##fles +##200 +himalayan +prodigy +##iance +transvaal +demonstrators +handcuffs +dodged +mcnamara +sublime +1726 +crazed +##efined +##till +ivo +pondered +reconciled +shrill +sava +##duk +bal +cad +heresy +jaipur +goran +##nished +341 +lux +shelly +whitehall +##hre +israelis +peacekeeping +##wled +1703 +demetrius +ousted +##arians +##zos +beale +anwar +backstroke +raged +shrinking +cremated +##yck +benign +towing +wadi +darmstadt +landfill +parana +soothe +colleen +sidewalks +mayfair +tumble +hepatitis +ferrer +superstructure +##gingly +##urse +##wee +anthropological +translators +##mies +closeness +hooves +##pw +mondays +##roll +##vita +landscaping +##urized +purification +sock +thorns +thwarted +jalan +tiberius +##taka +saline +##rito +confidently +khyber +sculptors +##ij +brahms +hammersmith +inspectors +battista +fivb +fragmentation +hackney +##uls +arresting +exercising +antoinette +bedfordshire +##zily +dyed +##hema +1656 +racetrack +variability +##tique +1655 +austrians +deteriorating +madman +theorists +aix +lehman +weathered +1731 +decreed +eruptions +1729 +flaw +quinlan +sorbonne +flutes +nunez +1711 +adored +downwards +fable +rasped +1712 +moritz +mouthful +renegade +shivers +stunts +dysfunction +restrain +translit +327 +pancakes +##avio +##cision +##tray +351 +vial +##lden +bain +##maid +##oxide +chihuahua +malacca +vimes +##rba +##rnier +1664 +donnie +plaques +##ually +337 +bangs +floppy +huntsville +loretta +nikolay +##otte +eater +handgun +ubiquitous +##hett +eras +zodiac +1634 +##omorphic +1820s +##zog +cochran +##bula +##lithic +warring +##rada +dalai +excused +blazers +mcconnell +reeling +bot +este +##abi +geese +hoax +taxon +##bla +guitarists +##icon +condemning +hunts +inversion +moffat +taekwondo +##lvis +1624 +stammered +##rest +##rzy +sousa +fundraiser +marylebone +navigable +uptown +cabbage +daniela +salman +shitty +whimper +##kian +##utive +programmers +protections +rm +##rmi +##rued +forceful +##enes +fuss +##tao +##wash +brat +oppressive +reykjavik +spartak +ticking +##inkles +##kiewicz +adolph +horst +maui +protege +straighten +cpc +landau +concourse +clements +resultant +##ando +imaginative +joo +reactivated +##rem +##ffled +##uising +consultative +##guide +flop +kaitlyn +mergers +parenting +somber +##vron +supervise +vidhan +##imum +courtship +exemplified +harmonies +medallist +refining +##rrow +##ка +amara +##hum +780 +goalscorer +sited +overshadowed +rohan +displeasure +secretive +multiplied +osman +##orth +engravings +padre +##kali +##veda +miniatures +mis +##yala +clap +pali +rook +##cana +1692 +57th +antennae +astro +oskar +1628 +bulldog +crotch +hackett +yucatan +##sure +amplifiers +brno +ferrara +migrating +##gree +thanking +turing +##eza +mccann +ting +andersson +onslaught +gaines +ganga +incense +standardization +##mation +sentai +scuba +stuffing +turquoise +waivers +alloys +##vitt +regaining +vaults +##clops +##gizing +digger +furry +memorabilia +probing +##iad +payton +rec +deutschland +filippo +opaque +seamen +zenith +afrikaans +##filtration +disciplined +inspirational +##merie +banco +confuse +grafton +tod +##dgets +championed +simi +anomaly +biplane +##ceptive +electrode +##para +1697 +cleavage +crossbow +swirl +informant +##lars +##osta +afi +bonfire +spec +##oux +lakeside +slump +##culus +##lais +##qvist +##rrigan +1016 +facades +borg +inwardly +cervical +xl +pointedly +050 +stabilization +##odon +chests +1699 +hacked +ctv +orthogonal +suzy +##lastic +gaulle +jacobite +rearview +##cam +##erted +ashby +##drik +##igate +##mise +##zbek +affectionately +canine +disperse +latham +##istles +##ivar +spielberg +##orin +##idium +ezekiel +cid +##sg +durga +middletown +##cina +customized +frontiers +harden +##etano +##zzy +1604 +bolsheviks +##66 +coloration +yoko +##bedo +briefs +slabs +debra +liquidation +plumage +##oin +blossoms +dementia +subsidy +1611 +proctor +relational +jerseys +parochial +ter +##ici +esa +peshawar +cavalier +loren +cpi +idiots +shamrock +1646 +dutton +malabar +mustache +##endez +##ocytes +referencing +terminates +marche +yarmouth +##sop +acton +mated +seton +subtly +baptised +beige +extremes +jolted +kristina +telecast +##actic +safeguard +waldo +##baldi +##bular +endeavors +sloppy +subterranean +##ensburg +##itung +delicately +pigment +tq +##scu +1626 +##ound +collisions +coveted +herds +##personal +##meister +##nberger +chopra +##ricting +abnormalities +defective +galician +lucie +##dilly +alligator +likened +##genase +burundi +clears +complexion +derelict +deafening +diablo +fingered +champaign +dogg +enlist +isotope +labeling +mrna +##erre +brilliance +marvelous +##ayo +1652 +crawley +ether +footed +dwellers +deserts +hamish +rubs +warlock +skimmed +##lizer +870 +buick +embark +heraldic +irregularities +##ajan +kiara +##kulam +##ieg +antigen +kowalski +##lge +oakley +visitation +##mbit +vt +##suit +1570 +murderers +##miento +##rites +chimneys +##sling +condemn +custer +exchequer +havre +##ghi +fluctuations +##rations +dfb +hendricks +vaccines +##tarian +nietzsche +biking +juicy +##duced +brooding +scrolling +selangor +##ragan +352 +annum +boomed +seminole +sugarcane +##dna +departmental +dismissing +innsbruck +arteries +ashok +batavia +daze +kun +overtook +##rga +##tlan +beheaded +gaddafi +holm +electronically +faulty +galilee +fractures +kobayashi +##lized +gunmen +magma +aramaic +mala +eastenders +inference +messengers +bf +##qu +407 +bathrooms +##vere +1658 +flashbacks +ideally +misunderstood +##jali +##weather +mendez +##grounds +505 +uncanny +##iii +1709 +friendships +##nbc +sacrament +accommodated +reiterated +logistical +pebbles +thumped +##escence +administering +decrees +drafts +##flight +##cased +##tula +futuristic +picket +intimidation +winthrop +##fahan +interfered +339 +afar +francoise +morally +uta +cochin +croft +dwarfs +##bruck +##dents +##nami +biker +##hner +##meral +nano +##isen +##ometric +##pres +##ан +brightened +meek +parcels +securely +gunners +##jhl +##zko +agile +hysteria +##lten +##rcus +bukit +champs +chevy +cuckoo +leith +sadler +theologians +welded +##section +1663 +jj +plurality +xander +##rooms +##formed +shredded +temps +intimately +pau +tormented +##lok +##stellar +1618 +charred +ems +essen +##mmel +alarms +spraying +ascot +blooms +twinkle +##abia +##apes +internment +obsidian +##chaft +snoop +##dav +##ooping +malibu +##tension +quiver +##itia +hays +mcintosh +travers +walsall +##ffie +1623 +beverley +schwarz +plunging +structurally +m3 +rosenthal +vikram +##tsk +770 +ghz +##onda +##tiv +chalmers +groningen +pew +reckon +unicef +##rvis +55th +##gni +1651 +sulawesi +avila +cai +metaphysical +screwing +turbulence +##mberg +augusto +samba +56th +baffled +momentary +toxin +##urian +##wani +aachen +condoms +dali +steppe +##3d +##app +##oed +##year +adolescence +dauphin +electrically +inaccessible +microscopy +nikita +##ega +atv +##cel +##enter +##oles +##oteric +##ы +accountants +punishments +wrongly +bribes +adventurous +clinch +flinders +southland +##hem +##kata +gough +##ciency +lads +soared +##ה +undergoes +deformation +outlawed +rubbish +##arus +##mussen +##nidae +##rzburg +arcs +##ingdon +##tituted +1695 +wheelbase +wheeling +bombardier +campground +zebra +##lices +##oj +##bain +lullaby +##ecure +donetsk +wylie +grenada +##arding +##ης +squinting +eireann +opposes +##andra +maximal +runes +##broken +##cuting +##iface +##ror +##rosis +additive +britney +adultery +triggering +##drome +detrimental +aarhus +containment +jc +swapped +vichy +##ioms +madly +##oric +##rag +brant +##ckey +##trix +1560 +1612 +broughton +rustling +##stems +##uder +asbestos +mentoring +##nivorous +finley +leaps +##isan +apical +pry +slits +substitutes +##dict +intuitive +fantasia +insistent +unreasonable +##igen +##vna +domed +hannover +margot +ponder +##zziness +impromptu +jian +lc +rampage +stemming +##eft +andrey +gerais +whichever +amnesia +appropriated +anzac +clicks +modifying +ultimatum +cambrian +maids +verve +yellowstone +##mbs +conservatoire +##scribe +adherence +dinners +spectra +imperfect +mysteriously +sidekick +tatar +tuba +##aks +##ifolia +distrust +##athan +##zle +c2 +ronin +zac +##pse +celaena +instrumentalist +scents +skopje +##mbling +comical +compensated +vidal +condor +intersect +jingle +wavelengths +##urrent +mcqueen +##izzly +carp +weasel +422 +kanye +militias +postdoctoral +eugen +gunslinger +##ɛ +faux +hospice +##for +appalled +derivation +dwarves +##elis +dilapidated +##folk +astoria +philology +##lwyn +##otho +##saka +inducing +philanthropy +##bf +##itative +geek +markedly +sql +##yce +bessie +indices +rn +##flict +495 +frowns +resolving +weightlifting +tugs +cleric +contentious +1653 +mania +rms +##miya +##reate +##ruck +##tucket +bien +eels +marek +##ayton +##cence +discreet +unofficially +##ife +leaks +##bber +1705 +332 +dung +compressor +hillsborough +pandit +shillings +distal +##skin +381 +##tat +##you +nosed +##nir +mangrove +undeveloped +##idia +textures +##inho +##500 +##rise +ae +irritating +nay +amazingly +bancroft +apologetic +compassionate +kata +symphonies +##lovic +airspace +##lch +930 +gifford +precautions +fulfillment +sevilla +vulgar +martinique +##urities +looting +piccolo +tidy +##dermott +quadrant +armchair +incomes +mathematicians +stampede +nilsson +##inking +##scan +foo +quarterfinal +##ostal +shang +shouldered +squirrels +##owe +344 +vinegar +##bner +##rchy +##systems +delaying +##trics +ars +dwyer +rhapsody +sponsoring +##gration +bipolar +cinder +starters +##olio +##urst +421 +signage +##nty +aground +figurative +mons +acquaintances +duets +erroneously +soyuz +elliptic +recreated +##cultural +##quette +##ssed +##tma +##zcz +moderator +scares +##itaire +##stones +##udence +juniper +sighting +##just +##nsen +britten +calabria +ry +bop +cramer +forsyth +stillness +##л +airmen +gathers +unfit +##umber +##upt +taunting +##rip +seeker +streamlined +##bution +holster +schumann +tread +vox +##gano +##onzo +strive +dil +reforming +covent +newbury +predicting +##orro +decorate +tre +##puted +andover +ie +asahi +dept +dunkirk +gills +##tori +buren +huskies +##stis +##stov +abstracts +bets +loosen +##opa +1682 +yearning +##glio +##sir +berman +effortlessly +enamel +napoli +persist +##peration +##uez +attache +elisa +b1 +invitations +##kic +accelerating +reindeer +boardwalk +clutches +nelly +polka +starbucks +##kei +adamant +huey +lough +unbroken +adventurer +embroidery +inspecting +stanza +##ducted +naia +taluka +##pone +##roids +chases +deprivation +florian +##jing +##ppet +earthly +##lib +##ssee +colossal +foreigner +vet +freaks +patrice +rosewood +triassic +upstate +##pkins +dominates +ata +chants +ks +vo +##400 +##bley +##raya +##rmed +555 +agra +infiltrate +##ailing +##ilation +##tzer +##uppe +##werk +binoculars +enthusiast +fujian +squeak +##avs +abolitionist +almeida +boredom +hampstead +marsden +rations +##ands +inflated +334 +bonuses +rosalie +patna +##rco +329 +detachments +penitentiary +54th +flourishing +woolf +##dion +##etched +papyrus +##lster +##nsor +##toy +bobbed +dismounted +endelle +inhuman +motorola +tbs +wince +wreath +##ticus +hideout +inspections +sanjay +disgrace +infused +pudding +stalks +##urbed +arsenic +leases +##hyl +##rrard +collarbone +##waite +##wil +dowry +##bant +##edance +genealogical +nitrate +salamanca +scandals +thyroid +necessitated +##! +##" +### +##$ +##% +##& +##' +##( +##) +##* +##+ +##, +##- +##. +##/ +##: +##; +##< +##= +##> +##? +##@ +##[ +##\ +##] +##^ +##_ +##` +##{ +##| +##} +##~ +##¡ +##¢ +##£ +##¤ +##¥ +##¦ +##§ +##¨ +##© +##ª +##« +##¬ +##® +##± +##´ +##µ +##¶ +##· +##º +##» +##¼ +##¾ +##¿ +##æ +##ð +##÷ +##þ +##đ +##ħ +##ŋ +##œ +##ƒ +##ɐ +##ɑ +##ɒ +##ɔ +##ɕ +##ə +##ɡ +##ɣ +##ɨ +##ɪ +##ɫ +##ɬ +##ɯ +##ɲ +##ɴ +##ɹ +##ɾ +##ʀ +##ʁ +##ʂ +##ʃ +##ʉ +##ʊ +##ʋ +##ʌ +##ʎ +##ʐ +##ʑ +##ʒ +##ʔ +##ʰ +##ʲ +##ʳ +##ʷ +##ʸ +##ʻ +##ʼ +##ʾ +##ʿ +##ˈ +##ˡ +##ˢ +##ˣ +##ˤ +##β +##γ +##δ +##ε +##ζ +##θ +##κ +##λ +##μ +##ξ +##ο +##π +##ρ +##σ +##τ +##υ +##φ +##χ +##ψ +##ω +##б +##г +##д +##ж +##з +##м +##п +##с +##у +##ф +##х +##ц +##ч +##ш +##щ +##ъ +##э +##ю +##ђ +##є +##і +##ј +##љ +##њ +##ћ +##ӏ +##ա +##բ +##գ +##դ +##ե +##թ +##ի +##լ +##կ +##հ +##մ +##յ +##ն +##ո +##պ +##ս +##վ +##տ +##ր +##ւ +##ք +##־ +##א +##ב +##ג +##ד +##ו +##ז +##ח +##ט +##י +##ך +##כ +##ל +##ם +##מ +##ן +##נ +##ס +##ע +##ף +##פ +##ץ +##צ +##ק +##ר +##ש +##ת +##، +##ء +##ب +##ت +##ث +##ج +##ح +##خ +##ذ +##ز +##س +##ش +##ص +##ض +##ط +##ظ +##ع +##غ +##ـ +##ف +##ق +##ك +##و +##ى +##ٹ +##پ +##چ +##ک +##گ +##ں +##ھ +##ہ +##ے +##अ +##आ +##उ +##ए +##क +##ख +##ग +##च +##ज +##ट +##ड +##ण +##त +##थ +##द +##ध +##न +##प +##ब +##भ +##म +##य +##र +##ल +##व +##श +##ष +##स +##ह +##ा +##ि +##ी +##ो +##। +##॥ +##ং +##অ +##আ +##ই +##উ +##এ +##ও +##ক +##খ +##গ +##চ +##ছ +##জ +##ট +##ড +##ণ +##ত +##থ +##দ +##ধ +##ন +##প +##ব +##ভ +##ম +##য +##র +##ল +##শ +##ষ +##স +##হ +##া +##ি +##ী +##ে +##க +##ச +##ட +##த +##ந +##ன +##ப +##ம +##ய +##ர +##ல +##ள +##வ +##ா +##ி +##ு +##ே +##ை +##ನ +##ರ +##ಾ +##ක +##ය +##ර +##ල +##ව +##ා +##ก +##ง +##ต +##ท +##น +##พ +##ม +##ย +##ร +##ล +##ว +##ส +##อ +##า +##เ +##་ +##། +##ག +##ང +##ད +##ན +##པ +##བ +##མ +##འ +##ར +##ལ +##ས +##မ +##ა +##ბ +##გ +##დ +##ე +##ვ +##თ +##ი +##კ +##ლ +##მ +##ნ +##ო +##რ +##ს +##ტ +##უ +##ᄀ +##ᄂ +##ᄃ +##ᄅ +##ᄆ +##ᄇ +##ᄉ +##ᄊ +##ᄋ +##ᄌ +##ᄎ +##ᄏ +##ᄐ +##ᄑ +##ᄒ +##ᅡ +##ᅢ +##ᅥ +##ᅦ +##ᅧ +##ᅩ +##ᅪ +##ᅭ +##ᅮ +##ᅯ +##ᅲ +##ᅳ +##ᅴ +##ᅵ +##ᆨ +##ᆫ +##ᆯ +##ᆷ +##ᆸ +##ᆼ +##ᴬ +##ᴮ +##ᴰ +##ᴵ +##ᴺ +##ᵀ +##ᵃ +##ᵇ +##ᵈ +##ᵉ +##ᵍ +##ᵏ +##ᵐ +##ᵒ +##ᵖ +##ᵗ +##ᵘ +##ᵣ +##ᵤ +##ᵥ +##ᶜ +##ᶠ +##‐ +##‑ +##‒ +##– +##— +##― +##‖ +##‘ +##’ +##‚ +##“ +##” +##„ +##† +##‡ +##• +##… +##‰ +##′ +##″ +##› +##‿ +##⁄ +##⁰ +##ⁱ +##⁴ +##⁵ +##⁶ +##⁷ +##⁸ +##⁹ +##⁻ +##ⁿ +##₅ +##₆ +##₇ +##₈ +##₉ +##₊ +##₍ +##₎ +##ₐ +##ₑ +##ₒ +##ₓ +##ₕ +##ₖ +##ₗ +##ₘ +##ₚ +##ₛ +##ₜ +##₤ +##₩ +##€ +##₱ +##₹ +##ℓ +##№ +##ℝ +##™ +##⅓ +##⅔ +##← +##↑ +##→ +##↓ +##↔ +##↦ +##⇄ +##⇌ +##⇒ +##∂ +##∅ +##∆ +##∇ +##∈ +##∗ +##∘ +##√ +##∞ +##∧ +##∨ +##∩ +##∪ +##≈ +##≡ +##≤ +##≥ +##⊂ +##⊆ +##⊕ +##⊗ +##⋅ +##─ +##│ +##■ +##▪ +##● +##★ +##☆ +##☉ +##♠ +##♣ +##♥ +##♦ +##♯ +##⟨ +##⟩ +##ⱼ +##⺩ +##⺼ +##⽥ +##、 +##。 +##〈 +##〉 +##《 +##》 +##「 +##」 +##『 +##』 +##〜 +##あ +##い +##う +##え +##お +##か +##き +##く +##け +##こ +##さ +##し +##す +##せ +##そ +##た +##ち +##っ +##つ +##て +##と +##な +##に +##ぬ +##ね +##の +##は +##ひ +##ふ +##へ +##ほ +##ま +##み +##む +##め +##も +##や +##ゆ +##よ +##ら +##り +##る +##れ +##ろ +##を +##ん +##ァ +##ア +##ィ +##イ +##ウ +##ェ +##エ +##オ +##カ +##キ +##ク +##ケ +##コ +##サ +##シ +##ス +##セ +##タ +##チ +##ッ +##ツ +##テ +##ト +##ナ +##ニ +##ノ +##ハ +##ヒ +##フ +##ヘ +##ホ +##マ +##ミ +##ム +##メ +##モ +##ャ +##ュ +##ョ +##ラ +##リ +##ル +##レ +##ロ +##ワ +##ン +##・ +##ー +##一 +##三 +##上 +##下 +##不 +##世 +##中 +##主 +##久 +##之 +##也 +##事 +##二 +##五 +##井 +##京 +##人 +##亻 +##仁 +##介 +##代 +##仮 +##伊 +##会 +##佐 +##侍 +##保 +##信 +##健 +##元 +##光 +##八 +##公 +##内 +##出 +##分 +##前 +##劉 +##力 +##加 +##勝 +##北 +##区 +##十 +##千 +##南 +##博 +##原 +##口 +##古 +##史 +##司 +##合 +##吉 +##同 +##名 +##和 +##囗 +##四 +##国 +##國 +##土 +##地 +##坂 +##城 +##堂 +##場 +##士 +##夏 +##外 +##大 +##天 +##太 +##夫 +##奈 +##女 +##子 +##学 +##宀 +##宇 +##安 +##宗 +##定 +##宣 +##宮 +##家 +##宿 +##寺 +##將 +##小 +##尚 +##山 +##岡 +##島 +##崎 +##川 +##州 +##巿 +##帝 +##平 +##年 +##幸 +##广 +##弘 +##張 +##彳 +##後 +##御 +##德 +##心 +##忄 +##志 +##忠 +##愛 +##成 +##我 +##戦 +##戸 +##手 +##扌 +##政 +##文 +##新 +##方 +##日 +##明 +##星 +##春 +##昭 +##智 +##曲 +##書 +##月 +##有 +##朝 +##木 +##本 +##李 +##村 +##東 +##松 +##林 +##森 +##楊 +##樹 +##橋 +##歌 +##止 +##正 +##武 +##比 +##氏 +##民 +##水 +##氵 +##氷 +##永 +##江 +##沢 +##河 +##治 +##法 +##海 +##清 +##漢 +##瀬 +##火 +##版 +##犬 +##王 +##生 +##田 +##男 +##疒 +##発 +##白 +##的 +##皇 +##目 +##相 +##省 +##真 +##石 +##示 +##社 +##神 +##福 +##禾 +##秀 +##秋 +##空 +##立 +##章 +##竹 +##糹 +##美 +##義 +##耳 +##良 +##艹 +##花 +##英 +##華 +##葉 +##藤 +##行 +##街 +##西 +##見 +##訁 +##語 +##谷 +##貝 +##貴 +##車 +##軍 +##辶 +##道 +##郎 +##郡 +##部 +##都 +##里 +##野 +##金 +##鈴 +##镇 +##長 +##門 +##間 +##阝 +##阿 +##陳 +##陽 +##雄 +##青 +##面 +##風 +##食 +##香 +##馬 +##高 +##龍 +##龸 +##fi +##fl +##! +##( +##) +##, +##- +##. +##/ +##: +##? +##~ diff --git a/models/intel/driver-action-recognition-adas-0002/description/driver-action-recognition-adas-0002.md b/models/intel/driver-action-recognition-adas-0002/description/driver-action-recognition-adas-0002.md index eb77fff7865..83faeb85d94 100644 --- a/models/intel/driver-action-recognition-adas-0002/description/driver-action-recognition-adas-0002.md +++ b/models/intel/driver-action-recognition-adas-0002/description/driver-action-recognition-adas-0002.md @@ -2,7 +2,7 @@ ## Use Case and High-Level Description -This is an action recognition composite model for the driver monitoring use case, consisting of encoder and decoder parts. The encoder model uses Video Transformer approach with MobileNetv2 encoder. It is able to recognize the following actions: drinking, doing hair or making up, operating the radio, reaching behind, safe driving, talking on the phone, texting. +This is an action recognition composite model for the driver monitoring use case, consisting of encoder and decoder parts. The encoder model uses Video Transformer approach with MobileNetv2 encoder. It is able to recognize actions such as drinking, doing hair or making up, operating the radio, reaching behind, safe driving, talking on the phone, texting. The full list of recognized actions is located here. ## Example @@ -26,8 +26,6 @@ Video frames should be sampled to cover ~1 second fragment (i.e. skip every seco | MParams | 2.863 | -### Performance - ### Inputs 1. name: "0" , shape: [1x3x224x224] - An input image in the format [BxCxHxW], @@ -41,7 +39,7 @@ Video frames should be sampled to cover ~1 second fragment (i.e. skip every seco ### Outputs -The model outputs a tensor with the shape [1x512x1x1], representing embedding of precessed frame. +The model outputs a tensor with the shape [1x512x1x1], representing embedding of processed frame. ## Decoder model specification @@ -54,8 +52,6 @@ The driver-action-recognition-adas-0002-decoder model accepts stack of frame emb | MParams | 4.205 | -### Performance - ### Inputs 1. name: "0" , shape: [1x16x512] - An embedding image in the format [BxTxC], diff --git a/models/intel/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-decoder/model.yml b/models/intel/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-decoder/model.yml index c7dc690429f..d62d45e59eb 100644 --- a/models/intel/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-decoder/model.yml +++ b/models/intel/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-decoder/model.yml @@ -17,28 +17,28 @@ description: >- task_type: action_recognition files: - name: FP32/driver-action-recognition-adas-0002-decoder.xml - size: 216233 - sha256: dd01ed906650a65218fc86be8af571cb3a8bead48cf97af32d462205bd594bdd - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-decoder/FP32/driver-action-recognition-adas-0002-decoder.xml + size: 216021 + sha256: 2140a4a1b036a0af2bf3a4129b37b8d6c6cdd1849d19430fdef2b95be715165d + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-decoder/FP32/driver-action-recognition-adas-0002-decoder.xml - name: FP32/driver-action-recognition-adas-0002-decoder.bin size: 29436380 sha256: 74c027469c0bd96192c6f7431181db59332125b1a92c707a10c27332df94d64e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-decoder/FP32/driver-action-recognition-adas-0002-decoder.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-decoder/FP32/driver-action-recognition-adas-0002-decoder.bin - name: FP16/driver-action-recognition-adas-0002-decoder.xml - size: 216197 - sha256: 318ddc4bc61a50994a4db5501c339f215be8a80406720d64d5c0c18af613035d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-decoder/FP16/driver-action-recognition-adas-0002-decoder.xml + size: 215985 + sha256: 3758cac7d73e83572c8758635363641a2657f1397079a17718cd3fd03116b416 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-decoder/FP16/driver-action-recognition-adas-0002-decoder.xml - name: FP16/driver-action-recognition-adas-0002-decoder.bin size: 14718282 sha256: ea94fa8f3d32d5258656d13f94983e4e95c56c6aa5b1cbbc0fbed668fab0e2f9 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-decoder/FP16/driver-action-recognition-adas-0002-decoder.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-decoder/FP16/driver-action-recognition-adas-0002-decoder.bin - name: FP16-INT8/driver-action-recognition-adas-0002-decoder.xml - size: 395311 - sha256: 109a61247fe412631d2f1b1161cd30da3e9013f39804f90666530b488dbbb7d5 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-decoder/FP16-INT8/driver-action-recognition-adas-0002-decoder.xml + size: 395487 + sha256: 9b03ec7a8bb875c18308c38ce404890b69fc8f222f02339112ad4794b0b68bd4 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-decoder/FP16-INT8/driver-action-recognition-adas-0002-decoder.xml - name: FP16-INT8/driver-action-recognition-adas-0002-decoder.bin size: 7398804 - sha256: 78c85595b1fb2bd346e376482913062c04c2ae7db9e22acf9395eef2b1ca6afb - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-decoder/FP16-INT8/driver-action-recognition-adas-0002-decoder.bin + sha256: 396c32db4c195578d730533571f7ec40fea683585c1f34d8358f93be13714010 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-decoder/FP16-INT8/driver-action-recognition-adas-0002-decoder.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-encoder/model.yml b/models/intel/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-encoder/model.yml index c97fa49c73a..e176f6a3ad2 100644 --- a/models/intel/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-encoder/model.yml +++ b/models/intel/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-encoder/model.yml @@ -17,28 +17,28 @@ description: >- task_type: action_recognition files: - name: FP32/driver-action-recognition-adas-0002-encoder.xml - size: 128307 - sha256: 90ff56d1dd4147364e233291819092526c291becda2c726e998df71f9825831c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-encoder/FP32/driver-action-recognition-adas-0002-encoder.xml + size: 129362 + sha256: 5c81617d19f37f95bcd9dea13d55c436f8d227188f5a12fdc6212876eed5079b + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-encoder/FP32/driver-action-recognition-adas-0002-encoder.xml - name: FP32/driver-action-recognition-adas-0002-encoder.bin size: 11450776 sha256: 12bf9bfebc74719d42bc2190bd00064ecf41b820df891040fcaa57f5eb4cffcb - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-encoder/FP32/driver-action-recognition-adas-0002-encoder.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-encoder/FP32/driver-action-recognition-adas-0002-encoder.bin - name: FP16/driver-action-recognition-adas-0002-encoder.xml - size: 128247 - sha256: 99326c9db50a955b8daf1125adb6673cadeb88a0a5a5dec6d07ba94ddfcdc74e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-encoder/FP16/driver-action-recognition-adas-0002-encoder.xml + size: 129302 + sha256: 4ff26641e18e32622565697a876d14f5390babc059e2f550cd6747428422263c + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-encoder/FP16/driver-action-recognition-adas-0002-encoder.xml - name: FP16/driver-action-recognition-adas-0002-encoder.bin size: 5725388 sha256: 165b34437d1c73bf5adf356ddc18fb6bb11b4d99d8db0921dd25894d886535ef - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-encoder/FP16/driver-action-recognition-adas-0002-encoder.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-encoder/FP16/driver-action-recognition-adas-0002-encoder.bin - name: FP16-INT8/driver-action-recognition-adas-0002-encoder.xml - size: 402764 - sha256: 099547bb680bfde08713c717ce751c332da8608c8cac8a242283662e8a76fbf3 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-encoder/FP16-INT8/driver-action-recognition-adas-0002-encoder.xml + size: 403877 + sha256: bf84faadc833816999ee5581fb2f45e405d923fc52f7fd42ccc2abcdf9f41976 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-encoder/FP16-INT8/driver-action-recognition-adas-0002-encoder.xml - name: FP16-INT8/driver-action-recognition-adas-0002-encoder.bin size: 2970016 - sha256: 48acb50bd3a69495f095be4888e2c24dedbbf0ee148c79a12b8636b47f612a5c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-encoder/FP16-INT8/driver-action-recognition-adas-0002-encoder.bin + sha256: b8cb951e0bca71e2870211d0e6b18a1f2289131adac443c03fbd1baaf5bb9412 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/driver-action-recognition-adas-0002/driver-action-recognition-adas-0002-encoder/FP16-INT8/driver-action-recognition-adas-0002-encoder.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/emotions-recognition-retail-0003/description/emotions-recognition-retail-0003.md b/models/intel/emotions-recognition-retail-0003/description/emotions-recognition-retail-0003.md index 89ba93d349e..33ef915d59c 100644 --- a/models/intel/emotions-recognition-retail-0003/description/emotions-recognition-retail-0003.md +++ b/models/intel/emotions-recognition-retail-0003/description/emotions-recognition-retail-0003.md @@ -34,8 +34,6 @@ only the images containing five aforementioned emotions is chosen. The total amo |-----------------|------------| | Accuracy | 70.20% | -## Performance - ## Inputs Name: `input`, shape: [1x3x64x64] - An input image in [1xCxHxW] format. Expected color order is BGR. diff --git a/models/intel/emotions-recognition-retail-0003/model.yml b/models/intel/emotions-recognition-retail-0003/model.yml index 8e8fd37cf03..d2974584f6b 100644 --- a/models/intel/emotions-recognition-retail-0003/model.yml +++ b/models/intel/emotions-recognition-retail-0003/model.yml @@ -17,28 +17,28 @@ description: >- task_type: object_attributes files: - name: FP32/emotions-recognition-retail-0003.xml - size: 37686 - sha256: 4fcbb8fb94ea4fc0e95e550e060bc390c59f6e3a444e484aa2a1e99f1bb13fe0 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.xml + size: 38008 + sha256: 85c130f8406818e539ca59ef5a7b0330dc345a7255e79d41a8c92aab7652c85d + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.xml - name: FP32/emotions-recognition-retail-0003.bin size: 9930028 sha256: bcb9b1a910fa3cd18a638bb1dbb0597c4ef7a080d1b83008c8e8c2c3c42b99dd - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.bin - name: FP16/emotions-recognition-retail-0003.xml - size: 37670 - sha256: f74d02bb1e03212b90b3fdf1af7a62df956a21caa79cdae7d2b86a6079a23372 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/emotions-recognition-retail-0003/FP16/emotions-recognition-retail-0003.xml + size: 37985 + sha256: a60156730d50065791321f42332bd81b1eb8f94e9a186e764dd31a4b99af1272 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/emotions-recognition-retail-0003/FP16/emotions-recognition-retail-0003.xml - name: FP16/emotions-recognition-retail-0003.bin size: 4965014 sha256: e62fb4b819b3b3ad8aafcd308d4353db2f164a1a31d78de6cf5970837aeb6f7b - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/emotions-recognition-retail-0003/FP16/emotions-recognition-retail-0003.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/emotions-recognition-retail-0003/FP16/emotions-recognition-retail-0003.bin - name: FP16-INT8/emotions-recognition-retail-0003.xml - size: 114706 - sha256: 99fea2a1f28f75b4b99ea30e064acbc40170242ded270fa47b93f6d8245e00c0 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/emotions-recognition-retail-0003/FP16-INT8/emotions-recognition-retail-0003.xml + size: 115062 + sha256: e34c1671dd2fd86d2fb972626801787045818828792cb3a84f75f2057400aaaa + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/emotions-recognition-retail-0003/FP16-INT8/emotions-recognition-retail-0003.xml - name: FP16-INT8/emotions-recognition-retail-0003.bin size: 2494128 sha256: 210c2a00ae1e977a17c4c2f59c54b3f5f99186b84c9312641ec230e699beb681 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/emotions-recognition-retail-0003/FP16-INT8/emotions-recognition-retail-0003.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/emotions-recognition-retail-0003/FP16-INT8/emotions-recognition-retail-0003.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/face-detection-0200/description/face-detection-0200.md b/models/intel/face-detection-0200/description/face-detection-0200.md index a4afd240031..0e040fc04be 100644 --- a/models/intel/face-detection-0200/description/face-detection-0200.md +++ b/models/intel/face-detection-0200/description/face-detection-0200.md @@ -24,8 +24,6 @@ Average Precision (AP) is defined as an area under the curve. All numbers were evaluated by taking into account only faces bigger than 64 x 64 pixels. -## Performance - ## Inputs Name: `input`, shape: [1x3x256x256] - An input image in the format [BxCxHxW], @@ -44,7 +42,7 @@ The net outputs blob with shape: [1, 1, N, 7], where N is the number of detected bounding boxes. Each detection has the format [`image_id`, `label`, `conf`, `x_min`, `y_min`, `x_max`, `y_max`], where: - `image_id` - ID of the image in the batch - - `label` - predicted class ID + - `label` - predicted class ID (0 - face) - `conf` - confidence for the predicted class - (`x_min`, `y_min`) - coordinates of the top left bounding box corner - (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner. diff --git a/models/intel/face-detection-0200/model.yml b/models/intel/face-detection-0200/model.yml index e504e8c044d..56ec9f9a49d 100644 --- a/models/intel/face-detection-0200/model.yml +++ b/models/intel/face-detection-0200/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/face-detection-0200.xml - size: 186720 - sha256: 853ad2a4a6ae336029f06ee3624a88cae963552043da513f64d7132b5aa6ed95 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0200/FP32/face-detection-0200.xml + size: 187837 + sha256: f9f805d40b1084e295501c68e086cca6462d1aa0a110ff31b387d4b647b685f3 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0200/FP32/face-detection-0200.xml - name: FP32/face-detection-0200.bin size: 7269168 sha256: 7d95167a92652b22e11f5894c3a089d1559f18788ac93fb4aa4f292c33e8da22 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0200/FP32/face-detection-0200.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0200/FP32/face-detection-0200.bin - name: FP16/face-detection-0200.xml - size: 186657 - sha256: f829421ce851d1843c4b30db74f1e7f8c069ca03a36acf8548afd82fd85e1404 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0200/FP16/face-detection-0200.xml + size: 187774 + sha256: 5430e07e5b14488782f9d9c38dccfe0704115a45b3cf6fc83db6efc5b68f2a5e + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0200/FP16/face-detection-0200.xml - name: FP16/face-detection-0200.bin size: 3634626 sha256: 74faab1e2d7b7133ea1141d5004b1ebb2c1f0a4bfcbfff536750dca4ed29ef0a - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0200/FP16/face-detection-0200.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0200/FP16/face-detection-0200.bin - name: FP16-INT8/face-detection-0200.xml - size: 493056 - sha256: 500e706192bcd3e723fb4d6fd682a4a237570c26a354cdd4761c579b2cc3c5db - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0200/FP16-INT8/face-detection-0200.xml + size: 494349 + sha256: eaec4e697781cd41336d494fcbd59f170e98670247c57224d4c8a54c7c584e32 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0200/FP16-INT8/face-detection-0200.xml - name: FP16-INT8/face-detection-0200.bin size: 1921621 sha256: 6e4228c91e6b7a05ee2b833624a368c2e9d2aafcae167ee9b26d4a37eb3f246d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0200/FP16-INT8/face-detection-0200.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0200/FP16-INT8/face-detection-0200.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/face-detection-0202/description/face-detection-0202.md b/models/intel/face-detection-0202/description/face-detection-0202.md index dfd5beeb087..891a3b599ef 100644 --- a/models/intel/face-detection-0202/description/face-detection-0202.md +++ b/models/intel/face-detection-0202/description/face-detection-0202.md @@ -24,8 +24,6 @@ Average Precision (AP) is defined as an area under the curve. All numbers were evaluated by taking into account only faces bigger than 64 x 64 pixels. -## Performance - ## Inputs Name: `input`, shape: [1x3x384x384] - An input image in the format [BxCxHxW], @@ -44,7 +42,7 @@ The net outputs blob with shape: [1, 1, N, 7], where N is the number of detected bounding boxes. Each detection has the format [`image_id`, `label`, `conf`, `x_min`, `y_min`, `x_max`, `y_max`], where: - `image_id` - ID of the image in the batch - - `label` - predicted class ID + - `label` - predicted class ID (0 - face) - `conf` - confidence for the predicted class - (`x_min`, `y_min`) - coordinates of the top left bounding box corner - (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner. diff --git a/models/intel/face-detection-0202/model.yml b/models/intel/face-detection-0202/model.yml index 8c39a1bcdd5..4b46fbc0ec5 100644 --- a/models/intel/face-detection-0202/model.yml +++ b/models/intel/face-detection-0202/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/face-detection-0202.xml - size: 186900 - sha256: fa9f4386ba32e8cff2f339a2ba43e110a9d0147a25985abf2033e18c539f20e5 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0202/FP32/face-detection-0202.xml + size: 188017 + sha256: ebb293aa5160fa23a170e8a9d77eb029d4fff1ad99a796f379cccf6b140e31e5 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0202/FP32/face-detection-0202.xml - name: FP32/face-detection-0202.bin size: 7269168 sha256: 9acf390e0a36dd6f579873f92d73064c0b1528a9b05280367152d8f7121a02db - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0202/FP32/face-detection-0202.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0202/FP32/face-detection-0202.bin - name: FP16/face-detection-0202.xml - size: 186837 - sha256: 98ac5479c6591576963eb7f090c0ea9667d29789abf63d68e5370140a129fc38 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0202/FP16/face-detection-0202.xml + size: 187954 + sha256: 17cc4411814fd6caf884461706c465b318fc22e2288adb3a79838472b0419926 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0202/FP16/face-detection-0202.xml - name: FP16/face-detection-0202.bin size: 3634626 sha256: d81b09ab3740b1ce820e371a3d8bba5807edd3338aa641c06791c264391ce893 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0202/FP16/face-detection-0202.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0202/FP16/face-detection-0202.bin - name: FP16-INT8/face-detection-0202.xml - size: 493292 - sha256: 1699cfe06217e4029efb5bb81ab56ac02df548e01e360deec6ac0232d6fb7ef3 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0202/FP16-INT8/face-detection-0202.xml + size: 494585 + sha256: b8b237744bf831cd253f45118a4b74344c49a29d56a5f7507e3e01c8a665479d + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0202/FP16-INT8/face-detection-0202.xml - name: FP16-INT8/face-detection-0202.bin size: 1921621 sha256: b0c702570b962554083c68c6bb9fa6bceabdd56571daf4bda7e4d3c0c700b4ff - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0202/FP16-INT8/face-detection-0202.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0202/FP16-INT8/face-detection-0202.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/face-detection-0204/description/face-detection-0204.md b/models/intel/face-detection-0204/description/face-detection-0204.md index 9958cf51ae4..54808c0c868 100644 --- a/models/intel/face-detection-0204/description/face-detection-0204.md +++ b/models/intel/face-detection-0204/description/face-detection-0204.md @@ -24,8 +24,6 @@ Average Precision (AP) is defined as an area under the curve. All numbers were evaluated by taking into account only faces bigger than 64 x 64 pixels. -## Performance - ## Inputs Name: `input`, shape: [1x3x448x448] - An input image in the format [BxCxHxW], @@ -44,7 +42,7 @@ The net outputs blob with shape: [1, 1, N, 7], where N is the number of detected bounding boxes. Each detection has the format [`image_id`, `label`, `conf`, `x_min`, `y_min`, `x_max`, `y_max`], where: - `image_id` - ID of the image in the batch - - `label` - predicted class ID + - `label` - predicted class ID (0 - face) - `conf` - confidence for the predicted class - (`x_min`, `y_min`) - coordinates of the top left bounding box corner - (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner. diff --git a/models/intel/face-detection-0204/model.yml b/models/intel/face-detection-0204/model.yml index e734b6db90f..057314b6203 100644 --- a/models/intel/face-detection-0204/model.yml +++ b/models/intel/face-detection-0204/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/face-detection-0204.xml - size: 186991 - sha256: 6c68df3fd4e601049146c84fa08e9fe4ede45381c3b110eab8c7e022ac5298f2 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0204/FP32/face-detection-0204.xml + size: 188108 + sha256: 9b50904183c08881c315efbe1deb7ad105a6343599ee9d852328e88ec25be951 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0204/FP32/face-detection-0204.xml - name: FP32/face-detection-0204.bin size: 7269168 sha256: a44f6042503cbd206bca55164820fa924330c963ff7eccc5d1ead59255d8a9f5 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0204/FP32/face-detection-0204.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0204/FP32/face-detection-0204.bin - name: FP16/face-detection-0204.xml - size: 186928 - sha256: 19cc5d489b8303996434d7b6619ceaed7ef4595cd434759467453b95ec827eb7 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0204/FP16/face-detection-0204.xml + size: 188045 + sha256: 29d995c68229944c8a19965e274e1ebec53ee159172f0730dc61612257c69dc7 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0204/FP16/face-detection-0204.xml - name: FP16/face-detection-0204.bin size: 3634626 sha256: 62c9cf76281da1332ac5b27d2c96a4d2104d739a9d9a8eba7f6c78e8eb7036d6 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0204/FP16/face-detection-0204.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0204/FP16/face-detection-0204.bin - name: FP16-INT8/face-detection-0204.xml - size: 493415 - sha256: cd6895eb2f815dded58e32bab7d8c03a6b8beec826b0da3816f6e13dfeee007d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0204/FP16-INT8/face-detection-0204.xml + size: 494708 + sha256: ca5857214fbe9ffd102a9212d0b7b88fcc566b992e6b55b21a658ec75e0ac484 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0204/FP16-INT8/face-detection-0204.xml - name: FP16-INT8/face-detection-0204.bin size: 1921621 sha256: c1a20bf893c8f3e4102fdab3d6b2935e4178b07ea985b1df850ba3e49274006b - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0204/FP16-INT8/face-detection-0204.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0204/FP16-INT8/face-detection-0204.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/face-detection-0205/description/face-detection-0205.md b/models/intel/face-detection-0205/description/face-detection-0205.md index c625a806d5a..6c385bac774 100644 --- a/models/intel/face-detection-0205/description/face-detection-0205.md +++ b/models/intel/face-detection-0205/description/face-detection-0205.md @@ -23,8 +23,6 @@ Average Precision (AP) is defined as an area under the curve. All numbers were evaluated by taking into account only faces bigger than 64 x 64 pixels. -## Performance - ## Inputs Name: `input`, shape: [1x3x416x416] - An input image in the format [BxCxHxW], @@ -47,7 +45,7 @@ Expected color order: BGR. - (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner - `conf` - confidence for the predicted class 2. The `labels` is a blob with the shape [N], where N is the number of detected - bounding boxes. It contains `label` per each detected box. + bounding boxes. It contains `label` (0 - face) per each detected box. ## Legal Information [*] Other names and brands may be claimed as the property of others. diff --git a/models/intel/face-detection-0205/model.yml b/models/intel/face-detection-0205/model.yml index 96e7ccfafb3..b55506eead1 100644 --- a/models/intel/face-detection-0205/model.yml +++ b/models/intel/face-detection-0205/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/face-detection-0205.xml - size: 825605 - sha256: fbd72bf38afd7b754daa66d64a02b2f66e6a0c20fb9be77f4b6500c1793807eb - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0205/FP32/face-detection-0205.xml + size: 823143 + sha256: 5c2dd7d3e7df6cb5a8f9ce1d4d3127ddfb8d4eb19ccb50e3bd0f8a8e6249a31b + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0205/FP32/face-detection-0205.xml - name: FP32/face-detection-0205.bin - size: 8049912 - sha256: 45fb0cc0fe16ada1c7b05767689f9f3e13492c778d4ca7135898518df61ad49c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0205/FP32/face-detection-0205.bin + size: 8049892 + sha256: 6d1d7cfbcc7eddc9001522845a3a321a74d5bad4afe7f670f17646a616884adb + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0205/FP32/face-detection-0205.bin - name: FP16/face-detection-0205.xml - size: 825443 - sha256: 4d93462e1e6e73dedc157e004c7998a6626f0ee61f31f238c0ebbd6606976fd2 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0205/FP16/face-detection-0205.xml + size: 822981 + sha256: 7844162e7ffe3df7b4b8a5d372bcc345d3765cc23c5a6f5a626f88298ff734de + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0205/FP16/face-detection-0205.xml - name: FP16/face-detection-0205.bin - size: 4025148 - sha256: 4a170639e45eaf5de02170e5542d8ffa332d15b3021522b2cd39a5bb368bb0f9 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0205/FP16/face-detection-0205.bin + size: 4025130 + sha256: 1b8d004fcbbc9e6222501cd1f94e69a3db3d20e492fed12824013555a9d234fe + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0205/FP16/face-detection-0205.bin - name: FP16-INT8/face-detection-0205.xml - size: 1456577 - sha256: ddf7edb0fe301d8358306b9d6dd09941f85e336b99f1fca87ae2a2d1db102ccd - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0205/FP16-INT8/face-detection-0205.xml + size: 1455446 + sha256: 9b42c94e24b234d26131324444f739cae1f1641979cdbc7ec1e3d03b0e26bdca + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0205/FP16-INT8/face-detection-0205.xml - name: FP16-INT8/face-detection-0205.bin - size: 2115144 - sha256: 0fb611e3d0e31c18cd16cac39ef653524ebb9aba38fcf807d11914bad702dd3c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0205/FP16-INT8/face-detection-0205.bin + size: 2115128 + sha256: 70e6aeca9364cb5c9ba06e08aee977adef51ee0daa7b25dc1f77381d20827db7 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0205/FP16-INT8/face-detection-0205.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/face-detection-0206/description/face-detection-0206.md b/models/intel/face-detection-0206/description/face-detection-0206.md index fcd6dd1aad0..cd386e0ca97 100644 --- a/models/intel/face-detection-0206/description/face-detection-0206.md +++ b/models/intel/face-detection-0206/description/face-detection-0206.md @@ -23,8 +23,6 @@ Average Precision (AP) is defined as an area under the curve. All numbers were evaluated by taking into account only faces bigger than 64 x 64 pixels. -## Performance - ## Inputs Name: `input`, shape: [1x3x640x640] - An input image in the format [BxCxHxW], @@ -47,7 +45,7 @@ Expected color order: BGR. - (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner - `conf` - confidence for the predicted class 2. The `labels` is a blob with the shape [N], where N is the number of detected - bounding boxes. It contains `label` per each detected box. + bounding boxes. It contains `label` (0 - face) per each detected box. ## Legal Information [*] Other names and brands may be claimed as the property of others. diff --git a/models/intel/face-detection-0206/model.yml b/models/intel/face-detection-0206/model.yml index 30d0a09a52c..b220fc417f0 100644 --- a/models/intel/face-detection-0206/model.yml +++ b/models/intel/face-detection-0206/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/face-detection-0206.xml - size: 1437585 - sha256: 5e058ba8533393e1940b095016ac43536a6e2903d83252e689961c91df28a610 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0206/FP32/face-detection-0206.xml + size: 1438058 + sha256: 89387d986e28c4a341a2e2b2a71523a39b7425cfbb38c2796ac5a0863516f123 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0206/FP32/face-detection-0206.xml - name: FP32/face-detection-0206.bin size: 254925252 sha256: 17639150fdbd81f7c0dca4d292047811c8b069ed322712fcba74d05c8d804f0e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0206/FP32/face-detection-0206.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0206/FP32/face-detection-0206.bin - name: FP16/face-detection-0206.xml - size: 1437105 - sha256: c86c09f2cd5ac897e16ed3241c9e8cbb3da3a6a583891c2031b04df5a857535c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0206/FP16/face-detection-0206.xml + size: 1437578 + sha256: d09da0150fe2e0f163d150ec6a3a55cc9bcf27b57992d1bc9b5cd7b377ad6b6c + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0206/FP16/face-detection-0206.xml - name: FP16/face-detection-0206.bin size: 127462834 sha256: 3ef680d4a3e62e1ca167824929fa0478837e663305467877f2a31654533ec6b0 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0206/FP16/face-detection-0206.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0206/FP16/face-detection-0206.bin - name: FP16-INT8/face-detection-0206.xml - size: 2701111 - sha256: f9961a289036984f521796f042f65dc6a1bbcb560f57bf0d509ce3baa83d3160 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0206/FP16-INT8/face-detection-0206.xml + size: 2703277 + sha256: 7d03e912392d97c1949f8682416fad9a2759b840f5c0e7750d8ca119360246e5 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0206/FP16-INT8/face-detection-0206.xml - name: FP16-INT8/face-detection-0206.bin size: 64135764 sha256: 9f3607e4a5c79b96c3312241d146731c4a1e5f4f686b947ce91dd0ada0db6ac9 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-0206/FP16-INT8/face-detection-0206.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-0206/FP16-INT8/face-detection-0206.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/face-detection-adas-0001/description/face-detection-adas-0001.md b/models/intel/face-detection-adas-0001/description/face-detection-adas-0001.md index cf03025cfa0..89124bf22cf 100644 --- a/models/intel/face-detection-adas-0001/description/face-detection-adas-0001.md +++ b/models/intel/face-detection-adas-0001/description/face-detection-adas-0001.md @@ -28,8 +28,6 @@ Average Precision (AP) is defined as an area under the curve. Numbers are on [Wider Face](http://shuoyang1213.me/WIDERFACE/) validation subset. -## Performance - ## Inputs Name: `input`, shape: [1x3x384x672] - An input image in the format [BxCxHxW], @@ -47,7 +45,7 @@ The net outputs blob with shape: [1, 1, N, 7], where N is the number of detected bounding boxes. The results are sorted by confidence in decreasing order. Each detection has the format [`image_id`, `label`, `conf`, `x_min`, `y_min`, `x_max`, `y_max`], where: - `image_id` - ID of the image in the batch - - `label` - predicted class ID + - `label` - predicted class ID (1 - face) - `conf` - confidence for the predicted class - (`x_min`, `y_min`) - coordinates of the top left bounding box corner - (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner. diff --git a/models/intel/face-detection-adas-0001/model.yml b/models/intel/face-detection-adas-0001/model.yml index b22c07880ac..66773e71365 100644 --- a/models/intel/face-detection-adas-0001/model.yml +++ b/models/intel/face-detection-adas-0001/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/face-detection-adas-0001.xml - size: 224545 - sha256: 3b93156c73fc86f6cfaa72a493a12ef4c13ae7e4ba53ef4ee1a7e10747128e15 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-adas-0001/FP32/face-detection-adas-0001.xml + size: 226000 + sha256: 0f2412f03f8d03d431d6c178eebcdbe0d39beb23b07ad7382a0145a66f18ce05 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-adas-0001/FP32/face-detection-adas-0001.xml - name: FP32/face-detection-adas-0001.bin size: 4212072 sha256: 811a332d80dc1891dc8254192e03de6a6de821af1cf0c1968f7632022d340524 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-adas-0001/FP32/face-detection-adas-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-adas-0001/FP32/face-detection-adas-0001.bin - name: FP16/face-detection-adas-0001.xml - size: 224509 - sha256: 3132f83cb433e53f8ea88e7973e257f76129d3a9b3c5c31b694b111346d8b67c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-adas-0001/FP16/face-detection-adas-0001.xml + size: 225964 + sha256: b490248f5105573ec3a22a695add6ef5b1701bed71963e01e9e56cde03ef1ac8 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-adas-0001/FP16/face-detection-adas-0001.xml - name: FP16/face-detection-adas-0001.bin size: 2106088 sha256: df0f5799d801c6afb355d1c4771693c782efbb58d2eb2238982eac8fe84bc821 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-adas-0001/FP16/face-detection-adas-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-adas-0001/FP16/face-detection-adas-0001.bin - name: FP16-INT8/face-detection-adas-0001.xml - size: 520036 - sha256: 2a8a3075eb7b243fc4072091b6548513131be4335c9af78d108080fa9c45913a - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-adas-0001/FP16-INT8/face-detection-adas-0001.xml + size: 521527 + sha256: d732732dd4ec9820057912d46786624cb12f904a4d945d8ef5e2198cb13401b0 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-adas-0001/FP16-INT8/face-detection-adas-0001.xml - name: FP16-INT8/face-detection-adas-0001.bin size: 1100296 sha256: 7d3396eb28d928f8e7a8caf7536cb6e402b3f13f2090c57b5832c4bb9da5226c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-adas-0001/FP16-INT8/face-detection-adas-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-adas-0001/FP16-INT8/face-detection-adas-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/face-detection-retail-0004/description/face-detection-retail-0004.md b/models/intel/face-detection-retail-0004/description/face-detection-retail-0004.md index 16541760b13..a70f8fc6291 100644 --- a/models/intel/face-detection-retail-0004/description/face-detection-retail-0004.md +++ b/models/intel/face-detection-retail-0004/description/face-detection-retail-0004.md @@ -25,8 +25,6 @@ Average Precision (AP) is defined as an area under the curve. All numbers were evaluated by taking into account only faces bigger than 60 x 60 pixels. -## Performance - ## Inputs Name: `input`, shape: [1x3x300x300] - An input image in the format [BxCxHxW], @@ -45,7 +43,7 @@ The net outputs blob with shape: [1, 1, N, 7], where N is the number of detected bounding boxes. Each detection has the format [`image_id`, `label`, `conf`, `x_min`, `y_min`, `x_max`, `y_max`], where: - `image_id` - ID of the image in the batch - - `label` - predicted class ID + - `label` - predicted class ID (1 - face) - `conf` - confidence for the predicted class - (`x_min`, `y_min`) - coordinates of the top left bounding box corner - (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner. diff --git a/models/intel/face-detection-retail-0004/model.yml b/models/intel/face-detection-retail-0004/model.yml index bc4d8db6a52..87eae6e564c 100644 --- a/models/intel/face-detection-retail-0004/model.yml +++ b/models/intel/face-detection-retail-0004/model.yml @@ -18,28 +18,28 @@ description: >- task_type: detection files: - name: FP32/face-detection-retail-0004.xml - size: 100376 - sha256: 01ac4cf7dea36f6fea52a9318b65cc8f2f023fa3f42852d8a13a9093a92ec1cd - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-retail-0004/FP32/face-detection-retail-0004.xml + size: 101038 + sha256: 955eacaaa0b0b08afa0a88c4761480010f171250d504df1717aee760adc1267a + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-retail-0004/FP32/face-detection-retail-0004.xml - name: FP32/face-detection-retail-0004.bin size: 2352984 sha256: 89349ce12dd21c5263fb302cd3ffd4b73c35ea12ed98aff863d03a2cf3a32464 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-retail-0004/FP32/face-detection-retail-0004.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-retail-0004/FP32/face-detection-retail-0004.bin - name: FP16/face-detection-retail-0004.xml - size: 100334 - sha256: 96c334ef737a89eb66606483f3985ee0d541d2b33d90d767c420e2917e5ed308 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-retail-0004/FP16/face-detection-retail-0004.xml + size: 100995 + sha256: fb362699cc4102e5232a7268d702ea00b311057adf7d0dd3bfcb8d3a36a5819a + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-retail-0004/FP16/face-detection-retail-0004.xml - name: FP16/face-detection-retail-0004.bin size: 1176544 sha256: ab7def342edab22e69ba1ef4e971983ea4e0f337c43b0a49c7ef3a7627f6cf1a - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-retail-0004/FP16/face-detection-retail-0004.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-retail-0004/FP16/face-detection-retail-0004.bin - name: FP16-INT8/face-detection-retail-0004.xml - size: 246681 - sha256: 52a97670dba9131dff391dbf5cde109eb5bffc830f11ffe267d52a60ec264795 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-retail-0004/FP16-INT8/face-detection-retail-0004.xml + size: 247355 + sha256: cdaad76d2a30eb500a54b4a0a0c40f923b3a04041bf933e15232c71bc71c081c + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-retail-0004/FP16-INT8/face-detection-retail-0004.xml - name: FP16-INT8/face-detection-retail-0004.bin size: 600350 - sha256: b2f612aea9f45f9c6a26498b8a53c9e4603c63455f0f4a02af37f8bd506c5653 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-retail-0004/FP16-INT8/face-detection-retail-0004.bin + sha256: 5fa7815213f0f243fb03704ed53afa048c1b6563d2a729540996020d103f7ed6 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-retail-0004/FP16-INT8/face-detection-retail-0004.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/face-detection-retail-0005/description/face-detection-retail-0005.md b/models/intel/face-detection-retail-0005/description/face-detection-retail-0005.md index 9808ce10844..a59ff07f957 100644 --- a/models/intel/face-detection-retail-0005/description/face-detection-retail-0005.md +++ b/models/intel/face-detection-retail-0005/description/face-detection-retail-0005.md @@ -24,8 +24,6 @@ Average Precision (AP) is defined as an area under the curve. All numbers were evaluated by taking into account only faces bigger than 60 x 60 pixels. -## Performance - ## Inputs Name: `input`, shape: [1x3x300x300] - An input image in the format [BxCxHxW], @@ -44,7 +42,7 @@ The net outputs blob with shape: [1, 1, N, 7], where N is the number of detected bounding boxes. Each detection has the format [`image_id`, `label`, `conf`, `x_min`, `y_min`, `x_max`, `y_max`], where: - `image_id` - ID of the image in the batch - - `label` - predicted class ID + - `label` - predicted class ID (1 - face) - `conf` - confidence for the predicted class - (`x_min`, `y_min`) - coordinates of the top left bounding box corner - (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner. diff --git a/models/intel/face-detection-retail-0005/model.yml b/models/intel/face-detection-retail-0005/model.yml index 97e0ee30e36..f9bdd3cb18e 100644 --- a/models/intel/face-detection-retail-0005/model.yml +++ b/models/intel/face-detection-retail-0005/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/face-detection-retail-0005.xml - size: 158758 - sha256: c7e263f7c5fdcf68112b28f165d1a11f32e935882f76c9c951801d369d2d6b74 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-retail-0005/FP32/face-detection-retail-0005.xml + size: 159822 + sha256: 76c4cd72e6bf0e4ac9215fe8d826494ff3ff0e24b527d590d5b8b4851f37add5 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-retail-0005/FP32/face-detection-retail-0005.xml - name: FP32/face-detection-retail-0005.bin size: 4083112 sha256: 27965fe54915256c9f0b134a89a846df07898492659d1751ad5a4a95f7486a14 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-retail-0005/FP32/face-detection-retail-0005.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-retail-0005/FP32/face-detection-retail-0005.bin - name: FP16/face-detection-retail-0005.xml - size: 158677 - sha256: e541424c58bab8d20ef9514156287ad7accf12b843b6df3cd5072775153268cd - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-retail-0005/FP16/face-detection-retail-0005.xml + size: 159741 + sha256: f7a98570eb0cb8d44f8f6149531ab89e68092d1ced368bf8d430b5d1f99ad956 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-retail-0005/FP16/face-detection-retail-0005.xml - name: FP16/face-detection-retail-0005.bin size: 2041598 sha256: 48a974efac09b993eaae2316466dc616c419acec0e109d6ae8e0ac061f9214f0 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-retail-0005/FP16/face-detection-retail-0005.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-retail-0005/FP16/face-detection-retail-0005.bin - name: FP16-INT8/face-detection-retail-0005.xml - size: 445434 - sha256: b2ef52c8400546776747a3326d6339e271ff992f9917bb3644e946b7ebef909e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-retail-0005/FP16-INT8/face-detection-retail-0005.xml + size: 446640 + sha256: bf14ab2ece9b858f0cc1532b6686d64cdee09a57994de4a02549bcf313f44f9e + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-retail-0005/FP16-INT8/face-detection-retail-0005.xml - name: FP16-INT8/face-detection-retail-0005.bin size: 1098793 - sha256: 9b475378a4f4119712e0e345a42fff6608b24d9b47efd97ccc9495c0a41fe605 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/face-detection-retail-0005/FP16-INT8/face-detection-retail-0005.bin + sha256: 5664b172931853033196f463957b1d1a3bf4cdd8baed40f0a50466dae9452511 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/face-detection-retail-0005/FP16-INT8/face-detection-retail-0005.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/facial-landmarks-35-adas-0002/description/facial-landmarks-35-adas-0002.md b/models/intel/facial-landmarks-35-adas-0002/description/facial-landmarks-35-adas-0002.md index 7676105b108..5fcd29dc39c 100644 --- a/models/intel/facial-landmarks-35-adas-0002/description/facial-landmarks-35-adas-0002.md +++ b/models/intel/facial-landmarks-35-adas-0002/description/facial-landmarks-35-adas-0002.md @@ -60,8 +60,6 @@ where N is the number of landmarks, _p_-hat and _p_ are, correspondingly, the pr | Internal dataset | 0.106 | 0.143 | 0.038 | -## Performance - ## Inputs * Blob in the format [BxCxHxW] diff --git a/models/intel/facial-landmarks-35-adas-0002/model.yml b/models/intel/facial-landmarks-35-adas-0002/model.yml index 0aaed8b0b10..69c8e27be1c 100644 --- a/models/intel/facial-landmarks-35-adas-0002/model.yml +++ b/models/intel/facial-landmarks-35-adas-0002/model.yml @@ -17,28 +17,28 @@ description: >- task_type: object_attributes files: - name: FP32/facial-landmarks-35-adas-0002.xml - size: 237171 - sha256: 09e9a1b5ad8f7e4c0f431dddbf6d872b4b63cfbc6c7ba320af51a4e8fcd293ee - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/facial-landmarks-35-adas-0002/FP32/facial-landmarks-35-adas-0002.xml + size: 239056 + sha256: 2ea7cbcc00dda5f8141c84b217a5b91caf5b223718026903d0738aa8c178104e + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/facial-landmarks-35-adas-0002/FP32/facial-landmarks-35-adas-0002.xml - name: FP32/facial-landmarks-35-adas-0002.bin size: 18381152 sha256: e1a325159eb1a0a7cd918d1a1d4cde250c2f6626737aa76597fb405e37af87c6 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/facial-landmarks-35-adas-0002/FP32/facial-landmarks-35-adas-0002.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/facial-landmarks-35-adas-0002/FP32/facial-landmarks-35-adas-0002.bin - name: FP16/facial-landmarks-35-adas-0002.xml - size: 237034 - sha256: 894bb182bf0a9dff3a0fae016ee502d642c250640e1d1e1cb377c05d65534f4c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/facial-landmarks-35-adas-0002/FP16/facial-landmarks-35-adas-0002.xml + size: 238919 + sha256: 517e0769c74b5555761cb5cb135ab389c91d83eb39845c39bdf03bbbdc298700 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/facial-landmarks-35-adas-0002/FP16/facial-landmarks-35-adas-0002.xml - name: FP16/facial-landmarks-35-adas-0002.bin size: 9190584 sha256: 69952f73ba3239f8692ee41514ceff793a014e2a7a777faa570f0a8aaf17278d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/facial-landmarks-35-adas-0002/FP16/facial-landmarks-35-adas-0002.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/facial-landmarks-35-adas-0002/FP16/facial-landmarks-35-adas-0002.bin - name: FP16-INT8/facial-landmarks-35-adas-0002.xml - size: 643170 - sha256: 6f747663119621482af10ca5bd73d59378c83cb3d0c86725c588859079239a4b - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/facial-landmarks-35-adas-0002/FP16-INT8/facial-landmarks-35-adas-0002.xml + size: 645091 + sha256: 451f89782c3e81c153654389cbc8bf2cb15fb7beb9820f8cc7d57887361d1017 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/facial-landmarks-35-adas-0002/FP16-INT8/facial-landmarks-35-adas-0002.xml - name: FP16-INT8/facial-landmarks-35-adas-0002.bin size: 4634174 sha256: c592f9f8e764e806c536b61385ed703b153c83b8ef662701e53cd41d3756e9d2 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/facial-landmarks-35-adas-0002/FP16-INT8/facial-landmarks-35-adas-0002.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/facial-landmarks-35-adas-0002/FP16-INT8/facial-landmarks-35-adas-0002.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/faster-rcnn-resnet101-coco-sparse-60-0001/description/faster-rcnn-resnet101-coco-sparse-60-0001.md b/models/intel/faster-rcnn-resnet101-coco-sparse-60-0001/description/faster-rcnn-resnet101-coco-sparse-60-0001.md index e2b8bd23db8..98beeebf93d 100644 --- a/models/intel/faster-rcnn-resnet101-coco-sparse-60-0001/description/faster-rcnn-resnet101-coco-sparse-60-0001.md +++ b/models/intel/faster-rcnn-resnet101-coco-sparse-60-0001/description/faster-rcnn-resnet101-coco-sparse-60-0001.md @@ -19,8 +19,6 @@ The model input is a blob that consists of a single image of `1x3x800x1280` in t See Average Precision metric description at [COCO: Common Objects in Context](https://cocodataset.org/#detection-eval). The primary challenge metric is used. Tested on the COCO validation dataset. -## Performance - ## Inputs Name: `input`, shape: [1x3x800x1280] - An input image in the format [BxCxHxW], diff --git a/models/intel/faster-rcnn-resnet101-coco-sparse-60-0001/model.yml b/models/intel/faster-rcnn-resnet101-coco-sparse-60-0001/model.yml index 0ca10d70fcf..f91ddaba0e1 100644 --- a/models/intel/faster-rcnn-resnet101-coco-sparse-60-0001/model.yml +++ b/models/intel/faster-rcnn-resnet101-coco-sparse-60-0001/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/faster-rcnn-resnet101-coco-sparse-60-0001.xml - size: 311266 - sha256: 0ae4453c2e9e387f3ef83c8f8fb60e07d044df9fd90ed84906a04976eb379882 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/faster-rcnn-resnet101-coco-sparse-60-0001/FP32/faster-rcnn-resnet101-coco-sparse-60-0001.xml + size: 311285 + sha256: b8b692d354023dff9c88b8ee90f656166b11f9c325464104e641a8a11a6d4c7d + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/faster-rcnn-resnet101-coco-sparse-60-0001/FP32/faster-rcnn-resnet101-coco-sparse-60-0001.xml - name: FP32/faster-rcnn-resnet101-coco-sparse-60-0001.bin size: 211169864 sha256: ac35543955374fa5ffc0f96c196c1a6831012c2ff76dd5d55d97e45e89035468 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/faster-rcnn-resnet101-coco-sparse-60-0001/FP32/faster-rcnn-resnet101-coco-sparse-60-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/faster-rcnn-resnet101-coco-sparse-60-0001/FP32/faster-rcnn-resnet101-coco-sparse-60-0001.bin - name: FP16/faster-rcnn-resnet101-coco-sparse-60-0001.xml - size: 311105 - sha256: 25ac1118f49891f4b26b830f991c62577af01d2ac85bd2dcc5c54eb09bc628c6 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/faster-rcnn-resnet101-coco-sparse-60-0001/FP16/faster-rcnn-resnet101-coco-sparse-60-0001.xml + size: 311124 + sha256: a85511d926740fe75e6ce561573438a577bb17c74d6cca0dcd840df1c28c1d9a + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/faster-rcnn-resnet101-coco-sparse-60-0001/FP16/faster-rcnn-resnet101-coco-sparse-60-0001.xml - name: FP16/faster-rcnn-resnet101-coco-sparse-60-0001.bin size: 105585010 sha256: 43482eb7feee83ebee97520b83b9e5d99cd1f8b109fa6993fe466a467b57ce3e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/faster-rcnn-resnet101-coco-sparse-60-0001/FP16/faster-rcnn-resnet101-coco-sparse-60-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/faster-rcnn-resnet101-coco-sparse-60-0001/FP16/faster-rcnn-resnet101-coco-sparse-60-0001.bin - name: FP16-INT8/faster-rcnn-resnet101-coco-sparse-60-0001.xml - size: 860077 - sha256: 2878e0f540c632a70aadf203c036f4ba700baaeba6d20841c509fc71943517d4 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/faster-rcnn-resnet101-coco-sparse-60-0001/FP16-INT8/faster-rcnn-resnet101-coco-sparse-60-0001.xml + size: 862380 + sha256: 03a5b50bb775d38112e181986a179f9de21b467c6bfc0a4168ed56db269ae764 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/faster-rcnn-resnet101-coco-sparse-60-0001/FP16-INT8/faster-rcnn-resnet101-coco-sparse-60-0001.xml - name: FP16-INT8/faster-rcnn-resnet101-coco-sparse-60-0001.bin size: 54722723 - sha256: 0231414d5510c0a87acb23c826cfa696151199d9d33b2d8b2ec6ecc128d7444f - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/faster-rcnn-resnet101-coco-sparse-60-0001/FP16-INT8/faster-rcnn-resnet101-coco-sparse-60-0001.bin + sha256: c1be3b6e52e61046104ba48fbc5fb5c0b56ab878365e0facf8b890dfff2c2a72 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/faster-rcnn-resnet101-coco-sparse-60-0001/FP16-INT8/faster-rcnn-resnet101-coco-sparse-60-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/formula-recognition-medium-scan-0001/description/formula-recognition-medium-scan-0001.md b/models/intel/formula-recognition-medium-scan-0001/description/formula-recognition-medium-scan-0001.md index ccdeef3f786..3b1d8d6d2a4 100644 --- a/models/intel/formula-recognition-medium-scan-0001/description/formula-recognition-medium-scan-0001.md +++ b/models/intel/formula-recognition-medium-scan-0001/description/formula-recognition-medium-scan-0001.md @@ -36,8 +36,6 @@ The formula-recognition-medium-scan-0001-encoder model is a ResNeXt-50 like back | MParams | 1.69 | -### Performance - ### Inputs 1. Name: `imgs` , shape: [1x3x160x1400]. An input image in the [1xCxHxW] format. @@ -62,8 +60,6 @@ The formula-recognition-medium-scan-0001-decoder model is an LSTM based decoder -### Performance - ### Inputs 1. Name: `dec_st_c` , shape: [1x512]. Current context state of the LSTM cell. diff --git a/models/intel/formula-recognition-medium-scan-0001/formula-recognition-medium-scan-0001-im2latex-decoder/model.yml b/models/intel/formula-recognition-medium-scan-0001/formula-recognition-medium-scan-0001-im2latex-decoder/model.yml index 23ec33e426a..099e15caa66 100644 --- a/models/intel/formula-recognition-medium-scan-0001/formula-recognition-medium-scan-0001-im2latex-decoder/model.yml +++ b/models/intel/formula-recognition-medium-scan-0001/formula-recognition-medium-scan-0001-im2latex-decoder/model.yml @@ -17,20 +17,20 @@ description: >- task_type: token_recognition files: - name: FP32/formula-recognition-medium-scan-0001-im2latex-decoder.xml - size: 49105 - sha256: 6684a3f59fbc4b675771a83f0ce32746f4165bb58d547837a8c79d49b7b1e33e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/formula-recognition-medium-scan-0001/formula-recognition-medium-scan-0001-im2latex-decoder/FP32/formula-recognition-medium-scan-0001-im2latex-decoder.xml + size: 48826 + sha256: 95590206f28dcf740db3696e94c9aaa33f5c3c0a19a1b9fe3e93de3b6bb5ed73 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/formula-recognition-medium-scan-0001/formula-recognition-medium-scan-0001-im2latex-decoder/FP32/formula-recognition-medium-scan-0001-im2latex-decoder.xml - name: FP32/formula-recognition-medium-scan-0001-im2latex-decoder.bin size: 10252352 sha256: 47313e32aacd678ebddb01fc288e67159bad2996fa92f53fd4711bc6564defcb - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/formula-recognition-medium-scan-0001/formula-recognition-medium-scan-0001-im2latex-decoder/FP32/formula-recognition-medium-scan-0001-im2latex-decoder.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/formula-recognition-medium-scan-0001/formula-recognition-medium-scan-0001-im2latex-decoder/FP32/formula-recognition-medium-scan-0001-im2latex-decoder.bin - name: FP16/formula-recognition-medium-scan-0001-im2latex-decoder.xml - size: 49097 - sha256: 27bd129490cb0f702d3691126f37b54a972ad5a75019a0dee55bb8381d2b2e02 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/formula-recognition-medium-scan-0001/formula-recognition-medium-scan-0001-im2latex-decoder/FP16/formula-recognition-medium-scan-0001-im2latex-decoder.xml + size: 48818 + sha256: a6c3507782f58a332eea8cf48631e4efedbda21c4a0c54a0e393434034c6c7a9 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/formula-recognition-medium-scan-0001/formula-recognition-medium-scan-0001-im2latex-decoder/FP16/formula-recognition-medium-scan-0001-im2latex-decoder.xml - name: FP16/formula-recognition-medium-scan-0001-im2latex-decoder.bin size: 5126230 sha256: 85c96b6cf2bbfaa79fc505717070e15236386d3aacc868ce044e3139eb2421ba - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/formula-recognition-medium-scan-0001/formula-recognition-medium-scan-0001-im2latex-decoder/FP16/formula-recognition-medium-scan-0001-im2latex-decoder.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/formula-recognition-medium-scan-0001/formula-recognition-medium-scan-0001-im2latex-decoder/FP16/formula-recognition-medium-scan-0001-im2latex-decoder.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/formula-recognition-medium-scan-0001/formula-recognition-medium-scan-0001-im2latex-encoder/model.yml b/models/intel/formula-recognition-medium-scan-0001/formula-recognition-medium-scan-0001-im2latex-encoder/model.yml index 60ca185fdad..ed1707e515c 100644 --- a/models/intel/formula-recognition-medium-scan-0001/formula-recognition-medium-scan-0001-im2latex-encoder/model.yml +++ b/models/intel/formula-recognition-medium-scan-0001/formula-recognition-medium-scan-0001-im2latex-encoder/model.yml @@ -17,20 +17,20 @@ description: >- task_type: feature_extraction files: - name: FP32/formula-recognition-medium-scan-0001-im2latex-encoder.xml - size: 144594 - sha256: dfda6869d48019419ea79381ccaedd7b75cd4322b117421c7e54380e49eb83bb - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/formula-recognition-medium-scan-0001/formula-recognition-medium-scan-0001-im2latex-encoder/FP32/formula-recognition-medium-scan-0001-im2latex-encoder.xml + size: 144955 + sha256: 9fd17de6e495a934f488296a1a61ca7fc711eb0fd89e480f8abd181d357530bf + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/formula-recognition-medium-scan-0001/formula-recognition-medium-scan-0001-im2latex-encoder/FP32/formula-recognition-medium-scan-0001-im2latex-encoder.xml - name: FP32/formula-recognition-medium-scan-0001-im2latex-encoder.bin size: 12979416 sha256: 7a4097c0ac22100d8d84b0dc93208755e4a2ad03acfa037e08545b967023aec3 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/formula-recognition-medium-scan-0001/formula-recognition-medium-scan-0001-im2latex-encoder/FP32/formula-recognition-medium-scan-0001-im2latex-encoder.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/formula-recognition-medium-scan-0001/formula-recognition-medium-scan-0001-im2latex-encoder/FP32/formula-recognition-medium-scan-0001-im2latex-encoder.bin - name: FP16/formula-recognition-medium-scan-0001-im2latex-encoder.xml - size: 144562 - sha256: d864607ff19adee42a930d72b46c7db057d5769e86578bf2bccd8cf00604fb02 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/formula-recognition-medium-scan-0001/formula-recognition-medium-scan-0001-im2latex-encoder/FP16/formula-recognition-medium-scan-0001-im2latex-encoder.xml + size: 144923 + sha256: ee643012ddb008775a170a320173a22f9b4f3f67d27c072e3f104ccc6f3eacf3 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/formula-recognition-medium-scan-0001/formula-recognition-medium-scan-0001-im2latex-encoder/FP16/formula-recognition-medium-scan-0001-im2latex-encoder.xml - name: FP16/formula-recognition-medium-scan-0001-im2latex-encoder.bin size: 6489816 sha256: cb5784c86f9eea9e6f56e84d51b3108cd08f9c6707f93514cd57d9e97f27dc60 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/formula-recognition-medium-scan-0001/formula-recognition-medium-scan-0001-im2latex-encoder/FP16/formula-recognition-medium-scan-0001-im2latex-encoder.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/formula-recognition-medium-scan-0001/formula-recognition-medium-scan-0001-im2latex-encoder/FP16/formula-recognition-medium-scan-0001-im2latex-encoder.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/formula-recognition-polynomials-handwritten-0001/description/formula-recognition-polynomials-handwritten-0001.md b/models/intel/formula-recognition-polynomials-handwritten-0001/description/formula-recognition-polynomials-handwritten-0001.md index 1299fe6dbc7..e533c1c6f05 100644 --- a/models/intel/formula-recognition-polynomials-handwritten-0001/description/formula-recognition-polynomials-handwritten-0001.md +++ b/models/intel/formula-recognition-polynomials-handwritten-0001/description/formula-recognition-polynomials-handwritten-0001.md @@ -37,8 +37,6 @@ The formula-recognition-polynomials-handwritten-0001-encoder model is a ResNeXt- | MParams | 8.6838 | -### Performance - ### Inputs 1. Name: `imgs` , shape: [1x3x96x990]. An input image in the [1xCxHxW] format. @@ -63,8 +61,6 @@ The formula-recognition-polynomials-handwritten-0001-decoder model is an LSTM ba -### Performance - ### Inputs 1. Name: `dec_st_c` , shape: [1x512]. Current context state of the LSTM cell. diff --git a/models/intel/formula-recognition-polynomials-handwritten-0001/formula-recognition-polynomials-handwritten-0001-decoder/model.yml b/models/intel/formula-recognition-polynomials-handwritten-0001/formula-recognition-polynomials-handwritten-0001-decoder/model.yml new file mode 100644 index 00000000000..b3b279dee0d --- /dev/null +++ b/models/intel/formula-recognition-polynomials-handwritten-0001/formula-recognition-polynomials-handwritten-0001-decoder/model.yml @@ -0,0 +1,36 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + Decoder part of latex formula recognition model. +task_type: token_recognition +files: + - name: FP32/formula-recognition-polynomials-handwritten-0001-decoder.xml + size: 48814 + sha256: 7d3e748f14e81c066c031ea4e0ea99012a51cacb6633cd8e478d0bb12a0307ef + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/formula-recognition-polynomials-handwritten-0001/formula-recognition-polynomials-handwritten-0001-decoder/FP32/formula-recognition-polynomials-handwritten-0001-decoder.xml + - name: FP32/formula-recognition-polynomials-handwritten-0001-decoder.bin + size: 10179560 + sha256: 5bd55bf08eaee8ef5a6d516b4a7af05a49df26bc9c5f020e9c80533d90a7ca10 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/formula-recognition-polynomials-handwritten-0001/formula-recognition-polynomials-handwritten-0001-decoder/FP32/formula-recognition-polynomials-handwritten-0001-decoder.bin + - name: FP16/formula-recognition-polynomials-handwritten-0001-decoder.xml + size: 48805 + sha256: e7eea2eec3f04039b956c50e102a3e214cccf85a6e827534764770d271eaceb4 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/formula-recognition-polynomials-handwritten-0001/formula-recognition-polynomials-handwritten-0001-decoder/FP16/formula-recognition-polynomials-handwritten-0001-decoder.xml + - name: FP16/formula-recognition-polynomials-handwritten-0001-decoder.bin + size: 5089834 + sha256: 681683c50d62291ee1a4d50200a8462dbb00f1ea927ff43276b4b3249016df39 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/formula-recognition-polynomials-handwritten-0001/formula-recognition-polynomials-handwritten-0001-decoder/FP16/formula-recognition-polynomials-handwritten-0001-decoder.bin +framework: dldt +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/formula-recognition-polynomials-handwritten-0001/formula-recognition-polynomials-handwritten-0001-encoder/model.yml b/models/intel/formula-recognition-polynomials-handwritten-0001/formula-recognition-polynomials-handwritten-0001-encoder/model.yml new file mode 100644 index 00000000000..e3aea4e2df4 --- /dev/null +++ b/models/intel/formula-recognition-polynomials-handwritten-0001/formula-recognition-polynomials-handwritten-0001-encoder/model.yml @@ -0,0 +1,36 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + Encoder part of latex formula recognition model. +task_type: feature_extraction +files: + - name: FP32/formula-recognition-polynomials-handwritten-0001-encoder.xml + size: 193554 + sha256: 7b571b0b5c18508f35c87c8048a150bcc42aa437de1d8e2e4ece734a689d9bfd + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/formula-recognition-polynomials-handwritten-0001/formula-recognition-polynomials-handwritten-0001-encoder/FP32/formula-recognition-polynomials-handwritten-0001-encoder.xml + - name: FP32/formula-recognition-polynomials-handwritten-0001-encoder.bin + size: 45210840 + sha256: df835cb5db54d6d2efb72f99d707e8289c2034c26284095fc2ca88a1e9df998a + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/formula-recognition-polynomials-handwritten-0001/formula-recognition-polynomials-handwritten-0001-encoder/FP32/formula-recognition-polynomials-handwritten-0001-encoder.bin + - name: FP16/formula-recognition-polynomials-handwritten-0001-encoder.xml + size: 193511 + sha256: 5a03add2b5963f90414a9aa03eac861310b080648c6ae6d82cde7fabd462f1f0 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/formula-recognition-polynomials-handwritten-0001/formula-recognition-polynomials-handwritten-0001-encoder/FP16/formula-recognition-polynomials-handwritten-0001-encoder.xml + - name: FP16/formula-recognition-polynomials-handwritten-0001-encoder.bin + size: 22605528 + sha256: 3adf19986f49650e24bf81a351b1d0dc0e6de8c9dbb0a6ae9f90eb10c55765cc + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/formula-recognition-polynomials-handwritten-0001/formula-recognition-polynomials-handwritten-0001-encoder/FP16/formula-recognition-polynomials-handwritten-0001-encoder.bin +framework: dldt +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/gaze-estimation-adas-0002/description/gaze-estimation-adas-0002.md b/models/intel/gaze-estimation-adas-0002/description/gaze-estimation-adas-0002.md index 214d22de893..35a1064856c 100644 --- a/models/intel/gaze-estimation-adas-0002/description/gaze-estimation-adas-0002.md +++ b/models/intel/gaze-estimation-adas-0002/description/gaze-estimation-adas-0002.md @@ -33,8 +33,6 @@ The accuracy of gaze direction prediction is evaluated through the use of [MAE]( | Internal dataset | 6.95 | 3.58 | -## Performance - ## Inputs * Blob in the format [BxCxHxW] diff --git a/models/intel/gaze-estimation-adas-0002/model.yml b/models/intel/gaze-estimation-adas-0002/model.yml index 9b23da21ce5..16f921eeafa 100644 --- a/models/intel/gaze-estimation-adas-0002/model.yml +++ b/models/intel/gaze-estimation-adas-0002/model.yml @@ -17,28 +17,28 @@ description: >- task_type: object_attributes files: - name: FP32/gaze-estimation-adas-0002.xml - size: 71408 - sha256: 68128a52e7f0a3319aa264af2c3096a5ad61e0af091695b80961ad90303fd704 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/gaze-estimation-adas-0002/FP32/gaze-estimation-adas-0002.xml + size: 71796 + sha256: aee115a62c7bf1e8ad0c43d9dd7cc305222212eb44aa472be323b0e4eb9c1a83 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/gaze-estimation-adas-0002/FP32/gaze-estimation-adas-0002.xml - name: FP32/gaze-estimation-adas-0002.bin size: 7529480 sha256: f9811838cc264443a845b8d5089d3cfeb2d354b832f52a96aa0ccfa5be8e8401 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/gaze-estimation-adas-0002/FP32/gaze-estimation-adas-0002.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/gaze-estimation-adas-0002/FP32/gaze-estimation-adas-0002.bin - name: FP16/gaze-estimation-adas-0002.xml - size: 71367 - sha256: a22a1fcf243c42e835bf3641cf6b66cbb16801cac76a3bf155fbe6b57b891233 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/gaze-estimation-adas-0002/FP16/gaze-estimation-adas-0002.xml + size: 71755 + sha256: 3307033ae20b649c0b5e56c5737abd7ed4164d090df5cb44df160f8f173dd9f4 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/gaze-estimation-adas-0002/FP16/gaze-estimation-adas-0002.xml - name: FP16/gaze-estimation-adas-0002.bin size: 3764842 sha256: 4aea144ee55e1c26ff81ffd006be71e581d869e76e38364fdc10c3e0d3848154 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/gaze-estimation-adas-0002/FP16/gaze-estimation-adas-0002.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/gaze-estimation-adas-0002/FP16/gaze-estimation-adas-0002.bin - name: FP16-INT8/gaze-estimation-adas-0002.xml - size: 150510 - sha256: 36a25c92cb1a4e34af12bd8f6e2da729285c8dc4ca3b62dbfd83840418c21623 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/gaze-estimation-adas-0002/FP16-INT8/gaze-estimation-adas-0002.xml + size: 151286 + sha256: b545b4f3fea28e57d595eb1ba01481905c27c8f205ba871ef09bd07354e126f3 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/gaze-estimation-adas-0002/FP16-INT8/gaze-estimation-adas-0002.xml - name: FP16-INT8/gaze-estimation-adas-0002.bin size: 1893396 sha256: b877b890ab18e14cbddde64aafe49c13cfccfc92a043b77f33b62e54d1af855c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/gaze-estimation-adas-0002/FP16-INT8/gaze-estimation-adas-0002.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/gaze-estimation-adas-0002/FP16-INT8/gaze-estimation-adas-0002.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/handwritten-japanese-recognition-0001/model.yml b/models/intel/handwritten-japanese-recognition-0001/model.yml index 4b92cc3bddb..99fe48df8db 100644 --- a/models/intel/handwritten-japanese-recognition-0001/model.yml +++ b/models/intel/handwritten-japanese-recognition-0001/model.yml @@ -17,28 +17,28 @@ description: >- task_type: optical_character_recognition files: - name: FP32/handwritten-japanese-recognition-0001.xml - size: 41786 - sha256: 9fdd2bb497fe76098a6b3721d69dead3532751031df0b032c27b0cbeb1ac537a - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/handwritten-japanese-recognition-0001/FP32/handwritten-japanese-recognition-0001.xml + size: 42046 + sha256: 10669117e8cbd394f14291ec3482e4282c97f958187e4257f300e3b636178365 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/handwritten-japanese-recognition-0001/FP32/handwritten-japanese-recognition-0001.xml - name: FP32/handwritten-japanese-recognition-0001.bin size: 67969208 sha256: be6f7eea5945af691277a1f3849f024ed6d3bb84c395bc66ed8e9da0346c063d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/handwritten-japanese-recognition-0001/FP32/handwritten-japanese-recognition-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/handwritten-japanese-recognition-0001/FP32/handwritten-japanese-recognition-0001.bin - name: FP16/handwritten-japanese-recognition-0001.xml - size: 41774 - sha256: d870f390e99887ff8272040ccab2c5b5b1ead762e53a31ad48e0a4f89f1e66ab - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/handwritten-japanese-recognition-0001/FP16/handwritten-japanese-recognition-0001.xml + size: 42034 + sha256: dc00ace79ac22295712495e7b0ca20882d61e8a045c40d5b798718129635c3b0 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/handwritten-japanese-recognition-0001/FP16/handwritten-japanese-recognition-0001.xml - name: FP16/handwritten-japanese-recognition-0001.bin size: 33984640 sha256: c98a73664e3e71151cad86bfb2dc434b3c2e6c6517716268d97ea0e9a3969e89 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/handwritten-japanese-recognition-0001/FP16/handwritten-japanese-recognition-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/handwritten-japanese-recognition-0001/FP16/handwritten-japanese-recognition-0001.bin - name: FP16-INT8/handwritten-japanese-recognition-0001.xml - size: 104177 - sha256: 4890b1b7bec77f13e9ab1d280b5ce04ab2fcca7b52504251fafa63283ee0f397 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/handwritten-japanese-recognition-0001/FP16-INT8/handwritten-japanese-recognition-0001.xml + size: 104473 + sha256: 29b2c6c6c402df7e08f1bb1433144802d796e8f5b5a1f56472c6594b60d43cdf + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/handwritten-japanese-recognition-0001/FP16-INT8/handwritten-japanese-recognition-0001.xml - name: FP16-INT8/handwritten-japanese-recognition-0001.bin size: 17035722 sha256: 834bbf5d55f40dde936e6402cf3c515c65884070f94fb6044ed44c883f205488 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/handwritten-japanese-recognition-0001/FP16-INT8/handwritten-japanese-recognition-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/handwritten-japanese-recognition-0001/FP16-INT8/handwritten-japanese-recognition-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/handwritten-score-recognition-0003/description/handwritten-score-recognition-0003.md b/models/intel/handwritten-score-recognition-0003/description/handwritten-score-recognition-0003.md index 56631d6c550..d439b23f6b0 100644 --- a/models/intel/handwritten-score-recognition-0003/description/handwritten-score-recognition-0003.md +++ b/models/intel/handwritten-score-recognition-0003/description/handwritten-score-recognition-0003.md @@ -20,8 +20,6 @@ The network is able to recognize school marks that should have format either `- task_type: optical_character_recognition files: - name: FP32/handwritten-score-recognition-0003.xml - size: 82982 - sha256: d0577b08391a8b1b00f6cdb8a5a74e763a88103d157a5134d6d930599ebead0e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/handwritten-score-recognition-0003/FP32/handwritten-score-recognition-0003.xml + size: 83000 + sha256: 50f083dc89381118db1aa2e4ca5af6b3d61ee982e2fc4457db4244f0412c168d + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/handwritten-score-recognition-0003/FP32/handwritten-score-recognition-0003.xml - name: FP32/handwritten-score-recognition-0003.bin size: 41121960 sha256: bec7a2090057609f2e371d01b2a44e4915fa80423caf520f536218b976f520ca - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/handwritten-score-recognition-0003/FP32/handwritten-score-recognition-0003.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/handwritten-score-recognition-0003/FP32/handwritten-score-recognition-0003.bin - name: FP16/handwritten-score-recognition-0003.xml - size: 82957 - sha256: 5aca730de2c03d09a4f3144d8068bc0e11d73c5eb6556f7a55f0329f45b6895a - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/handwritten-score-recognition-0003/FP16/handwritten-score-recognition-0003.xml + size: 82975 + sha256: 1a7fe18733d3a1bc157c0985ba6bd44b3c566ad33d94c62bf13df70a2d1c8b60 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/handwritten-score-recognition-0003/FP16/handwritten-score-recognition-0003.xml - name: FP16/handwritten-score-recognition-0003.bin size: 20561034 sha256: 7563345b12bc0d636237a78cb69fa9f43a4d99e1c07a7cf9d0abb74effd98471 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/handwritten-score-recognition-0003/FP16/handwritten-score-recognition-0003.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/handwritten-score-recognition-0003/FP16/handwritten-score-recognition-0003.bin - name: FP16-INT8/handwritten-score-recognition-0003.xml - size: 121284 - sha256: fe3d4ad98a6dde8f4903725adce2b9c039f3763c2db75e369a98525724e56cec - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/handwritten-score-recognition-0003/FP16-INT8/handwritten-score-recognition-0003.xml + size: 121501 + sha256: 824accc6bf5bd6a8aaf6908d68f0631b72a67f5c4a29d31bf65b4ffe4dad2440 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/handwritten-score-recognition-0003/FP16-INT8/handwritten-score-recognition-0003.xml - name: FP16-INT8/handwritten-score-recognition-0003.bin size: 15030170 - sha256: a8854a6999073ecc4fd89b2bcada1097312d3cce7fdaaa05bfe2f57edf89fb00 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/handwritten-score-recognition-0003/FP16-INT8/handwritten-score-recognition-0003.bin + sha256: 73d44b9f2fc8bd304e5de78b35b14238ee4de10949a94b5748a8748a98741ff6 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/handwritten-score-recognition-0003/FP16-INT8/handwritten-score-recognition-0003.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/handwritten-simplified-chinese-recognition-0001/model.yml b/models/intel/handwritten-simplified-chinese-recognition-0001/model.yml new file mode 100644 index 00000000000..9e7cad47aa2 --- /dev/null +++ b/models/intel/handwritten-simplified-chinese-recognition-0001/model.yml @@ -0,0 +1,45 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + Recognizes handwritten simplified Chinese text. Architecture is CNN-like: VGG16-like + backbone. +task_type: optical_character_recognition +files: + - name: FP32/handwritten-simplified-chinese-recognition-0001.xml + size: 112906 + sha256: 0794ccbf7ad23c91b7c17acd76eea42000cfa9cced2cb994a0d08b14e348d059 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/handwritten-simplified-chinese-recognition-0001/FP32/handwritten-simplified-chinese-recognition-0001.xml + - name: FP32/handwritten-simplified-chinese-recognition-0001.bin + size: 69071580 + sha256: 373eefe1b612ba55d52498cc3c6bd1c90f7c32e082ced0e540056a6b7382a22c + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/handwritten-simplified-chinese-recognition-0001/FP32/handwritten-simplified-chinese-recognition-0001.bin + - name: FP16/handwritten-simplified-chinese-recognition-0001.xml + size: 112830 + sha256: b46df09e70acbc98e9bd3ad869bc1b3bd738a5d483baed48da3fcddf57eaa763 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/handwritten-simplified-chinese-recognition-0001/FP16/handwritten-simplified-chinese-recognition-0001.xml + - name: FP16/handwritten-simplified-chinese-recognition-0001.bin + size: 34535842 + sha256: 1bb5768c4f50502a5d76e039b04081589e36336d9f66255b17da6de3f64d67c8 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/handwritten-simplified-chinese-recognition-0001/FP16/handwritten-simplified-chinese-recognition-0001.bin + - name: FP16-INT8/handwritten-simplified-chinese-recognition-0001.xml + size: 244836 + sha256: b1e4bc8d9a3ff9311f2a27d00daf17da5103a4edb6bd17832245da9f98332e68 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/handwritten-simplified-chinese-recognition-0001/FP16-INT8/handwritten-simplified-chinese-recognition-0001.xml + - name: FP16-INT8/handwritten-simplified-chinese-recognition-0001.bin + size: 17320956 + sha256: 2432c2cf8eab59a64af3a2b2f9b765e29dd65f85590f9aabdb437f5088fb09b2 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/handwritten-simplified-chinese-recognition-0001/FP16-INT8/handwritten-simplified-chinese-recognition-0001.bin +framework: dldt +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/head-pose-estimation-adas-0001/description/head-pose-estimation-adas-0001.md b/models/intel/head-pose-estimation-adas-0001/description/head-pose-estimation-adas-0001.md index 1dbeb43b9c3..d7123f3cb68 100644 --- a/models/intel/head-pose-estimation-adas-0001/description/head-pose-estimation-adas-0001.md +++ b/models/intel/head-pose-estimation-adas-0001/description/head-pose-estimation-adas-0001.md @@ -31,8 +31,6 @@ one output. | pitch | 5.5 ± 5.3 | | roll | 4.6 ± 5.6 | -## Performance - ## Inputs 1. name: "data" , shape: [1x3x60x60] - An input image in [1xCxHxW] format. Expected color order is BGR. diff --git a/models/intel/head-pose-estimation-adas-0001/model.yml b/models/intel/head-pose-estimation-adas-0001/model.yml index 89670a6c640..0e6c028a53f 100644 --- a/models/intel/head-pose-estimation-adas-0001/model.yml +++ b/models/intel/head-pose-estimation-adas-0001/model.yml @@ -17,28 +17,28 @@ description: >- task_type: head_pose_estimation files: - name: FP32/head-pose-estimation-adas-0001.xml - size: 56291 - sha256: a152270b9bcb1c31fd72b1e26f4ce5211485ff62866be1de03b879e07479d152 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/head-pose-estimation-adas-0001/FP32/head-pose-estimation-adas-0001.xml + size: 56798 + sha256: ec8a3e2e543015104721d13e4728205c27d9249a1460807b5fc348b545384643 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/head-pose-estimation-adas-0001/FP32/head-pose-estimation-adas-0001.xml - name: FP32/head-pose-estimation-adas-0001.bin size: 7647608 sha256: 00980a823b345c73a9b1aae80ea203b56a43929c27807a8994f3b1c029c70ab3 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/head-pose-estimation-adas-0001/FP32/head-pose-estimation-adas-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/head-pose-estimation-adas-0001/FP32/head-pose-estimation-adas-0001.bin - name: FP16/head-pose-estimation-adas-0001.xml - size: 56278 - sha256: 3725f0c8641ac4a15ae26c117bc5c6020b3a12cc6a5258d0f6577318cfb24d2f - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/head-pose-estimation-adas-0001/FP16/head-pose-estimation-adas-0001.xml + size: 56785 + sha256: 15b0c4e39f454477fa8303b4460e742dded864e1f5a1871acebf4f0e4d0438d2 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/head-pose-estimation-adas-0001/FP16/head-pose-estimation-adas-0001.xml - name: FP16/head-pose-estimation-adas-0001.bin size: 3823814 sha256: cb28630bd002b5881443ab20b01bc13150aee2db917ef91fa970e54ebe0430a5 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/head-pose-estimation-adas-0001/FP16/head-pose-estimation-adas-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/head-pose-estimation-adas-0001/FP16/head-pose-estimation-adas-0001.bin - name: FP16-INT8/head-pose-estimation-adas-0001.xml - size: 90448 - sha256: 0df611970f47d26f257d472cc8939a84769911c9d8780890913577287cfc67ef - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/head-pose-estimation-adas-0001/FP16-INT8/head-pose-estimation-adas-0001.xml + size: 95397 + sha256: a5258580c1591fe1b9e5576566b715be645f08356f849fc59da12cefb735baa4 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/head-pose-estimation-adas-0001/FP16-INT8/head-pose-estimation-adas-0001.xml - name: FP16-INT8/head-pose-estimation-adas-0001.bin - size: 2080036 - sha256: 02deed13f1a94135bdac6f9a428c693b19d5e643bcf635e60fd576255b76de0a - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/head-pose-estimation-adas-0001/FP16-INT8/head-pose-estimation-adas-0001.bin + size: 2076140 + sha256: ea258a3021934e5a17180163d18e2394ca7bc873ed149a459af53ee9e9499b11 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/head-pose-estimation-adas-0001/FP16-INT8/head-pose-estimation-adas-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/horizontal-text-detection-0001/accuracy-check.yml b/models/intel/horizontal-text-detection-0001/accuracy-check.yml index 52ba8fc5942..bf9abd1dea5 100644 --- a/models/intel/horizontal-text-detection-0001/accuracy-check.yml +++ b/models/intel/horizontal-text-detection-0001/accuracy-check.yml @@ -3,19 +3,6 @@ models: launchers: - framework: dlsdk - tags: - - FP32 - model: intel/horizontal-text-detection-0001/FP32/horizontal-text-detection-0001.xml - weights: intel/horizontal-text-detection-0001/FP32/horizontal-text-detection-0001.bin - adapter: - type: class_agnostic_detection - scale: 0.0014204 - - - framework: dlsdk - tags: - - FP16 - model: intel/horizontal-text-detection-0001/FP16/horizontal-text-detection-0001.xml - weights: intel/horizontal-text-detection-0001/FP16/horizontal-text-detection-0001.bin adapter: type: class_agnostic_detection scale: 0.0014204 @@ -42,6 +29,3 @@ models: ignore_difficult: True area_recall_constrain: 0.5 area_precision_constrain: 0.5 - - -global_definitions: ../dataset_definitions.yml diff --git a/models/intel/horizontal-text-detection-0001/description/horizontal-text-detection-0001.md b/models/intel/horizontal-text-detection-0001/description/horizontal-text-detection-0001.md index 88322b75053..54e843ee7ad 100644 --- a/models/intel/horizontal-text-detection-0001/description/horizontal-text-detection-0001.md +++ b/models/intel/horizontal-text-detection-0001/description/horizontal-text-detection-0001.md @@ -1,4 +1,4 @@ -# text-detection-0003 +# horizontal-text-detection-0001 ## Use Case and High-Level Description @@ -19,8 +19,6 @@ The key benefit of this model compared to the [base model](../../text-detection- | Source framework | PyTorch\* | -## Performance - ## Inputs 1. Name: `input`, shape: [1x3x704x704] - An input image in the format [1xCxHxW], diff --git a/models/intel/horizontal-text-detection-0001/model.yml b/models/intel/horizontal-text-detection-0001/model.yml index c0e1405a8af..845063b7974 100644 --- a/models/intel/horizontal-text-detection-0001/model.yml +++ b/models/intel/horizontal-text-detection-0001/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/horizontal-text-detection-0001.xml - size: 691736 - sha256: 42d6eb8104ffea3ee370767424a4e9a0715dc50786098b27df9d9f6663a00efa - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/horizontal-text-detection-0001/FP32/horizontal-text-detection-0001.xml + size: 705407 + sha256: 394b4c49fe37beab68e0204ccc6bee9916132074afe0a790ce1236300a0eca16 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/horizontal-text-detection-0001/FP32/horizontal-text-detection-0001.xml - name: FP32/horizontal-text-detection-0001.bin - size: 7753424 - sha256: c921d3089987f0ede91cc418c6d06c921305c74203e045d8085c725e695e082d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/horizontal-text-detection-0001/FP32/horizontal-text-detection-0001.bin + size: 7753400 + sha256: 4a7d1c49da673fd12e480f6bc0894b74536135e591d507331ec7e1531d189ca2 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/horizontal-text-detection-0001/FP32/horizontal-text-detection-0001.bin - name: FP16/horizontal-text-detection-0001.xml - size: 691574 - sha256: 6519b18299bc1c701e302cfdc73554b05d65b652fe6fc50896cea2213687baa0 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/horizontal-text-detection-0001/FP16/horizontal-text-detection-0001.xml + size: 705245 + sha256: d66d8100cf326d552ceaf97850ad6a8746b13478bb748ca465fd26d0e18e81bd + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/horizontal-text-detection-0001/FP16/horizontal-text-detection-0001.xml - name: FP16/horizontal-text-detection-0001.bin - size: 3876884 - sha256: f1915fe302bd50d7ee529bd874581cab20cc85e0613a5a09dd1e1e13fef6e94b - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/horizontal-text-detection-0001/FP16/horizontal-text-detection-0001.bin + size: 3876860 + sha256: 05bf95549719dccfc80dc98f98bebe75eafe5cc0bc4300de6a12617d38f5e4e5 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/horizontal-text-detection-0001/FP16/horizontal-text-detection-0001.bin - name: FP16-INT8/horizontal-text-detection-0001.xml - size: 1319552 - sha256: 450dd027b07b888a19027e192c0bc639002c51067df170ad117570fd8f61a487 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/horizontal-text-detection-0001/FP16-INT8/horizontal-text-detection-0001.xml + size: 1334728 + sha256: c1d105f892826f711ffd282296101d84c495e8b5fc48fb701c03157d947554d1 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/horizontal-text-detection-0001/FP16-INT8/horizontal-text-detection-0001.xml - name: FP16-INT8/horizontal-text-detection-0001.bin - size: 2038032 - sha256: f068bc5a7eaa70bd456e9df05aadf092f2d59048abb217ce89bce2aa2ab42d09 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/horizontal-text-detection-0001/FP16-INT8/horizontal-text-detection-0001.bin + size: 2038010 + sha256: f9849cc0a09857c328e785f29a552a87af91a278e8240279330982bb6dd824e2 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/horizontal-text-detection-0001/FP16-INT8/horizontal-text-detection-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/human-pose-estimation-0001/description/human-pose-estimation-0001.md b/models/intel/human-pose-estimation-0001/description/human-pose-estimation-0001.md index d7bcd453c03..725baa42300 100644 --- a/models/intel/human-pose-estimation-0001/description/human-pose-estimation-0001.md +++ b/models/intel/human-pose-estimation-0001/description/human-pose-estimation-0001.md @@ -23,8 +23,6 @@ Average Precision metric described in [COCO Keypoint Evaluation site](https://co Tested on a COCO validation subset from the original paper [Realtime Multi-Person 2D Pose Estimation using Part Affinity Fields](https://arxiv.org/abs/1611.08050). -## Performance - ## Inputs Name: `input`, shape: [1x3x256x456]. An input image in the [BxCxHxW] format , diff --git a/models/intel/human-pose-estimation-0001/model.yml b/models/intel/human-pose-estimation-0001/model.yml index 1ed2cc9d3ad..6bcf75c0629 100644 --- a/models/intel/human-pose-estimation-0001/model.yml +++ b/models/intel/human-pose-estimation-0001/model.yml @@ -17,28 +17,28 @@ description: >- task_type: human_pose_estimation files: - name: FP32/human-pose-estimation-0001.xml - size: 144190 - sha256: 648215ffe9c7a8bff4c46a4203bd0e01b75caf898842222e5a4d5c4c4a761c47 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/human-pose-estimation-0001/FP32/human-pose-estimation-0001.xml + size: 145295 + sha256: a7de7d9a50198badc8daffeb4aaca40cb945de6a91f0dc09458d677b463e6d5f + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/human-pose-estimation-0001/FP32/human-pose-estimation-0001.xml - name: FP32/human-pose-estimation-0001.bin size: 16394712 sha256: 6a277f9564dd7f296c84deefed785de2b43639ca1f0d03281367606033ba9aa6 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/human-pose-estimation-0001/FP32/human-pose-estimation-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/human-pose-estimation-0001/FP32/human-pose-estimation-0001.bin - name: FP16/human-pose-estimation-0001.xml - size: 144118 - sha256: 1e7174267693b22c826c5f8ce997da0527c5c695996f9d7b5bbb2e9c361ef9c0 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/human-pose-estimation-0001/FP16/human-pose-estimation-0001.xml + size: 145223 + sha256: 553a9e0b7d7039899bfbee6bde7e10b579132c0179b202e0dc686a5b8eb93e8b + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/human-pose-estimation-0001/FP16/human-pose-estimation-0001.xml - name: FP16/human-pose-estimation-0001.bin size: 8197356 sha256: c1c828d5d1ea2b03035692a8600f06d787fe1a20e79dac159c4293ed7063a382 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/human-pose-estimation-0001/FP16/human-pose-estimation-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/human-pose-estimation-0001/FP16/human-pose-estimation-0001.bin - name: FP16-INT8/human-pose-estimation-0001.xml - size: 434200 - sha256: 1dec65f640865051f3daf2c91f6a37aecf5dee6939da5c0771fcce467566aeea - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/human-pose-estimation-0001/FP16-INT8/human-pose-estimation-0001.xml + size: 435357 + sha256: c3a47de94906e6b3256eb16af7274141b2fc9f6c7889a02d96ef430b9bc321d3 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/human-pose-estimation-0001/FP16-INT8/human-pose-estimation-0001.xml - name: FP16-INT8/human-pose-estimation-0001.bin size: 4170036 - sha256: e0e996424edfd8b0435a0a5db8b66a2ebafc6435e7d963fb07276f19141fac9c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/human-pose-estimation-0001/FP16-INT8/human-pose-estimation-0001.bin + sha256: fc7e9dde0f4a34876cfbbd266388a59526a8c8c1bc9394ce4827b7a007d20f82 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/human-pose-estimation-0001/FP16-INT8/human-pose-estimation-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/human-pose-estimation-0002/accuracy-check.yml b/models/intel/human-pose-estimation-0002/accuracy-check.yml new file mode 100644 index 00000000000..3cc19db2792 --- /dev/null +++ b/models/intel/human-pose-estimation-0002/accuracy-check.yml @@ -0,0 +1,27 @@ +models: + - name: human-pose-estimation-0002 + + launchers: + - framework: dlsdk + allow_reshape_input: True + adapter: + type: human_pose_estimation_ae + heatmaps_out: heatmaps + nms_heatmaps_out: nms_heatmaps + embeddings_out: embeddings + + datasets: + - name: ms_coco_val2017_keypoints + + preprocessing: + - type: resize + size: 288 + interpolation: LINEAR + aspect_ratio_scale: greater + - type: padding + stride: 32 + pad_type: right_bottom + + metrics: + - name: AP + type: coco_orig_keypoints_precision diff --git a/models/intel/human-pose-estimation-0002/description/human-pose-estimation-0002.md b/models/intel/human-pose-estimation-0002/description/human-pose-estimation-0002.md new file mode 100644 index 00000000000..dbb1b971a73 --- /dev/null +++ b/models/intel/human-pose-estimation-0002/description/human-pose-estimation-0002.md @@ -0,0 +1,42 @@ +# human-pose-estimation-0002 + +## Use Case and High-Level Description + +This is a multi-person 2D pose estimation network based on the EfficientHRNet approach (that follows the Associative Embedding framework). +For every person in an image, the network detects a human pose: a body skeleton consisting of keypoints and connections between them. +The pose may contain up to 17 keypoints: ears, eyes, nose, shoulders, elbows, wrists, hips, knees, and ankles. + +## Example + +![](./human-pose-estimation-0002.png) + +## Specification + +| Metric | Value | +|---------------------------------|-------------------------------------------| +| Average Precision (AP) | 44.4% | +| GFlops | 5.9393 | +| MParams | 8.1504 | +| Source framework | PyTorch\* | + +Average Precision metric described in [COCO Keypoint Evaluation site](https://cocodataset.org/#keypoints-eval). + +## Inputs + +Name: `input`, shape: [1x3x288x288]. An input image in the [BxCxHxW] format , +where: + - B - batch size + - C - number of channels + - H - image height + - W - image width +Expected color order is BGR. + +## Outputs + +The net outputs three blobs: + * "heatmaps" of shape [N, 17, 144, 144] containing location heatmaps for keypoints of all types. + * "nms_heatmaps" of shape [N, 17, 144, 144] containing heatmaps after non-maximum suppression. + * "embeddings" of shape [N, 17, 144, 144, 1] containing associative embedding values, which are used for grouping individual keypoints into poses. + +## Legal Information +[*] Other names and brands may be claimed as the property of others. diff --git a/models/intel/human-pose-estimation-0002/description/human-pose-estimation-0002.png b/models/intel/human-pose-estimation-0002/description/human-pose-estimation-0002.png new file mode 100644 index 00000000000..d3cfc55c673 Binary files /dev/null and b/models/intel/human-pose-estimation-0002/description/human-pose-estimation-0002.png differ diff --git a/models/intel/human-pose-estimation-0002/model.yml b/models/intel/human-pose-estimation-0002/model.yml new file mode 100644 index 00000000000..1877faf0582 --- /dev/null +++ b/models/intel/human-pose-estimation-0002/model.yml @@ -0,0 +1,36 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + 2D human pose estimation based on EfficientHRNet. +task_type: human_pose_estimation +files: + - name: FP32/human-pose-estimation-0002.xml + size: 714225 + sha256: ef21187b55a222c1fa0d50f31ef40a8bf6fc066049602eef557dece9f4be7c79 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/human-pose-estimation-0002/FP32/human-pose-estimation-0002.xml + - name: FP32/human-pose-estimation-0002.bin + size: 32601932 + sha256: e7ab3c30ec909af6b0d93db52b76d20e59ae30da9a37b473699d58936b34f308 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/human-pose-estimation-0002/FP32/human-pose-estimation-0002.bin + - name: FP16/human-pose-estimation-0002.xml + size: 713975 + sha256: 126980d280f132eced30027c97af2ed1a103b40e33102af675d0fc5e9b6a6a0c + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/human-pose-estimation-0002/FP16/human-pose-estimation-0002.xml + - name: FP16/human-pose-estimation-0002.bin + size: 16301102 + sha256: 31f89c400a90a286eb2cd8c696246d92f9f8b039c81a539be08376fb328aabc1 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/human-pose-estimation-0002/FP16/human-pose-estimation-0002.bin +framework: dldt +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/human-pose-estimation-0003/accuracy-check.yml b/models/intel/human-pose-estimation-0003/accuracy-check.yml new file mode 100644 index 00000000000..64905e81d63 --- /dev/null +++ b/models/intel/human-pose-estimation-0003/accuracy-check.yml @@ -0,0 +1,27 @@ +models: + - name: human-pose-estimation-0003 + + launchers: + - framework: dlsdk + allow_reshape_input: True + adapter: + type: human_pose_estimation_ae + heatmaps_out: heatmaps + nms_heatmaps_out: nms_heatmaps + embeddings_out: embeddings + + datasets: + - name: ms_coco_val2017_keypoints + + preprocessing: + - type: resize + size: 352 + interpolation: LINEAR + aspect_ratio_scale: greater + - type: padding + stride: 32 + pad_type: right_bottom + + metrics: + - name: AP + type: coco_orig_keypoints_precision diff --git a/models/intel/human-pose-estimation-0003/description/human-pose-estimation-0003.md b/models/intel/human-pose-estimation-0003/description/human-pose-estimation-0003.md new file mode 100644 index 00000000000..7b074bcd1d0 --- /dev/null +++ b/models/intel/human-pose-estimation-0003/description/human-pose-estimation-0003.md @@ -0,0 +1,42 @@ +# human-pose-estimation-0003 + +## Use Case and High-Level Description + +This is a multi-person 2D pose estimation network based on the EfficientHRNet approach (that follows the Associative Embedding framework). +For every person in an image, the network detects a human pose: a body skeleton consisting of keypoints and connections between them. +The pose may contain up to 17 keypoints: ears, eyes, nose, shoulders, elbows, wrists, hips, knees, and ankles. + +## Example + +![](./human-pose-estimation-0003.png) + +## Specification + +| Metric | Value | +|---------------------------------|-------------------------------------------| +| Average Precision (AP) | 50.2% | +| GFlops | 8.8720 | +| MParams | 8.1504 | +| Source framework | PyTorch\* | + +Average Precision metric described in [COCO Keypoint Evaluation site](https://cocodataset.org/#keypoints-eval). + +## Inputs + +Name: `input`, shape: [1x3x352x352]. An input image in the [BxCxHxW] format , +where: + - B - batch size + - C - number of channels + - H - image height + - W - image width +Expected color order is BGR. + +## Outputs + +The net outputs three blobs: + * "heatmaps" of shape [N, 17, 176, 176] containing location heatmaps for keypoints of all types. + * "nms_heatmaps" of shape [N, 17, 176, 176] containing heatmaps after non-maximum suppression. + * "embeddings" of shape [N, 17, 176, 176, 1] containing associative embedding values, which are used for grouping individual keypoints into poses. + +## Legal Information +[*] Other names and brands may be claimed as the property of others. diff --git a/models/intel/human-pose-estimation-0003/description/human-pose-estimation-0003.png b/models/intel/human-pose-estimation-0003/description/human-pose-estimation-0003.png new file mode 100644 index 00000000000..d3cfc55c673 Binary files /dev/null and b/models/intel/human-pose-estimation-0003/description/human-pose-estimation-0003.png differ diff --git a/models/intel/human-pose-estimation-0003/model.yml b/models/intel/human-pose-estimation-0003/model.yml new file mode 100644 index 00000000000..4b6d252c935 --- /dev/null +++ b/models/intel/human-pose-estimation-0003/model.yml @@ -0,0 +1,36 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + 2D human pose estimation based on EfficientHRNet. +task_type: human_pose_estimation +files: + - name: FP32/human-pose-estimation-0003.xml + size: 714739 + sha256: 160b0c1cbd6cea0fb58d67e386009ff2b55f30eb5f24ccb89263312f9ca4e6ae + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/human-pose-estimation-0003/FP32/human-pose-estimation-0003.xml + - name: FP32/human-pose-estimation-0003.bin + size: 32601932 + sha256: e7ab3c30ec909af6b0d93db52b76d20e59ae30da9a37b473699d58936b34f308 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/human-pose-estimation-0003/FP32/human-pose-estimation-0003.bin + - name: FP16/human-pose-estimation-0003.xml + size: 714489 + sha256: db21b8abff265e6f6265c66d68c106fe807420f21920ea5028510af6148f43d0 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/human-pose-estimation-0003/FP16/human-pose-estimation-0003.xml + - name: FP16/human-pose-estimation-0003.bin + size: 16301102 + sha256: 31f89c400a90a286eb2cd8c696246d92f9f8b039c81a539be08376fb328aabc1 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/human-pose-estimation-0003/FP16/human-pose-estimation-0003.bin +framework: dldt +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/human-pose-estimation-0004/accuracy-check.yml b/models/intel/human-pose-estimation-0004/accuracy-check.yml new file mode 100644 index 00000000000..a8869c6903a --- /dev/null +++ b/models/intel/human-pose-estimation-0004/accuracy-check.yml @@ -0,0 +1,27 @@ +models: + - name: human-pose-estimation-0004 + + launchers: + - framework: dlsdk + allow_reshape_input: True + adapter: + type: human_pose_estimation_ae + heatmaps_out: heatmaps + nms_heatmaps_out: nms_heatmaps + embeddings_out: embeddings + + datasets: + - name: ms_coco_val2017_keypoints + + preprocessing: + - type: resize + size: 448 + interpolation: LINEAR + aspect_ratio_scale: greater + - type: padding + stride: 32 + pad_type: right_bottom + + metrics: + - name: AP + type: coco_orig_keypoints_precision diff --git a/models/intel/human-pose-estimation-0004/description/human-pose-estimation-0004.md b/models/intel/human-pose-estimation-0004/description/human-pose-estimation-0004.md new file mode 100644 index 00000000000..ae47c2c840d --- /dev/null +++ b/models/intel/human-pose-estimation-0004/description/human-pose-estimation-0004.md @@ -0,0 +1,42 @@ +# human-pose-estimation-0004 + +## Use Case and High-Level Description + +This is a multi-person 2D pose estimation network based on the EfficientHRNet approach (that follows the Associative Embedding framework). +For every person in an image, the network detects a human pose: a body skeleton consisting of keypoints and connections between them. +The pose may contain up to 17 keypoints: ears, eyes, nose, shoulders, elbows, wrists, hips, knees, and ankles. + +## Example + +![](./human-pose-estimation-0004.png) + +## Specification + +| Metric | Value | +|---------------------------------|-------------------------------------------| +| Average Precision (AP) | 52.9% | +| GFlops | 14.3707 | +| MParams | 8.1504 | +| Source framework | PyTorch\* | + +Average Precision metric described in [COCO Keypoint Evaluation site](https://cocodataset.org/#keypoints-eval). + +## Inputs + +Name: `input`, shape: [1x3x448x448]. An input image in the [BxCxHxW] format , +where: + - B - batch size + - C - number of channels + - H - image height + - W - image width +Expected color order is BGR. + +## Outputs + +The net outputs three blobs: + * "heatmaps" of shape [N, 17, 224, 224] containing location heatmaps for keypoints of all types. + * "nms_heatmaps" of shape [N, 17, 224, 224] containing heatmaps after non-maximum suppression. + * "embeddings" of shape [N, 17, 224, 224, 1] containing associative embedding values, which are used for grouping individual keypoints into poses. + +## Legal Information +[*] Other names and brands may be claimed as the property of others. diff --git a/models/intel/human-pose-estimation-0004/description/human-pose-estimation-0004.png b/models/intel/human-pose-estimation-0004/description/human-pose-estimation-0004.png new file mode 100644 index 00000000000..d3cfc55c673 Binary files /dev/null and b/models/intel/human-pose-estimation-0004/description/human-pose-estimation-0004.png differ diff --git a/models/intel/human-pose-estimation-0004/model.yml b/models/intel/human-pose-estimation-0004/model.yml new file mode 100644 index 00000000000..2657e322b21 --- /dev/null +++ b/models/intel/human-pose-estimation-0004/model.yml @@ -0,0 +1,36 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + 2D human pose estimation based on EfficientHRNet. +task_type: human_pose_estimation +files: + - name: FP32/human-pose-estimation-0004.xml + size: 715389 + sha256: 7a9a2186d715caa42b032f0325d9100b4eec52504147c6fcf00fd6c6cdef9706 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/human-pose-estimation-0004/FP32/human-pose-estimation-0004.xml + - name: FP32/human-pose-estimation-0004.bin + size: 32601932 + sha256: e7ab3c30ec909af6b0d93db52b76d20e59ae30da9a37b473699d58936b34f308 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/human-pose-estimation-0004/FP32/human-pose-estimation-0004.bin + - name: FP16/human-pose-estimation-0004.xml + size: 715139 + sha256: 8107372de556acaed3cdecb9ebf95b2d2b7a4d6ae4e6b48ad16f834278c170c4 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/human-pose-estimation-0004/FP16/human-pose-estimation-0004.xml + - name: FP16/human-pose-estimation-0004.bin + size: 16301102 + sha256: 31f89c400a90a286eb2cd8c696246d92f9f8b039c81a539be08376fb328aabc1 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/human-pose-estimation-0004/FP16/human-pose-estimation-0004.bin +framework: dldt +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/icnet-camvid-ava-0001/description/icnet-camvid-ava-0001.md b/models/intel/icnet-camvid-ava-0001/description/icnet-camvid-ava-0001.md index bc9fac9d671..d71ce8cc554 100644 --- a/models/intel/icnet-camvid-ava-0001/description/icnet-camvid-ava-0001.md +++ b/models/intel/icnet-camvid-ava-0001/description/icnet-camvid-ava-0001.md @@ -30,8 +30,6 @@ The quality metrics were calculated on the CamVid\* validation dataset. The `unl - `FP` - number of false positive pixels for given class -## Performance - ## Input Image, shape - `1,3,720,960`, format is `B,C,H,W` where: diff --git a/models/intel/icnet-camvid-ava-0001/model.yml b/models/intel/icnet-camvid-ava-0001/model.yml index 21a10bdf4aa..249e5900644 100644 --- a/models/intel/icnet-camvid-ava-0001/model.yml +++ b/models/intel/icnet-camvid-ava-0001/model.yml @@ -17,28 +17,28 @@ description: >- task_type: semantic_segmentation files: - name: FP32/icnet-camvid-ava-0001.xml - size: 210469 - sha256: ffa6e8f1443f25de533c8eef209dac06d64b52f6b76170c15f7bd83e96897615 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/icnet-camvid-ava-0001/FP32/icnet-camvid-ava-0001.xml + size: 210507 + sha256: 3fc7ad7bc186ff25a6454d32c86ee5b7e258b5d4c3b1c3ae25ce967bd7bd01fa + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/icnet-camvid-ava-0001/FP32/icnet-camvid-ava-0001.xml - name: FP32/icnet-camvid-ava-0001.bin size: 106816756 sha256: 07baba823966d3c4cbd08d59187c8e53d9c3b9455d2d11ccea1f0b3756ae892e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/icnet-camvid-ava-0001/FP32/icnet-camvid-ava-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/icnet-camvid-ava-0001/FP32/icnet-camvid-ava-0001.bin - name: FP16/icnet-camvid-ava-0001.xml - size: 210377 - sha256: d3b498c44037c4af1d5a21d167accce80253a61bf1a3785c69985bc2a8c766f7 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/icnet-camvid-ava-0001/FP16/icnet-camvid-ava-0001.xml + size: 210415 + sha256: 86dbfba4ac73f9a69c1e045be650e124c924e47d3aa366c5a8769d4d2418ffd3 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/icnet-camvid-ava-0001/FP16/icnet-camvid-ava-0001.xml - name: FP16/icnet-camvid-ava-0001.bin size: 53408464 sha256: 88a3d1f2cdc585073d1dc4af0217ddf924fcb191e65d89d64687ad2eb4b4bdc3 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/icnet-camvid-ava-0001/FP16/icnet-camvid-ava-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/icnet-camvid-ava-0001/FP16/icnet-camvid-ava-0001.bin - name: FP16-INT8/icnet-camvid-ava-0001.xml - size: 589007 - sha256: 95273ac90d81eac607e7cef6171b5513508af4957e1adfa706f7adda574a9aa3 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/icnet-camvid-ava-0001/FP16-INT8/icnet-camvid-ava-0001.xml + size: 590450 + sha256: ee8839c2065e85547ce6e43b3220dc0531447bce3751882b7cff95f078a54f05 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/icnet-camvid-ava-0001/FP16-INT8/icnet-camvid-ava-0001.xml - name: FP16-INT8/icnet-camvid-ava-0001.bin size: 26847350 sha256: a300e550d061fb67806340fbaa00d6470055253bcdc781fe0a6146e88c05976e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/icnet-camvid-ava-0001/FP16-INT8/icnet-camvid-ava-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/icnet-camvid-ava-0001/FP16-INT8/icnet-camvid-ava-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/icnet-camvid-ava-sparse-30-0001/description/icnet-camvid-ava-sparse-30-0001.md b/models/intel/icnet-camvid-ava-sparse-30-0001/description/icnet-camvid-ava-sparse-30-0001.md index eb8571a6f49..920b01bf7a5 100644 --- a/models/intel/icnet-camvid-ava-sparse-30-0001/description/icnet-camvid-ava-sparse-30-0001.md +++ b/models/intel/icnet-camvid-ava-sparse-30-0001/description/icnet-camvid-ava-sparse-30-0001.md @@ -30,8 +30,6 @@ The quality metrics were calculated on the CamVid\* validation dataset. The `unl - `FP` - number of false positive pixels for given class -## Performance - ## Input Image, shape - `1,3,720,960`, format is `B,C,H,W` where: diff --git a/models/intel/icnet-camvid-ava-sparse-30-0001/model.yml b/models/intel/icnet-camvid-ava-sparse-30-0001/model.yml index 84b4d97cf14..ed1101bc07a 100644 --- a/models/intel/icnet-camvid-ava-sparse-30-0001/model.yml +++ b/models/intel/icnet-camvid-ava-sparse-30-0001/model.yml @@ -17,28 +17,28 @@ description: >- task_type: semantic_segmentation files: - name: FP32/icnet-camvid-ava-sparse-30-0001.xml - size: 210489 - sha256: aed0a7be0c5993e177ffc3e96b8db0af609f34d91cce2622cfdee5c489d38ee9 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/icnet-camvid-ava-sparse-30-0001/FP32/icnet-camvid-ava-sparse-30-0001.xml + size: 210527 + sha256: da3b399578f349db93572e3412e14df2aeb12596ec7b48ef7d5025c6897ae6e8 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/icnet-camvid-ava-sparse-30-0001/FP32/icnet-camvid-ava-sparse-30-0001.xml - name: FP32/icnet-camvid-ava-sparse-30-0001.bin size: 106816756 sha256: eaf6274b44f26eeda4e593e3868641cf8cada3db92178e0a05c2bfb7ea35215d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/icnet-camvid-ava-sparse-30-0001/FP32/icnet-camvid-ava-sparse-30-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/icnet-camvid-ava-sparse-30-0001/FP32/icnet-camvid-ava-sparse-30-0001.bin - name: FP16/icnet-camvid-ava-sparse-30-0001.xml - size: 210397 - sha256: 2e714ca340a397fc62d76b115ed749d42c552119fe63fc172c514a404e13b75f - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/icnet-camvid-ava-sparse-30-0001/FP16/icnet-camvid-ava-sparse-30-0001.xml + size: 210435 + sha256: d53a11d5d7ba7e8679c76bea9bc7c54cab064377933701cac33ba5a74af0ab6a + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/icnet-camvid-ava-sparse-30-0001/FP16/icnet-camvid-ava-sparse-30-0001.xml - name: FP16/icnet-camvid-ava-sparse-30-0001.bin size: 53408464 sha256: ec1ef20ce5cf46e163fa0d1366eaad01c4e0ab3ab2d4ca960a1939e9922249c1 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/icnet-camvid-ava-sparse-30-0001/FP16/icnet-camvid-ava-sparse-30-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/icnet-camvid-ava-sparse-30-0001/FP16/icnet-camvid-ava-sparse-30-0001.bin - name: FP16-INT8/icnet-camvid-ava-sparse-30-0001.xml - size: 589039 - sha256: 54111e87b8c16d5aab59c28ba73480eb392d0e7dc53f2c66e5f2799c61d4f2d7 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/icnet-camvid-ava-sparse-30-0001/FP16-INT8/icnet-camvid-ava-sparse-30-0001.xml + size: 590482 + sha256: d86a0a4bd9749f9889d328de9f2e2f592385944fa9da2e0a57ac604b01534bc7 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/icnet-camvid-ava-sparse-30-0001/FP16-INT8/icnet-camvid-ava-sparse-30-0001.xml - name: FP16-INT8/icnet-camvid-ava-sparse-30-0001.bin size: 26847344 sha256: 6e15e11faff5b7ecf032987a6d8b76c25a1ee91da993ed9a83fbb858d752eaca - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/icnet-camvid-ava-sparse-30-0001/FP16-INT8/icnet-camvid-ava-sparse-30-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/icnet-camvid-ava-sparse-30-0001/FP16-INT8/icnet-camvid-ava-sparse-30-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/icnet-camvid-ava-sparse-60-0001/description/icnet-camvid-ava-sparse-60-0001.md b/models/intel/icnet-camvid-ava-sparse-60-0001/description/icnet-camvid-ava-sparse-60-0001.md index 9c2db5c6943..2310fca5756 100644 --- a/models/intel/icnet-camvid-ava-sparse-60-0001/description/icnet-camvid-ava-sparse-60-0001.md +++ b/models/intel/icnet-camvid-ava-sparse-60-0001/description/icnet-camvid-ava-sparse-60-0001.md @@ -30,8 +30,6 @@ The quality metrics were calculated on the CamVid\* validation dataset. The `unl - `FP` - number of false positive pixels for given class -## Performance - ## Input Image, shape - `1,3,720,960`, format is `B,C,H,W` where: diff --git a/models/intel/icnet-camvid-ava-sparse-60-0001/model.yml b/models/intel/icnet-camvid-ava-sparse-60-0001/model.yml index ad5dbaa2a9d..7db6b19cd39 100644 --- a/models/intel/icnet-camvid-ava-sparse-60-0001/model.yml +++ b/models/intel/icnet-camvid-ava-sparse-60-0001/model.yml @@ -17,28 +17,28 @@ description: >- task_type: semantic_segmentation files: - name: FP32/icnet-camvid-ava-sparse-60-0001.xml - size: 210489 - sha256: ce45d14ec3931c4033a5b0c7f28fc7db157350144a452b51183a94e7ae960c42 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/icnet-camvid-ava-sparse-60-0001/FP32/icnet-camvid-ava-sparse-60-0001.xml + size: 210527 + sha256: c5125d2fc5730af3c251de1b1a65fe9cf8a4c2692e1a35de52d5b9086db1638e + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/icnet-camvid-ava-sparse-60-0001/FP32/icnet-camvid-ava-sparse-60-0001.xml - name: FP32/icnet-camvid-ava-sparse-60-0001.bin size: 106816756 sha256: eed6911e4a4e56613ea01317d386f51b7f5529f944b65a97aeb045f7afa4b9eb - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/icnet-camvid-ava-sparse-60-0001/FP32/icnet-camvid-ava-sparse-60-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/icnet-camvid-ava-sparse-60-0001/FP32/icnet-camvid-ava-sparse-60-0001.bin - name: FP16/icnet-camvid-ava-sparse-60-0001.xml - size: 210397 - sha256: c63d8ec0dbdad3332ee00c31f6fb4856eb0b9f1e456daef8b8f836b018591bef - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/icnet-camvid-ava-sparse-60-0001/FP16/icnet-camvid-ava-sparse-60-0001.xml + size: 210435 + sha256: f94e57277e44894962df3e9ccb384ec6a89b4d58f70f980104f36c12ea796c61 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/icnet-camvid-ava-sparse-60-0001/FP16/icnet-camvid-ava-sparse-60-0001.xml - name: FP16/icnet-camvid-ava-sparse-60-0001.bin size: 53408464 sha256: 7a5d41199e2a121f67251bd7a4acb41f72033e24611b3333956f89bf27697e3b - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/icnet-camvid-ava-sparse-60-0001/FP16/icnet-camvid-ava-sparse-60-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/icnet-camvid-ava-sparse-60-0001/FP16/icnet-camvid-ava-sparse-60-0001.bin - name: FP16-INT8/icnet-camvid-ava-sparse-60-0001.xml - size: 589039 - sha256: db62483e15499d5de7e5cb7b654c7b2beb113c2ccc303ea1b11ab4c45cbdfbcf - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/icnet-camvid-ava-sparse-60-0001/FP16-INT8/icnet-camvid-ava-sparse-60-0001.xml + size: 590482 + sha256: bd8724bc72313f2be499cf12a99dca9a0b868ce9501502bd34ac187b6db5a3f9 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/icnet-camvid-ava-sparse-60-0001/FP16-INT8/icnet-camvid-ava-sparse-60-0001.xml - name: FP16-INT8/icnet-camvid-ava-sparse-60-0001.bin size: 26847346 sha256: 8a5af2c8055f3c02db4b59b5411a1f256d697923d8c86d5f56646553aee1964d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/icnet-camvid-ava-sparse-60-0001/FP16-INT8/icnet-camvid-ava-sparse-60-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/icnet-camvid-ava-sparse-60-0001/FP16-INT8/icnet-camvid-ava-sparse-60-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/image-retrieval-0001/description/image-retrieval-0001.md b/models/intel/image-retrieval-0001/description/image-retrieval-0001.md index f4857235183..ae989253ce3 100644 --- a/models/intel/image-retrieval-0001/description/image-retrieval-0001.md +++ b/models/intel/image-retrieval-0001/description/image-retrieval-0001.md @@ -17,8 +17,6 @@ Image retrieval model based on [MobileNetV2](https://arxiv.org/abs/1801.04381) a | MParams | 2.535 | | Source framework | TensorFlow\* | -## Performance - ## Inputs Name: `input`, shape: [1x3x224x224] — An input image in the format [BxCxHxW], diff --git a/models/intel/image-retrieval-0001/model.yml b/models/intel/image-retrieval-0001/model.yml index 9347475a88a..4edce18c640 100644 --- a/models/intel/image-retrieval-0001/model.yml +++ b/models/intel/image-retrieval-0001/model.yml @@ -18,28 +18,28 @@ description: >- task_type: object_attributes files: - name: FP32/image-retrieval-0001.xml - size: 142438 - sha256: 5a137a4c11ba723f5fd2e4d76c6f65a393e35fc3c0b41389499082e37bef05c6 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/image-retrieval-0001/FP32/image-retrieval-0001.xml + size: 142816 + sha256: d99fbc860fc742e18f99e9cda887e227bca732a5e6e6027fc0d9a43e7c948cb2 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/image-retrieval-0001/FP32/image-retrieval-0001.xml - name: FP32/image-retrieval-0001.bin - size: 10139176 - sha256: 193674816f857bd7143667e6330b9171057048deadf933d81633c7e68db5b4fe - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/image-retrieval-0001/FP32/image-retrieval-0001.bin + size: 10139168 + sha256: cbdbc1cda87cede7ceaa764b09eafb532dcd604a95dc32ecfb17e43e70100e49 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/image-retrieval-0001/FP32/image-retrieval-0001.bin - name: FP16/image-retrieval-0001.xml - size: 142371 - sha256: 0b103fd6ab76c56250ca91b5e5fcf3eddc1b88caf827df39fed127b2b87d7160 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/image-retrieval-0001/FP16/image-retrieval-0001.xml + size: 142750 + sha256: 1e269e5cf25e16b13ceacd8c65f9bda973c02172d182827718449a02bc108c99 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/image-retrieval-0001/FP16/image-retrieval-0001.xml - name: FP16/image-retrieval-0001.bin - size: 5069656 - sha256: bc1ea805f260ee74ad9c1ce7e344848188d089d03be5d1ffb95e9d9380c53d45 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/image-retrieval-0001/FP16/image-retrieval-0001.bin + size: 5069652 + sha256: f8dfc71a7a976947fd882e89b590fac8a6293c7ea35b95f0ff816e7f536f9b5f + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/image-retrieval-0001/FP16/image-retrieval-0001.bin - name: FP16-INT8/image-retrieval-0001.xml - size: 427791 - sha256: 04271f07145fadc83f10aa44c96403e4860629c871a3ba156fb512959f752ee4 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/image-retrieval-0001/FP16-INT8/image-retrieval-0001.xml + size: 428988 + sha256: 959aff597038cfbc652ecd5a85fa02d499c6a519ed18612541d4fd8a1c247def + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/image-retrieval-0001/FP16-INT8/image-retrieval-0001.xml - name: FP16-INT8/image-retrieval-0001.bin - size: 2640925 - sha256: b5fc3a38e8c9f54912ec2f9b809679232783930f1989e29e41854afa71966fb9 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/image-retrieval-0001/FP16-INT8/image-retrieval-0001.bin + size: 2640921 + sha256: b59c7b4e01622e213574218a09bdfb92fdec9174b219ca8580c25657c2778f7a + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/image-retrieval-0001/FP16-INT8/image-retrieval-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/index.md b/models/intel/index.md index 433f426735e..c7b412586bc 100644 --- a/models/intel/index.md +++ b/models/intel/index.md @@ -38,6 +38,7 @@ network to detect objects of the same type better. | [person-detection-0200](./person-detection-0200/description/person-detection-0200.md) | 0.786 | 1.817 | | X | | | | | | [person-detection-0201](./person-detection-0201/description/person-detection-0201.md) | 1.768 | 1.817 | | X | | | | | | [person-detection-0202](./person-detection-0202/description/person-detection-0202.md) | 3.143 | 1.817 | | X | | | | | +| [person-detection-0203](./person-detection-0203/description/person-detection-0203.md) | 6.519 | 2.394 | | X | | | | | | [person-detection-0106](./person-detection-0106/description/person-detection-0106.md) | 404.264 | 71.565 | | X | | | | | | [pedestrian-detection-adas-0002](./pedestrian-detection-adas-0002/description/pedestrian-detection-adas-0002.md) | 2.836 | 1.165 | | X | | | | | | [pedestrian-and-vehicle-detector-adas-0001](./pedestrian-and-vehicle-detector-adas-0001/description/pedestrian-and-vehicle-detector-adas-0001.md) | 3.974 | 1.650 | | X | X | | | | @@ -154,7 +155,10 @@ instances, thus faster than previous, because network runs once. | Model Name | Complexity (GFLOPs) | Size (Mp) | |----------------------------------------------------------------------------------------------------------------------------|--------------------- |---------------- | -| [human-pose-estimation-0001](./human-pose-estimation-0001/description/human-pose-estimation-0001.md) | 15.435 | 4.099 | +| [human-pose-estimation-0001](./human-pose-estimation-0001/description/human-pose-estimation-0001.md) | 15.435 | 4.099 | +| [human-pose-estimation-0002](./human-pose-estimation-0002/description/human-pose-estimation-0002.md) | 5.9393 | 8.1504 | +| [human-pose-estimation-0003](./human-pose-estimation-0003/description/human-pose-estimation-0003.md) | 8.8720 | 8.1504 | +| [human-pose-estimation-0004](./human-pose-estimation-0004/description/human-pose-estimation-0004.md) | 14.3707 | 8.1504 | ## Image Processing @@ -196,10 +200,10 @@ Deep Learning models for text spotting (simultaneous detection and recognition). | Model Name | Complexity (GFLOPs) | Size (Mp) | |------------------------------------------------------------------------------------------------------------------------------------------------|--------------------- |----------- | -| [text-spotting-0002](./text-spotting-0002/description/text-spotting-0002.md) | | | -| text-spotting-0002-detector | 185.169 | 26.497 | -| text-spotting-0002-recognizer-encoder | 2.082 | 1.328 | -| text-spotting-0002-recognizer-decoder | 0.002 | 0.273 | +| [text-spotting-0003](./text-spotting-0003/description/text-spotting-0003.md) | | | +| text-spotting-0003-detector | 184.495 | 27.010 | +| text-spotting-0003-recognizer-encoder | 2.082 | 1.328 | +| text-spotting-0003-recognizer-decoder | 0.002 | 0.273 | ## Action Recognition Models @@ -241,11 +245,13 @@ Deep Learning compressed models | Model Name| Complexity (GFLOPs)|Size (Mp)| |-----------|--------------------|---------| -| [bert-large-uncased-whole-word-masking-squad-fp32-0001](./bert-large-uncased-whole-word-masking-squad-fp32-0001/description/bert-large-uncased-whole-word-masking-squad-fp32-0001.md) | 246.93 | 333.96 | +| [bert-large-uncased-whole-word-masking-squad-0001](./bert-large-uncased-whole-word-masking-squad-0001/description/bert-large-uncased-whole-word-masking-squad-0001.md) | 246.93 | 333.96 | | [bert-large-uncased-whole-word-masking-squad-int8-0001](./bert-large-uncased-whole-word-masking-squad-int8-0001/description/bert-large-uncased-whole-word-masking-squad-int8-0001.md) | 246.93 | 333.96 | +| [bert-large-uncased-whole-word-masking-squad-emb-0001](./bert-large-uncased-whole-word-masking-squad-emb-0001/description/bert-large-uncased-whole-word-masking-squad-emb-0001.md) | 246.93 (for [1,384] input size) | 333.96 | | [bert-small-uncased-whole-word-masking-squad-0001](./bert-small-uncased-whole-word-masking-squad-0001/description/bert-small-uncased-whole-word-masking-squad-0001.md) | 23.9 | 57.94 | | [bert-small-uncased-whole-word-masking-squad-0002](./bert-small-uncased-whole-word-masking-squad-0002/description/bert-small-uncased-whole-word-masking-squad-0002.md) | 23.9 | 41.1 | -| [bert-large-uncased-whole-word-masking-squad-emb-0001](./bert-large-uncased-whole-word-masking-squad-emb-0001/description/bert-large-uncased-whole-word-masking-squad-emb-0001.md) | 246.93 (for [1,384] input size) | 333.96 | +| [bert-small-uncased-whole-word-masking-squad-int8-0002](./bert-small-uncased-whole-word-masking-squad-int8-0002/description/bert-small-uncased-whole-word-masking-squad-int8-0002.md) | 23.9 | 41.1 | +| [bert-small-uncased-whole-word-masking-squad-emb-int8-0001](./bert-small-uncased-whole-word-masking-squad-emb-int8-0001/bert-small-uncased-whole-word-masking-squad-emb-int8-0001.md) | 23.9 (for [1,384] input size) | 41.1 | ## Machine Translation diff --git a/models/intel/instance-segmentation-security-0010/description/instance-segmentation-security-0010.md b/models/intel/instance-segmentation-security-0010/description/instance-segmentation-security-0010.md index 34ad4d88314..c2da380f320 100644 --- a/models/intel/instance-segmentation-security-0010/description/instance-segmentation-security-0010.md +++ b/models/intel/instance-segmentation-security-0010/description/instance-segmentation-security-0010.md @@ -27,8 +27,6 @@ in all ROI-wise heads. Average Precision (AP) is defined and measured according to standard [MS COCO evaluation procedure](https://cocodataset.org/#detection-eval). -## Performance - ## Inputs 1. name: `im_data` , shape: [1x3x800x1344] - An input image in the format diff --git a/models/intel/instance-segmentation-security-0010/model.yml b/models/intel/instance-segmentation-security-0010/model.yml index 63874a6fb47..f883bef9575 100644 --- a/models/intel/instance-segmentation-security-0010/model.yml +++ b/models/intel/instance-segmentation-security-0010/model.yml @@ -19,28 +19,28 @@ description: >- task_type: instance_segmentation files: - name: FP32/instance-segmentation-security-0010.xml - size: 621532 - sha256: 2c70bb88967e4381671514ff40add3e479ceffb305eed378a91fde77ef8a5f06 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/instance-segmentation-security-0010/FP32/instance-segmentation-security-0010.xml + size: 621834 + sha256: 6718659be9d40ce5dd55732e39d09b567c928d7889dd02b6ba0bd34aba19ce25 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/instance-segmentation-security-0010/FP32/instance-segmentation-security-0010.xml - name: FP32/instance-segmentation-security-0010.bin size: 688761896 sha256: c5bd3d72affcb62f734ed8c8360f89d2048001fae344c1b8dc34224afb459920 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/instance-segmentation-security-0010/FP32/instance-segmentation-security-0010.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/instance-segmentation-security-0010/FP32/instance-segmentation-security-0010.bin - name: FP16/instance-segmentation-security-0010.xml - size: 621321 - sha256: 9e8c32374deb1ee2120efdc895d162e4b192c9be4651df5b4a5cd1a77532803d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/instance-segmentation-security-0010/FP16/instance-segmentation-security-0010.xml + size: 621623 + sha256: 3b4446af20d05c433b9f585849de7189b86418d6574f402d0f34ca10d90256ed + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/instance-segmentation-security-0010/FP16/instance-segmentation-security-0010.xml - name: FP16/instance-segmentation-security-0010.bin size: 344381074 sha256: 2a4e95f7bf418ced9a11dd68adb99f600369deef7072fe0d506c3bcc63fc6ee2 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/instance-segmentation-security-0010/FP16/instance-segmentation-security-0010.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/instance-segmentation-security-0010/FP16/instance-segmentation-security-0010.bin - name: FP16-INT8/instance-segmentation-security-0010.xml - size: 1437491 - sha256: 9d8c9424e188c6dd8cf60a5d9dc5581749b0672c4566570204baf662c4918ef2 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/instance-segmentation-security-0010/FP16-INT8/instance-segmentation-security-0010.xml + size: 1438717 + sha256: 175e60b3d521ef440b3941da333a985f1cd67d1142247290adc4f95f8482a77b + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/instance-segmentation-security-0010/FP16-INT8/instance-segmentation-security-0010.xml - name: FP16-INT8/instance-segmentation-security-0010.bin size: 318659054 - sha256: 4fa096f9ab7da5116ad2c28fb0b479acb55f5f657c1bb66630709e40cd85550a - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/instance-segmentation-security-0010/FP16-INT8/instance-segmentation-security-0010.bin + sha256: a50a1fc3d2518e041e4f2527e5932f204140900c924b9afe8f8558e3b96f9ca6 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/instance-segmentation-security-0010/FP16-INT8/instance-segmentation-security-0010.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/instance-segmentation-security-0050/description/instance-segmentation-security-0050.md b/models/intel/instance-segmentation-security-0050/description/instance-segmentation-security-0050.md index 15da7bea4f2..1aad96abcab 100644 --- a/models/intel/instance-segmentation-security-0050/description/instance-segmentation-security-0050.md +++ b/models/intel/instance-segmentation-security-0050/description/instance-segmentation-security-0050.md @@ -24,8 +24,6 @@ and light-weight RPN. Average Precision (AP) is defined and measured according to standard [MS COCO evaluation procedure](https://cocodataset.org/#detection-eval). -## Performance - ## Inputs 1. name: `im_data` , shape: [1x3x480x480] - An input image in the format diff --git a/models/intel/instance-segmentation-security-0050/model.yml b/models/intel/instance-segmentation-security-0050/model.yml index e9a1de505c0..fbd34e45f45 100644 --- a/models/intel/instance-segmentation-security-0050/model.yml +++ b/models/intel/instance-segmentation-security-0050/model.yml @@ -18,28 +18,28 @@ description: >- task_type: instance_segmentation files: - name: FP32/instance-segmentation-security-0050.xml - size: 304992 - sha256: 137327dd41e01e36277d4848d396fb43f455d9545de73e5e7817ccb81c395d3e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/instance-segmentation-security-0050/FP32/instance-segmentation-security-0050.xml + size: 306356 + sha256: 1645e1df60a90f464102b38c4bc5d7d6417b5be1d56a0598173b63a1745ff538 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/instance-segmentation-security-0050/FP32/instance-segmentation-security-0050.xml - name: FP32/instance-segmentation-security-0050.bin size: 121497512 sha256: 695c5fcbf8b49916c3a8b9a16011bfdf9f9a17d4460596fa518b26c01d0726ff - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/instance-segmentation-security-0050/FP32/instance-segmentation-security-0050.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/instance-segmentation-security-0050/FP32/instance-segmentation-security-0050.bin - name: FP16/instance-segmentation-security-0050.xml - size: 304880 - sha256: 94900afa540ed2b058dcc14c8ddfce78d1631dd8e74502eb98a9f650bbb275a1 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/instance-segmentation-security-0050/FP16/instance-segmentation-security-0050.xml + size: 306244 + sha256: 5d715ef74df10f8a2257ddc295c31b5f5026faf54783981771f2728d82403ee6 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/instance-segmentation-security-0050/FP16/instance-segmentation-security-0050.xml - name: FP16/instance-segmentation-security-0050.bin size: 60748858 sha256: e1408865cee9629e60160cb767aa0afa6cf87813425806a0de7ee29898ec14dc - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/instance-segmentation-security-0050/FP16/instance-segmentation-security-0050.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/instance-segmentation-security-0050/FP16/instance-segmentation-security-0050.bin - name: FP16-INT8/instance-segmentation-security-0050.xml - size: 737596 - sha256: 8cbbd126c68bdca3d54e04c4083398d7bbc4dab54742a66d07805390f5a9662b - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/instance-segmentation-security-0050/FP16-INT8/instance-segmentation-security-0050.xml + size: 739598 + sha256: 0b90d77d0ed377792f4a567fbfc9951cb119ea51dc8e7821a744f80158f63e25 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/instance-segmentation-security-0050/FP16-INT8/instance-segmentation-security-0050.xml - name: FP16-INT8/instance-segmentation-security-0050.bin size: 30598022 - sha256: 6761bec44b6f6c36906dbd8fa51da8f8b2430e7f97958f95f2574c4adf986724 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/instance-segmentation-security-0050/FP16-INT8/instance-segmentation-security-0050.bin + sha256: 0a3f6ab0ee855807d4b755eb80ab8e43d030052b8b3a880d647ded08e3166508 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/instance-segmentation-security-0050/FP16-INT8/instance-segmentation-security-0050.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/instance-segmentation-security-0083/description/instance-segmentation-security-0083.md b/models/intel/instance-segmentation-security-0083/description/instance-segmentation-security-0083.md index 2119c225cf6..28a8061e90f 100644 --- a/models/intel/instance-segmentation-security-0083/description/instance-segmentation-security-0083.md +++ b/models/intel/instance-segmentation-security-0083/description/instance-segmentation-security-0083.md @@ -26,8 +26,6 @@ Feature Pyramid Networks block for feature maps refinement. Average Precision (AP) is defined and measured according to standard [MS COCO evaluation procedure](https://cocodataset.org/#detection-eval). -## Performance - ## Inputs 1. name: `im_data` , shape: [1x3x480x640] - An input image in the format diff --git a/models/intel/instance-segmentation-security-0083/model.yml b/models/intel/instance-segmentation-security-0083/model.yml index b61272313eb..b4f5e4a4176 100644 --- a/models/intel/instance-segmentation-security-0083/model.yml +++ b/models/intel/instance-segmentation-security-0083/model.yml @@ -18,28 +18,28 @@ description: >- task_type: instance_segmentation files: - name: FP32/instance-segmentation-security-0083.xml - size: 547844 - sha256: 3de868b63097f040d14dd1d79589d154eb4413f9fcaf0d160721da628aaea536 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/instance-segmentation-security-0083/FP32/instance-segmentation-security-0083.xml + size: 551188 + sha256: 5e5a1f0467bd9a5fd1e55c5c7fab8d42cd5d7194bcba97a28dab2bae935ea3b7 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/instance-segmentation-security-0083/FP32/instance-segmentation-security-0083.xml - name: FP32/instance-segmentation-security-0083.bin size: 564274600 sha256: 744a69478c1aa00de1269b5e0487fedb591c38eca3f5d54b376d584ac0042bd7 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/instance-segmentation-security-0083/FP32/instance-segmentation-security-0083.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/instance-segmentation-security-0083/FP32/instance-segmentation-security-0083.bin - name: FP16/instance-segmentation-security-0083.xml - size: 547639 - sha256: 2edefd1ab69e267c82f4f356cff126faf28947f508625afa0c25cc56707f9852 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/instance-segmentation-security-0083/FP16/instance-segmentation-security-0083.xml + size: 550983 + sha256: 7092caeacbe05b9c9722d59b23845ae77d388bd349547cb049fd880ef09f6bd5 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/instance-segmentation-security-0083/FP16/instance-segmentation-security-0083.xml - name: FP16/instance-segmentation-security-0083.bin size: 282137402 sha256: 955df4f38d7b9c3ccfd884c524641359b326afe481f08eca3573b5c1669e2386 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/instance-segmentation-security-0083/FP16/instance-segmentation-security-0083.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/instance-segmentation-security-0083/FP16/instance-segmentation-security-0083.bin - name: FP16-INT8/instance-segmentation-security-0083.xml - size: 1481534 - sha256: 33e37f1bc86b07a42836e513a109e4423d7f6c08e5ca91511572b6ecd71272f3 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/instance-segmentation-security-0083/FP16-INT8/instance-segmentation-security-0083.xml + size: 1485582 + sha256: 0370cd1698fa378255f5de743675c58904420ca1bd49e34d274b6bc4361ec34e + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/instance-segmentation-security-0083/FP16-INT8/instance-segmentation-security-0083.xml - name: FP16-INT8/instance-segmentation-security-0083.bin size: 142099102 sha256: 64c6e72c200e56426fa1808a2176265731af2445d45fc423462accee431c4b92 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/instance-segmentation-security-0083/FP16-INT8/instance-segmentation-security-0083.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/instance-segmentation-security-0083/FP16-INT8/instance-segmentation-security-0083.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/instance-segmentation-security-1025/description/instance-segmentation-security-1025.md b/models/intel/instance-segmentation-security-1025/description/instance-segmentation-security-1025.md index 009063ee57a..c910f92e3ed 100644 --- a/models/intel/instance-segmentation-security-1025/description/instance-segmentation-security-1025.md +++ b/models/intel/instance-segmentation-security-1025/description/instance-segmentation-security-1025.md @@ -24,8 +24,6 @@ SERes detection head, and dual attention segmentation head. Average Precision (AP) is defined and measured according to the standard [MS COCO evaluation procedure](https://cocodataset.org/#detection-eval). -## Performance - ## Inputs 1. Name: `im_data`, shape: [1x3x480x480] - An input image in the format diff --git a/models/intel/instance-segmentation-security-1025/model.yml b/models/intel/instance-segmentation-security-1025/model.yml index 85f742f77f6..d835305b8c4 100644 --- a/models/intel/instance-segmentation-security-1025/model.yml +++ b/models/intel/instance-segmentation-security-1025/model.yml @@ -18,28 +18,28 @@ description: >- task_type: instance_segmentation files: - name: FP32/instance-segmentation-security-1025.xml - size: 905335 - sha256: 88fe9575235756c7a3e45cf3a703aa93571bf3fe9e5e5f9db19273c83636bf61 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/instance-segmentation-security-1025/FP32/instance-segmentation-security-1025.xml + size: 905470 + sha256: e912fae9b27e99d286f910c332aa9ee2e4dd3b8d2e1ad527f6b3526e6432d79b + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/instance-segmentation-security-1025/FP32/instance-segmentation-security-1025.xml - name: FP32/instance-segmentation-security-1025.bin size: 107603436 - sha256: e039ee8c0d576d50a6f87ff624fbb82bfb4edffefbc0428866a5d40a24324fc8 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/instance-segmentation-security-1025/FP32/instance-segmentation-security-1025.bin + sha256: eaa0981fd532787dd7c57ab50d14140b0f78a606fa2e117e2a4f6b8c35757f2b + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/instance-segmentation-security-1025/FP32/instance-segmentation-security-1025.bin - name: FP16/instance-segmentation-security-1025.xml - size: 904884 - sha256: 600671b6d3475ae8c662f34c8c53e72e0ab79254735e067e273394959df1b405 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/instance-segmentation-security-1025/FP16/instance-segmentation-security-1025.xml + size: 905019 + sha256: 29f27fbedf438edb5f0afd8c693bb64bb99d284cb48d2971d396c62e7deb4d70 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/instance-segmentation-security-1025/FP16/instance-segmentation-security-1025.xml - name: FP16/instance-segmentation-security-1025.bin size: 53801846 sha256: 7ef91a9ba9d29a4856b10cd1d10ba8b3f69e509f69ec461e7a646a52cdae647d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/instance-segmentation-security-1025/FP16/instance-segmentation-security-1025.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/instance-segmentation-security-1025/FP16/instance-segmentation-security-1025.bin - name: FP16-INT8/instance-segmentation-security-1025.xml - size: 2468094 - sha256: bde4af76ed445cda758e9821d90e9a4150aefb6fd2f1e9fa21bc4ef361fdcd38 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/instance-segmentation-security-1025/FP16-INT8/instance-segmentation-security-1025.xml + size: 2472851 + sha256: fb64f015db57c9fa1df9d8b987518451bacd0ba411d7ed8f3ea9e246e7f6eba0 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/instance-segmentation-security-1025/FP16-INT8/instance-segmentation-security-1025.xml - name: FP16-INT8/instance-segmentation-security-1025.bin size: 29070549 - sha256: 31ca03a9228a65f4adfc92e5c6c729061a4de77ac6385ecdd3fa29ade6ec7c23 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/instance-segmentation-security-1025/FP16-INT8/instance-segmentation-security-1025.bin + sha256: a9aebbca6c423ad08728ace6281710dd74b62fcd4c45f4e63150c3e344d64267 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/instance-segmentation-security-1025/FP16-INT8/instance-segmentation-security-1025.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/landmarks-regression-retail-0009/description/landmarks-regression-retail-0009.md b/models/intel/landmarks-regression-retail-0009/description/landmarks-regression-retail-0009.md index 324b48108a6..d21f9a2f0ad 100644 --- a/models/intel/landmarks-regression-retail-0009/description/landmarks-regression-retail-0009.md +++ b/models/intel/landmarks-regression-retail-0009/description/landmarks-regression-retail-0009.md @@ -24,8 +24,6 @@ Normed Error (NE) for ith sample has the following form: where N is the number of landmarks, _p_-hat and _p_ are, correspondingly, the prediction and ground truth vectors of kth landmark of ith sample, and di is the interocular distance for ith sample. -## Performance - ## Inputs Name: "data" , shape: [1x3x48x48] - An input image in the format [BxCxHxW], diff --git a/models/intel/landmarks-regression-retail-0009/model.yml b/models/intel/landmarks-regression-retail-0009/model.yml index 819bffe0541..b7bb9c24cfa 100644 --- a/models/intel/landmarks-regression-retail-0009/model.yml +++ b/models/intel/landmarks-regression-retail-0009/model.yml @@ -18,28 +18,28 @@ description: >- task_type: object_attributes files: - name: FP32/landmarks-regression-retail-0009.xml - size: 42546 - sha256: b0189b5b8d01b8ceeacdbd57b2331ff3e90a3bd47328fada1230eaa4507491a0 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/landmarks-regression-retail-0009/FP32/landmarks-regression-retail-0009.xml + size: 42861 + sha256: e7d2a7be68c444e628e576864b7a737fcf6ab84123b509573c4ad680f54337ed + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/landmarks-regression-retail-0009/FP32/landmarks-regression-retail-0009.xml - name: FP32/landmarks-regression-retail-0009.bin size: 762464 sha256: 743d6045dd1c8df90649d2e19ce40ee41de18b799e261bb11682e1d9ef124b5d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/landmarks-regression-retail-0009/FP32/landmarks-regression-retail-0009.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/landmarks-regression-retail-0009/FP32/landmarks-regression-retail-0009.bin - name: FP16/landmarks-regression-retail-0009.xml - size: 42527 - sha256: 2651b65a2115a6e75474bb1d86836ca85c018875a34ba18655477718b8ad6f03 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/landmarks-regression-retail-0009/FP16/landmarks-regression-retail-0009.xml + size: 42842 + sha256: 3d9257f2ce80377bf7ebad9381bd800518bfc98f9024747daff301c7aea2143a + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/landmarks-regression-retail-0009/FP16/landmarks-regression-retail-0009.xml - name: FP16/landmarks-regression-retail-0009.bin size: 381248 sha256: 973b13e64b3576f754a690266b069438b531bc657233d09d7b382ca36e6cf1e4 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/landmarks-regression-retail-0009/FP16/landmarks-regression-retail-0009.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/landmarks-regression-retail-0009/FP16/landmarks-regression-retail-0009.bin - name: FP16-INT8/landmarks-regression-retail-0009.xml - size: 88170 - sha256: f57dfccb81581c3c3df9a9ce9778f423d0c9ef6db81d315b763334bb1084c1c1 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/landmarks-regression-retail-0009/FP16-INT8/landmarks-regression-retail-0009.xml + size: 90287 + sha256: db363fe1f234c698366a9f0aff5c70052c13de9f25797068489b1b8fc90ada7a + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/landmarks-regression-retail-0009/FP16-INT8/landmarks-regression-retail-0009.xml - name: FP16-INT8/landmarks-regression-retail-0009.bin - size: 196426 - sha256: fc11ccd2d574db5e1fd68b371049d64699f2c93eeaa4a8ce98e4ecdcdfed05bf - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/landmarks-regression-retail-0009/FP16-INT8/landmarks-regression-retail-0009.bin + size: 196428 + sha256: 10bf666506daa4f2ed3a34b256977f549cc0e5dda091256c58d6f1067e955dbe + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/landmarks-regression-retail-0009/FP16-INT8/landmarks-regression-retail-0009.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/license-plate-recognition-barrier-0001/description/license-plate-recognition-barrier-0001.md b/models/intel/license-plate-recognition-barrier-0001/description/license-plate-recognition-barrier-0001.md index 9158bbfc8ec..5c10c13daad 100644 --- a/models/intel/license-plate-recognition-barrier-0001/description/license-plate-recognition-barrier-0001.md +++ b/models/intel/license-plate-recognition-barrier-0001/description/license-plate-recognition-barrier-0001.md @@ -32,8 +32,6 @@ Chinese license plates in traffic. Only "blue" license plates, which are common in public, were tested thoroughly. Other types of license plates may underperform. -## Performance - ## Inputs 1. name: "data" , shape: [1x3x24x94] - An input image in following format [1xCxHxW]. Expected color order is BGR. diff --git a/models/intel/license-plate-recognition-barrier-0001/model.yml b/models/intel/license-plate-recognition-barrier-0001/model.yml index 9bbdc3dfe89..09d83d55a9a 100644 --- a/models/intel/license-plate-recognition-barrier-0001/model.yml +++ b/models/intel/license-plate-recognition-barrier-0001/model.yml @@ -17,28 +17,28 @@ description: >- task_type: optical_character_recognition files: - name: FP32/license-plate-recognition-barrier-0001.xml - size: 50677 - sha256: 4f7d69d3a04c97bfb0f9896f775390c8ac079dd186fb48ca63e80ecf1297862f - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/license-plate-recognition-barrier-0001/FP32/license-plate-recognition-barrier-0001.xml + size: 50998 + sha256: b5b649b9566f5cf352554acffd44207f4aecee1da767f4b69f46060a102623fa + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/license-plate-recognition-barrier-0001/FP32/license-plate-recognition-barrier-0001.xml - name: FP32/license-plate-recognition-barrier-0001.bin size: 4871944 sha256: 685934518a930cc55d023a53ac2d5e47bbe81b80828354d8318de6dc3ad5cfba - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/license-plate-recognition-barrier-0001/FP32/license-plate-recognition-barrier-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/license-plate-recognition-barrier-0001/FP32/license-plate-recognition-barrier-0001.bin - name: FP16/license-plate-recognition-barrier-0001.xml - size: 50658 - sha256: d309fabb64c172ee73438581762b2508f9d099660aa0d1ecbf95891e9401816d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/license-plate-recognition-barrier-0001/FP16/license-plate-recognition-barrier-0001.xml + size: 50979 + sha256: 5333519903a18e0081fd8d165f8a685a778a0c3de922e050cfa0835f676b4ad2 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/license-plate-recognition-barrier-0001/FP16/license-plate-recognition-barrier-0001.xml - name: FP16/license-plate-recognition-barrier-0001.bin size: 2436042 sha256: 651140db9aa1a818b5488e70bf7b543fed602dcc6fc732a765a7abafda3ece42 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/license-plate-recognition-barrier-0001/FP16/license-plate-recognition-barrier-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/license-plate-recognition-barrier-0001/FP16/license-plate-recognition-barrier-0001.bin - name: FP16-INT8/license-plate-recognition-barrier-0001.xml - size: 117970 - sha256: de6cc6cbaf8a1b721833c363c5829e71d8e2e55d51abb04c7d08bbc6d15f9014 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/license-plate-recognition-barrier-0001/FP16-INT8/license-plate-recognition-barrier-0001.xml + size: 118327 + sha256: 671334e5201c6c2240d081770bfdb56ec9b10c40345e496f0ad86bd2bfc93430 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/license-plate-recognition-barrier-0001/FP16-INT8/license-plate-recognition-barrier-0001.xml - name: FP16-INT8/license-plate-recognition-barrier-0001.bin size: 2041030 sha256: 9b995f97703239da248fc4823e39ffd3f732434937296627739f03f7add1b670 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/license-plate-recognition-barrier-0001/FP16-INT8/license-plate-recognition-barrier-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/license-plate-recognition-barrier-0001/FP16-INT8/license-plate-recognition-barrier-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/machine-translation-nar-en-ru-0001/description/machine-translation-nar-en-ru-0001.md b/models/intel/machine-translation-nar-en-ru-0001/description/machine-translation-nar-en-ru-0001.md index b834e134877..3127756af73 100644 --- a/models/intel/machine-translation-nar-en-ru-0001/description/machine-translation-nar-en-ru-0001.md +++ b/models/intel/machine-translation-nar-en-ru-0001/description/machine-translation-nar-en-ru-0001.md @@ -24,8 +24,6 @@ The quality metrics were calculated on the wmt19-ru-en dataset ("test" split in | BLEU | 21.6 % | -## Performance - ## Input name: tokens diff --git a/models/intel/machine-translation-nar-en-ru-0001/model.yml b/models/intel/machine-translation-nar-en-ru-0001/model.yml index 02bc00d30e5..02a12bd967d 100644 --- a/models/intel/machine-translation-nar-en-ru-0001/model.yml +++ b/models/intel/machine-translation-nar-en-ru-0001/model.yml @@ -18,20 +18,20 @@ description: >- task_type: machine_translation files: - name: FP32/machine-translation-nar-en-ru-0001.xml - size: 1040029 - sha256: 8ab7b24a78d1d79a431b8a6328e813cb740d9e976957348a47379aefc5ae1912 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/machine-translation-nar-en-ru-0001/FP32/machine-translation-nar-en-ru-0001.xml + size: 1032757 + sha256: 9f4826e1f458938e77008ff61f6971a550453d5643b398e142a51f54f6a25cae + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/machine-translation-nar-en-ru-0001/FP32/machine-translation-nar-en-ru-0001.xml - name: FP32/machine-translation-nar-en-ru-0001.bin size: 251814444 sha256: 5006b86467e6a82fb10af6fd2feb0ccb3a67d50c02cc76d031282d3fa043f67e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/machine-translation-nar-en-ru-0001/FP32/machine-translation-nar-en-ru-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/machine-translation-nar-en-ru-0001/FP32/machine-translation-nar-en-ru-0001.bin - name: FP16/machine-translation-nar-en-ru-0001.xml - size: 1039484 - sha256: 1a47a2b48861bad9892a74eed6bac759d879ff69c394b758f7c969cecbe5624c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/machine-translation-nar-en-ru-0001/FP16/machine-translation-nar-en-ru-0001.xml + size: 1032212 + sha256: fdb89c6fec1c6a42e56c606334e1a4822a6bdea9276816baf76cbd971a6b0b69 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/machine-translation-nar-en-ru-0001/FP16/machine-translation-nar-en-ru-0001.xml - name: FP16/machine-translation-nar-en-ru-0001.bin size: 125907336 sha256: 265129769fb9f3f167a358520982de6a455473806afa5724c443838816ac1d47 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/machine-translation-nar-en-ru-0001/FP16/machine-translation-nar-en-ru-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/machine-translation-nar-en-ru-0001/FP16/machine-translation-nar-en-ru-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/machine-translation-nar-ru-en-0001/description/machine-translation-nar-ru-en-0001.md b/models/intel/machine-translation-nar-ru-en-0001/description/machine-translation-nar-ru-en-0001.md index e41b1fd4b05..ddcac91a108 100644 --- a/models/intel/machine-translation-nar-ru-en-0001/description/machine-translation-nar-ru-en-0001.md +++ b/models/intel/machine-translation-nar-ru-en-0001/description/machine-translation-nar-ru-en-0001.md @@ -24,8 +24,6 @@ The quality metrics were calculated on the wmt19-ru-en dataset ("test" split in | BLEU | 22.8 % | -## Performance - ## Input name: tokens diff --git a/models/intel/machine-translation-nar-ru-en-0001/model.yml b/models/intel/machine-translation-nar-ru-en-0001/model.yml index bb7dbc9f7bd..46a8be02b26 100644 --- a/models/intel/machine-translation-nar-ru-en-0001/model.yml +++ b/models/intel/machine-translation-nar-ru-en-0001/model.yml @@ -18,20 +18,20 @@ description: >- task_type: machine_translation files: - name: FP32/machine-translation-nar-ru-en-0001.xml - size: 1040029 - sha256: 61da48cd47eaf68e624a9d593ecaae852871de80e285ff5b537d95fdfb01f2ed - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/machine-translation-nar-ru-en-0001/FP32/machine-translation-nar-ru-en-0001.xml + size: 1032757 + sha256: 55a8406f21278dd43da11dc43633b9ae99bf0d0e1d3d9e2af481dfe1f69aa11d + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/machine-translation-nar-ru-en-0001/FP32/machine-translation-nar-ru-en-0001.xml - name: FP32/machine-translation-nar-ru-en-0001.bin size: 251814444 sha256: 4cbad8f0d3ee675fd503b0c686154e671afd47442c11687e983f34f78a75626c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/machine-translation-nar-ru-en-0001/FP32/machine-translation-nar-ru-en-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/machine-translation-nar-ru-en-0001/FP32/machine-translation-nar-ru-en-0001.bin - name: FP16/machine-translation-nar-ru-en-0001.xml - size: 1039484 - sha256: 8394ec59a8205d2e13a4ecace84ecefdcd268d229cda335574e35642bedb24af - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/machine-translation-nar-ru-en-0001/FP16/machine-translation-nar-ru-en-0001.xml + size: 1032212 + sha256: 94734ef157e0b81afd6cab832fd78972aa8891c94953435cb25771c873310f62 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/machine-translation-nar-ru-en-0001/FP16/machine-translation-nar-ru-en-0001.xml - name: FP16/machine-translation-nar-ru-en-0001.bin size: 125907336 sha256: ad90a9f473237c56b00506f5883ebe3fb0b7625d4d3195cde1d0af53cd52bc68 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/machine-translation-nar-ru-en-0001/FP16/machine-translation-nar-ru-en-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/machine-translation-nar-ru-en-0001/FP16/machine-translation-nar-ru-en-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/pedestrian-and-vehicle-detector-adas-0001/description/pedestrian-and-vehicle-detector-adas-0001.md b/models/intel/pedestrian-and-vehicle-detector-adas-0001/description/pedestrian-and-vehicle-detector-adas-0001.md index ae0023b02a8..70a043efee1 100644 --- a/models/intel/pedestrian-and-vehicle-detector-adas-0001/description/pedestrian-and-vehicle-detector-adas-0001.md +++ b/models/intel/pedestrian-and-vehicle-detector-adas-0001/description/pedestrian-and-vehicle-detector-adas-0001.md @@ -25,8 +25,6 @@ Average Precision (AP) metric is described in: Mark Everingham et al. Tested on challenging internal datasets with 1001 pedestrian and 12585 vehicles to detect. -## Performance - ## Inputs Name: `input`, shape: [1x3x384x672] - An input image in the format [BxCxHxW], diff --git a/models/intel/pedestrian-and-vehicle-detector-adas-0001/model.yml b/models/intel/pedestrian-and-vehicle-detector-adas-0001/model.yml index a33894d47f3..96c75d9db60 100644 --- a/models/intel/pedestrian-and-vehicle-detector-adas-0001/model.yml +++ b/models/intel/pedestrian-and-vehicle-detector-adas-0001/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/pedestrian-and-vehicle-detector-adas-0001.xml - size: 233110 - sha256: b31a1efc2ef23798f4f697595bd6edfeba8c1c5fafe45b693fbc50d7bd9f1bbc - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/pedestrian-and-vehicle-detector-adas-0001/FP32/pedestrian-and-vehicle-detector-adas-0001.xml + size: 234411 + sha256: 2b83a584750f965b25fb8446af2babb06bf9b516b57049ae4402479d716196fe + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/pedestrian-and-vehicle-detector-adas-0001/FP32/pedestrian-and-vehicle-detector-adas-0001.xml - name: FP32/pedestrian-and-vehicle-detector-adas-0001.bin size: 6598568 sha256: 24b06d7ecc98d1d58fead4e1c2bc30501693d17ec516119393b61a351011525c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/pedestrian-and-vehicle-detector-adas-0001/FP32/pedestrian-and-vehicle-detector-adas-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/pedestrian-and-vehicle-detector-adas-0001/FP32/pedestrian-and-vehicle-detector-adas-0001.bin - name: FP16/pedestrian-and-vehicle-detector-adas-0001.xml - size: 233064 - sha256: 5a8f080eb8ecf038ab0d5cc3fcce55d24418d4825d1c0f539fd8437343234437 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/pedestrian-and-vehicle-detector-adas-0001/FP16/pedestrian-and-vehicle-detector-adas-0001.xml + size: 234365 + sha256: 5e00070c66adbe00295f54f8269b2d413a5a44e01654465a45e4c44eecc3c53d + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/pedestrian-and-vehicle-detector-adas-0001/FP16/pedestrian-and-vehicle-detector-adas-0001.xml - name: FP16/pedestrian-and-vehicle-detector-adas-0001.bin size: 3299336 sha256: 3f9739b91277bc916f29b17d043115c6669e113e5d60d61589063d8054c40d7d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/pedestrian-and-vehicle-detector-adas-0001/FP16/pedestrian-and-vehicle-detector-adas-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/pedestrian-and-vehicle-detector-adas-0001/FP16/pedestrian-and-vehicle-detector-adas-0001.bin - name: FP16-INT8/pedestrian-and-vehicle-detector-adas-0001.xml - size: 487755 - sha256: cea2ddb4541850814dcf8a6ae69e09efcb618365947f874b4763f7e5617bfdbf - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/pedestrian-and-vehicle-detector-adas-0001/FP16-INT8/pedestrian-and-vehicle-detector-adas-0001.xml + size: 489092 + sha256: aef7196bc9729e85866519c4d2368db8cc58bf83e803015b5374d3dd325e9210 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/pedestrian-and-vehicle-detector-adas-0001/FP16-INT8/pedestrian-and-vehicle-detector-adas-0001.xml - name: FP16-INT8/pedestrian-and-vehicle-detector-adas-0001.bin size: 1705676 sha256: ef5da5b8add2897be722ef2dc8c3e825cab94ba9ddd509d238ad30f0e5838f74 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/pedestrian-and-vehicle-detector-adas-0001/FP16-INT8/pedestrian-and-vehicle-detector-adas-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/pedestrian-and-vehicle-detector-adas-0001/FP16-INT8/pedestrian-and-vehicle-detector-adas-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/pedestrian-detection-adas-0002/description/pedestrian-detection-adas-0002.md b/models/intel/pedestrian-detection-adas-0002/description/pedestrian-detection-adas-0002.md index 98b8c485105..d54f3ab2d09 100644 --- a/models/intel/pedestrian-detection-adas-0002/description/pedestrian-detection-adas-0002.md +++ b/models/intel/pedestrian-detection-adas-0002/description/pedestrian-detection-adas-0002.md @@ -24,8 +24,6 @@ Average Precision metric described in: Mark Everingham et al. Tested on an internal dataset with 1001 pedestrian to detect. -## Performance - ## Inputs Name: `input`, shape: [1x3x384x672] - An input image in the format [BxCxHxW], diff --git a/models/intel/pedestrian-detection-adas-0002/model.yml b/models/intel/pedestrian-detection-adas-0002/model.yml index db1d6585aab..08e86f2db55 100644 --- a/models/intel/pedestrian-detection-adas-0002/model.yml +++ b/models/intel/pedestrian-detection-adas-0002/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/pedestrian-detection-adas-0002.xml - size: 232993 - sha256: 27d751578370db3999c05a9b87e6f7cd1be01157829f07d19645f0dde3c8f94e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/pedestrian-detection-adas-0002/FP32/pedestrian-detection-adas-0002.xml + size: 234294 + sha256: 637bf1d94ed869f20dfac4a2082d19b63e751ebf2e4ffff353a01eea62ffd262 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/pedestrian-detection-adas-0002/FP32/pedestrian-detection-adas-0002.xml - name: FP32/pedestrian-detection-adas-0002.bin size: 4660248 sha256: 249c964cbe38135cc5f2682288978652dd93aa4918e7043f96f894790f11c265 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/pedestrian-detection-adas-0002/FP32/pedestrian-detection-adas-0002.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/pedestrian-detection-adas-0002/FP32/pedestrian-detection-adas-0002.bin - name: FP16/pedestrian-detection-adas-0002.xml - size: 232944 - sha256: f6fdecf7fead42d2ba256657b3b76f7a15a7b6466871974356d29491830b8560 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/pedestrian-detection-adas-0002/FP16/pedestrian-detection-adas-0002.xml + size: 234245 + sha256: 0ba809eb932fd9f842b31c4d921243160c2b53e29ea7d3081a0461e5ce9a1477 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/pedestrian-detection-adas-0002/FP16/pedestrian-detection-adas-0002.xml - name: FP16/pedestrian-detection-adas-0002.bin size: 2330176 sha256: 693753b7466da913b537016b31e3012f8ce6a885ac0897e3986eeca66d4ef8e6 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/pedestrian-detection-adas-0002/FP16/pedestrian-detection-adas-0002.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/pedestrian-detection-adas-0002/FP16/pedestrian-detection-adas-0002.bin - name: FP16-INT8/pedestrian-detection-adas-0002.xml - size: 487467 - sha256: 88f41fb6cd6fc45298d1cacc39e367b2925e82483d6b181fe46d165c3dbed200 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/pedestrian-detection-adas-0002/FP16-INT8/pedestrian-detection-adas-0002.xml + size: 488804 + sha256: 4cf4f6744a1f7026880665f501ac302f971a166a1273ced3d76c436d2d941315 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/pedestrian-detection-adas-0002/FP16-INT8/pedestrian-detection-adas-0002.xml - name: FP16-INT8/pedestrian-detection-adas-0002.bin size: 1212526 sha256: 6039d1786a10b3e18e3ada8ed1f9dcad70040034d6a23cf08bb408f2827214ab - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/pedestrian-detection-adas-0002/FP16-INT8/pedestrian-detection-adas-0002.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/pedestrian-detection-adas-0002/FP16-INT8/pedestrian-detection-adas-0002.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-attributes-recognition-crossroad-0230/description/person-attributes-recognition-crossroad-0230.md b/models/intel/person-attributes-recognition-crossroad-0230/description/person-attributes-recognition-crossroad-0230.md index e75a802b0f5..a0b50243a07 100644 --- a/models/intel/person-attributes-recognition-crossroad-0230/description/person-attributes-recognition-crossroad-0230.md +++ b/models/intel/person-attributes-recognition-crossroad-0230/description/person-attributes-recognition-crossroad-0230.md @@ -37,8 +37,6 @@ This model presents a person attributes classification algorithm analysis scenar | `has_longhair` | 0.83 | | `has_coat_jacket` | NA | -## Performance - ## Inputs 1. name: `input` , shape: [1x3x160x80] - An input image in following format diff --git a/models/intel/person-attributes-recognition-crossroad-0230/model.yml b/models/intel/person-attributes-recognition-crossroad-0230/model.yml index 52d8a7841b3..b72b67e2846 100644 --- a/models/intel/person-attributes-recognition-crossroad-0230/model.yml +++ b/models/intel/person-attributes-recognition-crossroad-0230/model.yml @@ -18,20 +18,28 @@ description: >- task_type: object_attributes files: - name: FP32/person-attributes-recognition-crossroad-0230.xml - size: 179559 - sha256: d78e9e5992cbd5432554b432b67dbe48bc01913e7ccdf60fe8281ab96bd1d3a6 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-attributes-recognition-crossroad-0230/FP32/person-attributes-recognition-crossroad-0230.xml + size: 180320 + sha256: 5d7be706f1011e72f23f59f273a48fa5ec882b4db7dac92d8e123cad27be4a19 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-attributes-recognition-crossroad-0230/FP32/person-attributes-recognition-crossroad-0230.xml - name: FP32/person-attributes-recognition-crossroad-0230.bin size: 2939240 sha256: 85fa1bcb05ca429525b5e305d6d85b4f0f0108fb026dd8a22ca9865beefa064a - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-attributes-recognition-crossroad-0230/FP32/person-attributes-recognition-crossroad-0230.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-attributes-recognition-crossroad-0230/FP32/person-attributes-recognition-crossroad-0230.bin - name: FP16/person-attributes-recognition-crossroad-0230.xml - size: 179474 - sha256: 23b065a5c30591b32753e36615617005c600ac4ed53a30d6f8f5ec8784f4e8ea - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-attributes-recognition-crossroad-0230/FP16/person-attributes-recognition-crossroad-0230.xml + size: 180235 + sha256: d0f50238c041db75e913c12ecef6d75785d2ae8db8cc78d576b3527ab50e7556 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-attributes-recognition-crossroad-0230/FP16/person-attributes-recognition-crossroad-0230.xml - name: FP16/person-attributes-recognition-crossroad-0230.bin size: 1469632 sha256: 282b7d09a1cde7a898c35d14eb47a91d17c00d97ba02984c2b288a1fd9511e18 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-attributes-recognition-crossroad-0230/FP16/person-attributes-recognition-crossroad-0230.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-attributes-recognition-crossroad-0230/FP16/person-attributes-recognition-crossroad-0230.bin + - name: FP16-INT8/person-attributes-recognition-crossroad-0230.xml + size: 501253 + sha256: 69aa0b36cbc761445ee56be04b03de6da993ca9778b36d8acd50b65d633b0a74 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-attributes-recognition-crossroad-0230/FP16-INT8/person-attributes-recognition-crossroad-0230.xml + - name: FP16-INT8/person-attributes-recognition-crossroad-0230.bin + size: 753574 + sha256: fa4774ed0477ca5429eac7013db4b5e237694753bce000923c995ecf60c9bccc + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-attributes-recognition-crossroad-0230/FP16-INT8/person-attributes-recognition-crossroad-0230.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-attributes-recognition-crossroad-0234/description/person-attributes-recognition-crossroad-0234.md b/models/intel/person-attributes-recognition-crossroad-0234/description/person-attributes-recognition-crossroad-0234.md index 0a7f13c1e85..f17f5af3274 100644 --- a/models/intel/person-attributes-recognition-crossroad-0234/description/person-attributes-recognition-crossroad-0234.md +++ b/models/intel/person-attributes-recognition-crossroad-0234/description/person-attributes-recognition-crossroad-0234.md @@ -31,8 +31,6 @@ that are probabilities of the corresponding 7 attributes. | `has_longhair` | 0.84 | | `has_coat_jacket` | NA | -## Performance - ## Inputs 1. name: `input` , shape: [1x3x160x80] - An input image in the format [1xCxHxW], where diff --git a/models/intel/person-attributes-recognition-crossroad-0234/model.yml b/models/intel/person-attributes-recognition-crossroad-0234/model.yml index db89cdea183..a02f46bc8fe 100644 --- a/models/intel/person-attributes-recognition-crossroad-0234/model.yml +++ b/models/intel/person-attributes-recognition-crossroad-0234/model.yml @@ -17,28 +17,28 @@ description: >- task_type: object_attributes files: - name: FP32/person-attributes-recognition-crossroad-0234.xml - size: 181745 - sha256: 2cae4cd2aeacca5b33699ec3e6db27fe017783630e90a1b5467a143e29e34528 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-attributes-recognition-crossroad-0234/FP32/person-attributes-recognition-crossroad-0234.xml + size: 182411 + sha256: dfb3d432af32de8b67af8094cade8ca7635655c657baa57d008982fc3ef5faba + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-attributes-recognition-crossroad-0234/FP32/person-attributes-recognition-crossroad-0234.xml - name: FP32/person-attributes-recognition-crossroad-0234.bin size: 94040708 - sha256: a8ba23bee30a6f20e7e1de1296c55818e929cf54f4a529e87690485ea8869b09 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-attributes-recognition-crossroad-0234/FP32/person-attributes-recognition-crossroad-0234.bin + sha256: 8db3b4035aab4e0d728e86b7ee5996cdd4581041c23a2678c68a06a0bc596886 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-attributes-recognition-crossroad-0234/FP32/person-attributes-recognition-crossroad-0234.bin - name: FP16/person-attributes-recognition-crossroad-0234.xml - size: 181685 - sha256: 2aecb6258a6c67e3ad51917d375c2807e7abd5c62bcbc24bc00ed2af896716dd - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-attributes-recognition-crossroad-0234/FP16/person-attributes-recognition-crossroad-0234.xml + size: 182351 + sha256: 08b50edcddc7b0b45b3ada2b982abed51a35ce1cf4b4728dfbb390fc67792759 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-attributes-recognition-crossroad-0234/FP16/person-attributes-recognition-crossroad-0234.xml - name: FP16/person-attributes-recognition-crossroad-0234.bin size: 47020380 sha256: 0d1ac8684bb541133a10b729b6f601b241a6b922d83e5f6d5238ec3f05383a9e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-attributes-recognition-crossroad-0234/FP16/person-attributes-recognition-crossroad-0234.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-attributes-recognition-crossroad-0234/FP16/person-attributes-recognition-crossroad-0234.bin - name: FP16-INT8/person-attributes-recognition-crossroad-0234.xml - size: 458125 - sha256: fa27f5595a4cc1f43c8622f5a747db2edc8c4fa092a41fe7e7d9556349158a97 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-attributes-recognition-crossroad-0234/FP16-INT8/person-attributes-recognition-crossroad-0234.xml + size: 458959 + sha256: 1cb88f95303062fa0d4fc9eef95aaec03b91869cb2c76cc2ed0d49951158304b + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-attributes-recognition-crossroad-0234/FP16-INT8/person-attributes-recognition-crossroad-0234.xml - name: FP16-INT8/person-attributes-recognition-crossroad-0234.bin size: 23651466 - sha256: 34a02f703d5a282c2a7bf32d9c23c87cbc1315ceb88928c1b95e9122ca74a980 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-attributes-recognition-crossroad-0234/FP16-INT8/person-attributes-recognition-crossroad-0234.bin + sha256: 901fa4b26714e03858bc21817f2b6c5ae823b34a090636eae788670cba9b4514 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-attributes-recognition-crossroad-0234/FP16-INT8/person-attributes-recognition-crossroad-0234.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-attributes-recognition-crossroad-0238/description/person-attributes-recognition-crossroad-0238.md b/models/intel/person-attributes-recognition-crossroad-0238/description/person-attributes-recognition-crossroad-0238.md index a49ee87f363..931ea23c187 100644 --- a/models/intel/person-attributes-recognition-crossroad-0238/description/person-attributes-recognition-crossroad-0238.md +++ b/models/intel/person-attributes-recognition-crossroad-0238/description/person-attributes-recognition-crossroad-0238.md @@ -31,8 +31,6 @@ that are probabilities of the corresponding 7 attributes. | `has_longhair` | 0.77 | | `has_coat_jacket` | NA | -## Performance - ## Inputs 1. name: `input` , shape: [1x3x160x80] - An input image in the format [1xCxHxW], where diff --git a/models/intel/person-attributes-recognition-crossroad-0238/model.yml b/models/intel/person-attributes-recognition-crossroad-0238/model.yml index e9540803f3c..bc61765bb55 100644 --- a/models/intel/person-attributes-recognition-crossroad-0238/model.yml +++ b/models/intel/person-attributes-recognition-crossroad-0238/model.yml @@ -17,28 +17,28 @@ description: >- task_type: object_attributes files: - name: FP32/person-attributes-recognition-crossroad-0238.xml - size: 288639 - sha256: ed880e29b2bd46e6ba223e4e8820777d5d58cb93b1ce8ad34a66c9cbb8a23201 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-attributes-recognition-crossroad-0238/FP32/person-attributes-recognition-crossroad-0238.xml + size: 290306 + sha256: 8b418561025ae8b7f0bd9db558073434e39775b9b476fc4858eb02d657cb1b69 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-attributes-recognition-crossroad-0238/FP32/person-attributes-recognition-crossroad-0238.xml - name: FP32/person-attributes-recognition-crossroad-0238.bin size: 87188228 - sha256: 30ed52be4cbf1025a27e10cbbeb1244ceae6723e75f1b67d5eb76ac1fa980269 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-attributes-recognition-crossroad-0238/FP32/person-attributes-recognition-crossroad-0238.bin + sha256: 8373c038b0646fd32b46fb352d379dc70e2f19641b2e1e7c545f5519bb19aafd + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-attributes-recognition-crossroad-0238/FP32/person-attributes-recognition-crossroad-0238.bin - name: FP16/person-attributes-recognition-crossroad-0238.xml - size: 288533 - sha256: 520a18df44303875f6996a9080ec96a590845660a324481b24ad73f4e93e042d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-attributes-recognition-crossroad-0238/FP16/person-attributes-recognition-crossroad-0238.xml + size: 290200 + sha256: d1276513f952d972636ef625ad642009dcd4711c18af849b6b7189305449eaf5 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-attributes-recognition-crossroad-0238/FP16/person-attributes-recognition-crossroad-0238.xml - name: FP16/person-attributes-recognition-crossroad-0238.bin size: 43594140 - sha256: 575b79d0d949eff90080c31ef46a1d4cc5f9334fbbdb74be2e923bf0d3d9e86b - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-attributes-recognition-crossroad-0238/FP16/person-attributes-recognition-crossroad-0238.bin + sha256: 7f37084a0dfb73862b55ead9076817328270e80353c58373fae9aa08b322716c + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-attributes-recognition-crossroad-0238/FP16/person-attributes-recognition-crossroad-0238.bin - name: FP16-INT8/person-attributes-recognition-crossroad-0238.xml - size: 722500 - sha256: a34e1a2d56430ae9aa2a7270b5b00f6ff122aa6e9ac43428e1f02b8fab4d876e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-attributes-recognition-crossroad-0238/FP16-INT8/person-attributes-recognition-crossroad-0238.xml + size: 724335 + sha256: 4daa76ce1d500a70ad3283220d95fc9f9ce9d4462a598297bd2a3c980eb8fdfe + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-attributes-recognition-crossroad-0238/FP16-INT8/person-attributes-recognition-crossroad-0238.xml - name: FP16-INT8/person-attributes-recognition-crossroad-0238.bin size: 22044738 - sha256: 3709de960d617e352a8cce83e55ea5e4f64e70bf03a95fdecfe0291e0597046b - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-attributes-recognition-crossroad-0238/FP16-INT8/person-attributes-recognition-crossroad-0238.bin + sha256: 0f03ed04f151d3c1bc3e3df4c69ee60b6885d000fb8ea1b23b0da158220bc655 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-attributes-recognition-crossroad-0238/FP16-INT8/person-attributes-recognition-crossroad-0238.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-detection-0106/description/person-detection-0106.md b/models/intel/person-detection-0106/description/person-detection-0106.md index 16c918a7b65..f119e812b48 100644 --- a/models/intel/person-detection-0106/description/person-detection-0106.md +++ b/models/intel/person-detection-0106/description/person-detection-0106.md @@ -22,8 +22,6 @@ Average Precision (AP) is defined as an area under the [precision/recall](https://en.wikipedia.org/wiki/Precision_and_recall) curve. -## Performance - ## Inputs Name: `input`, shape: [1x3x800x1344] - An input image in the format [BxCxHxW], @@ -46,7 +44,7 @@ Expected color order is BGR. - (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner - `conf` - confidence for the predicted class 2. The `labels` is a blob with the shape [N], where N is the number of detected - bounding boxes. It contains `label` per each detected box. + bounding boxes. It contains `label` (0 - person) per each detected box. ## Legal Information [*] Other names and brands may be claimed as the property of others. diff --git a/models/intel/person-detection-0106/model.yml b/models/intel/person-detection-0106/model.yml index 5f9ef2b23e0..a3dbd993043 100644 --- a/models/intel/person-detection-0106/model.yml +++ b/models/intel/person-detection-0106/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/person-detection-0106.xml - size: 1276692 - sha256: 904b72c84c2b3c57f49c4a395bb9fe2db12be3a49e73a997bda27ce2d24d46bb - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-0106/FP32/person-detection-0106.xml + size: 1320567 + sha256: 084ceb791fc2ff200c8ddf194293c5f5f9cbc39dcbfc2fbff2e37821d1279250 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0106/FP32/person-detection-0106.xml - name: FP32/person-detection-0106.bin - size: 276502576 - sha256: 4b0457d7432954a8868a62c1207e13269b6912def92bf9a94d369f8ad9419137 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-0106/FP32/person-detection-0106.bin + size: 276502400 + sha256: 6635faaecbb0d6c9d75580b1973c1211193a13053aac31033b3c89eba1ea3771 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0106/FP32/person-detection-0106.bin - name: FP16/person-detection-0106.xml - size: 1275645 - sha256: 75d744048c14f6f6def61448ed1379bbb1162621955d97b37fcb22e49568148d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-0106/FP16/person-detection-0106.xml + size: 1319682 + sha256: 186cc857bc030f815d41184d89e33302d5eb9f3d088a32c5c10359ad86ebd97a + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0106/FP16/person-detection-0106.xml - name: FP16/person-detection-0106.bin - size: 138251530 - sha256: 69efb894d35fcc6e49383576d51c529a4393f27c0933486180a3ec1c1912025d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-0106/FP16/person-detection-0106.bin + size: 138251354 + sha256: 6e74c9d0397381d5adeccf36036df308afa32da1a0c1d1556ebd3935cc11eca1 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0106/FP16/person-detection-0106.bin - name: FP16-INT8/person-detection-0106.xml - size: 1676662 - sha256: 4ed0a7cba1927d8f2b46c6e5164da344d82b326f10cd1d6e979c1f155c179d3e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-0106/FP16-INT8/person-detection-0106.xml + size: 1721799 + sha256: e1008d3b48ddaa3455474a59acf2436302b6c4de0d870340606889ba6501a352 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0106/FP16-INT8/person-detection-0106.xml - name: FP16-INT8/person-detection-0106.bin - size: 146372170 - sha256: 444bdeecfaa70b11191cf182bb1e77bc859ca7d5f20c62f7c504a3f5be60a476 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-0106/FP16-INT8/person-detection-0106.bin + size: 146371994 + sha256: 371587f95c39a90529b3354a278db19053599b8ab997ea7f2882eb5603b003aa + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0106/FP16-INT8/person-detection-0106.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-detection-0200/description/person-detection-0200.md b/models/intel/person-detection-0200/description/person-detection-0200.md index bf0d5e636ab..a4ad457db43 100644 --- a/models/intel/person-detection-0200/description/person-detection-0200.md +++ b/models/intel/person-detection-0200/description/person-detection-0200.md @@ -23,8 +23,6 @@ Average Precision (AP) is defined as an area under the [precision/recall](https://en.wikipedia.org/wiki/Precision_and_recall) curve. -## Performance - ## Inputs Name: `input`, shape: [1x3x256x256] - An input image in the format [BxCxHxW], @@ -43,7 +41,7 @@ The net outputs blob with shape: [1, 1, N, 7], where N is the number of detected bounding boxes. Each detection has the format [`image_id`, `label`, `conf`, `x_min`, `y_min`, `x_max`, `y_max`], where: - `image_id` - ID of the image in the batch - - `label` - predicted class ID + - `label` - predicted class ID (0 - person) - `conf` - confidence for the predicted class - (`x_min`, `y_min`) - coordinates of the top left bounding box corner - (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner. diff --git a/models/intel/person-detection-0200/model.yml b/models/intel/person-detection-0200/model.yml index fbf1f8abe54..572edd773f1 100644 --- a/models/intel/person-detection-0200/model.yml +++ b/models/intel/person-detection-0200/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/person-detection-0200.xml - size: 186758 - sha256: b1155bce964c9fd2d56c89cea47f350689b1cacf91657cb42293769b473415dd - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-0200/FP32/person-detection-0200.xml + size: 187875 + sha256: 53db887a2ba71fdea6f1c9572ce5ce2bd60e708ba3054876e33fe70b6e2aba68 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0200/FP32/person-detection-0200.xml - name: FP32/person-detection-0200.bin size: 7269168 sha256: c44a6e7ddab71fb784c599ab8325c7ccd72c8c0ab1312cd0f93924c9c2c655cb - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-0200/FP32/person-detection-0200.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0200/FP32/person-detection-0200.bin - name: FP16/person-detection-0200.xml - size: 186695 - sha256: 4823d05d7c7c83bf9e292bb5349b0115e83f059e87eae225ce76a3edcc3b7a84 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-0200/FP16/person-detection-0200.xml + size: 187812 + sha256: b7c7c743a8062220511af588142efb74194014370d59cbf62ede84d772ccb684 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0200/FP16/person-detection-0200.xml - name: FP16/person-detection-0200.bin size: 3634626 sha256: aba627cdd9c6576cf6e7442191b9663811d327f2ea0ffe113fb77ba07c124b58 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-0200/FP16/person-detection-0200.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0200/FP16/person-detection-0200.bin - name: FP16-INT8/person-detection-0200.xml - size: 492953 - sha256: 13303fa485e0a7122a36c5b6309f0fe5600015e5ad73d27effe76392652052ba - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-0200/FP16-INT8/person-detection-0200.xml + size: 494246 + sha256: 496aa2801a6211413a21fd471435744284c192d860bd2798463574597bc1026e + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0200/FP16-INT8/person-detection-0200.xml - name: FP16-INT8/person-detection-0200.bin size: 1921625 sha256: 96eae0de7a1b2d568f8931390e5b09f68443bd74b6cf0fead92c4e9c8398a0d1 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-0200/FP16-INT8/person-detection-0200.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0200/FP16-INT8/person-detection-0200.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-detection-0201/description/person-detection-0201.md b/models/intel/person-detection-0201/description/person-detection-0201.md index a49cc186932..96f84b9709c 100644 --- a/models/intel/person-detection-0201/description/person-detection-0201.md +++ b/models/intel/person-detection-0201/description/person-detection-0201.md @@ -23,8 +23,6 @@ Average Precision (AP) is defined as an area under the [precision/recall](https://en.wikipedia.org/wiki/Precision_and_recall) curve. -## Performance - ## Inputs Name: `input`, shape: [1x3x384x384] - An input image in the format [BxCxHxW], @@ -43,7 +41,7 @@ The net outputs blob with shape: [1, 1, N, 7], where N is the number of detected bounding boxes. Each detection has the format [`image_id`, `label`, `conf`, `x_min`, `y_min`, `x_max`, `y_max`], where: - `image_id` - ID of the image in the batch - - `label` - predicted class ID + - `label` - predicted class ID (0 - person) - `conf` - confidence for the predicted class - (`x_min`, `y_min`) - coordinates of the top left bounding box corner - (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner. diff --git a/models/intel/person-detection-0201/model.yml b/models/intel/person-detection-0201/model.yml index 69e13f0b742..fd0a3925ebc 100644 --- a/models/intel/person-detection-0201/model.yml +++ b/models/intel/person-detection-0201/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/person-detection-0201.xml - size: 186949 - sha256: f6bcbb4fdccd03a87e25df3c4bb58c4cf4aa82e78ca9eb5854d28ddc9255e96f - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-0201/FP32/person-detection-0201.xml + size: 188066 + sha256: d1a0b7a32544b55c87fac541d7bd8288f2f7c4303a6e78a1200fd7b4840e01be + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0201/FP32/person-detection-0201.xml - name: FP32/person-detection-0201.bin size: 7269168 sha256: e21fc97a9a28310a096a3ca6c29674f35e99016e7fcc0d5d80bce15747fdf5f3 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-0201/FP32/person-detection-0201.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0201/FP32/person-detection-0201.bin - name: FP16/person-detection-0201.xml - size: 186886 - sha256: 0fb4923bd59a91564c62af16c7359a22085aed8613bbe7a6b00832480c876ac2 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-0201/FP16/person-detection-0201.xml + size: 188003 + sha256: d24923cce7e0b533023c8e3fed0c37d51ea93a3909e724d926fed8770aa35f48 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0201/FP16/person-detection-0201.xml - name: FP16/person-detection-0201.bin size: 3634626 sha256: 81ec4d0c1219ec7f00e17102c86900e4253776227137f15e12cda8c7e7994aec - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-0201/FP16/person-detection-0201.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0201/FP16/person-detection-0201.bin - name: FP16-INT8/person-detection-0201.xml - size: 493200 - sha256: 5e6eb9bdf129d75bd31c425e28f64ceadfbf57e0aee6d17c335b0a7e6f396d46 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-0201/FP16-INT8/person-detection-0201.xml + size: 494493 + sha256: c9aae3beca4fff07e00d49590122af94c11c71417cbc178fa47719999b74db62 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0201/FP16-INT8/person-detection-0201.xml - name: FP16-INT8/person-detection-0201.bin size: 1921623 sha256: b5afd5c109e69f6bc16252df0f1cf7281889e0012821eb4d500f86155daf4e5c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-0201/FP16-INT8/person-detection-0201.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0201/FP16-INT8/person-detection-0201.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-detection-0202/description/person-detection-0202.md b/models/intel/person-detection-0202/description/person-detection-0202.md index ea3d9da7193..c3fe8001da9 100644 --- a/models/intel/person-detection-0202/description/person-detection-0202.md +++ b/models/intel/person-detection-0202/description/person-detection-0202.md @@ -23,8 +23,6 @@ Average Precision (AP) is defined as an area under the [precision/recall](https://en.wikipedia.org/wiki/Precision_and_recall) curve. -## Performance - ## Inputs Name: `input`, shape: [1x3x512x512] - An input image in the format [BxCxHxW], @@ -43,7 +41,7 @@ The net outputs blob with shape: [1, 1, N, 7], where N is the number of detected bounding boxes. Each detection has the format [`image_id`, `label`, `conf`, `x_min`, `y_min`, `x_max`, `y_max`], where: - `image_id` - ID of the image in the batch - - `label` - predicted class ID + - `label` - predicted class ID (0 - person) - `conf` - confidence for the predicted class - (`x_min`, `y_min`) - coordinates of the top left bounding box corner - (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner. diff --git a/models/intel/person-detection-0202/model.yml b/models/intel/person-detection-0202/model.yml index 577569adae9..fecb02d58da 100644 --- a/models/intel/person-detection-0202/model.yml +++ b/models/intel/person-detection-0202/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/person-detection-0202.xml - size: 187030 - sha256: 2d0d8cd562825433a293562f71a17b35c2c8839c51cbd20b74b60485609f892d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-0202/FP32/person-detection-0202.xml + size: 188147 + sha256: b98e6f77e245c503590bfc60d80c5df6ce613210da7cb5e0520eb38321475ed7 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0202/FP32/person-detection-0202.xml - name: FP32/person-detection-0202.bin size: 7269168 sha256: 51d95e643733d2a11ad830b954f8c3cc9e15c08ffab796be0c96c37e99e27e83 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-0202/FP32/person-detection-0202.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0202/FP32/person-detection-0202.bin - name: FP16/person-detection-0202.xml - size: 186967 - sha256: 90c49851013bd0ea211a25870cb21cb8ed23e3d65eab555f327ddf453103fa86 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-0202/FP16/person-detection-0202.xml + size: 188084 + sha256: 649213976ea433d338752235944c96ce67809d175860b6814778847192497501 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0202/FP16/person-detection-0202.xml - name: FP16/person-detection-0202.bin size: 3634626 sha256: c82526a14d4c3c2d4c04e06e1173f573374fb5a2a97393b926f96adbff7b345b - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-0202/FP16/person-detection-0202.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0202/FP16/person-detection-0202.bin - name: FP16-INT8/person-detection-0202.xml - size: 493313 - sha256: 08c456854441005d7ad6d540b21bc5efdddfb7705ea9d56ba3a0f7a14c9d3747 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-0202/FP16-INT8/person-detection-0202.xml + size: 494606 + sha256: 54ac2e5a674fd96460bcd0be2946673c688dce843ec9e4c8c81d3eac4e098eb3 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0202/FP16-INT8/person-detection-0202.xml - name: FP16-INT8/person-detection-0202.bin size: 1921623 sha256: bfabc65982221b500dd3ea90dc54f010ac31636011067920ef6ead298e39e5af - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-0202/FP16-INT8/person-detection-0202.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0202/FP16-INT8/person-detection-0202.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-detection-0203/accuracy-check.yml b/models/intel/person-detection-0203/accuracy-check.yml new file mode 100644 index 00000000000..98209233179 --- /dev/null +++ b/models/intel/person-detection-0203/accuracy-check.yml @@ -0,0 +1,27 @@ +models: + - name: person-detection-0203 + + launchers: + - framework: dlsdk + adapter: + + type: class_agnostic_detection + scale: [0.0011574, 0.0020833] + + datasets: + - name: crossroad_extra_untagged_person_hb + preprocessing: + - type: resize + dst_width: 864 + dst_height: 480 + + postprocessing: + - type: resize_prediction_boxes + - type: cast_to_int + - type: nms + overlap: 0.6 + - type: clip_boxes + apply_to: prediction + + metrics: + - type: coco_orig_precision diff --git a/models/intel/person-detection-0203/description/person-detection-0203.md b/models/intel/person-detection-0203/description/person-detection-0203.md new file mode 100644 index 00000000000..4b53a2fe099 --- /dev/null +++ b/models/intel/person-detection-0203/description/person-detection-0203.md @@ -0,0 +1,50 @@ +# person-detection-0203 + +## Use Case and High-Level Description + +This is a person detector that is based on MobileNetV2 +backbone with ATSS head for 864x480 resolution. + +## Example + +![](./person-detection-0203.png) + +## Specification + +| Metric | Value | +|---------------------------------|-------------------------------------------| +| AP @ [ IoU=0.50:0.95 ] | 0.408 (internal test set) | +| GFlops | 6.519 | +| MParams | 2.394 | +| Source framework | PyTorch\* | + +Average Precision (AP) is defined as an area under +the [precision/recall](https://en.wikipedia.org/wiki/Precision_and_recall) +curve. + +## Inputs + +Name: `input`, shape: [1x3x480x864] - An input image in the format [BxCxHxW], +where: + +- B - batch size +- C - number of channels +- H - image height +- W - image width + +Expected color order is BGR. + +## Outputs + +1. The `boxes` is a blob with shape: [N, 5], where N is the number of detected + bounding boxes. For each detection, the description has the format: + [`x_min`, `y_min`, `x_max`, `y_max`, `conf`], + where: + - (`x_min`, `y_min`) - coordinates of the top left bounding box corner + - (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner. + - `conf` - confidence for the predicted class +2. The `labels` is a blob with shape: [N], where N is the number of detected + bounding boxes. In case of person detection, it is equal to `1` for each detected box with person in it and `0` for the background. + +## Legal Information +[*] Other names and brands may be claimed as the property of others. diff --git a/models/intel/person-detection-0203/description/person-detection-0203.png b/models/intel/person-detection-0203/description/person-detection-0203.png new file mode 100644 index 00000000000..de3f62ab777 Binary files /dev/null and b/models/intel/person-detection-0203/description/person-detection-0203.png differ diff --git a/models/intel/person-detection-0203/model.yml b/models/intel/person-detection-0203/model.yml new file mode 100644 index 00000000000..62196c3fa07 --- /dev/null +++ b/models/intel/person-detection-0203/model.yml @@ -0,0 +1,36 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + Person Detection based on MobileNetV2 (ATSS) on 864x480 resolution. +task_type: detection +files: + - name: FP32/person-detection-0203.xml + size: 1068612 + sha256: f7b3590794ddb668573413e2c984edf3df365e8edba70ee2eda5a256afd14b8f + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0203/FP32/person-detection-0203.xml + - name: FP32/person-detection-0203.bin + size: 7804876 + sha256: f7fd0fbf2a29fcc370e561cf499bcecc4d2a684905a7d199c5cea13a896dbd5d + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0203/FP32/person-detection-0203.bin + - name: FP16/person-detection-0203.xml + size: 1068440 + sha256: 0f3316a35412b48b760e97ba33063fedd82ef4aeb5521ceefe233a11f3a539eb + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0203/FP16/person-detection-0203.xml + - name: FP16/person-detection-0203.bin + size: 3902622 + sha256: e7ff7f360d42bd24476ce7e83e41bed99d9014058ac6f0ce70cc84f76d78fb12 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-0203/FP16/person-detection-0203.bin +framework: dldt +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-detection-action-recognition-0005/accuracy-check.yml b/models/intel/person-detection-action-recognition-0005/accuracy-check.yml index 93a3c1da7b4..c5f25c6e8ad 100644 --- a/models/intel/person-detection-action-recognition-0005/accuracy-check.yml +++ b/models/intel/person-detection-action-recognition-0005/accuracy-check.yml @@ -3,44 +3,6 @@ models: launchers: - framework: dlsdk - tags: - - FP32 - model: intel/person-detection-action-recognition-0005/FP32/person-detection-action-recognition-0005.xml - weights: intel/person-detection-action-recognition-0005/FP32/person-detection-action-recognition-0005.bin - adapter: - type: action_detection - priorbox_out: mbox/priorbox - loc_out: mbox_loc1/out/conv/flat - main_conf_out: mbox_main_conf/out/conv/flat/softmax/flat - add_conf_out_prefix: out/anchor - add_conf_out_count: 4 - num_action_classes: 3 - detection_threshold: 0.4 - action_confidence_threshold: 0.75 - action_scale: 3 - - - framework: dlsdk - tags: - - FP16 - model: intel/person-detection-action-recognition-0005/FP16/person-detection-action-recognition-0005.xml - weights: intel/person-detection-action-recognition-0005/FP16/person-detection-action-recognition-0005.bin - adapter: - type: action_detection - priorbox_out: mbox/priorbox - loc_out: mbox_loc1/out/conv/flat - main_conf_out: mbox_main_conf/out/conv/flat/softmax/flat - add_conf_out_prefix: out/anchor - add_conf_out_count: 4 - num_action_classes: 3 - detection_threshold: 0.4 - action_confidence_threshold: 0.75 - action_scale: 3 - - - framework: dlsdk - tags: - - FP16-INT8 - model: intel/person-detection-action-recognition-0005/FP16-INT8/person-detection-action-recognition-0005.xml - weights: intel/person-detection-action-recognition-0005/FP16-INT8/person-detection-action-recognition-0005.bin adapter: type: action_detection priorbox_out: mbox/priorbox diff --git a/models/intel/person-detection-action-recognition-0005/description/person-detection-action-recognition-0005.md b/models/intel/person-detection-action-recognition-0005/description/person-detection-action-recognition-0005.md index 47641bf9250..c9e6a04a615 100644 --- a/models/intel/person-detection-action-recognition-0005/description/person-detection-action-recognition-0005.md +++ b/models/intel/person-detection-action-recognition-0005/description/person-detection-action-recognition-0005.md @@ -12,8 +12,8 @@ This is an action detector for the Smart Classroom scenario. It is based on the | Metric | Value | |-----------------------------------|-------------------------------------------| -| Detector AP (internal test set 2) | 82.79% | -| Accuracy (internal test set 2) | 93.55% | +| Detector AP (internal test set 2) | 80.0% | +| Accuracy (internal test set 2) | 83.8% | | Pose coverage | Sitting, standing, raising hand | | Support of occluded pedestrians | YES | | Occlusion coverage | <50% | @@ -25,8 +25,6 @@ This is an action detector for the Smart Classroom scenario. It is based on the Average Precision (AP) is defined as an area under the [precision/recall](https://en.wikipedia.org/wiki/Precision_and_recall) curve. -## Performance - ## Inputs Name: `input`, shape: [1x3x400x680] - An input image in the format [BxCxHxW], diff --git a/models/intel/person-detection-action-recognition-0005/model.yml b/models/intel/person-detection-action-recognition-0005/model.yml index af10b3445f3..a56f1f1b9b6 100644 --- a/models/intel/person-detection-action-recognition-0005/model.yml +++ b/models/intel/person-detection-action-recognition-0005/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/person-detection-action-recognition-0005.xml - size: 655383 - sha256: 98e80844e7db455e480e07d356654cef58496ee464b21d3261eb55bcda961224 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-action-recognition-0005/FP32/person-detection-action-recognition-0005.xml + size: 659983 + sha256: 06d6953d6cddfdf919127dad26c43bda5bb05056e363877d8fd4e0bc00bf3e95 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-action-recognition-0005/FP32/person-detection-action-recognition-0005.xml - name: FP32/person-detection-action-recognition-0005.bin size: 7800360 sha256: 2982e6c2683229a450d674c362cc11abd640dce4e39e95925c7957a28011f147 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-action-recognition-0005/FP32/person-detection-action-recognition-0005.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-action-recognition-0005/FP32/person-detection-action-recognition-0005.bin - name: FP16/person-detection-action-recognition-0005.xml - size: 655141 - sha256: 3c8e1734e2b507a5506dd0fccd7220f81e570c67d217252f999aa08de8b7f172 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-action-recognition-0005/FP16/person-detection-action-recognition-0005.xml + size: 659739 + sha256: 1ac6e22364162f75d0b6b43ae7def18271507bbb110993ec6ea1303948849c14 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-action-recognition-0005/FP16/person-detection-action-recognition-0005.xml - name: FP16/person-detection-action-recognition-0005.bin size: 3900234 sha256: 159f52fdd28bef5a3ef3edd998fe08fd4d51c4a3fb2b9134b82a09f6a252c378 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-action-recognition-0005/FP16/person-detection-action-recognition-0005.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-action-recognition-0005/FP16/person-detection-action-recognition-0005.bin - name: FP16-INT8/person-detection-action-recognition-0005.xml - size: 1962478 - sha256: 256c7e4aaf5454c0d3c278138547e8a502eb2a81016d87b4a0bfa45681ebe01d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-action-recognition-0005/FP16-INT8/person-detection-action-recognition-0005.xml + size: 1967081 + sha256: 42919624a2ec86e51e234d6d6aedb75ab4e30c52965401777b39c840a3c8e7a9 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-action-recognition-0005/FP16-INT8/person-detection-action-recognition-0005.xml - name: FP16-INT8/person-detection-action-recognition-0005.bin size: 2055082 sha256: df44ee72055b916400cf1e186de275beed6f6af7d81c5883153c3d7e382fdb5c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-action-recognition-0005/FP16-INT8/person-detection-action-recognition-0005.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-action-recognition-0005/FP16-INT8/person-detection-action-recognition-0005.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-detection-action-recognition-0006/description/person-detection-action-recognition-0006.md b/models/intel/person-detection-action-recognition-0006/description/person-detection-action-recognition-0006.md index 6caa36cb4cd..cddd87841a4 100644 --- a/models/intel/person-detection-action-recognition-0006/description/person-detection-action-recognition-0006.md +++ b/models/intel/person-detection-action-recognition-0006/description/person-detection-action-recognition-0006.md @@ -26,8 +26,6 @@ This is an action detector for the Smart Classroom scenario. It is based on the Average Precision (AP) is defined as an area under the [precision/recall](https://en.wikipedia.org/wiki/Precision_and_recall) curve. -## Performance - ## Inputs Name: `input`, shape: [1x400x680x3] - An input image in the format [BxHxWxC], diff --git a/models/intel/person-detection-action-recognition-0006/model.yml b/models/intel/person-detection-action-recognition-0006/model.yml index dc8970fbd26..ac40898507f 100644 --- a/models/intel/person-detection-action-recognition-0006/model.yml +++ b/models/intel/person-detection-action-recognition-0006/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/person-detection-action-recognition-0006.xml - size: 753010 - sha256: bc5fcffe328a4677648551b163725cf7a00831d2c311e9871419df038dbaec48 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-action-recognition-0006/FP32/person-detection-action-recognition-0006.xml + size: 752661 + sha256: ead7637ecfcb40b63c0d4f9821085c3c2caaaae7651c07eef4f3d3b9d9973960 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-action-recognition-0006/FP32/person-detection-action-recognition-0006.xml - name: FP32/person-detection-action-recognition-0006.bin size: 7458352 sha256: 888d01b994c58baa65ab20b948439620222512ee49d45e6f443f271d7637f603 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-action-recognition-0006/FP32/person-detection-action-recognition-0006.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-action-recognition-0006/FP32/person-detection-action-recognition-0006.bin - name: FP16/person-detection-action-recognition-0006.xml - size: 752732 - sha256: 1ed36bd0f511d24063edb1dc505eb79a30df0c40ca5c152e5e9c200785a94e67 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-action-recognition-0006/FP16/person-detection-action-recognition-0006.xml + size: 752383 + sha256: 4f5bb4490b4eda35b9699f20fee7190b4b822db19df6db735ffd371dd2877a91 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-action-recognition-0006/FP16/person-detection-action-recognition-0006.xml - name: FP16/person-detection-action-recognition-0006.bin size: 3729222 sha256: 6752e639f4035582f77209a6030cded78ec4869b628ad9cdde1907d8cfd13368 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-action-recognition-0006/FP16/person-detection-action-recognition-0006.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-action-recognition-0006/FP16/person-detection-action-recognition-0006.bin - name: FP16-INT8/person-detection-action-recognition-0006.xml - size: 2187370 - sha256: bf8fd6f44bfdea8c0c0b3a4b956093979e8e545d3be39d53ee129bb827ca98a0 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-action-recognition-0006/FP16-INT8/person-detection-action-recognition-0006.xml + size: 2187800 + sha256: e31cc3c1a68d707d7defed7cca1507930aba950e02008b3e6f7329cf3553c800 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-action-recognition-0006/FP16-INT8/person-detection-action-recognition-0006.xml - name: FP16-INT8/person-detection-action-recognition-0006.bin size: 1982776 sha256: 79ae53bf1f80644eee9f59d80cba1c27473419ee1c21e40fcd9ead8568364c5d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-action-recognition-0006/FP16-INT8/person-detection-action-recognition-0006.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-action-recognition-0006/FP16-INT8/person-detection-action-recognition-0006.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-detection-action-recognition-teacher-0002/description/person-detection-action-recognition-teacher-0002.md b/models/intel/person-detection-action-recognition-teacher-0002/description/person-detection-action-recognition-teacher-0002.md index 452a218695b..e774dd6bea7 100644 --- a/models/intel/person-detection-action-recognition-teacher-0002/description/person-detection-action-recognition-teacher-0002.md +++ b/models/intel/person-detection-action-recognition-teacher-0002/description/person-detection-action-recognition-teacher-0002.md @@ -12,8 +12,8 @@ This is an action detector for the Smart Classroom scenario. It is based on the | Metric | Value | |-----------------------------------|----------------------------------| -| Detector AP (internal test set 2) | 77.11% | -| Accuracy (internal test set 1) | 92.64% | +| Detector AP (internal test set 2) | 80.0% | +| Accuracy (internal test set 1) | 72.4% | | Pose coverage | Standing, writing, demonstrating | | Support of occluded pedestrians | YES | | Occlusion coverage | <50% | @@ -25,8 +25,6 @@ This is an action detector for the Smart Classroom scenario. It is based on the Average Precision (AP) is defined as an area under the [precision/recall](https://en.wikipedia.org/wiki/Precision_and_recall) curve. -## Performance - ## Inputs Name: `input`, shape: [1x3x400x680] - An input image in the format [BxCxHxW], diff --git a/models/intel/person-detection-action-recognition-teacher-0002/model.yml b/models/intel/person-detection-action-recognition-teacher-0002/model.yml index 937bfeb91b2..73a61df4811 100644 --- a/models/intel/person-detection-action-recognition-teacher-0002/model.yml +++ b/models/intel/person-detection-action-recognition-teacher-0002/model.yml @@ -18,28 +18,28 @@ description: >- task_type: detection files: - name: FP32/person-detection-action-recognition-teacher-0002.xml - size: 655393 - sha256: cec7849f78a29b0c87157012657f396360af809fda74fc5bd1816496cf245c7e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-action-recognition-teacher-0002/FP32/person-detection-action-recognition-teacher-0002.xml + size: 659991 + sha256: 07cffbacdc614adc78c427c92056a583dfa2549dfc66ffccdde8c61f881581f6 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-action-recognition-teacher-0002/FP32/person-detection-action-recognition-teacher-0002.xml - name: FP32/person-detection-action-recognition-teacher-0002.bin size: 7800360 sha256: ebe9c7cdca28a408302b3b1f241afdc670abc251bd692c13a3140c78b08b0498 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-action-recognition-teacher-0002/FP32/person-detection-action-recognition-teacher-0002.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-action-recognition-teacher-0002/FP32/person-detection-action-recognition-teacher-0002.bin - name: FP16/person-detection-action-recognition-teacher-0002.xml - size: 655149 - sha256: 820aaeecdfbddd4595c290bef9ca3f7badf2aa9e255da88385f51f8e311f51d1 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-action-recognition-teacher-0002/FP16/person-detection-action-recognition-teacher-0002.xml + size: 659746 + sha256: db186cfe594453aa029367746f284e67f014cc1b32905d35cb5d8045a8bf18c7 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-action-recognition-teacher-0002/FP16/person-detection-action-recognition-teacher-0002.xml - name: FP16/person-detection-action-recognition-teacher-0002.bin size: 3900234 sha256: 190e9b71ae02e022c6afe2dc9fb59939066e046234ff35f4ceab6ddfabab7883 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-action-recognition-teacher-0002/FP16/person-detection-action-recognition-teacher-0002.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-action-recognition-teacher-0002/FP16/person-detection-action-recognition-teacher-0002.bin - name: FP16-INT8/person-detection-action-recognition-teacher-0002.xml - size: 1957431 - sha256: 812c21752fbc56e4eab71c339d3061b24372e3cb5877aad2e1f12a42ca87439f - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-action-recognition-teacher-0002/FP16-INT8/person-detection-action-recognition-teacher-0002.xml + size: 1962033 + sha256: 5bbccdb1598e230cdbefe75be4637d9abc2ea2c354214f8f439d1b1770b0fd69 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-action-recognition-teacher-0002/FP16-INT8/person-detection-action-recognition-teacher-0002.xml - name: FP16-INT8/person-detection-action-recognition-teacher-0002.bin size: 2055074 sha256: 96cad98eab14477f7428a145c8b80a3bdf294d45f79df453a36e95305400de1a - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-action-recognition-teacher-0002/FP16-INT8/person-detection-action-recognition-teacher-0002.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-action-recognition-teacher-0002/FP16-INT8/person-detection-action-recognition-teacher-0002.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-detection-asl-0001/description/person-detection-asl-0001.md b/models/intel/person-detection-asl-0001/description/person-detection-asl-0001.md index cb96682651c..24fbdecdd01 100644 --- a/models/intel/person-detection-asl-0001/description/person-detection-asl-0001.md +++ b/models/intel/person-detection-asl-0001/description/person-detection-asl-0001.md @@ -12,7 +12,7 @@ This is a person detector for the ASL Recognition scenario. It is based on Shuff | Metric | Value | |---------------------------------|-------------------------------------------| -| Persons AP on MS-COCO\* | 77.68% | +| Persons AP on MS-COCO\* | 80.0% | | Minimal person height | 100 pixel | | GFlops | 0.986 | | MParams | 1.338 | @@ -20,8 +20,6 @@ This is a person detector for the ASL Recognition scenario. It is based on Shuff Average Precision (AP) is defined as an area under the [precision/recall](https://en.wikipedia.org/wiki/Precision_and_recall) curve. -## Performance - ## Inputs Name: `input`, shape: [1x3x320x320] - An input image in the format [1xCxHxW], where: diff --git a/models/intel/person-detection-asl-0001/model.yml b/models/intel/person-detection-asl-0001/model.yml index 386a23cc1ce..6ab22b68f11 100644 --- a/models/intel/person-detection-asl-0001/model.yml +++ b/models/intel/person-detection-asl-0001/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/person-detection-asl-0001.xml - size: 815577 - sha256: 8fdd3cb144936c0e919f11033d1a559345ba1cdc19748580e21bc38aa7c1b4a7 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-asl-0001/FP32/person-detection-asl-0001.xml + size: 828845 + sha256: 6019b3645213f000386d962dea09e5edabf50972b6a6aa1bc5f61b81500bb4cd + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-asl-0001/FP32/person-detection-asl-0001.xml - name: FP32/person-detection-asl-0001.bin - size: 4026308 - sha256: 3a2fcda9d7c62e9e41c8fc889573379428e3660c60d63b3fc80f9dd2fdc35747 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-asl-0001/FP32/person-detection-asl-0001.bin + size: 4026300 + sha256: 585f7c1c4533ee87137924ba0f58969d7321f68dd008fb9efea27521c80f3277 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-asl-0001/FP32/person-detection-asl-0001.bin - name: FP16/person-detection-asl-0001.xml - size: 815428 - sha256: a2bf1eaedfcc70f16126fa9d80d98a76c5c505c0b6c3bbb3e5b15d3b1fad0d28 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-asl-0001/FP16/person-detection-asl-0001.xml + size: 828696 + sha256: 95b0e9d41ce6f84197ad0b8d50348a6ff515985a80fbd80b3eedf3d1ce6024d6 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-asl-0001/FP16/person-detection-asl-0001.xml - name: FP16/person-detection-asl-0001.bin - size: 2013340 - sha256: 7f3a401ac5eb738d1e32984a4f29dd5d41cacf71730b0b76a853ced4fb6342c5 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-asl-0001/FP16/person-detection-asl-0001.bin + size: 2013332 + sha256: 485662e4b8ceb9b3f5266c717c4ad96d6d8786e27d6f8acd736296e02f93141c + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-asl-0001/FP16/person-detection-asl-0001.bin - name: FP16-INT8/person-detection-asl-0001.xml - size: 1531879 - sha256: ba29e2171dee51d846aaf80ed2e139bfe8d0dd34944d5f777dcf16763c767647 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-asl-0001/FP16-INT8/person-detection-asl-0001.xml + size: 1546623 + sha256: d66d923685c864094f121dedd03375f186642fb0672404560703edb4fd6e55fd + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-asl-0001/FP16-INT8/person-detection-asl-0001.xml - name: FP16-INT8/person-detection-asl-0001.bin - size: 1056000 - sha256: 19f27e4cf4abefa9ac4ccb91e9e556513ec35bca0154ac2e86a647e6b88b02dc - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-asl-0001/FP16-INT8/person-detection-asl-0001.bin + size: 1055992 + sha256: 0b4382f65d7ba8955e5ac517162eaf7440eb5c4de6a9c05eb68f3a76f9d63c63 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-asl-0001/FP16-INT8/person-detection-asl-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-detection-raisinghand-recognition-0001/description/person-detection-raisinghand-recognition-0001.md b/models/intel/person-detection-raisinghand-recognition-0001/description/person-detection-raisinghand-recognition-0001.md index 403587416d1..442fe5226cf 100644 --- a/models/intel/person-detection-raisinghand-recognition-0001/description/person-detection-raisinghand-recognition-0001.md +++ b/models/intel/person-detection-raisinghand-recognition-0001/description/person-detection-raisinghand-recognition-0001.md @@ -12,8 +12,8 @@ This is an action detector for the Smart Classroom scenario. It is based on the | Metric | Value | |-----------------------------------|-------------------------------------------| -| Detector AP (internal test set 2) | 81.50% | -| Accuracy (internal test set 2) | 94.93% | +| Detector AP (internal test set 2) | 80.0% | +| Accuracy (internal test set 2) | 90.5% | | Pose coverage | Sitting, standing, raising hand | | Support of occluded pedestrians | YES | | Occlusion coverage | <50% | @@ -25,8 +25,6 @@ This is an action detector for the Smart Classroom scenario. It is based on the Average Precision (AP) is defined as an area under the [precision/recall](https://en.wikipedia.org/wiki/Precision_and_recall) curve. -## Performance - ## Inputs Name: `input`, shape: [1x3x400x680] - An input image in the format [BxCxHxW], diff --git a/models/intel/person-detection-raisinghand-recognition-0001/model.yml b/models/intel/person-detection-raisinghand-recognition-0001/model.yml index bd6ca7e5453..3ce89bde95b 100644 --- a/models/intel/person-detection-raisinghand-recognition-0001/model.yml +++ b/models/intel/person-detection-raisinghand-recognition-0001/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/person-detection-raisinghand-recognition-0001.xml - size: 655388 - sha256: 7ec8efb343b54f2eb7c840d1d082d882f7c61d51382397d6b68d63dd4a358b01 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-raisinghand-recognition-0001/FP32/person-detection-raisinghand-recognition-0001.xml + size: 659988 + sha256: a63e92478557df83c1149e55d9267a7fee058bc662bcc38be81a0c78288dfcf7 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-raisinghand-recognition-0001/FP32/person-detection-raisinghand-recognition-0001.xml - name: FP32/person-detection-raisinghand-recognition-0001.bin size: 7799848 sha256: 5183cc9d4d71e208a2cc70db9ea98bf14657d07b2bfafd050aeae9687e4359c4 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-raisinghand-recognition-0001/FP32/person-detection-raisinghand-recognition-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-raisinghand-recognition-0001/FP32/person-detection-raisinghand-recognition-0001.bin - name: FP16/person-detection-raisinghand-recognition-0001.xml - size: 655145 - sha256: 90b910fd3997598a65cade1ba725c3150e3657b85419cb9d7f5b66df402ce689 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-raisinghand-recognition-0001/FP16/person-detection-raisinghand-recognition-0001.xml + size: 659744 + sha256: e8d47f1108db63b207f94f9f58f382cf61fad48fcf62d30300234ffde502d342 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-raisinghand-recognition-0001/FP16/person-detection-raisinghand-recognition-0001.xml - name: FP16/person-detection-raisinghand-recognition-0001.bin size: 3899978 sha256: 601543473374722d45eb56b3aa8f7f250f33e1bb548d63e392332441e97c87d8 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-raisinghand-recognition-0001/FP16/person-detection-raisinghand-recognition-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-raisinghand-recognition-0001/FP16/person-detection-raisinghand-recognition-0001.bin - name: FP16-INT8/person-detection-raisinghand-recognition-0001.xml - size: 1957421 - sha256: 5786ebf65f1c1f8689f976dd99db630e9828f31e3401c6a76a3906020fa170f3 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-raisinghand-recognition-0001/FP16-INT8/person-detection-raisinghand-recognition-0001.xml + size: 1809586 + sha256: bd9341d10c6b2f12e606196f164879342d9c09a5d352ca6151dd5c579e2a090b + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-raisinghand-recognition-0001/FP16-INT8/person-detection-raisinghand-recognition-0001.xml - name: FP16-INT8/person-detection-raisinghand-recognition-0001.bin - size: 2054940 - sha256: 762367acc3434a7babf619e188d1b86459dbcd0165eaa7bf4abf1b7c30568f6b - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-raisinghand-recognition-0001/FP16-INT8/person-detection-raisinghand-recognition-0001.bin + size: 2054922 + sha256: 85b640e152e632c35c680fc2ef13770fe1a2811f5049b7383c5f056cac2f4428 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-raisinghand-recognition-0001/FP16-INT8/person-detection-raisinghand-recognition-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-detection-retail-0002/description/person-detection-retail-0002.md b/models/intel/person-detection-retail-0002/description/person-detection-retail-0002.md index 1237eb5f5e8..75ada53fb3c 100644 --- a/models/intel/person-detection-retail-0002/description/person-detection-retail-0002.md +++ b/models/intel/person-detection-retail-0002/description/person-detection-retail-0002.md @@ -26,8 +26,6 @@ Average Precision (AP) is defined as an area under the [precision/recall](https://en.wikipedia.org/wiki/Precision_and_recall) curve. Validation dataset consists of ~50K of images from ~100 different scenes. -## Performance - ## Inputs 1. name: `data` , shape: [1x3x544x992] - An input image in following format diff --git a/models/intel/person-detection-retail-0002/model.yml b/models/intel/person-detection-retail-0002/model.yml index 8e6e5e0c7dd..91415b669b9 100644 --- a/models/intel/person-detection-retail-0002/model.yml +++ b/models/intel/person-detection-retail-0002/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/person-detection-retail-0002.xml - size: 267737 - sha256: 00875a8c4fe918171799479817217d397860298461330ff35bc265c0fa34fa08 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-retail-0002/FP32/person-detection-retail-0002.xml + size: 269608 + sha256: b6f51aca79c85c77b5952a664c42a2e8f935112a297eadddd175394ee2f79a98 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-retail-0002/FP32/person-detection-retail-0002.xml - name: FP32/person-detection-retail-0002.bin size: 12976100 sha256: 8150eb7ea3352abb272276deb3ce64d0414464e9f4bf02739ec4f2770b8acb75 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-retail-0002/FP32/person-detection-retail-0002.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-retail-0002/FP32/person-detection-retail-0002.bin - name: FP16/person-detection-retail-0002.xml - size: 267614 - sha256: 55206506c5a4eaabc3a0138aa984410ef280698fec10a3482d29c87af63062f1 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-retail-0002/FP16/person-detection-retail-0002.xml + size: 269485 + sha256: 1ca58e544c3ee87db1243e162e62fe848fd1e4d18cc2a6f6dd846bad58fa4db5 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-retail-0002/FP16/person-detection-retail-0002.xml - name: FP16/person-detection-retail-0002.bin size: 6488130 sha256: 32008b134ea50eb70a4f97d74562a0a2c542d3c30f19a5d7ef1b57e8615d7039 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-retail-0002/FP16/person-detection-retail-0002.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-retail-0002/FP16/person-detection-retail-0002.bin - name: FP16-INT8/person-detection-retail-0002.xml - size: 735663 - sha256: cf7bfce9bbbd22f6a7d063ccd8e0212e6b31653caefd6c83472275c7fdb98b19 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-retail-0002/FP16-INT8/person-detection-retail-0002.xml + size: 737568 + sha256: 946f8f531ce3fe1b386782739998589e5e76f5d51560efc04f805b13eca5d35d + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-retail-0002/FP16-INT8/person-detection-retail-0002.xml - name: FP16-INT8/person-detection-retail-0002.bin size: 3298356 - sha256: 9946108061a67e67385a2a9dca6b40af9e5a1b1f21bd0bdeee768000cc398acb - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-retail-0002/FP16-INT8/person-detection-retail-0002.bin + sha256: 762b94732cec5ac8134782c8264e10dd54bce61eb951b4c6d7b6a87a915381ea + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-retail-0002/FP16-INT8/person-detection-retail-0002.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-detection-retail-0013/description/person-detection-retail-0013.md b/models/intel/person-detection-retail-0013/description/person-detection-retail-0013.md index 76a8c76bc60..ff9b8095e2f 100644 --- a/models/intel/person-detection-retail-0013/description/person-detection-retail-0013.md +++ b/models/intel/person-detection-retail-0013/description/person-detection-retail-0013.md @@ -28,8 +28,6 @@ Average Precision (AP) is defined as an area under the [precision/recall](https://en.wikipedia.org/wiki/Precision_and_recall) curve. -## Performance - ## Inputs Name: `input`, shape: [1x3x320x544] - An input image in the format [BxCxHxW], @@ -47,7 +45,7 @@ The net outputs blob with shape: [1, 1, N, 7], where N is the number of detected bounding boxes. Each detection has the format [`image_id`, `label`, `conf`, `x_min`, `y_min`, `x_max`, `y_max`], where: - `image_id` - ID of the image in the batch - - `label` - predicted class ID + - `label` - predicted class ID (1 - person) - `conf` - confidence for the predicted class - (`x_min`, `y_min`) - coordinates of the top left bounding box corner - (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner. diff --git a/models/intel/person-detection-retail-0013/model.yml b/models/intel/person-detection-retail-0013/model.yml index cd3c1409d30..d61eea9e816 100644 --- a/models/intel/person-detection-retail-0013/model.yml +++ b/models/intel/person-detection-retail-0013/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/person-detection-retail-0013.xml - size: 355850 - sha256: 4c7d5d40fce71f2715f8175010309b33071bd6a768475e3563ade5d3584c31e4 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-retail-0013/FP32/person-detection-retail-0013.xml + size: 358403 + sha256: 35a270956dd41751b7f627307f468d6d2220fedd8414e6463bd8dbc4467543e2 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-retail-0013/FP32/person-detection-retail-0013.xml - name: FP32/person-detection-retail-0013.bin size: 2891364 sha256: 6f09cb7061328942f9d5e9fc81631a4234be66a26daa50cd672d4077ee82ad44 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-retail-0013/FP32/person-detection-retail-0013.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-retail-0013/FP32/person-detection-retail-0013.bin - name: FP16/person-detection-retail-0013.xml - size: 355696 - sha256: 6efe3d1c649f9755890623ecd9523e7220d849081363b34930346c013ce56f8b - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-retail-0013/FP16/person-detection-retail-0013.xml + size: 358248 + sha256: a1d2d3fbd200bb73813d35158a303d28b71178b9c3331a9f2edb411404a6cffe + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-retail-0013/FP16/person-detection-retail-0013.xml - name: FP16/person-detection-retail-0013.bin size: 1445736 sha256: 56eeccbeb3f27144046edacb95b459d60f3930f54051ef5b9e5253923c07b672 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-retail-0013/FP16/person-detection-retail-0013.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-retail-0013/FP16/person-detection-retail-0013.bin - name: FP16-INT8/person-detection-retail-0013.xml - size: 976690 - sha256: b2fa2555dff13ab8a23a0e0c9fcdb88334dc19bfd0cfad95d5f0830dffe669aa - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-retail-0013/FP16-INT8/person-detection-retail-0013.xml + size: 979278 + sha256: 854ed900837c44371232180ae83c26b641faca8109710beaa0a8e22a99b290ab + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-retail-0013/FP16-INT8/person-detection-retail-0013.xml - name: FP16-INT8/person-detection-retail-0013.bin size: 770362 sha256: 5d8c63480b116846e3354abe8d4e00406f9b0fe9b3a8d224a907dfb2fc506c62 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-detection-retail-0013/FP16-INT8/person-detection-retail-0013.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-detection-retail-0013/FP16-INT8/person-detection-retail-0013.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-reidentification-retail-0277/description/person-reidentification-retail-0277.md b/models/intel/person-reidentification-retail-0277/description/person-reidentification-retail-0277.md index 21da40327e8..42dc9a3d45b 100644 --- a/models/intel/person-reidentification-retail-0277/description/person-reidentification-retail-0277.md +++ b/models/intel/person-reidentification-retail-0277/description/person-reidentification-retail-0277.md @@ -32,8 +32,6 @@ Mean Average Precision (mAP) is the mean across Average Precision (AP) of all qu the area under the [precision and recall](https://en.wikipedia.org/wiki/Precision_and_recall) curve. -## Performance - ## Inputs The net expects one input image of the shape [1x3x256x128] in the [BxCxHxW] format, where: diff --git a/models/intel/person-reidentification-retail-0277/model.yml b/models/intel/person-reidentification-retail-0277/model.yml index 6830941e93a..1a3236dbea1 100644 --- a/models/intel/person-reidentification-retail-0277/model.yml +++ b/models/intel/person-reidentification-retail-0277/model.yml @@ -17,28 +17,28 @@ description: >- task_type: object_attributes files: - name: FP32/person-reidentification-retail-0277.xml - size: 504843 - sha256: a3426067d589b6e5e1b150e9e760f6cc84d8da732132244913a3e397a2cced89 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-reidentification-retail-0277/FP32/person-reidentification-retail-0277.xml + size: 505140 + sha256: 8a3f19accc49fe3d08ca509627d6f30f7aa2afed0394996c721325141a35c37b + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-reidentification-retail-0277/FP32/person-reidentification-retail-0277.xml - name: FP32/person-reidentification-retail-0277.bin size: 8357560 sha256: cf497eff2c8264099ca56fac5d665b45950b1a2070eefd2fc3b4be08d3742062 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-reidentification-retail-0277/FP32/person-reidentification-retail-0277.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-reidentification-retail-0277/FP32/person-reidentification-retail-0277.bin - name: FP16/person-reidentification-retail-0277.xml - size: 504725 - sha256: cc7612d775eef845ae28e1723f9ffe816da1d0d6a0e700882837f798e1949df6 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-reidentification-retail-0277/FP16/person-reidentification-retail-0277.xml + size: 505022 + sha256: a25ccb661d221850b52377a1be916b22acdaa6b20b3d041a6e4ef43d6290b8b9 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-reidentification-retail-0277/FP16/person-reidentification-retail-0277.xml - name: FP16/person-reidentification-retail-0277.bin size: 4178812 sha256: 105f5897019274c6373c00ecaee2f2cbbb6f7e9cc8e371796536fc95bd1a1167 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-reidentification-retail-0277/FP16/person-reidentification-retail-0277.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-reidentification-retail-0277/FP16/person-reidentification-retail-0277.bin - name: FP16-INT8/person-reidentification-retail-0277.xml - size: 1429481 - sha256: b2a9ef6666b98c54e4185103aaf37c0124924a7dc9f0c3d72ca33232f78a827a - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-reidentification-retail-0277/FP16-INT8/person-reidentification-retail-0277.xml + size: 1431178 + sha256: 05d27aaedf9747b75d0cd11a81097bf675a62381242d41cb3af44ad7f9b4e488 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-reidentification-retail-0277/FP16-INT8/person-reidentification-retail-0277.xml - name: FP16-INT8/person-reidentification-retail-0277.bin size: 2202802 - sha256: ebc5fcd30d59a2f0d76ebe99aa05ce4dcf52d8b3777c3d82aad931a6287cc200 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-reidentification-retail-0277/FP16-INT8/person-reidentification-retail-0277.bin + sha256: a7402b5d618ca56c43541140f9fd9d137e126aa8773eddba43ce506ee3095a35 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-reidentification-retail-0277/FP16-INT8/person-reidentification-retail-0277.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-reidentification-retail-0286/description/person-reidentification-retail-0286.md b/models/intel/person-reidentification-retail-0286/description/person-reidentification-retail-0286.md index 70c65905865..c31eb852552 100644 --- a/models/intel/person-reidentification-retail-0286/description/person-reidentification-retail-0286.md +++ b/models/intel/person-reidentification-retail-0286/description/person-reidentification-retail-0286.md @@ -32,8 +32,6 @@ Mean Average Precision (mAP) is the mean across Average Precision (AP) of all qu AP is defined as the area under the [precision and recall](https://en.wikipedia.org/wiki/Precision_and_recall) curve. -## Performance - ## Inputs The net expects one input image of the shape [1x3x256x128] in the [BxCxHxW] format, where: diff --git a/models/intel/person-reidentification-retail-0286/model.yml b/models/intel/person-reidentification-retail-0286/model.yml index ce9c5363291..d4dfc345108 100644 --- a/models/intel/person-reidentification-retail-0286/model.yml +++ b/models/intel/person-reidentification-retail-0286/model.yml @@ -17,28 +17,28 @@ description: >- task_type: object_attributes files: - name: FP32/person-reidentification-retail-0286.xml - size: 504087 - sha256: bab36f3d14a09a4f98479e5aa2f6e39dbc4696f04731bb8bb12a825789a69bd8 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-reidentification-retail-0286/FP32/person-reidentification-retail-0286.xml + size: 504384 + sha256: acd7467cde4b406d9754e71adba6d89aeafda551f86262abf6cfe97d01c7d26a + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-reidentification-retail-0286/FP32/person-reidentification-retail-0286.xml - name: FP32/person-reidentification-retail-0286.bin size: 4905116 sha256: 159442768eeb08f23af66f1c95c55072aa3d59f5e6cbf068dfc756544a908226 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-reidentification-retail-0286/FP32/person-reidentification-retail-0286.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-reidentification-retail-0286/FP32/person-reidentification-retail-0286.bin - name: FP16/person-reidentification-retail-0286.xml - size: 503939 - sha256: 0c50b99e0a81ac102af700c88aa48dad1b265f16fba866d176b06f221e2e9a66 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-reidentification-retail-0286/FP16/person-reidentification-retail-0286.xml + size: 504236 + sha256: 384c9c0b0492b29343e24a231efd09d511f2e4b55e8e5f20a38076ce4da4b7e0 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-reidentification-retail-0286/FP16/person-reidentification-retail-0286.xml - name: FP16/person-reidentification-retail-0286.bin size: 2452658 sha256: b505697b2cae65ed09025193ec04c61c9fba9f9e4f558a32ef326cd60bf923ed - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-reidentification-retail-0286/FP16/person-reidentification-retail-0286.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-reidentification-retail-0286/FP16/person-reidentification-retail-0286.bin - name: FP16-INT8/person-reidentification-retail-0286.xml - size: 1426991 - sha256: af5abef782a70dde678a33ea481ee4c104c2ade23da416dfe600365d51f622d5 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-reidentification-retail-0286/FP16-INT8/person-reidentification-retail-0286.xml + size: 1428688 + sha256: 4dc2132a762807fab5c6d895e3712f4ce8202c76772ebc49f49aa03e509e5ae2 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-reidentification-retail-0286/FP16-INT8/person-reidentification-retail-0286.xml - name: FP16-INT8/person-reidentification-retail-0286.bin size: 1311268 - sha256: f5e7d2112c42f36282bc858b946e79c0cad273b441e90b277f85fd7117c2b3a8 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-reidentification-retail-0286/FP16-INT8/person-reidentification-retail-0286.bin + sha256: 2d1d77b2a6c18aed81cddb42a015f032739630cc1e630bdbb5ef56d6d6e3601f + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-reidentification-retail-0286/FP16-INT8/person-reidentification-retail-0286.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-reidentification-retail-0287/description/person-reidentification-retail-0287.md b/models/intel/person-reidentification-retail-0287/description/person-reidentification-retail-0287.md index 31aaef6c6e1..cce0e6ce7d6 100644 --- a/models/intel/person-reidentification-retail-0287/description/person-reidentification-retail-0287.md +++ b/models/intel/person-reidentification-retail-0287/description/person-reidentification-retail-0287.md @@ -32,8 +32,6 @@ Mean Average Precision (mAP) is the mean across Average Precision (AP) of all qu AP is defined as the area under the [precision and recall](https://en.wikipedia.org/wiki/Precision_and_recall) curve. -## Performance - ## Inputs The net expects one input image of the shape [1x3x256x128] in the [BxCxHxW] format, where: diff --git a/models/intel/person-reidentification-retail-0287/model.yml b/models/intel/person-reidentification-retail-0287/model.yml index fd7ea129d7c..966a2fbdf97 100644 --- a/models/intel/person-reidentification-retail-0287/model.yml +++ b/models/intel/person-reidentification-retail-0287/model.yml @@ -17,28 +17,28 @@ description: >- task_type: object_attributes files: - name: FP32/person-reidentification-retail-0287.xml - size: 503998 - sha256: 5856b5e48f3266c88d6d9993a609a6a0a9998ec09f0be455ac38d3f7528eddb8 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-reidentification-retail-0287/FP32/person-reidentification-retail-0287.xml + size: 504295 + sha256: 95b7dc76dd85bae3dae4e528540e6133e54d86ed6f241c9a24e26b9b9ebcb064 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-reidentification-retail-0287/FP32/person-reidentification-retail-0287.xml - name: FP32/person-reidentification-retail-0287.bin size: 2362196 sha256: 2def95a238b8c6a63925d9772deb5684ceb2e933d20a5e3a1dbcade15e287eea - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-reidentification-retail-0287/FP32/person-reidentification-retail-0287.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-reidentification-retail-0287/FP32/person-reidentification-retail-0287.bin - name: FP16/person-reidentification-retail-0287.xml - size: 503681 - sha256: 1a3f3c60531aadcca77577cb6e4328abd784e792cb5960010572acedee7b8a7c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-reidentification-retail-0287/FP16/person-reidentification-retail-0287.xml + size: 503978 + sha256: 1b9a34caecea292e855b69010b1611c4fa0fd0d57290e829725bbddfcc8040b1 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-reidentification-retail-0287/FP16/person-reidentification-retail-0287.xml - name: FP16/person-reidentification-retail-0287.bin size: 1181130 sha256: 72fcb96efd983a928d847caf0c5877ba95c139d4c93c2819b9c6269466f8ed71 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-reidentification-retail-0287/FP16/person-reidentification-retail-0287.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-reidentification-retail-0287/FP16/person-reidentification-retail-0287.bin - name: FP16-INT8/person-reidentification-retail-0287.xml - size: 1426430 - sha256: 43a780ade23fdfadc035f17d8bb4afcdca61309d5aa3bd58f04bb6525c8468c8 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-reidentification-retail-0287/FP16-INT8/person-reidentification-retail-0287.xml + size: 1428127 + sha256: d2b6a05cc55e90a486ae43c1f4ef615a5618adceada211a3bf8efea40f8d235e + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-reidentification-retail-0287/FP16-INT8/person-reidentification-retail-0287.xml - name: FP16-INT8/person-reidentification-retail-0287.bin size: 647532 - sha256: b9163e2a581893813c424f5a58db92e6482ac3950a1d96f0d82c708d348d8972 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-reidentification-retail-0287/FP16-INT8/person-reidentification-retail-0287.bin + sha256: fa14ae20061e849c701bfdfabaa012372afdd5516e254c0217b7e18b0a52a7e1 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-reidentification-retail-0287/FP16-INT8/person-reidentification-retail-0287.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-reidentification-retail-0288/description/person-reidentification-retail-0288.md b/models/intel/person-reidentification-retail-0288/description/person-reidentification-retail-0288.md index 5c0c03a6849..87e2abf79cc 100644 --- a/models/intel/person-reidentification-retail-0288/description/person-reidentification-retail-0288.md +++ b/models/intel/person-reidentification-retail-0288/description/person-reidentification-retail-0288.md @@ -31,8 +31,6 @@ Mean Average Precision (mAP) is the mean across Average Precision (AP) of all qu AP is defined as the area under the [precision and recall](https://en.wikipedia.org/wiki/Precision_and_recall) curve. -## Performance - ## Inputs The net expects one input image of the shape [1x3x256x128] in the [BxCxHxW] format, where: diff --git a/models/intel/person-reidentification-retail-0288/model.yml b/models/intel/person-reidentification-retail-0288/model.yml index 758ad2ed9a5..4c6f2ca66da 100644 --- a/models/intel/person-reidentification-retail-0288/model.yml +++ b/models/intel/person-reidentification-retail-0288/model.yml @@ -17,20 +17,20 @@ description: >- task_type: object_attributes files: - name: FP32/person-reidentification-retail-0288.xml - size: 503451 - sha256: 2da638ff5c494198d5e0050fa4b1c8de277304c9a97a4d5006922780edf568ca - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-reidentification-retail-0288/FP32/person-reidentification-retail-0288.xml + size: 503748 + sha256: 9f53a621a24cddb743421d4ae89ebacffe89f250371c4ba162a7b39b3b2956b0 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-reidentification-retail-0288/FP32/person-reidentification-retail-0288.xml - name: FP32/person-reidentification-retail-0288.bin size: 728632 sha256: 1d50150374cf33e0fb582d7b7affc06feb8fe2c8081e877e6456cc1f8d2eef3e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-reidentification-retail-0288/FP32/person-reidentification-retail-0288.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-reidentification-retail-0288/FP32/person-reidentification-retail-0288.bin - name: FP16/person-reidentification-retail-0288.xml - size: 503202 - sha256: 8b4954db92b8e3b177cf0e5d90b732969a66af70b98a8d2c0db38d1d8bad0cba - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-reidentification-retail-0288/FP16/person-reidentification-retail-0288.xml + size: 503499 + sha256: 1c306970309834f98bb4a7117c8c6f4bc72f04a6b620b0d01d072fa7a42d7260 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-reidentification-retail-0288/FP16/person-reidentification-retail-0288.xml - name: FP16/person-reidentification-retail-0288.bin size: 364360 sha256: 643492c3d210465d19155a76a4f21f01e74157d2e6afd9a8436685089e538331 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-reidentification-retail-0288/FP16/person-reidentification-retail-0288.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-reidentification-retail-0288/FP16/person-reidentification-retail-0288.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-vehicle-bike-detection-2000/description/person-vehicle-bike-detection-2000.md b/models/intel/person-vehicle-bike-detection-2000/description/person-vehicle-bike-detection-2000.md index db66f04d571..dabcaf684e5 100644 --- a/models/intel/person-vehicle-bike-detection-2000/description/person-vehicle-bike-detection-2000.md +++ b/models/intel/person-vehicle-bike-detection-2000/description/person-vehicle-bike-detection-2000.md @@ -23,8 +23,6 @@ Average Precision (AP) is defined as an area under the [precision/recall](https://en.wikipedia.org/wiki/Precision_and_recall) curve. -## Performance - ## Inputs Name: `input`, shape: [1x3x256x256] - An input image in the format [BxCxHxW], diff --git a/models/intel/person-vehicle-bike-detection-2000/model.yml b/models/intel/person-vehicle-bike-detection-2000/model.yml index c1fd3acec8b..1ac8a3d5f2e 100644 --- a/models/intel/person-vehicle-bike-detection-2000/model.yml +++ b/models/intel/person-vehicle-bike-detection-2000/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/person-vehicle-bike-detection-2000.xml - size: 186801 - sha256: a7f65eb188c09fd150d985dab618a25612dd0d035767761198cd7bdcd0aebde0 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-2000/FP32/person-vehicle-bike-detection-2000.xml + size: 187918 + sha256: b1fee6f2916d84547c0b24c843fe1b99c65587cc602665e5ffd0401df807566f + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-2000/FP32/person-vehicle-bike-detection-2000.xml - name: FP32/person-vehicle-bike-detection-2000.bin size: 7285112 sha256: 765e81e9ed490acdaa24d65e1124946b0254cb392717a743774cfd493d3e5fef - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-2000/FP32/person-vehicle-bike-detection-2000.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-2000/FP32/person-vehicle-bike-detection-2000.bin - name: FP16/person-vehicle-bike-detection-2000.xml - size: 186739 - sha256: 76786e538f129a82726080fe809fe1651b87110bbba33bf7cf43a0bdab1c705e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-2000/FP16/person-vehicle-bike-detection-2000.xml + size: 187856 + sha256: 4ed8eadaade9bd84c130d6f44db5ad61d3a07e6c0fb651ae2a2d055c8fd35be5 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-2000/FP16/person-vehicle-bike-detection-2000.xml - name: FP16/person-vehicle-bike-detection-2000.bin size: 3642598 sha256: c64141e1f48ac75c5a4b1bac40b5400fdac8c4aaeae386eae73bc2bc9168c312 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-2000/FP16/person-vehicle-bike-detection-2000.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-2000/FP16/person-vehicle-bike-detection-2000.bin - name: FP16-INT8/person-vehicle-bike-detection-2000.xml - size: 473415 - sha256: 159e799891fa791f69990999872ef6a455ccde664a36f6feeb712337a7cc5ce3 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-2000/FP16-INT8/person-vehicle-bike-detection-2000.xml + size: 466266 + sha256: cac3cceabe31f00fc6df5658998ab60a8118b479a1f27529d27ffe3640919936 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-2000/FP16-INT8/person-vehicle-bike-detection-2000.xml - name: FP16-INT8/person-vehicle-bike-detection-2000.bin - size: 1930907 - sha256: 164de8285e5b5872ab1eb60b5823f2df44cb5c12b2c1dd6e9a76654b0d32892d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-2000/FP16-INT8/person-vehicle-bike-detection-2000.bin + size: 1932535 + sha256: ceb135af3f792e73163869278df5bf279c9bf9a4a1049c403358be839fa169fe + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-2000/FP16-INT8/person-vehicle-bike-detection-2000.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-vehicle-bike-detection-2001/description/person-vehicle-bike-detection-2001.md b/models/intel/person-vehicle-bike-detection-2001/description/person-vehicle-bike-detection-2001.md index 7f208becf12..6210f600a7f 100644 --- a/models/intel/person-vehicle-bike-detection-2001/description/person-vehicle-bike-detection-2001.md +++ b/models/intel/person-vehicle-bike-detection-2001/description/person-vehicle-bike-detection-2001.md @@ -23,8 +23,6 @@ Average Precision (AP) is defined as an area under the [precision/recall](https://en.wikipedia.org/wiki/Precision_and_recall) curve. -## Performance - ## Inputs Name: `input`, shape: [1x3x384x384] - An input image in the format [BxCxHxW], diff --git a/models/intel/person-vehicle-bike-detection-2001/model.yml b/models/intel/person-vehicle-bike-detection-2001/model.yml index e64b92d692a..8d99a0cf916 100644 --- a/models/intel/person-vehicle-bike-detection-2001/model.yml +++ b/models/intel/person-vehicle-bike-detection-2001/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/person-vehicle-bike-detection-2001.xml - size: 186993 - sha256: 7dc824c7b1118091be9aab2663db3b550de9e96b2494983909a5710ef576cdd5 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-2001/FP32/person-vehicle-bike-detection-2001.xml + size: 188110 + sha256: 7ea15fde78798cbee9e67f71925e8ede0b420b69a62afcca480dc487f7722dcf + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-2001/FP32/person-vehicle-bike-detection-2001.xml - name: FP32/person-vehicle-bike-detection-2001.bin size: 7285112 sha256: 3c91bc0b7013ed9d4b077f4aefb0c5929776ecd34f7e8906e4bf1dcedf48eee7 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-2001/FP32/person-vehicle-bike-detection-2001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-2001/FP32/person-vehicle-bike-detection-2001.bin - name: FP16/person-vehicle-bike-detection-2001.xml - size: 186931 - sha256: b9463dd842073fafab11006f9b61517ef2b7e0ac09a313ed5defdf47bd6f5adb - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-2001/FP16/person-vehicle-bike-detection-2001.xml + size: 188048 + sha256: 610135761820d7daee84f6f2c5cd1c94d4131c0934230b3c7303e6cdacceadf3 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-2001/FP16/person-vehicle-bike-detection-2001.xml - name: FP16/person-vehicle-bike-detection-2001.bin size: 3642598 sha256: 1e3089a94f70387281499594b9b769d4c0a64d1fd158184e7a04a98f031fe4fa - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-2001/FP16/person-vehicle-bike-detection-2001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-2001/FP16/person-vehicle-bike-detection-2001.bin - name: FP16-INT8/person-vehicle-bike-detection-2001.xml - size: 415669 - sha256: fb5886a77d12acba9180ec639889dfb0cbba23c7eacf999332fd61cca7d53741 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-2001/FP16-INT8/person-vehicle-bike-detection-2001.xml + size: 414177 + sha256: 641946e4ff7cce8f143489fc4f9b2e87163960da420ce7488c8e52208facfe43 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-2001/FP16-INT8/person-vehicle-bike-detection-2001.xml - name: FP16-INT8/person-vehicle-bike-detection-2001.bin - size: 2136469 - sha256: 9b309e25fc04bdd5dc22d84a0aaae7bbd4018efd9ba8d6e744e6b5f6420a1a1f - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-2001/FP16-INT8/person-vehicle-bike-detection-2001.bin + size: 1967581 + sha256: 633b0bc3e7ed4260a6d88c2c81e289dac97b3267d376ee255598e7e2a049adeb + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-2001/FP16-INT8/person-vehicle-bike-detection-2001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-vehicle-bike-detection-2002/description/person-vehicle-bike-detection-2002.md b/models/intel/person-vehicle-bike-detection-2002/description/person-vehicle-bike-detection-2002.md index 5b2b608d121..e6a3a9d1bfa 100644 --- a/models/intel/person-vehicle-bike-detection-2002/description/person-vehicle-bike-detection-2002.md +++ b/models/intel/person-vehicle-bike-detection-2002/description/person-vehicle-bike-detection-2002.md @@ -19,8 +19,6 @@ prior boxes for 512x512 resolution. | MParams | 1.821 | | Source framework | PyTorch\* | -## Performance - ## Inputs Name: `input`, shape: [1x3x512x512] - An input image in the format [BxCxHxW], diff --git a/models/intel/person-vehicle-bike-detection-2002/model.yml b/models/intel/person-vehicle-bike-detection-2002/model.yml index f124fe17b70..1907ccd8989 100644 --- a/models/intel/person-vehicle-bike-detection-2002/model.yml +++ b/models/intel/person-vehicle-bike-detection-2002/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/person-vehicle-bike-detection-2002.xml - size: 187072 - sha256: 002c22f679622f8ebfe6216a3adb383c2033e6a9ae8cb632a0939112475d8260 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-2002/FP32/person-vehicle-bike-detection-2002.xml + size: 188189 + sha256: 669b8dd08855c54b29eb243502ffe088d08cc58be0c3ad0563372f854ae5b517 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-2002/FP32/person-vehicle-bike-detection-2002.xml - name: FP32/person-vehicle-bike-detection-2002.bin size: 7285112 sha256: 2bf525c551a9a0625bfe7f2fc462b1c1f4bb1218d06472b03c9424d0dc2ea684 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-2002/FP32/person-vehicle-bike-detection-2002.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-2002/FP32/person-vehicle-bike-detection-2002.bin - name: FP16/person-vehicle-bike-detection-2002.xml - size: 187010 - sha256: ea875381c4e4bdfb4361cbea7a625da7742af51c8f2edbd456baa58bc419290b - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-2002/FP16/person-vehicle-bike-detection-2002.xml + size: 188127 + sha256: 297e596221b7d9aeb51cdcaf29979038f9ab98681c8c7826b705daaf320ddc16 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-2002/FP16/person-vehicle-bike-detection-2002.xml - name: FP16/person-vehicle-bike-detection-2002.bin size: 3642598 sha256: 5f1d98f95cdf46dab234d70754a6e8f5b3d770465f8050b9643e3c4fe4bd22d4 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-2002/FP16/person-vehicle-bike-detection-2002.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-2002/FP16/person-vehicle-bike-detection-2002.bin - name: FP16-INT8/person-vehicle-bike-detection-2002.xml - size: 493358 - sha256: 1f2cca984648fa1d5e2bcc9b8bdedc6cd80f2c9afd094152494e75199b23cc07 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-2002/FP16-INT8/person-vehicle-bike-detection-2002.xml + size: 494651 + sha256: ce0fc5f8575c98f704f6f0e309835ec4cb4035f2b32d97e9f3eccf6223c7bb36 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-2002/FP16-INT8/person-vehicle-bike-detection-2002.xml - name: FP16-INT8/person-vehicle-bike-detection-2002.bin size: 1925701 sha256: c836b4a0b4d5ba15ac23c52e997e977dc3d742b0bf541f089309f7abac3844e3 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-2002/FP16-INT8/person-vehicle-bike-detection-2002.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-2002/FP16-INT8/person-vehicle-bike-detection-2002.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-vehicle-bike-detection-crossroad-0078/description/person-vehicle-bike-detection-crossroad-0078.md b/models/intel/person-vehicle-bike-detection-crossroad-0078/description/person-vehicle-bike-detection-crossroad-0078.md index 036deb7452f..a221f9890a7 100644 --- a/models/intel/person-vehicle-bike-detection-crossroad-0078/description/person-vehicle-bike-detection-crossroad-0078.md +++ b/models/intel/person-vehicle-bike-detection-crossroad-0078/description/person-vehicle-bike-detection-crossroad-0078.md @@ -15,7 +15,7 @@ conditions. | Metric | Value | |---------------------------------|-------------------------------------------| | Mean Average Precision (mAP) | 65.12% | -| AP people | 76.28% | +| AP people | 77.47% | | AP vehicles | 74.94% | | AP bikes | 44.14% | | Max objects to detect | 200 | @@ -43,8 +43,6 @@ Similarly, training dataset has 160,297 images with: | Pedestrian | 706,786 | | Bike | 55,692 | -## Performance - ## Inputs Name: `input`, shape: [1x3x1024x1024] - An input image in the format [BxCxHxW], @@ -62,7 +60,7 @@ The net outputs blob with shape: [1, 1, N, 7], where N is the number of detected bounding boxes. Each detection has the format [`image_id`, `label`, `conf`, `x_min`, `y_min`, `x_max`, `y_max`], where: - `image_id` - ID of the image in the batch - - `label` - predicted class ID + - `label` - predicted class ID (1- person, 2 - vehicle, 3 - bike) - `conf` - confidence for the predicted class - (`x_min`, `y_min`) - coordinates of the top left bounding box corner - (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner. diff --git a/models/intel/person-vehicle-bike-detection-crossroad-0078/model.yml b/models/intel/person-vehicle-bike-detection-crossroad-0078/model.yml index 592220cbe29..832e13ff732 100644 --- a/models/intel/person-vehicle-bike-detection-crossroad-0078/model.yml +++ b/models/intel/person-vehicle-bike-detection-crossroad-0078/model.yml @@ -19,28 +19,28 @@ description: >- task_type: detection files: - name: FP32/person-vehicle-bike-detection-crossroad-0078.xml - size: 354904 - sha256: 1c5f14795c11d3154a5001a0ff10f5a8a44d0a06dca673b5bef2660fa1caaf73 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-crossroad-0078/FP32/person-vehicle-bike-detection-crossroad-0078.xml + size: 357661 + sha256: 6f63b0fc0a0cf6198924804e56b9aea42e38e6b6e7e015a7faceca39aae3e318 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-crossroad-0078/FP32/person-vehicle-bike-detection-crossroad-0078.xml - name: FP32/person-vehicle-bike-detection-crossroad-0078.bin size: 4713980 sha256: 178e05f0635b0ee35b577a9dd31ea6da2a2a842635793f1ad18907d00f3a966a - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-crossroad-0078/FP32/person-vehicle-bike-detection-crossroad-0078.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-crossroad-0078/FP32/person-vehicle-bike-detection-crossroad-0078.bin - name: FP16/person-vehicle-bike-detection-crossroad-0078.xml - size: 354729 - sha256: 05d6ffdf5d117b6409ee57fa165343a04b60faecf1c89da0e36ea393efeccc55 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-crossroad-0078/FP16/person-vehicle-bike-detection-crossroad-0078.xml + size: 357488 + sha256: 6de9b74fb6312e7eb6d5a82edfe7658694019c0bcf9da488d46228760d1bca77 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-crossroad-0078/FP16/person-vehicle-bike-detection-crossroad-0078.xml - name: FP16/person-vehicle-bike-detection-crossroad-0078.bin size: 2357042 sha256: a074ff0cad298ed9c35d0ce6ed58e09ee05216b907c97e6bb50f1b77a046bcfd - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-crossroad-0078/FP16/person-vehicle-bike-detection-crossroad-0078.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-crossroad-0078/FP16/person-vehicle-bike-detection-crossroad-0078.bin - name: FP16-INT8/person-vehicle-bike-detection-crossroad-0078.xml - size: 1007883 - sha256: 38abf600e479f7c3e0630d321e8d69ee2ac28014a5304abba4043be72311da97 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-crossroad-0078/FP16-INT8/person-vehicle-bike-detection-crossroad-0078.xml + size: 1093045 + sha256: d23c5533bdfd615cfe7df3db28e6674eec2f9cd9a6febedef86447f9e9f87e3a + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-crossroad-0078/FP16-INT8/person-vehicle-bike-detection-crossroad-0078.xml - name: FP16-INT8/person-vehicle-bike-detection-crossroad-0078.bin - size: 1228809 - sha256: faf5ead607a011f5b15fd77e885565215fff6b0600c234f28369d509bbfab673 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-crossroad-0078/FP16-INT8/person-vehicle-bike-detection-crossroad-0078.bin + size: 1228707 + sha256: 50c69b2139e947eb8c4cc4f4324148aff8f4f9a0e3c9af5541167efc014be0f5 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-crossroad-0078/FP16-INT8/person-vehicle-bike-detection-crossroad-0078.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-vehicle-bike-detection-crossroad-1016/description/person-vehicle-bike-detection-crossroad-1016.md b/models/intel/person-vehicle-bike-detection-crossroad-1016/description/person-vehicle-bike-detection-crossroad-1016.md index c305d81d149..e99839c57b8 100644 --- a/models/intel/person-vehicle-bike-detection-crossroad-1016/description/person-vehicle-bike-detection-crossroad-1016.md +++ b/models/intel/person-vehicle-bike-detection-crossroad-1016/description/person-vehicle-bike-detection-crossroad-1016.md @@ -42,8 +42,6 @@ Similarly, training dataset has 219,181 images with: | Pedestrian | 1,114,799 | | Non-vehicle | 62,334 | -## Performance - ## Inputs 1. name: "input.1" , shape: [1x3x512x512] - An input image in the format [BxCxHxW], diff --git a/models/intel/person-vehicle-bike-detection-crossroad-1016/model.yml b/models/intel/person-vehicle-bike-detection-crossroad-1016/model.yml index af4bca88a2c..edc16a9c385 100644 --- a/models/intel/person-vehicle-bike-detection-crossroad-1016/model.yml +++ b/models/intel/person-vehicle-bike-detection-crossroad-1016/model.yml @@ -18,28 +18,28 @@ description: >- task_type: detection files: - name: FP32/person-vehicle-bike-detection-crossroad-1016.xml - size: 213998 - sha256: 22f2b9b9409e65dc694181cde043bad2e075d742eb08782a7ea33bf7d4590332 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-crossroad-1016/FP32/person-vehicle-bike-detection-crossroad-1016.xml + size: 215398 + sha256: 871326bb6435df1f38b4c1808b74e4c6a77de22af50f5d66dacbb1d1a8f2da7b + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-crossroad-1016/FP32/person-vehicle-bike-detection-crossroad-1016.xml - name: FP32/person-vehicle-bike-detection-crossroad-1016.bin size: 11547984 sha256: 9fe2f12857921c8a3705ac586677c4a01bce8f6187086855615e067e9ee4f441 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-crossroad-1016/FP32/person-vehicle-bike-detection-crossroad-1016.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-crossroad-1016/FP32/person-vehicle-bike-detection-crossroad-1016.bin - name: FP16/person-vehicle-bike-detection-crossroad-1016.xml - size: 213885 - sha256: b3c3c2f45eb71aecbb6ee124f604702e6348c25a5a7d0fee91d355deff093f71 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-crossroad-1016/FP16/person-vehicle-bike-detection-crossroad-1016.xml + size: 215285 + sha256: 3c4141f3d3bf298327ef36cb26f4494a0a4a598f36b7bb48964913cff97c4eb9 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-crossroad-1016/FP16/person-vehicle-bike-detection-crossroad-1016.xml - name: FP16/person-vehicle-bike-detection-crossroad-1016.bin size: 5774034 sha256: fe54eff5ee188117b4c38a82b3a684e5699f0cfa09d1fafb7db351726b8d32b8 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-crossroad-1016/FP16/person-vehicle-bike-detection-crossroad-1016.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-crossroad-1016/FP16/person-vehicle-bike-detection-crossroad-1016.bin - name: FP16-INT8/person-vehicle-bike-detection-crossroad-1016.xml - size: 552185 - sha256: 9675e375824d3e721eab723c771d6530fc85c06ed49359dbe0ade81f7eceddb0 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-crossroad-1016/FP16-INT8/person-vehicle-bike-detection-crossroad-1016.xml + size: 553815 + sha256: e3bcc1710860ea947c31a896bebd8f83efc74efe9b2410f4f63db73a8046a28f + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-crossroad-1016/FP16-INT8/person-vehicle-bike-detection-crossroad-1016.xml - name: FP16-INT8/person-vehicle-bike-detection-crossroad-1016.bin size: 3024907 sha256: 4c81c6e53e309b945e79a3af2b18f384ab08b7799070e2b8414e5cf6145214b6 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-crossroad-1016/FP16-INT8/person-vehicle-bike-detection-crossroad-1016.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-crossroad-1016/FP16-INT8/person-vehicle-bike-detection-crossroad-1016.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/person-vehicle-bike-detection-crossroad-yolov3-1020/description/person-vehicle-bike-detection-crossroad-yolov3-1020.md b/models/intel/person-vehicle-bike-detection-crossroad-yolov3-1020/description/person-vehicle-bike-detection-crossroad-yolov3-1020.md index 0707c64582e..a0ff184e339 100644 --- a/models/intel/person-vehicle-bike-detection-crossroad-yolov3-1020/description/person-vehicle-bike-detection-crossroad-yolov3-1020.md +++ b/models/intel/person-vehicle-bike-detection-crossroad-yolov3-1020/description/person-vehicle-bike-detection-crossroad-yolov3-1020.md @@ -50,8 +50,6 @@ Similarly, training dataset has 17084 images with: | Pedestrian | 119546 | | Bike/Motorcycle | 30220 | -## Performance - ## Inputs Name: `image_input` , shape: [1x3x416x416] - An input image in the format [BxCxHxW], diff --git a/models/intel/person-vehicle-bike-detection-crossroad-yolov3-1020/model.yml b/models/intel/person-vehicle-bike-detection-crossroad-yolov3-1020/model.yml index fa69a9e123c..483c4720d42 100644 --- a/models/intel/person-vehicle-bike-detection-crossroad-yolov3-1020/model.yml +++ b/models/intel/person-vehicle-bike-detection-crossroad-yolov3-1020/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/person-vehicle-bike-detection-crossroad-yolov3-1020.xml - size: 239718 - sha256: 558fc2965857deb5ce2ab7e141a0561bfc611db9de3aadf69dd70c217c93bd41 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-crossroad-yolov3-1020/FP32/person-vehicle-bike-detection-crossroad-yolov3-1020.xml + size: 238843 + sha256: 693a178786414cba2e165acc760d6b6aa0d6c666760bf4a3887b56bdc8fa4a17 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-crossroad-yolov3-1020/FP32/person-vehicle-bike-detection-crossroad-yolov3-1020.xml - name: FP32/person-vehicle-bike-detection-crossroad-yolov3-1020.bin size: 247688372 sha256: 37501c68ed184a9cd0bff2e4a4a73d7420fe443e2c53a8cfab7c0374c57297cd - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-crossroad-yolov3-1020/FP32/person-vehicle-bike-detection-crossroad-yolov3-1020.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-crossroad-yolov3-1020/FP32/person-vehicle-bike-detection-crossroad-yolov3-1020.bin - name: FP16/person-vehicle-bike-detection-crossroad-yolov3-1020.xml - size: 239623 - sha256: e65e060070534080690782d65a451516122d8735783f68b133c776746d5e60a7 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-crossroad-yolov3-1020/FP16/person-vehicle-bike-detection-crossroad-yolov3-1020.xml + size: 238748 + sha256: 0683e9621d8775e8cfdd3370a4643161940e500ac233c81c25b7f38f1d730725 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-crossroad-yolov3-1020/FP16/person-vehicle-bike-detection-crossroad-yolov3-1020.xml - name: FP16/person-vehicle-bike-detection-crossroad-yolov3-1020.bin size: 123844212 sha256: 9625a2d5fcc80a4abeaafefaf670fbb3e32c34e98b8618f27b10dbe699a77028 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-crossroad-yolov3-1020/FP16/person-vehicle-bike-detection-crossroad-yolov3-1020.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-crossroad-yolov3-1020/FP16/person-vehicle-bike-detection-crossroad-yolov3-1020.bin - name: FP16-INT8/person-vehicle-bike-detection-crossroad-yolov3-1020.xml - size: 606744 - sha256: 134694600ec642b030f41c7f0b854f8d637bdd54e3cbb82da458345bc76c2eeb - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-crossroad-yolov3-1020/FP16-INT8/person-vehicle-bike-detection-crossroad-yolov3-1020.xml + size: 608364 + sha256: 4ae9d35c5c58dc62bb9fdae63c90bb7d94635eaa06d2189074a7f56bdb2e7b69 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-crossroad-yolov3-1020/FP16-INT8/person-vehicle-bike-detection-crossroad-yolov3-1020.xml - name: FP16-INT8/person-vehicle-bike-detection-crossroad-yolov3-1020.bin size: 62057600 sha256: fe45357b0ac98fd138bec6aff5b946a5061e68244fdf5954251045a98f2347fc - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/person-vehicle-bike-detection-crossroad-yolov3-1020/FP16-INT8/person-vehicle-bike-detection-crossroad-yolov3-1020.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/person-vehicle-bike-detection-crossroad-yolov3-1020/FP16-INT8/person-vehicle-bike-detection-crossroad-yolov3-1020.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/product-detection-0001/accuracy-check.yml b/models/intel/product-detection-0001/accuracy-check.yml index f0d76e86021..c3867228fbc 100644 --- a/models/intel/product-detection-0001/accuracy-check.yml +++ b/models/intel/product-detection-0001/accuracy-check.yml @@ -3,24 +3,6 @@ models: launchers: - framework: dlsdk - tags: - - FP32 - model: intel/product-detection-0001/FP32/product-detection-0001.xml - weights: intel/product-detection-0001/FP32/product-detection-0001.bin - adapter: ssd - - - framework: dlsdk - tags: - - FP16 - model: intel/product-detection-0001/FP16/product-detection-0001.xml - weights: intel/product-detection-0001/FP16/product-detection-0001.bin - adapter: ssd - - - framework: dlsdk - tags: - - FP16-INT8 - model: intel/product-detection-0001/FP16-INT8/product-detection-0001.xml - weights: intel/product-detection-0001/FP16-INT8/product-detection-0001.bin adapter: ssd datasets: diff --git a/models/intel/product-detection-0001/description/product-detection-0001.md b/models/intel/product-detection-0001/description/product-detection-0001.md index ab66dbc941e..77b27e30547 100644 --- a/models/intel/product-detection-0001/description/product-detection-0001.md +++ b/models/intel/product-detection-0001/description/product-detection-0001.md @@ -18,8 +18,6 @@ The network can detect 12 classes of objects (`sprite`, `kool-aid`, `extra`, `oc | MParams | 3.212 | | Source framework | PyTorch* | -## Performance - ## Inputs Name: `input`, shape: [1x3x512x512]. An input image in the format [BxCxHxW], diff --git a/models/intel/product-detection-0001/model.yml b/models/intel/product-detection-0001/model.yml index 5f257dff043..5f718cddba9 100644 --- a/models/intel/product-detection-0001/model.yml +++ b/models/intel/product-detection-0001/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/product-detection-0001.xml - size: 303195 - sha256: 313aa8437f102f07d2d78bcf29c1c350f7196603aaafebc35b8c2057f9974152 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/product-detection-0001/FP32/product-detection-0001.xml + size: 304868 + sha256: c85552b50d3b7d63dadd1e55b03da1cd6deeaa242cf617534dc96f905fba5dda + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/product-detection-0001/FP32/product-detection-0001.xml - name: FP32/product-detection-0001.bin size: 12850024 sha256: 49a49dfdbff2f7a794fcad60e872fa2e2b3f95c1f12e33fd49b975f3fa91439d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/product-detection-0001/FP32/product-detection-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/product-detection-0001/FP32/product-detection-0001.bin - name: FP16/product-detection-0001.xml - size: 303017 - sha256: df25fffb6d82ca13d73bcd152f5d4b4e921780f42835af02c9522f84868dc310 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/product-detection-0001/FP16/product-detection-0001.xml + size: 304690 + sha256: 0b18601e0b273d63dec77be4c0b1f700f577d1b2b7501e12c55850d89b5dd4a9 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/product-detection-0001/FP16/product-detection-0001.xml - name: FP16/product-detection-0001.bin size: 6425058 sha256: 4952708beb67fb5c8ea97f28358045a31d358af22dd0b82431d649b2ee4e0f95 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/product-detection-0001/FP16/product-detection-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/product-detection-0001/FP16/product-detection-0001.bin - name: FP16-INT8/product-detection-0001.xml - size: 735034 - sha256: 71e3ee488014f8b14428bed80eca7bb7094a22e4632db055a2313db37b4efa13 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/product-detection-0001/FP16-INT8/product-detection-0001.xml + size: 737069 + sha256: f60bb0bbfc5413d45f26f0861533d1237f95d303da46ade82436eb53b162bae9 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/product-detection-0001/FP16-INT8/product-detection-0001.xml - name: FP16-INT8/product-detection-0001.bin size: 3364177 sha256: 3cc212481465237d5be9bce5c081ee24774edf0006f919fc2caf5e8bbf7388ea - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/product-detection-0001/FP16-INT8/product-detection-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/product-detection-0001/FP16-INT8/product-detection-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/resnet18-xnor-binary-onnx-0001/description/resnet18-xnor-binary-onnx-0001.md b/models/intel/resnet18-xnor-binary-onnx-0001/description/resnet18-xnor-binary-onnx-0001.md index fae03f745d6..7a963aaac87 100644 --- a/models/intel/resnet18-xnor-binary-onnx-0001/description/resnet18-xnor-binary-onnx-0001.md +++ b/models/intel/resnet18-xnor-binary-onnx-0001/description/resnet18-xnor-binary-onnx-0001.md @@ -21,8 +21,6 @@ The quality metrics calculated on ImageNet validation dataset is 61.71% accuracy |---------------------------|---------------| | Accuracy top-1 (ImageNet) | 61.71% | -## Performance - ## Inputs A blob with a BGR image in the format: [B, C=3, H=224, W=224], where: diff --git a/models/intel/resnet18-xnor-binary-onnx-0001/model.yml b/models/intel/resnet18-xnor-binary-onnx-0001/model.yml index 4377049d9df..8ec2d363f38 100644 --- a/models/intel/resnet18-xnor-binary-onnx-0001/model.yml +++ b/models/intel/resnet18-xnor-binary-onnx-0001/model.yml @@ -17,20 +17,20 @@ description: >- task_type: classification files: - name: FP32-INT1/resnet18-xnor-binary-onnx-0001.xml - size: 97948 - sha256: aec764721a96d1acfbb2c6f145a167b1362147cf9bb917d9a4f7d1c27ac88935 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/resnet18-xnor-binary-onnx-0001/FP32-INT1/resnet18-xnor-binary-onnx-0001.xml + size: 98334 + sha256: f5d07c037c5ca2335baca26819849da4ccbbd0407e8233ba3645b8c901fc4fdd + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/resnet18-xnor-binary-onnx-0001/FP32-INT1/resnet18-xnor-binary-onnx-0001.xml - name: FP32-INT1/resnet18-xnor-binary-onnx-0001.bin size: 4190948 sha256: e7f808e2cf493194eece7792bf362a9623ba8f8e66f44c8bd3c460826de03d83 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/resnet18-xnor-binary-onnx-0001/FP32-INT1/resnet18-xnor-binary-onnx-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/resnet18-xnor-binary-onnx-0001/FP32-INT1/resnet18-xnor-binary-onnx-0001.bin - name: FP16-INT1/resnet18-xnor-binary-onnx-0001.xml - size: 97922 - sha256: 039f5c4fdd6f490d24c9fad2ad2c6d4c61e5301d4fa88545e5a9e86628778afe - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/resnet18-xnor-binary-onnx-0001/FP16-INT1/resnet18-xnor-binary-onnx-0001.xml + size: 98308 + sha256: 105e0691c4f3b1c98462ea8b540f50d1cf9582065207ec78d55572fa9aaef846 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/resnet18-xnor-binary-onnx-0001/FP16-INT1/resnet18-xnor-binary-onnx-0001.xml - name: FP16-INT1/resnet18-xnor-binary-onnx-0001.bin size: 2782084 sha256: 031e74abeddc9330a052d7b6719bec8d620263c5dd37f15f51fc9883726874ef - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/resnet18-xnor-binary-onnx-0001/FP16-INT1/resnet18-xnor-binary-onnx-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/resnet18-xnor-binary-onnx-0001/FP16-INT1/resnet18-xnor-binary-onnx-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/resnet50-binary-0001/description/resnet50-binary-0001.md b/models/intel/resnet50-binary-0001/description/resnet50-binary-0001.md index 46436def805..4ef094cd089 100644 --- a/models/intel/resnet50-binary-0001/description/resnet50-binary-0001.md +++ b/models/intel/resnet50-binary-0001/description/resnet50-binary-0001.md @@ -23,8 +23,6 @@ The quality metrics calculated on ImageNet validation dataset is 70.69% accuracy |---------------------------|---------------| | Accuracy top-1 (ImageNet) | 70.69% | -## Performance - ## Inputs A blob with a BGR image in the format: [B, C=3, H=224, W=224], where: diff --git a/models/intel/resnet50-binary-0001/model.yml b/models/intel/resnet50-binary-0001/model.yml index 05555f18879..1705a188226 100644 --- a/models/intel/resnet50-binary-0001/model.yml +++ b/models/intel/resnet50-binary-0001/model.yml @@ -17,20 +17,20 @@ description: >- task_type: classification files: - name: FP32-INT1/resnet50-binary-0001.xml - size: 231891 - sha256: 2fd440a25995c9c0357fe3632dbb7891bedffa03ca5ce69c5aff3883cdd4b673 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/resnet50-binary-0001/FP32-INT1/resnet50-binary-0001.xml + size: 232680 + sha256: 20bb30339b0913904bd9398e52efb344a66715b4ecfe75bf069c55900b60d9f9 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/resnet50-binary-0001/FP32-INT1/resnet50-binary-0001.xml - name: FP32-INT1/resnet50-binary-0001.bin size: 22112984 sha256: e1b2cd17644699369284e7a0c6113b0ae1d6411ddca6ceba2423a4cbe139072c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/resnet50-binary-0001/FP32-INT1/resnet50-binary-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/resnet50-binary-0001/FP32-INT1/resnet50-binary-0001.bin - name: FP16-INT1/resnet50-binary-0001.xml - size: 231792 - sha256: c820860b29c43ed5df43d6ab2273c80777ad92968b9557d500ff51b4cf6446a7 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/resnet50-binary-0001/FP16-INT1/resnet50-binary-0001.xml + size: 232581 + sha256: 15533a8781e8162158559a80068cc548fc469a1a5c34baf36324a8088c20ebcc + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/resnet50-binary-0001/FP16-INT1/resnet50-binary-0001.xml - name: FP16-INT1/resnet50-binary-0001.bin size: 12348792 sha256: fcc76148a770e81bfbb3c2af30397ee54a52532bdbc97c3bd5a29e9f7836ba58 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/resnet50-binary-0001/FP16-INT1/resnet50-binary-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/resnet50-binary-0001/FP16-INT1/resnet50-binary-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/road-segmentation-adas-0001/description/road-segmentation-adas-0001.md b/models/intel/road-segmentation-adas-0001/description/road-segmentation-adas-0001.md index c3e8e8ee8c2..9e72a8a130a 100644 --- a/models/intel/road-segmentation-adas-0001/description/road-segmentation-adas-0001.md +++ b/models/intel/road-segmentation-adas-0001/description/road-segmentation-adas-0001.md @@ -36,8 +36,6 @@ that was converted for four class classification task are: - `FP` - number of false positive pixels for given class - `GT` - number of ground truth pixels for given class -## Performance - ## Inputs A blob with a BGR image in the format: [B, C=3, H=512, W=896], where: diff --git a/models/intel/road-segmentation-adas-0001/model.yml b/models/intel/road-segmentation-adas-0001/model.yml index 498bab7a860..4d390837bae 100644 --- a/models/intel/road-segmentation-adas-0001/model.yml +++ b/models/intel/road-segmentation-adas-0001/model.yml @@ -18,28 +18,28 @@ description: >- task_type: semantic_segmentation files: - name: FP32/road-segmentation-adas-0001.xml - size: 373152 - sha256: a881ce1541e4f4caf2f15af0d294284928f0fbad4c9f35adef3fe6082a2ce6ad - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/road-segmentation-adas-0001/FP32/road-segmentation-adas-0001.xml + size: 375958 + sha256: f6d70a3428be36cd02964f48bdbee381dbf1eee78d11f9f1652e0d02133d4182 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/road-segmentation-adas-0001/FP32/road-segmentation-adas-0001.xml - name: FP32/road-segmentation-adas-0001.bin size: 737168 sha256: 8c70f026c4e340a191a9a02c1b4c55aea112f1e35965362b1a87a8b949cb6e51 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/road-segmentation-adas-0001/FP32/road-segmentation-adas-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/road-segmentation-adas-0001/FP32/road-segmentation-adas-0001.bin - name: FP16/road-segmentation-adas-0001.xml - size: 372997 - sha256: 51d457ec677cb921c1003f6447671fdfba5acec5df6ecc0a236b613062ea852f - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/road-segmentation-adas-0001/FP16/road-segmentation-adas-0001.xml + size: 375803 + sha256: 381fc74084a8c2ab7eed4d50459b74537f4b3ddf9e5b00adcaf8ae0068fe6c06 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/road-segmentation-adas-0001/FP16/road-segmentation-adas-0001.xml - name: FP16/road-segmentation-adas-0001.bin size: 368600 sha256: 2a1d09b6aab18e145f14d92f5f425af92ad5338a04b0670205759d8c5b075111 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/road-segmentation-adas-0001/FP16/road-segmentation-adas-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/road-segmentation-adas-0001/FP16/road-segmentation-adas-0001.bin - name: FP16-INT8/road-segmentation-adas-0001.xml - size: 1130522 - sha256: 1aa7dfa5d39b0d0bb59f78d367864a92bf652732af7c8017a27785cee72a942c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/road-segmentation-adas-0001/FP16-INT8/road-segmentation-adas-0001.xml + size: 1133364 + sha256: c23a637834aa128e701808c5a6ec04d76bcab970a3b165bfd3aa5c31b8bd4053 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/road-segmentation-adas-0001/FP16-INT8/road-segmentation-adas-0001.xml - name: FP16-INT8/road-segmentation-adas-0001.bin size: 212270 sha256: 6409e3d7f83b67cccaebef50c4932c43f30aac2f6bc5a5167539e35c610166ef - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/road-segmentation-adas-0001/FP16-INT8/road-segmentation-adas-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/road-segmentation-adas-0001/FP16-INT8/road-segmentation-adas-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/semantic-segmentation-adas-0001/description/semantic-segmentation-adas-0001.md b/models/intel/semantic-segmentation-adas-0001/description/semantic-segmentation-adas-0001.md index 5c4df0bb481..0b6f3bbe85b 100644 --- a/models/intel/semantic-segmentation-adas-0001/description/semantic-segmentation-adas-0001.md +++ b/models/intel/semantic-segmentation-adas-0001/description/semantic-segmentation-adas-0001.md @@ -70,8 +70,6 @@ The quality metrics calculated on 2000 images: - `FN` - number of false negative pixels for given class - `FP` - number of false positive pixels for given class -## Performance - ## Inputs The blob with BGR image in format: [B, C=3, H=1024, W=2048], where: diff --git a/models/intel/semantic-segmentation-adas-0001/model.yml b/models/intel/semantic-segmentation-adas-0001/model.yml index db290508b4b..894cc0d9c94 100644 --- a/models/intel/semantic-segmentation-adas-0001/model.yml +++ b/models/intel/semantic-segmentation-adas-0001/model.yml @@ -19,28 +19,28 @@ description: >- task_type: semantic_segmentation files: - name: FP32/semantic-segmentation-adas-0001.xml - size: 195016 - sha256: 2688d0b9aa6475af5d71da613e729bfdbda1c2ece680a44fbec26533c2651807 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/semantic-segmentation-adas-0001/FP32/semantic-segmentation-adas-0001.xml + size: 196345 + sha256: 6453d8bd27ac7ae7ba523c1ca2ddd11192f052ff25bbfa6bb76779700805e3b2 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/semantic-segmentation-adas-0001/FP32/semantic-segmentation-adas-0001.xml - name: FP32/semantic-segmentation-adas-0001.bin size: 26743532 sha256: 62e92c031789e6f24ddcca7a5177635144058ec93c3cd52d09b434ec46377008 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/semantic-segmentation-adas-0001/FP32/semantic-segmentation-adas-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/semantic-segmentation-adas-0001/FP32/semantic-segmentation-adas-0001.bin - name: FP16/semantic-segmentation-adas-0001.xml - size: 194935 - sha256: 6373b63d658638e625db508d0aff9c78ef7d2cd3ac49843ab83377d1bdd779b3 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/semantic-segmentation-adas-0001/FP16/semantic-segmentation-adas-0001.xml + size: 196264 + sha256: 17aeaee87f8889643225ae6b4544b0ce5aac7e25ff8fe9b1e10cfa76461f7888 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/semantic-segmentation-adas-0001/FP16/semantic-segmentation-adas-0001.xml - name: FP16/semantic-segmentation-adas-0001.bin size: 13371792 sha256: 3c161dbba54e5636fa995889d051f09cadd54768f1fd3e552d17d07a7625ff17 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/semantic-segmentation-adas-0001/FP16/semantic-segmentation-adas-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/semantic-segmentation-adas-0001/FP16/semantic-segmentation-adas-0001.bin - name: FP16-INT8/semantic-segmentation-adas-0001.xml - size: 540503 - sha256: f9f4ffb4293a2f95b76ac36d9f622d94dc5c4e6424b94cb3644999de68ae7dca - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/semantic-segmentation-adas-0001/FP16-INT8/semantic-segmentation-adas-0001.xml + size: 541868 + sha256: 5ced07e0ac057d48bbef7f92d91612cf9891e3f40b044eb2632838a1e107e9bf + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/semantic-segmentation-adas-0001/FP16-INT8/semantic-segmentation-adas-0001.xml - name: FP16-INT8/semantic-segmentation-adas-0001.bin size: 6757652 sha256: 0f542e8c8bbcc5fd7c32bbfab230a54d5a6dc75aefbb381e3835c6e44011dcc3 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/semantic-segmentation-adas-0001/FP16-INT8/semantic-segmentation-adas-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/semantic-segmentation-adas-0001/FP16-INT8/semantic-segmentation-adas-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/single-image-super-resolution-1032/description/single-image-super-resolution-1032.md b/models/intel/single-image-super-resolution-1032/description/single-image-super-resolution-1032.md index 26ea71c6c74..eb9606eb9b2 100644 --- a/models/intel/single-image-super-resolution-1032/description/single-image-super-resolution-1032.md +++ b/models/intel/single-image-super-resolution-1032/description/single-image-super-resolution-1032.md @@ -30,8 +30,6 @@ Super resolution: For reference, PSNR for bicubic upsampling on test dataset is 26.79 dB. -## Performance - ## Inputs 1. name: "0" , shape: [1x3x270x480] - An input image in the format [BxCxHxW], diff --git a/models/intel/single-image-super-resolution-1032/model.yml b/models/intel/single-image-super-resolution-1032/model.yml index 4e1e8cece0e..069ec361f5e 100644 --- a/models/intel/single-image-super-resolution-1032/model.yml +++ b/models/intel/single-image-super-resolution-1032/model.yml @@ -17,28 +17,28 @@ description: >- task_type: image_processing files: - name: FP32/single-image-super-resolution-1032.xml - size: 77781 - sha256: dec128010f885637da35608e48295ff157cb1890bf6a2c3396b7113fefccc0e6 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/single-image-super-resolution-1032/FP32/single-image-super-resolution-1032.xml + size: 77646 + sha256: ecfa7449bce7d04da9b59b46b66ccaa8fa367b415469f52e643f9d1e05e0fdf0 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/single-image-super-resolution-1032/FP32/single-image-super-resolution-1032.xml - name: FP32/single-image-super-resolution-1032.bin size: 119436 sha256: d09c215077e7a95d15636c79d006039ffaacfaf1889ea07668cbf21120295287 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/single-image-super-resolution-1032/FP32/single-image-super-resolution-1032.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/single-image-super-resolution-1032/FP32/single-image-super-resolution-1032.bin - name: FP16/single-image-super-resolution-1032.xml - size: 77704 - sha256: d1c2fce6b1e2842fd7861894ceba07fabffc1696855ed8e183f6db03f159cf0e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/single-image-super-resolution-1032/FP16/single-image-super-resolution-1032.xml + size: 77569 + sha256: 9e15d4a7bbddb080d874bb41218fbf39aa7a4c0828274dfa3bb425929ecdcd45 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/single-image-super-resolution-1032/FP16/single-image-super-resolution-1032.xml - name: FP16/single-image-super-resolution-1032.bin size: 59762 sha256: a52a4549011480d90246bbe6118718ee485c130480bbf5f7befdb3d5a2a1f057 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/single-image-super-resolution-1032/FP16/single-image-super-resolution-1032.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/single-image-super-resolution-1032/FP16/single-image-super-resolution-1032.bin - name: FP16-INT8/single-image-super-resolution-1032.xml - size: 172956 - sha256: 46d3024a38a3c2c488ddc74f2bda86b6f9f5858a0956a7157db0fd7b9de4b95c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/single-image-super-resolution-1032/FP16-INT8/single-image-super-resolution-1032.xml + size: 173174 + sha256: 958cbb09e0c5074175761fed47623948a77af618116d3b77909db32f00a0dc81 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/single-image-super-resolution-1032/FP16-INT8/single-image-super-resolution-1032.xml - name: FP16-INT8/single-image-super-resolution-1032.bin size: 31049 sha256: 2a9acb9db263965cc74e2f881b0d3650e9691cf31510ec300145171efc47336a - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/single-image-super-resolution-1032/FP16-INT8/single-image-super-resolution-1032.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/single-image-super-resolution-1032/FP16-INT8/single-image-super-resolution-1032.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/single-image-super-resolution-1033/description/single-image-super-resolution-1033.md b/models/intel/single-image-super-resolution-1033/description/single-image-super-resolution-1033.md index a1474279ff0..1e48ed849ae 100644 --- a/models/intel/single-image-super-resolution-1033/description/single-image-super-resolution-1033.md +++ b/models/intel/single-image-super-resolution-1033/description/single-image-super-resolution-1033.md @@ -30,8 +30,6 @@ Super resolution: For reference, PSNR for bicubic upsampling on test dataset is 28.48 dB. -## Performance - ## Inputs 1. name: "0" , shape: [1x3x360x640] - An input image in the format [BxCxHxW], diff --git a/models/intel/single-image-super-resolution-1033/model.yml b/models/intel/single-image-super-resolution-1033/model.yml index 599131cb94d..9eb6fcf0d06 100644 --- a/models/intel/single-image-super-resolution-1033/model.yml +++ b/models/intel/single-image-super-resolution-1033/model.yml @@ -17,28 +17,28 @@ description: >- task_type: image_processing files: - name: FP32/single-image-super-resolution-1033.xml - size: 54456 - sha256: 2cca685169a40abffbafe910b6644839c011aa1722f1bcc99c67fcfab259a6a5 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/single-image-super-resolution-1033/FP32/single-image-super-resolution-1033.xml + size: 54320 + sha256: 406459c64ec6c8d6593af98d9af37981f377bb8637eed97f14729bd9cd1e3b55 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/single-image-super-resolution-1033/FP32/single-image-super-resolution-1033.xml - name: FP32/single-image-super-resolution-1033.bin size: 121780 sha256: ba6247c93395bc0649986f28dec0c745d543afcf667c732877b712e05564fb16 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/single-image-super-resolution-1033/FP32/single-image-super-resolution-1033.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/single-image-super-resolution-1033/FP32/single-image-super-resolution-1033.bin - name: FP16/single-image-super-resolution-1033.xml - size: 54413 - sha256: c7771eaef226009a1c7958939e8690593154e731acaa6a5a9f7afe0e700db6b0 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/single-image-super-resolution-1033/FP16/single-image-super-resolution-1033.xml + size: 54277 + sha256: 9bb075eea4e1a86bfe402d4599875a98d304e1157ee1c000ccd69ff9ecc8f5bb + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/single-image-super-resolution-1033/FP16/single-image-super-resolution-1033.xml - name: FP16/single-image-super-resolution-1033.bin size: 60938 sha256: 9a9d5a8cbd9520e4c282600feea95b31228d7de9716e8807acb53c572bd9cd31 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/single-image-super-resolution-1033/FP16/single-image-super-resolution-1033.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/single-image-super-resolution-1033/FP16/single-image-super-resolution-1033.bin - name: FP16-INT8/single-image-super-resolution-1033.xml - size: 145127 - sha256: de88a76c69a91b28f0d7195dc66a9ad87759326c351915405189a6a0f8d24713 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/single-image-super-resolution-1033/FP16-INT8/single-image-super-resolution-1033.xml + size: 145322 + sha256: c07ed5de0dab6d76d86e5429353259aa1dd2fb591cdfb7ce85c5bc3df8d76ba7 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/single-image-super-resolution-1033/FP16-INT8/single-image-super-resolution-1033.xml - name: FP16-INT8/single-image-super-resolution-1033.bin size: 31679 sha256: e6dd3179f37ef32d6039907bf0e9cb37b12fec6a027024ee0c9b5b7f9d60cc07 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/single-image-super-resolution-1033/FP16-INT8/single-image-super-resolution-1033.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/single-image-super-resolution-1033/FP16-INT8/single-image-super-resolution-1033.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/text-detection-0003/description/text-detection-0003.md b/models/intel/text-detection-0003/description/text-detection-0003.md index 12062745b80..15deee6a978 100644 --- a/models/intel/text-detection-0003/description/text-detection-0003.md +++ b/models/intel/text-detection-0003/description/text-detection-0003.md @@ -17,8 +17,6 @@ Text detector based on [PixelLink](https://arxiv.org/abs/1801.01315) architectur | MParams | 6.747 | | Source framework | TensorFlow | -## Performance - ## Inputs Name: `input`, shape: [1x3x768x1280] - An input image in the format [BxCxHxW], diff --git a/models/intel/text-detection-0003/model.yml b/models/intel/text-detection-0003/model.yml index d2d3c7e7184..e49473ed5a6 100644 --- a/models/intel/text-detection-0003/model.yml +++ b/models/intel/text-detection-0003/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/text-detection-0003.xml - size: 203899 - sha256: 06ee56c9078ef6d1c5c0940a26fc45c8fadfd8027cdb19399e266f45e298d119 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-detection-0003/FP32/text-detection-0003.xml + size: 203625 + sha256: ecc6f9a02428db051227a26dbae1fc283014f0ff8dfd5def22083aed385901da + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-detection-0003/FP32/text-detection-0003.xml - name: FP32/text-detection-0003.bin size: 26986280 sha256: 1e2d51382f34750d5c878195e2fdac3207c3de58e74ad56ea624ed9ed2e3efb8 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-detection-0003/FP32/text-detection-0003.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-detection-0003/FP32/text-detection-0003.bin - name: FP16/text-detection-0003.xml - size: 203819 - sha256: e6f7b6a5f3f8ab17bbf7cdffcd99f7e5ac3a7d8efe3fc29d590b471ccfc4323c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-detection-0003/FP16/text-detection-0003.xml + size: 203545 + sha256: ad79a4f056952325f01d2a8117abd0e62b834640875ff1cda62f7c76f80f2f91 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-detection-0003/FP16/text-detection-0003.xml - name: FP16/text-detection-0003.bin size: 13493056 sha256: 30b6597325c90bdb48abd7873f71fb1d56f8233ff9d53305d177c2b9546b59a8 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-detection-0003/FP16/text-detection-0003.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-detection-0003/FP16/text-detection-0003.bin - name: FP16-INT8/text-detection-0003.xml - size: 630066 - sha256: fc79f44f85865427ba452d422c89b68fcd32e8fe6bad459404321a4acc593cd3 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-detection-0003/FP16-INT8/text-detection-0003.xml + size: 631284 + sha256: e797e70a7af9e771073c47ac7ea63f86d722c6dd6ce3a7b4cf56e09ab193e9b3 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-detection-0003/FP16-INT8/text-detection-0003.xml - name: FP16-INT8/text-detection-0003.bin size: 6894798 sha256: 731ef9e22ff6f4905cac6720eef882a594564bf87e5698aeb99f3ea88b5c3666 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-detection-0003/FP16-INT8/text-detection-0003.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-detection-0003/FP16-INT8/text-detection-0003.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/text-detection-0004/description/text-detection-0004.md b/models/intel/text-detection-0004/description/text-detection-0004.md index 173a857a08a..9d1e7c62dde 100644 --- a/models/intel/text-detection-0004/description/text-detection-0004.md +++ b/models/intel/text-detection-0004/description/text-detection-0004.md @@ -17,8 +17,6 @@ Text detector based on [PixelLink](https://arxiv.org/abs/1801.01315) architectur | MParams | 4.328 | | Source framework | TensorFlow | -## Performance - ## Inputs Name: `input`, shape: [1x3x768x1280] - An input image in the format [BxCxHxW], diff --git a/models/intel/text-detection-0004/model.yml b/models/intel/text-detection-0004/model.yml index 0fc6b5a0297..6e13a42a3f9 100644 --- a/models/intel/text-detection-0004/model.yml +++ b/models/intel/text-detection-0004/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/text-detection-0004.xml - size: 183664 - sha256: eda21e2713115c7467b46488dd0c13139e3232c9eff82ad6e95f8e77bef81f18 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-detection-0004/FP32/text-detection-0004.xml + size: 183954 + sha256: cbcfd6bc16ba14d1bb56629fbc73294181f0363dfd5967298ce44e545e6d2675 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-detection-0004/FP32/text-detection-0004.xml - name: FP32/text-detection-0004.bin - size: 17312168 - sha256: 6da328c7675c2d1568cbb50b2c1643c8ba6194461b01b3461216c77e1258c7d5 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-detection-0004/FP32/text-detection-0004.bin + size: 17312160 + sha256: 497443f67044c9b446ad0f34ccfbdca3c0d3df3c32c83ae9d1bb6539da81b608 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-detection-0004/FP32/text-detection-0004.bin - name: FP16/text-detection-0004.xml - size: 183533 - sha256: 7a5d2658b1e91859dfed2b8e06624f01ee2586605dd6d79b5ff769ebe640304c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-detection-0004/FP16/text-detection-0004.xml + size: 183824 + sha256: 06d2f269954c653a8106de4036caf48306faea6f6a1928a845e8c8c22dab3c05 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-detection-0004/FP16/text-detection-0004.xml - name: FP16/text-detection-0004.bin - size: 8656000 - sha256: 54f0a45a2b0903c59ebb4a68ceadac3037ac137bec7677dae1a5089dd164b40c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-detection-0004/FP16/text-detection-0004.bin + size: 8655996 + sha256: 602201e8169858a9b1e9d2a7859e376829882af5c62aff14613d110d45380210 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-detection-0004/FP16/text-detection-0004.bin - name: FP16-INT8/text-detection-0004.xml - size: 512433 - sha256: 950c5ef9aa440715eba9ec616890f7e0e8a12f012d9f98bf6e8c0ff2681e136c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-detection-0004/FP16-INT8/text-detection-0004.xml + size: 513627 + sha256: c4cab5f740ad87891d23005e523224648a5a35011236e76ea1c5f832ae2b6318 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-detection-0004/FP16-INT8/text-detection-0004.xml - name: FP16-INT8/text-detection-0004.bin - size: 4475516 - sha256: 78d156a6bb35bf45aae14334d645586416dbfbb3d23ce41a6c6711100944712e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-detection-0004/FP16-INT8/text-detection-0004.bin + size: 4475512 + sha256: 4a3a804ecbc42ce87b37e31dd1f0e4300ab70d65ec3fada8b14391dac3859ee5 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-detection-0004/FP16-INT8/text-detection-0004.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/text-image-super-resolution-0001/description/text-image-super-resolution-0001.md b/models/intel/text-image-super-resolution-0001/description/text-image-super-resolution-0001.md index 57c5918fdc9..404de24355c 100644 --- a/models/intel/text-image-super-resolution-0001/description/text-image-super-resolution-0001.md +++ b/models/intel/text-image-super-resolution-0001/description/text-image-super-resolution-0001.md @@ -31,8 +31,6 @@ support the `reshape` function. | Source framework | PyTorch\* | -## Performance - ## Inputs 1. name: `0`, shape: [1x1x360x640] - An input image in the format [BxCxHxW], diff --git a/models/intel/text-image-super-resolution-0001/model.yml b/models/intel/text-image-super-resolution-0001/model.yml index 2cffb280823..9c094ec0ee7 100644 --- a/models/intel/text-image-super-resolution-0001/model.yml +++ b/models/intel/text-image-super-resolution-0001/model.yml @@ -17,28 +17,28 @@ description: >- task_type: image_processing files: - name: FP32/text-image-super-resolution-0001.xml - size: 11187 - sha256: ff5cb6c719b2798addb0b3a43ed72f6d1c02c88b21ededea2539e72d3e0d0966 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-image-super-resolution-0001/FP32/text-image-super-resolution-0001.xml + size: 11202 + sha256: 1e13e412fafab39b3a8824573d11a496fa20271879e7fb994c8d62a8ee260c8f + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-image-super-resolution-0001/FP32/text-image-super-resolution-0001.xml - name: FP32/text-image-super-resolution-0001.bin size: 10836 sha256: b9405f0bce254c61f0487b0fa53c89621dc440cbc560c7dc92506900b62d6af5 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-image-super-resolution-0001/FP32/text-image-super-resolution-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-image-super-resolution-0001/FP32/text-image-super-resolution-0001.bin - name: FP16/text-image-super-resolution-0001.xml - size: 11177 - sha256: ebcc815a463d207579e44d27a1eca875c0e5b00ab48ac72b6bc7e76067f8c48c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-image-super-resolution-0001/FP16/text-image-super-resolution-0001.xml + size: 11192 + sha256: c680c30a6e546c7cd66b30e2a503f072fe90a99c983c54254ab751cea886814a + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-image-super-resolution-0001/FP16/text-image-super-resolution-0001.xml - name: FP16/text-image-super-resolution-0001.bin size: 5418 sha256: f203818d73b933e5004aff85aeb84783dbf0be9e5c296d2995fc0678ff719e9c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-image-super-resolution-0001/FP16/text-image-super-resolution-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-image-super-resolution-0001/FP16/text-image-super-resolution-0001.bin - name: FP16-INT8/text-image-super-resolution-0001.xml - size: 25380 - sha256: 1a46337e08547e47447253dfb458ae1dda0d389f5adbff3056d3869691189e73 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-image-super-resolution-0001/FP16-INT8/text-image-super-resolution-0001.xml + size: 25466 + sha256: ef58e266d75b392f406ea6a47f9a82d19786568cfaecbb26a94d2ac698a285d6 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-image-super-resolution-0001/FP16-INT8/text-image-super-resolution-0001.xml - name: FP16-INT8/text-image-super-resolution-0001.bin size: 4224 sha256: 8c1ec28bb810a0ad4de8d9c4d2c37939cfe1a64bbb36d4a9379815c154f8339f - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-image-super-resolution-0001/FP16-INT8/text-image-super-resolution-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-image-super-resolution-0001/FP16-INT8/text-image-super-resolution-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/text-recognition-0012/description/text-recognition-0012.md b/models/intel/text-recognition-0012/description/text-recognition-0012.md index 4a458fea79d..a604727dcd9 100644 --- a/models/intel/text-recognition-0012/description/text-recognition-0012.md +++ b/models/intel/text-recognition-0012/description/text-recognition-0012.md @@ -19,8 +19,6 @@ The network is able to recognize case-insensitive alphanumeric text (36 unique s | MParams | 5.568 | | Source framework | TensorFlow | -## Performance - ## Inputs Shape: [1x1x32x120] - An input image in the format [BxCxHxW], diff --git a/models/intel/text-recognition-0012/model.yml b/models/intel/text-recognition-0012/model.yml index c2ef9f5680b..9266bb61381 100644 --- a/models/intel/text-recognition-0012/model.yml +++ b/models/intel/text-recognition-0012/model.yml @@ -18,28 +18,28 @@ description: >- task_type: optical_character_recognition files: - name: FP32/text-recognition-0012.xml - size: 100082 - sha256: e9b1c28e6d346ba8c4af91fe419ef99553eb3f39ee1bd8723f5e1cd1e6c6d7c5 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-recognition-0012/FP32/text-recognition-0012.xml + size: 100100 + sha256: 0e073d693a384640fff41dc57d989360082f9b771f26c35a3090616ebc7a9017 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-recognition-0012/FP32/text-recognition-0012.xml - name: FP32/text-recognition-0012.bin size: 47470856 sha256: 5db1a62db744123f969cacb729f5ec3819502d8c092dc5d7a2354a675361fc75 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-recognition-0012/FP32/text-recognition-0012.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-recognition-0012/FP32/text-recognition-0012.bin - name: FP16/text-recognition-0012.xml - size: 100050 - sha256: dd6cea131c30689b6b355c963e46f1ad0c8feef5819873988a39e8ade2ca9d30 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-recognition-0012/FP16/text-recognition-0012.xml + size: 100068 + sha256: b5f49a62b651c93a23ea6d63d488ad168029ea84cbf5d4fd34ab0371e7f0346e + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-recognition-0012/FP16/text-recognition-0012.xml - name: FP16/text-recognition-0012.bin size: 23735482 sha256: d70cb3a39ef72c44f52e400a39bd3cd66f64a69c31e0d95d3b21b376c73410c6 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-recognition-0012/FP16/text-recognition-0012.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-recognition-0012/FP16/text-recognition-0012.bin - name: FP16-INT8/text-recognition-0012.xml - size: 138461 - sha256: ab93119dbcbae46199b7e653651838a2e5feda5324c0d69b132443266c8c4453 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-recognition-0012/FP16-INT8/text-recognition-0012.xml + size: 138678 + sha256: fa4e73143cfdf9c0413439ab2c406808ca1abd3f0b98dfcd5eba8ee6350f302e + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-recognition-0012/FP16-INT8/text-recognition-0012.xml - name: FP16-INT8/text-recognition-0012.bin size: 18217002 - sha256: 0b2ad004e7a54e39020faa41ae9c2f06f291a1d25cea26245e476aec3192ae58 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-recognition-0012/FP16-INT8/text-recognition-0012.bin + sha256: 0f872d6dcb1b4f16ab1456522cc6460719e783a1f3227757a35f6fda76d1c56c + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-recognition-0012/FP16-INT8/text-recognition-0012.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/text-spotting-0002/text-spotting-0002-detector/model.yml b/models/intel/text-spotting-0002/text-spotting-0002-detector/model.yml deleted file mode 100644 index ecc793673c8..00000000000 --- a/models/intel/text-spotting-0002/text-spotting-0002-detector/model.yml +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -description: >- - Mask R-CNN-based text detector. -task_type: detection -files: - - name: FP32/text-spotting-0002-detector.xml - size: 310312 - sha256: 1d2048f2edbe2c1a7760f33eda3586410251e0aa988097116af35d56879a793c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-spotting-0002/text-spotting-0002-detector/FP32/text-spotting-0002-detector.xml - - name: FP32/text-spotting-0002-detector.bin - size: 105907024 - sha256: 8150f4ff1f93d286bca4b2683bc779f645961b344b1fd2eed6ea0a5bb78dda4e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-spotting-0002/text-spotting-0002-detector/FP32/text-spotting-0002-detector.bin - - name: FP16/text-spotting-0002-detector.xml - size: 310191 - sha256: cd4306c0db3d99e53867f9dd7c5bc38e6cd84af2768eddeb84b1bd9491ae5e5d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-spotting-0002/text-spotting-0002-detector/FP16/text-spotting-0002-detector.xml - - name: FP16/text-spotting-0002-detector.bin - size: 52953614 - sha256: 18d9d9a074f5bebbbf80890543917437b48b0ecc74673c9aefa9c3b3d92c29f7 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-spotting-0002/text-spotting-0002-detector/FP16/text-spotting-0002-detector.bin - - name: FP16-INT8/text-spotting-0002-detector.xml - size: 741907 - sha256: 8e6dd53011f4c966da5a79f2f9b3bc538fa445bee7ac9502ceb0b28d929932f3 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-spotting-0002/text-spotting-0002-detector/FP16-INT8/text-spotting-0002-detector.xml - - name: FP16-INT8/text-spotting-0002-detector.bin - size: 26678244 - sha256: b2d123e0796e9fa5e8fe5abb7e5c867adc7b1420738ac84a125bf3fb0e3d7b2c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-spotting-0002/text-spotting-0002-detector/FP16-INT8/text-spotting-0002-detector.bin -framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE diff --git a/models/intel/text-spotting-0002/text-spotting-0002-recognizer-decoder/model.yml b/models/intel/text-spotting-0002/text-spotting-0002-recognizer-decoder/model.yml deleted file mode 100644 index 81195cccb73..00000000000 --- a/models/intel/text-spotting-0002/text-spotting-0002-recognizer-decoder/model.yml +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -description: >- - Decoder part of text recognition head that takes encoder features from text-spotting-0002-text-recognizer-encoder - as input. -task_type: optical_character_recognition -files: - - name: FP32/text-spotting-0002-recognizer-decoder.xml - size: 48241 - sha256: 4fda00a7e8525a3e03182396d095e7ecf91ba9081c79a3d18bc6967862dd7830 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-spotting-0002/text-spotting-0002-recognizer-decoder/FP32/text-spotting-0002-recognizer-decoder.xml - - name: FP32/text-spotting-0002-recognizer-decoder.bin - size: 2707708 - sha256: cb58bb4bcc06b90c779c3581cf17fc3448e8174eb127d33ee615d9a17126ebe1 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-spotting-0002/text-spotting-0002-recognizer-decoder/FP32/text-spotting-0002-recognizer-decoder.bin - - name: FP16/text-spotting-0002-recognizer-decoder.xml - size: 48230 - sha256: a76c296fae7c0acf31c2be4a1550144f57491c162b0116929514fd1bd67967fa - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-spotting-0002/text-spotting-0002-recognizer-decoder/FP16/text-spotting-0002-recognizer-decoder.xml - - name: FP16/text-spotting-0002-recognizer-decoder.bin - size: 1353904 - sha256: 7c8910607b025ca1a6a7d385ede696c9053e52605eda2bb2c1b5b501c3ef9fdb - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-spotting-0002/text-spotting-0002-recognizer-decoder/FP16/text-spotting-0002-recognizer-decoder.bin - - name: FP16-INT8/text-spotting-0002-recognizer-decoder.xml - size: 74145 - sha256: 7250ca3408e4dfae063b35f4a87b462a229ffefefd522a2642f080bfbb3eed61 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-spotting-0002/text-spotting-0002-recognizer-decoder/FP16-INT8/text-spotting-0002-recognizer-decoder.xml - - name: FP16-INT8/text-spotting-0002-recognizer-decoder.bin - size: 1150058 - sha256: 514cdd801926e399067e406710202f074b08019322f0c0cb7f1455777f99b52d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-spotting-0002/text-spotting-0002-recognizer-decoder/FP16-INT8/text-spotting-0002-recognizer-decoder.bin -framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE diff --git a/models/intel/text-spotting-0002/text-spotting-0002-recognizer-encoder/model.yml b/models/intel/text-spotting-0002/text-spotting-0002-recognizer-encoder/model.yml deleted file mode 100644 index e7a1963c0ae..00000000000 --- a/models/intel/text-spotting-0002/text-spotting-0002-recognizer-encoder/model.yml +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -description: >- - Encoder part of text recognition head that takes features from text-spotting-0002-detector - as input. -task_type: feature_extraction -files: - - name: FP32/text-spotting-0002-recognizer-encoder.xml - size: 9754 - sha256: 6d9e22767154398b0c1a568e096ef2f5e08d2f00f5b31f78cbd556838c9066cf - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-spotting-0002/text-spotting-0002-recognizer-encoder/FP32/text-spotting-0002-recognizer-encoder.xml - - name: FP32/text-spotting-0002-recognizer-encoder.bin - size: 5311488 - sha256: 018e69d5571190031105fe558684ecafb15699002cc3ffc02e125cf8857f818a - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-spotting-0002/text-spotting-0002-recognizer-encoder/FP32/text-spotting-0002-recognizer-encoder.bin - - name: FP16/text-spotting-0002-recognizer-encoder.xml - size: 9751 - sha256: 2fdebec5af97092af73eb4e0bc529715765318e0616fd2f23ae472ec51ea7e79 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-spotting-0002/text-spotting-0002-recognizer-encoder/FP16/text-spotting-0002-recognizer-encoder.xml - - name: FP16/text-spotting-0002-recognizer-encoder.bin - size: 2655744 - sha256: 1675893bc936c1af5a03b02380212a68fe9391e2b6d563527e75c100b75f12ca - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-spotting-0002/text-spotting-0002-recognizer-encoder/FP16/text-spotting-0002-recognizer-encoder.bin - - name: FP16-INT8/text-spotting-0002-recognizer-encoder.xml - size: 12450 - sha256: 1a3b6befcbb929b2557b52633ff2a764c586e2f6f7640a9f3aa8c6fb551e4128 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-spotting-0002/text-spotting-0002-recognizer-encoder/FP16-INT8/text-spotting-0002-recognizer-encoder.xml - - name: FP16-INT8/text-spotting-0002-recognizer-encoder.bin - size: 2655744 - sha256: 1675893bc936c1af5a03b02380212a68fe9391e2b6d563527e75c100b75f12ca - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/text-spotting-0002/text-spotting-0002-recognizer-encoder/FP16-INT8/text-spotting-0002-recognizer-encoder.bin -framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE diff --git a/models/intel/text-spotting-0002/accuracy-check.yml b/models/intel/text-spotting-0003/accuracy-check.yml similarity index 81% rename from models/intel/text-spotting-0002/accuracy-check.yml rename to models/intel/text-spotting-0003/accuracy-check.yml index cdf40f3ddee..bddabc5a5a2 100644 --- a/models/intel/text-spotting-0002/accuracy-check.yml +++ b/models/intel/text-spotting-0003/accuracy-check.yml @@ -1,5 +1,5 @@ evaluations: - - name: text-spotting-0002 + - name: text-spotting-0003 module: custom_evaluators.text_spotting_evaluator.TextSpottingEvaluator module_config: network_info: @@ -19,19 +19,19 @@ evaluations: cur_hidden: hidden max_seq_len: '28' + recognizer_confidence_threshold: '0.5' - alphabet: __0123456789abcdefghijklmnopqrstuvwxyz + alphabet: __abcdefghijklmnopqrstuvwxyz0123456789 sos_index: '0' eos_index: '1' adapter: type: mask_rcnn_with_text - classes_out: classes - scores_out: scores + classes_out: labels boxes_out: boxes - raw_masks_out: raw_masks + raw_masks_out: masks texts_out: texts - confidence_threshold: 0.8 + confidence_threshold: 0.5 launchers: - framework: dlsdk diff --git a/models/intel/text-spotting-0002/description/text-spotting-0002.md b/models/intel/text-spotting-0003/description/text-spotting-0003.md similarity index 68% rename from models/intel/text-spotting-0002/description/text-spotting-0002.md rename to models/intel/text-spotting-0003/description/text-spotting-0003.md index bc1dcdd944d..a5cd4e4cc48 100644 --- a/models/intel/text-spotting-0002/description/text-spotting-0002.md +++ b/models/intel/text-spotting-0003/description/text-spotting-0003.md @@ -1,4 +1,4 @@ -# text-spotting-0002 (composite) +# text-spotting-0003 (composite) ## Use Case and High-Level Description @@ -7,17 +7,17 @@ recognizes text. The model detects symbol sequences separated by space and perfo recognition without a dictionary. The model is built on top of the Mask-RCNN framework with additional attention-based text recognition head. -Symbols set is alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyz`. +Alphabet is alphanumeric: `abcdefghijklmnopqrstuvwxyz0123456789`. ## Example -![](./text-spotting-0002.png) +![](./text-spotting-0003.png) ## Composite model specification | Metric | Value | |-----------------------------------------------|-----------| -| Word spotting hmean ICDAR2015, without a dictionary | 61.01% | +| Word spotting hmean ICDAR2015, without a dictionary | 64.81% | | Source framework | PyTorch\* | *Hmean Word spotting* is defined and measured according to the @@ -25,15 +25,12 @@ Symbols set is alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyz`. ## Detector model specification -The text-spotting-0002-detector model is a Mask-RCNN-based text detector with ResNet50 backbone and additional text features output. +The text-spotting-0003-detector model is a Mask-RCNN-based text detector with ResNet50 backbone and additional text features output. | Metric | Value | |-----------------------------------------------|-----------| -| GFlops | 185.169 | -| MParams | 26.497 | - - -### Performance +| GFlops | 184.495 | +| MParams | 27.010 | ### Inputs @@ -44,29 +41,22 @@ The text-spotting-0002-detector model is a Mask-RCNN-based text detector with Re ### Outputs -1. Name: `classes`, shape: [100]. Contiguous integer class ID for every - detected object, `0` for background (no object detected). -2. Name: `scores`, shape: [100]. Detection confidence scores in the [0, 1] range - for every object. -3. Name: `boxes`, shape: [100x4]. Bounding boxes around every detected object - in the (top_left_x, top_left_y, bottom_right_x, bottom_right_y) format. -4. Name: `raw_masks`, shape: [100x2x28x28]. Segmentation heatmaps for all - classes for every output bounding box. -5. Name: `text_features`, shape [100x64x28x28]. Text features that are fed to a text recognition head. - +1. Name: `labels`, shape: [100]. Contiguous integer class ID for every + detected object, `0` is for text class. +2. Name: `boxes`, shape: [100x5]. Bounding boxes around every detected object + in the (top_left_x, top_left_y, bottom_right_x, bottom_right_y, confidence) format. +3. Name: `masks`, shape: [100x28x28]. Text segmentation masks for every output bounding box. +4. Name: `text_features.0`, shape [100x64x28x28]. Text features that are fed to a text recognition head. ## Encoder model specification -The text-spotting-0002-recognizer-encoder model is a fully-convolutional encoder of text recognition head. +The text-spotting-0003-recognizer-encoder model is a fully-convolutional encoder of text recognition head. | Metric | Value | |-----------------------------------------------|-----------| | GFlops | 2.082 | | MParams | 1.328 | - -### Performance - ### Inputs Name: `input` , shape: [1x64x28x28]. Text recognition features obtained from detection part. @@ -75,16 +65,12 @@ Name: `input` , shape: [1x64x28x28]. Text recognition features obtained from det Name: `output`, shape: [1x256x28x28]. Encoded text recognition features. - ## Decoder model specification | Metric | Value | |-----------------------------------------------|-----------| -| GFlops | 0.002 | -| MParams | 0.273 | - - -### Performance +| GFlops | 0.106 | +| MParams | 0.283 | ### Inputs @@ -94,7 +80,8 @@ Name: `output`, shape: [1x256x28x28]. Encoded text recognition features. ### Outputs -1. Name: `output`, shape: [1x38]. Encoded text recognition features. +1. Name: `output`, shape: [1x38]. Encoded text recognition features. Indices starting from 2 correspond to symbols from the +alphabet. The 0 and 1 are special Start of Sequence and End of Sequence symbols correspondingly. 1. Name: `hidden`, shape: [1x1x256]. Current hidden state of GRU. diff --git a/models/intel/text-spotting-0002/description/text-spotting-0002.png b/models/intel/text-spotting-0003/description/text-spotting-0003.png similarity index 100% rename from models/intel/text-spotting-0002/description/text-spotting-0002.png rename to models/intel/text-spotting-0003/description/text-spotting-0003.png diff --git a/models/intel/text-spotting-0003/text-spotting-0003-detector/model.yml b/models/intel/text-spotting-0003/text-spotting-0003-detector/model.yml new file mode 100644 index 00000000000..391bbdd2b17 --- /dev/null +++ b/models/intel/text-spotting-0003/text-spotting-0003-detector/model.yml @@ -0,0 +1,36 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + Mask R-CNN-based text detector. +task_type: detection +files: + - name: FP32/text-spotting-0003-detector.xml + size: 762233 + sha256: 422c57a748fd11378dbe636be18e9d9e1240c8eb40edc689c8da0f4ce82088b6 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-spotting-0003/text-spotting-0003-detector/FP32/text-spotting-0003-detector.xml + - name: FP32/text-spotting-0003-detector.bin + size: 103797692 + sha256: a090e41ace97be67430bc0048a9b727f2b10b2f444ea138a937bdc975a7091d1 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-spotting-0003/text-spotting-0003-detector/FP32/text-spotting-0003-detector.bin + - name: FP16/text-spotting-0003-detector.xml + size: 762111 + sha256: ea659838699acb8e21e8bf8f2424dceb4cced6c31692c317466b30050e3c3996 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-spotting-0003/text-spotting-0003-detector/FP16/text-spotting-0003-detector.xml + - name: FP16/text-spotting-0003-detector.bin + size: 51899076 + sha256: ae2bd9227c11e3f4ae2cdc0fb350374c74645bb671a0fdee363c93ca1a9256d5 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-spotting-0003/text-spotting-0003-detector/FP16/text-spotting-0003-detector.bin +framework: dldt +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/text-spotting-0003/text-spotting-0003-recognizer-decoder/model.yml b/models/intel/text-spotting-0003/text-spotting-0003-recognizer-decoder/model.yml new file mode 100644 index 00000000000..3b8c642b3de --- /dev/null +++ b/models/intel/text-spotting-0003/text-spotting-0003-recognizer-decoder/model.yml @@ -0,0 +1,37 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + Decoder part of text recognition head that takes encoder features from text-spotting-0003-text-recognizer-encoder + as input. +task_type: optical_character_recognition +files: + - name: FP32/text-spotting-0003-recognizer-decoder.xml + size: 51567 + sha256: 2ed4d72da33647622ac296cc4836992a4168ad39ffa3db6db8096bd4c6b61599 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-spotting-0003/text-spotting-0003-recognizer-decoder/FP32/text-spotting-0003-recognizer-decoder.xml + - name: FP32/text-spotting-0003-recognizer-decoder.bin + size: 2707708 + sha256: bbdd79a0e90b5afa20a051b265f2e187ce336b5d854d5f3369c5abab55179449 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-spotting-0003/text-spotting-0003-recognizer-decoder/FP32/text-spotting-0003-recognizer-decoder.bin + - name: FP16/text-spotting-0003-recognizer-decoder.xml + size: 51556 + sha256: ba3b3719468dc91f8892baf05ee86e4eb7eceb4afd82c35979c94ae79d238657 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-spotting-0003/text-spotting-0003-recognizer-decoder/FP16/text-spotting-0003-recognizer-decoder.xml + - name: FP16/text-spotting-0003-recognizer-decoder.bin + size: 1353904 + sha256: 14554c1dfdf5cadcf1e96d11d9cfdb61ac8c97e0b116106919f9973ab17b7328 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-spotting-0003/text-spotting-0003-recognizer-decoder/FP16/text-spotting-0003-recognizer-decoder.bin +framework: dldt +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/text-spotting-0003/text-spotting-0003-recognizer-encoder/model.yml b/models/intel/text-spotting-0003/text-spotting-0003-recognizer-encoder/model.yml new file mode 100644 index 00000000000..93039486a21 --- /dev/null +++ b/models/intel/text-spotting-0003/text-spotting-0003-recognizer-encoder/model.yml @@ -0,0 +1,37 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + Encoder part of text recognition head that takes features from text-spotting-0003-detector + as input. +task_type: feature_extraction +files: + - name: FP32/text-spotting-0003-recognizer-encoder.xml + size: 9894 + sha256: 79c5721e8b1955dff76c01bda166b6f289a73022b539c1e8beddd63d47bb1211 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-spotting-0003/text-spotting-0003-recognizer-encoder/FP32/text-spotting-0003-recognizer-encoder.xml + - name: FP32/text-spotting-0003-recognizer-encoder.bin + size: 5311488 + sha256: b941c3d30672345e3582ff80b01834650b5ad8246aab7351c2f54f7213108145 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-spotting-0003/text-spotting-0003-recognizer-encoder/FP32/text-spotting-0003-recognizer-encoder.bin + - name: FP16/text-spotting-0003-recognizer-encoder.xml + size: 9891 + sha256: a3daf8b2f7857ff6ccb2c9aa7a0ab76794639aee19ea82476db050cb343ff133 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-spotting-0003/text-spotting-0003-recognizer-encoder/FP16/text-spotting-0003-recognizer-encoder.xml + - name: FP16/text-spotting-0003-recognizer-encoder.bin + size: 2655744 + sha256: da26119bdf99385b17dbf03ada05c14dd2a5c69b3e80d95703945ea92a332647 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/text-spotting-0003/text-spotting-0003-recognizer-encoder/FP16/text-spotting-0003-recognizer-encoder.bin +framework: dldt +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/unet-camvid-onnx-0001/description/unet-camvid-onnx-0001.md b/models/intel/unet-camvid-onnx-0001/description/unet-camvid-onnx-0001.md index 712ff00bedc..43c987c5add 100644 --- a/models/intel/unet-camvid-onnx-0001/description/unet-camvid-onnx-0001.md +++ b/models/intel/unet-camvid-onnx-0001/description/unet-camvid-onnx-0001.md @@ -30,8 +30,6 @@ The quality metrics were calculated on the CamVid validation dataset. The `unlab - `FP` - number of false positive pixels for given class -## Performance - ## Input Image, shape - `1,3,368,480`, format is `B,C,H,W` where: diff --git a/models/intel/unet-camvid-onnx-0001/model.yml b/models/intel/unet-camvid-onnx-0001/model.yml index 90d6f002242..ed3205430a8 100644 --- a/models/intel/unet-camvid-onnx-0001/model.yml +++ b/models/intel/unet-camvid-onnx-0001/model.yml @@ -17,28 +17,28 @@ description: >- task_type: semantic_segmentation files: - name: FP32/unet-camvid-onnx-0001.xml - size: 64281 - sha256: 8b38111de395ced4a83aad7e7f0c2c99b60518f87b18c29fa68923ee91d308e1 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/unet-camvid-onnx-0001/FP32/unet-camvid-onnx-0001.xml + size: 64680 + sha256: 738e8c6611d5f994b4b3270d38f764870a55e8b96ea1b398fe3bbacba621a120 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/unet-camvid-onnx-0001/FP32/unet-camvid-onnx-0001.xml - name: FP32/unet-camvid-onnx-0001.bin size: 124129876 sha256: cf996b45dadfa397f16aad5a7264787e3666a7645eba3653e5c48d42076e86d7 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/unet-camvid-onnx-0001/FP32/unet-camvid-onnx-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/unet-camvid-onnx-0001/FP32/unet-camvid-onnx-0001.bin - name: FP16/unet-camvid-onnx-0001.xml - size: 64235 - sha256: 5765ae0f76294b2a28d26d90a0d30c01704b8f435ec17c41c9e49cb9d04d40e9 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/unet-camvid-onnx-0001/FP16/unet-camvid-onnx-0001.xml + size: 64634 + sha256: 908f346fa5cf3267803952e15d0ce8b8d4231b13776f82cf67d2f395ed175b8c + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/unet-camvid-onnx-0001/FP16/unet-camvid-onnx-0001.xml - name: FP16/unet-camvid-onnx-0001.bin size: 62064942 sha256: 0c8dda21bc6ad71f6e78dea15d228f1bb293efeb2e97dff8d91ea91d357ca080 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/unet-camvid-onnx-0001/FP16/unet-camvid-onnx-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/unet-camvid-onnx-0001/FP16/unet-camvid-onnx-0001.bin - name: FP16-INT8/unet-camvid-onnx-0001.xml - size: 162369 - sha256: f8636048caf1cc9418f425e025457ff6c0f383c87c4e8d3d1d97a5de99362b5f - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/unet-camvid-onnx-0001/FP16-INT8/unet-camvid-onnx-0001.xml + size: 149574 + sha256: 069a06f33a555f1708ad456c61010a372aeef911564ac0be7c333041c74dc52b + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/unet-camvid-onnx-0001/FP16-INT8/unet-camvid-onnx-0001.xml - name: FP16-INT8/unet-camvid-onnx-0001.bin - size: 33848330 - sha256: c3652ed17e019270394015c765bc6887366af33711de618a98405a86ca9b5474 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/unet-camvid-onnx-0001/FP16-INT8/unet-camvid-onnx-0001.bin + size: 33848274 + sha256: dc6286855c9a45b4014b52b650164bd2b3371abe25c666b34d302407da6b6f89 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/unet-camvid-onnx-0001/FP16-INT8/unet-camvid-onnx-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/vehicle-attributes-recognition-barrier-0039/description/vehicle-attributes-recognition-barrier-0039.md b/models/intel/vehicle-attributes-recognition-barrier-0039/description/vehicle-attributes-recognition-barrier-0039.md index ad245e232d5..50714656ee9 100644 --- a/models/intel/vehicle-attributes-recognition-barrier-0039/description/vehicle-attributes-recognition-barrier-0039.md +++ b/models/intel/vehicle-attributes-recognition-barrier-0039/description/vehicle-attributes-recognition-barrier-0039.md @@ -48,8 +48,6 @@ This model presents a vehicle attributes classification algorithm for a traffic **Type average accuracy: 87.56 %** -## Performance (FPS) - ## Inputs 1. name: `input` , shape: [1x3x72x72] - An input image in following format diff --git a/models/intel/vehicle-attributes-recognition-barrier-0039/model.yml b/models/intel/vehicle-attributes-recognition-barrier-0039/model.yml index 7f20d8b95f9..aa57f3205aa 100644 --- a/models/intel/vehicle-attributes-recognition-barrier-0039/model.yml +++ b/models/intel/vehicle-attributes-recognition-barrier-0039/model.yml @@ -17,28 +17,28 @@ description: >- task_type: object_attributes files: - name: FP32/vehicle-attributes-recognition-barrier-0039.xml - size: 37526 - sha256: 24431b2063f42df7ac336f47811e3eaa0fcba53905f9e19a05cd031f2932f878 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-attributes-recognition-barrier-0039/FP32/vehicle-attributes-recognition-barrier-0039.xml + size: 37726 + sha256: 705bb593c33ceb224ffe4c137e45387fa8080b4c6baa119b4cfe27e32f59c425 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-attributes-recognition-barrier-0039/FP32/vehicle-attributes-recognition-barrier-0039.xml - name: FP32/vehicle-attributes-recognition-barrier-0039.bin size: 2504028 sha256: 0a88a00de406dea62455d4c5385357655bf29687d4b538051307102fcd54a8d1 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-attributes-recognition-barrier-0039/FP32/vehicle-attributes-recognition-barrier-0039.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-attributes-recognition-barrier-0039/FP32/vehicle-attributes-recognition-barrier-0039.bin - name: FP16/vehicle-attributes-recognition-barrier-0039.xml - size: 37513 - sha256: bd4219e7830441ad88e81f573ebece75999bc5e58bc0f45441440c3406f59850 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-attributes-recognition-barrier-0039/FP16/vehicle-attributes-recognition-barrier-0039.xml + size: 37711 + sha256: 3b570503bf193cf6bfca552cd54de60615aeaa459f0b0325ea2677e95d761234 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-attributes-recognition-barrier-0039/FP16/vehicle-attributes-recognition-barrier-0039.xml - name: FP16/vehicle-attributes-recognition-barrier-0039.bin size: 1252026 sha256: 8c46540ca4b4bad43a0918fae6367c0e70c94ad513cc52d2243ea1b02bd369c3 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-attributes-recognition-barrier-0039/FP16/vehicle-attributes-recognition-barrier-0039.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-attributes-recognition-barrier-0039/FP16/vehicle-attributes-recognition-barrier-0039.bin - name: FP16-INT8/vehicle-attributes-recognition-barrier-0039.xml - size: 101678 - sha256: 89143350b0eb592f7a5761335a93b45d0fa973e4694426ee315e2feb8e97b7c4 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-attributes-recognition-barrier-0039/FP16-INT8/vehicle-attributes-recognition-barrier-0039.xml + size: 101913 + sha256: 4eb792c73d73aa4e5f392fc595382e33a1d720514b9ee4f2a674d7c761617308 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-attributes-recognition-barrier-0039/FP16-INT8/vehicle-attributes-recognition-barrier-0039.xml - name: FP16-INT8/vehicle-attributes-recognition-barrier-0039.bin size: 631134 sha256: 2dc0b8bf4c611f117f47831332ef7292b83df65320bb0ae3d2f2b41786667edb - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-attributes-recognition-barrier-0039/FP16-INT8/vehicle-attributes-recognition-barrier-0039.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-attributes-recognition-barrier-0039/FP16-INT8/vehicle-attributes-recognition-barrier-0039.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/vehicle-attributes-recognition-barrier-0042/description/vehicle-attributes-recognition-barrier-0042.md b/models/intel/vehicle-attributes-recognition-barrier-0042/description/vehicle-attributes-recognition-barrier-0042.md index a9d871e8df4..55aa80ec693 100644 --- a/models/intel/vehicle-attributes-recognition-barrier-0042/description/vehicle-attributes-recognition-barrier-0042.md +++ b/models/intel/vehicle-attributes-recognition-barrier-0042/description/vehicle-attributes-recognition-barrier-0042.md @@ -48,8 +48,6 @@ This model presents a vehicle attributes classification algorithm for a traffic **Type average accuracy: 87.34%** -## Performance - ## Inputs Name: `input` , shape: [1x3x72x72] - an input image in following format diff --git a/models/intel/vehicle-attributes-recognition-barrier-0042/model.yml b/models/intel/vehicle-attributes-recognition-barrier-0042/model.yml index 13627917be0..0776b3acba1 100644 --- a/models/intel/vehicle-attributes-recognition-barrier-0042/model.yml +++ b/models/intel/vehicle-attributes-recognition-barrier-0042/model.yml @@ -17,28 +17,28 @@ description: >- task_type: object_attributes files: - name: FP32/vehicle-attributes-recognition-barrier-0042.xml - size: 68592 - sha256: 9cc5ab9c9689fe17c4d0d57ec5e11329d06f6b4ba81153843a0b861e2447c179 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-attributes-recognition-barrier-0042/FP32/vehicle-attributes-recognition-barrier-0042.xml + size: 68799 + sha256: 9d1e877b153699caf4547d08bff7fe268f65b663441a42b929924b8d95dacdbb + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-attributes-recognition-barrier-0042/FP32/vehicle-attributes-recognition-barrier-0042.xml - name: FP32/vehicle-attributes-recognition-barrier-0042.bin size: 44709496 sha256: 492520e55f452223e767d54227d6ef6b60b0c1752dd7b9d747be65d57b685a0e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-attributes-recognition-barrier-0042/FP32/vehicle-attributes-recognition-barrier-0042.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-attributes-recognition-barrier-0042/FP32/vehicle-attributes-recognition-barrier-0042.bin - name: FP16/vehicle-attributes-recognition-barrier-0042.xml - size: 68572 - sha256: 7203ed3023723c2a17ba6fa5559a9bc13a6494168d3ac8cdca4700098b36c7b4 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-attributes-recognition-barrier-0042/FP16/vehicle-attributes-recognition-barrier-0042.xml + size: 68779 + sha256: 045c8bf097a400b633ef366a7c09b9e9cb57b2375503db27efdd94f63f50544b + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-attributes-recognition-barrier-0042/FP16/vehicle-attributes-recognition-barrier-0042.xml - name: FP16/vehicle-attributes-recognition-barrier-0042.bin size: 22354774 sha256: 76d2d72c3a757955f7b0c2b22b95c1e6892f71c6447418e246dca6545d235084 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-attributes-recognition-barrier-0042/FP16/vehicle-attributes-recognition-barrier-0042.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-attributes-recognition-barrier-0042/FP16/vehicle-attributes-recognition-barrier-0042.bin - name: FP16-INT8/vehicle-attributes-recognition-barrier-0042.xml - size: 177743 - sha256: 2c9bde86a82054f824100cea264fd2b40eb8c8d34dc1b2c3762d51e507d37c50 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-attributes-recognition-barrier-0042/FP16-INT8/vehicle-attributes-recognition-barrier-0042.xml + size: 178012 + sha256: 780e87632681567ad91b82ca659f9994a16d15e18b6a36ef0c09c2424ff266c2 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-attributes-recognition-barrier-0042/FP16-INT8/vehicle-attributes-recognition-barrier-0042.xml - name: FP16-INT8/vehicle-attributes-recognition-barrier-0042.bin size: 11205658 sha256: 6eae80fe1616f39474704f77f262b124f727cb904a5c01ba442b334989d0dd71 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-attributes-recognition-barrier-0042/FP16-INT8/vehicle-attributes-recognition-barrier-0042.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-attributes-recognition-barrier-0042/FP16-INT8/vehicle-attributes-recognition-barrier-0042.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/vehicle-detection-0200/description/vehicle-detection-0200.md b/models/intel/vehicle-detection-0200/description/vehicle-detection-0200.md index 082c70b1755..ca2e0a9e54a 100644 --- a/models/intel/vehicle-detection-0200/description/vehicle-detection-0200.md +++ b/models/intel/vehicle-detection-0200/description/vehicle-detection-0200.md @@ -23,8 +23,6 @@ Average Precision (AP) is defined as an area under the [precision/recall](https://en.wikipedia.org/wiki/Precision_and_recall) curve. -## Performance - ## Inputs Name: `input`, shape: [1x3x256x256] - An input image in the format [BxCxHxW], @@ -43,7 +41,7 @@ The net outputs blob with shape: [1, 1, N, 7], where N is the number of detected bounding boxes. Each detection has the format [`image_id`, `label`, `conf`, `x_min`, `y_min`, `x_max`, `y_max`], where: - `image_id` - ID of the image in the batch - - `label` - predicted class ID + - `label` - predicted class ID (0 - vehicle) - `conf` - confidence for the predicted class - (`x_min`, `y_min`) - coordinates of the top left bounding box corner - (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner. diff --git a/models/intel/vehicle-detection-0200/model.yml b/models/intel/vehicle-detection-0200/model.yml index 49998de0787..e54044bd74e 100644 --- a/models/intel/vehicle-detection-0200/model.yml +++ b/models/intel/vehicle-detection-0200/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/vehicle-detection-0200.xml - size: 186759 - sha256: eba3efeab3f4c46a30e61fa98898eb97e2b0d964feeb56760d0a25bd17213bff - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-detection-0200/FP32/vehicle-detection-0200.xml + size: 187876 + sha256: 3279a6ab14355e71020ec252d63d6ab1ef13831e18cd80ac90f7dfdcc3fc3033 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-detection-0200/FP32/vehicle-detection-0200.xml - name: FP32/vehicle-detection-0200.bin size: 7269168 sha256: 22968dd07f17738f11e61cd956976e5ae4789c00635e0418155a0da8ba8146fd - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-detection-0200/FP32/vehicle-detection-0200.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-detection-0200/FP32/vehicle-detection-0200.bin - name: FP16/vehicle-detection-0200.xml - size: 186696 - sha256: 147cc9cbb2910a9706389b7b8775b206d256890b138bae6ae94d52c1de48667b - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-detection-0200/FP16/vehicle-detection-0200.xml + size: 187813 + sha256: 1b04ba778eb69ef79686c03a0ceccdae5c0e62c0384dc90dd68f19ea71b1cbff + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-detection-0200/FP16/vehicle-detection-0200.xml - name: FP16/vehicle-detection-0200.bin size: 3634626 sha256: 8e2779dd1bbed6f08a923ed8a2d581ab5bec6de487849726708f9e8b18c3556f - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-detection-0200/FP16/vehicle-detection-0200.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-detection-0200/FP16/vehicle-detection-0200.bin - name: FP16-INT8/vehicle-detection-0200.xml - size: 492988 - sha256: 84ea8cacae6f4957e10109f29ad6c9b642677109852ac08f6b2705a0dd976284 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-detection-0200/FP16-INT8/vehicle-detection-0200.xml + size: 494281 + sha256: 56e70829d6b559460033aa8a40637bbb4ea722704cf6e95ee42f80e8b401dd62 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-detection-0200/FP16-INT8/vehicle-detection-0200.xml - name: FP16-INT8/vehicle-detection-0200.bin size: 1921625 sha256: b828b71bf3c6dd11a78e54448504bbb0eb6ed61a6f8843870e10d60f1ebff879 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-detection-0200/FP16-INT8/vehicle-detection-0200.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-detection-0200/FP16-INT8/vehicle-detection-0200.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/vehicle-detection-0201/description/vehicle-detection-0201.md b/models/intel/vehicle-detection-0201/description/vehicle-detection-0201.md index 15ae373cb2e..546c548a2e9 100644 --- a/models/intel/vehicle-detection-0201/description/vehicle-detection-0201.md +++ b/models/intel/vehicle-detection-0201/description/vehicle-detection-0201.md @@ -23,8 +23,6 @@ Average Precision (AP) is defined as an area under the [precision/recall](https://en.wikipedia.org/wiki/Precision_and_recall) curve. -## Performance - ## Inputs Name: `input`, shape: [1x3x384x384] - An input image in the format [BxCxHxW], @@ -43,7 +41,7 @@ The net outputs blob with shape: [1, 1, N, 7], where N is the number of detected bounding boxes. Each detection has the format [`image_id`, `label`, `conf`, `x_min`, `y_min`, `x_max`, `y_max`], where: - `image_id` - ID of the image in the batch - - `label` - predicted class ID + - `label` - predicted class ID (0 - vehicle) - `conf` - confidence for the predicted class - (`x_min`, `y_min`) - coordinates of the top left bounding box corner - (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner. diff --git a/models/intel/vehicle-detection-0201/model.yml b/models/intel/vehicle-detection-0201/model.yml index 09cb9cf5abe..e0edb910b5e 100644 --- a/models/intel/vehicle-detection-0201/model.yml +++ b/models/intel/vehicle-detection-0201/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/vehicle-detection-0201.xml - size: 186952 - sha256: 28e1d068e4bd07774aaef65a18f24cd5a4746813b72975136c90d84fdb009107 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-detection-0201/FP32/vehicle-detection-0201.xml + size: 188069 + sha256: 3655fe421766a8268fb5cefd5d32e30d682cbf67a77a5931ce76f7295ab47776 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-detection-0201/FP32/vehicle-detection-0201.xml - name: FP32/vehicle-detection-0201.bin size: 7269168 sha256: 6ad77363ad7b4071d9a16f171cf4d6b08fab80ebbac395cb36e095223671d22f - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-detection-0201/FP32/vehicle-detection-0201.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-detection-0201/FP32/vehicle-detection-0201.bin - name: FP16/vehicle-detection-0201.xml - size: 186889 - sha256: 014d0df56bc460df8a0d1efc16ed2263bf099b8ec9d917045b7194caa0645572 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-detection-0201/FP16/vehicle-detection-0201.xml + size: 188006 + sha256: a98cc0fdcd90dd1e99729266b2fae2968183493e97c7fdf47a56d1706e420c44 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-detection-0201/FP16/vehicle-detection-0201.xml - name: FP16/vehicle-detection-0201.bin size: 3634626 sha256: 25c70860906bc9bc1470b95983c7638ec704205094a1716eacfe3b7eb413c046 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-detection-0201/FP16/vehicle-detection-0201.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-detection-0201/FP16/vehicle-detection-0201.bin - name: FP16-INT8/vehicle-detection-0201.xml - size: 493211 - sha256: a28648577fb5c6b26554c4fdfcf0c20ffb3e93b0f52eb1cda3cbc6b8129c88ee - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-detection-0201/FP16-INT8/vehicle-detection-0201.xml + size: 494504 + sha256: aae14e837658909471c8695438a3e3cd49bae70b59ec219d930ec710834a01c4 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-detection-0201/FP16-INT8/vehicle-detection-0201.xml - name: FP16-INT8/vehicle-detection-0201.bin size: 1921625 sha256: 852325d04402b4fad7ee167ef8fa95970e65db13487d8eaf23d0e55a4a79f33e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-detection-0201/FP16-INT8/vehicle-detection-0201.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-detection-0201/FP16-INT8/vehicle-detection-0201.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/vehicle-detection-0202/description/vehicle-detection-0202.md b/models/intel/vehicle-detection-0202/description/vehicle-detection-0202.md index 008291bfb0b..57f862a813f 100644 --- a/models/intel/vehicle-detection-0202/description/vehicle-detection-0202.md +++ b/models/intel/vehicle-detection-0202/description/vehicle-detection-0202.md @@ -12,11 +12,9 @@ prior boxes for 512x512 resolution. ## Specification -## Specification - | Metric | Value | |---------------------------------|-------------------------------------------| -| AP @ [ IoU=0.50:0.95 ] | 0.369 (internal test set) | +| AP @ [ IoU=0.50:0.95 ] | 0.36 (internal test set) | | GFlops | 3.143 | | MParams | 1.817 | | Source framework | PyTorch\* | @@ -25,8 +23,6 @@ Average Precision (AP) is defined as an area under the [precision/recall](https://en.wikipedia.org/wiki/Precision_and_recall) curve. -## Performance - ## Inputs Name: `input`, shape: [1x3x512x512] - An input image in the format [BxCxHxW], @@ -45,7 +41,7 @@ The net outputs blob with shape: [1, 1, N, 7], where N is the number of detected bounding boxes. Each detection has the format [`image_id`, `label`, `conf`, `x_min`, `y_min`, `x_max`, `y_max`], where: - `image_id` - ID of the image in the batch - - `label` - predicted class ID + - `label` - predicted class ID (0 - vehicle) - `conf` - confidence for the predicted class - (`x_min`, `y_min`) - coordinates of the top left bounding box corner - (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner. diff --git a/models/intel/vehicle-detection-0202/model.yml b/models/intel/vehicle-detection-0202/model.yml index 7c54fde4938..42b822eb0ef 100644 --- a/models/intel/vehicle-detection-0202/model.yml +++ b/models/intel/vehicle-detection-0202/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/vehicle-detection-0202.xml - size: 187034 - sha256: f71b2582e4cbedeac4424722a6f74af82f6fd1ae8fb1a2a2f46332676f1da9ee - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-detection-0202/FP32/vehicle-detection-0202.xml + size: 188151 + sha256: 8ea8aece8b70463d1cb5741ab63473192c92c4686a24086150fe9f156f101ca4 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-detection-0202/FP32/vehicle-detection-0202.xml - name: FP32/vehicle-detection-0202.bin size: 7269168 sha256: 5b9c9d0f5d6543fd6c27df7c09d2adc0fd0ae2fb67d803cbfaeabba6861d3de4 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-detection-0202/FP32/vehicle-detection-0202.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-detection-0202/FP32/vehicle-detection-0202.bin - name: FP16/vehicle-detection-0202.xml - size: 186971 - sha256: 4373f2266869175ce8e3ddf547428b978823eca3b1ec4949b8becafefefdf1c2 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-detection-0202/FP16/vehicle-detection-0202.xml + size: 188088 + sha256: b497ae42daa7d612ad70890857d36c1efc45adc02c77448e906531cfe4c75dbb + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-detection-0202/FP16/vehicle-detection-0202.xml - name: FP16/vehicle-detection-0202.bin size: 3634626 sha256: 6e612af65dd992a3013ffff91739a70b93230ac7a98646a1c274daf93f056edc - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-detection-0202/FP16/vehicle-detection-0202.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-detection-0202/FP16/vehicle-detection-0202.bin - name: FP16-INT8/vehicle-detection-0202.xml - size: 493321 - sha256: b7ca442f89d2309b40d8ed2a7c9cd50a78ee41515162fcfab343e90500cca87d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-detection-0202/FP16-INT8/vehicle-detection-0202.xml + size: 494614 + sha256: 92078776c849daff24ea8b0532c1847e1fe90110443e358224da49d5ffa7c309 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-detection-0202/FP16-INT8/vehicle-detection-0202.xml - name: FP16-INT8/vehicle-detection-0202.bin size: 1921623 sha256: cab370f6bb236b31814311cd6340cfa7d2771115e45c7ed8821d93d8da474b64 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-detection-0202/FP16-INT8/vehicle-detection-0202.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-detection-0202/FP16-INT8/vehicle-detection-0202.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/vehicle-detection-adas-0002/description/vehicle-detection-adas-0002.md b/models/intel/vehicle-detection-adas-0002/description/vehicle-detection-adas-0002.md index 9ea42ebc320..a64e4a7ae2b 100644 --- a/models/intel/vehicle-detection-adas-0002/description/vehicle-detection-adas-0002.md +++ b/models/intel/vehicle-detection-adas-0002/description/vehicle-detection-adas-0002.md @@ -23,8 +23,6 @@ For Average Precision metric description, see [The PASCAL Visual Object Classes Tested on a challenging internal dataset with 3000 images and 12585 vehicles to detect. -## Performance - ## Inputs Name: `input`, shape: [1x3x384x672] - An input image in the format [BxCxHxW], diff --git a/models/intel/vehicle-detection-adas-0002/model.yml b/models/intel/vehicle-detection-adas-0002/model.yml index 1c7b9c163d0..2518e20acbf 100644 --- a/models/intel/vehicle-detection-adas-0002/model.yml +++ b/models/intel/vehicle-detection-adas-0002/model.yml @@ -18,28 +18,28 @@ description: >- task_type: detection files: - name: FP32/vehicle-detection-adas-0002.xml - size: 206214 - sha256: d3674b73586293401df90a3ac13a66131471990d4cac49e33fdd2c32bc63cff7 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-detection-adas-0002/FP32/vehicle-detection-adas-0002.xml + size: 207427 + sha256: 79778fad4a699e79e34e8cf5c5cf6c0ddf9cd250f9efd9b1ee2a4e2365d5fc2f + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-detection-adas-0002/FP32/vehicle-detection-adas-0002.xml - name: FP32/vehicle-detection-adas-0002.bin size: 4314552 sha256: dbe837dc1628ede3da0f4fe1e3a5f9a0457ef55c8bc050ba9ca257cd75d01929 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-detection-adas-0002/FP32/vehicle-detection-adas-0002.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-detection-adas-0002/FP32/vehicle-detection-adas-0002.bin - name: FP16/vehicle-detection-adas-0002.xml - size: 206168 - sha256: 9c764bb7f954b864294a38063b590069df9418efb6e17594203045d4edd6874d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-detection-adas-0002/FP16/vehicle-detection-adas-0002.xml + size: 207381 + sha256: 88a412cc3262ebdc8133df42887a3d60bd2bcfa279afea7fd4a61d3a7c0e3da1 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-detection-adas-0002/FP16/vehicle-detection-adas-0002.xml - name: FP16/vehicle-detection-adas-0002.bin size: 2157328 sha256: e119b3bec50bc836f2eb26a56a40a6d5e3c33bde819f3e6d00f829978092742b - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-detection-adas-0002/FP16/vehicle-detection-adas-0002.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-detection-adas-0002/FP16/vehicle-detection-adas-0002.bin - name: FP16-INT8/vehicle-detection-adas-0002.xml - size: 448680 - sha256: 1ab130363ff9ef9ca71ed6bc49a7ae40d801f0a8cd9660f96dc8af01f1e2073f - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-detection-adas-0002/FP16-INT8/vehicle-detection-adas-0002.xml + size: 449929 + sha256: c9d4fb33e65d6318dff8a84c0d271f97189d340af683639920368849f4d4bd00 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-detection-adas-0002/FP16-INT8/vehicle-detection-adas-0002.xml - name: FP16-INT8/vehicle-detection-adas-0002.bin size: 1123350 sha256: 2a80c5055cb3385fa25d919a3506ed8457fdefb7f8b6d8c9363f1b9a9c5d198b - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-detection-adas-0002/FP16-INT8/vehicle-detection-adas-0002.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-detection-adas-0002/FP16-INT8/vehicle-detection-adas-0002.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/vehicle-license-plate-detection-barrier-0106/description/vehicle-license-plate-detection-barrier-0106.md b/models/intel/vehicle-license-plate-detection-barrier-0106/description/vehicle-license-plate-detection-barrier-0106.md index 7a8f807f8cc..2acb89dc01b 100644 --- a/models/intel/vehicle-license-plate-detection-barrier-0106/description/vehicle-license-plate-detection-barrier-0106.md +++ b/models/intel/vehicle-license-plate-detection-barrier-0106/description/vehicle-license-plate-detection-barrier-0106.md @@ -27,8 +27,6 @@ Average Precision (AP) is defined as an area under the [precision/recall](https://en.wikipedia.org/wiki/Precision_and_recall) curve. Validation dataset is BIT-Vehicle. -## Performance - ## Inputs Name: `input`, shape: [1x3x300x300] - An input image in the format [BxCxHxW], diff --git a/models/intel/vehicle-license-plate-detection-barrier-0106/model.yml b/models/intel/vehicle-license-plate-detection-barrier-0106/model.yml index 52afc5b7fbc..6c1e3c468d5 100644 --- a/models/intel/vehicle-license-plate-detection-barrier-0106/model.yml +++ b/models/intel/vehicle-license-plate-detection-barrier-0106/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/vehicle-license-plate-detection-barrier-0106.xml - size: 212606 - sha256: e69d158e881a84b76fb44d6fc3673a24209c59f38e9e43a66ce0a5c0e50f7530 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-license-plate-detection-barrier-0106/FP32/vehicle-license-plate-detection-barrier-0106.xml + size: 212761 + sha256: e305dea89c08501b66774fdcd31eee279c3531cbab04127c62aeac34682c0330 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-license-plate-detection-barrier-0106/FP32/vehicle-license-plate-detection-barrier-0106.xml - name: FP32/vehicle-license-plate-detection-barrier-0106.bin - size: 2573368 - sha256: 113b86e6ed156253eeccc9a61b3ad602e6980928b7fa47a8232a875079ece5df - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-license-plate-detection-barrier-0106/FP32/vehicle-license-plate-detection-barrier-0106.bin + size: 2573360 + sha256: def0179e5896b732d54654c369f1c0d896a457d7d3a50627dd9020e45fd6d6eb + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-license-plate-detection-barrier-0106/FP32/vehicle-license-plate-detection-barrier-0106.bin - name: FP16/vehicle-license-plate-detection-barrier-0106.xml - size: 212538 - sha256: a7de48553fa055bae9c0cd07fe3a9ad504edbe84eb2ea5da27359d8decc4b417 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-license-plate-detection-barrier-0106/FP16/vehicle-license-plate-detection-barrier-0106.xml + size: 212694 + sha256: c1bdeca60af892ffc9c0458ccf8b9068ed27ac8020e5925cccd8363b6706be55 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-license-plate-detection-barrier-0106/FP16/vehicle-license-plate-detection-barrier-0106.xml - name: FP16/vehicle-license-plate-detection-barrier-0106.bin - size: 1286746 - sha256: 08fc0477fc69e343861c9b318ee0f5ce3c80eddac74220a209267b1742debbb4 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-license-plate-detection-barrier-0106/FP16/vehicle-license-plate-detection-barrier-0106.bin + size: 1286742 + sha256: 8e32f212b544500168661b736d898831cd1d67633b6ab85e2505a9d9d04dc5e2 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-license-plate-detection-barrier-0106/FP16/vehicle-license-plate-detection-barrier-0106.bin - name: FP16-INT8/vehicle-license-plate-detection-barrier-0106.xml - size: 558430 - sha256: 31542d69971b243f23d03c1992364767aee8f92c5010a751b21c95be2537965d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-license-plate-detection-barrier-0106/FP16-INT8/vehicle-license-plate-detection-barrier-0106.xml + size: 559626 + sha256: 4844c1c3f736578745a3eb71a225e77d703a2f1b83e15444bce77e54bfca21f5 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-license-plate-detection-barrier-0106/FP16-INT8/vehicle-license-plate-detection-barrier-0106.xml - name: FP16-INT8/vehicle-license-plate-detection-barrier-0106.bin - size: 693924 - sha256: 4cd37f74a02c971023d9f5169f233313cd187246e08c3ae9c41214d247a9fb4a - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/vehicle-license-plate-detection-barrier-0106/FP16-INT8/vehicle-license-plate-detection-barrier-0106.bin + size: 693920 + sha256: cb6704a2814c80176108d25d34b734ae8d01e6c7a0d8b9154d9948d5df1622e6 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/vehicle-license-plate-detection-barrier-0106/FP16-INT8/vehicle-license-plate-detection-barrier-0106.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/weld-porosity-detection-0001/description/weld-porosity-detection-0001.md b/models/intel/weld-porosity-detection-0001/description/weld-porosity-detection-0001.md index 09462af5e81..6e84a57a96a 100644 --- a/models/intel/weld-porosity-detection-0001/description/weld-porosity-detection-0001.md +++ b/models/intel/weld-porosity-detection-0001/description/weld-porosity-detection-0001.md @@ -19,8 +19,6 @@ This is a porosity weld recognition model. It runs on a video stream capturing w | Source framework | PyTorch\* | -## Performance - ## Inputs Name: `input`, shape: [1x3x224x224] - An input image in the format [BxCxHxW], diff --git a/models/intel/weld-porosity-detection-0001/model.yml b/models/intel/weld-porosity-detection-0001/model.yml index cf962221da1..a3896291862 100644 --- a/models/intel/weld-porosity-detection-0001/model.yml +++ b/models/intel/weld-porosity-detection-0001/model.yml @@ -17,28 +17,28 @@ description: >- task_type: action_recognition files: - name: FP32/weld-porosity-detection-0001.xml - size: 58986 - sha256: e5bea076928908927c9646250954c2d627fc4fd533e143650802a4fe884597a8 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/weld-porosity-detection-0001/FP32/weld-porosity-detection-0001.xml + size: 59350 + sha256: 6e937f324247f2da0f12f0ba9f44bfe59a9826e02488047afea3ce3e5239f61c + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/weld-porosity-detection-0001/FP32/weld-porosity-detection-0001.xml - name: FP32/weld-porosity-detection-0001.bin size: 44693044 sha256: 91fd5057ce1213c705518648dbf62e16a59061e8f2dcd02b83a9137d66ba6327 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/weld-porosity-detection-0001/FP32/weld-porosity-detection-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/weld-porosity-detection-0001/FP32/weld-porosity-detection-0001.bin - name: FP16/weld-porosity-detection-0001.xml - size: 58961 - sha256: c9aba330cfac5bf9f2faf8d6d2db3d9b7ade5ac912acaf3f0f4bc38246a14c93 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/weld-porosity-detection-0001/FP16/weld-porosity-detection-0001.xml + size: 59325 + sha256: 5b59594760ba2e2cf11694d7357c4d65a6deaeccf8fb8843e3f2e5626722de30 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/weld-porosity-detection-0001/FP16/weld-porosity-detection-0001.xml - name: FP16/weld-porosity-detection-0001.bin size: 22346530 sha256: 157c06cd80929fc4abec9ffa760345e0dae536a98034e0f45a3b247d285d13cf - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/weld-porosity-detection-0001/FP16/weld-porosity-detection-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/weld-porosity-detection-0001/FP16/weld-porosity-detection-0001.bin - name: FP16-INT8/weld-porosity-detection-0001.xml - size: 165070 - sha256: 138ab3c348cb5e22f0ec69e8155b060edce81bcc4ecd35425dd11e2b48ad4650 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/weld-porosity-detection-0001/FP16-INT8/weld-porosity-detection-0001.xml + size: 165492 + sha256: a513e0fb153fdf0089c69f1b5fd6d6a425ee6338032185a0a55aec9a03511882 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/weld-porosity-detection-0001/FP16-INT8/weld-porosity-detection-0001.xml - name: FP16-INT8/weld-porosity-detection-0001.bin size: 11197382 sha256: 99ba305a093a17a517112f4de0db5fa5bf6afc0a409d700966017102983d0705 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/weld-porosity-detection-0001/FP16-INT8/weld-porosity-detection-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/weld-porosity-detection-0001/FP16-INT8/weld-porosity-detection-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/yolo-v2-ava-0001/description/yolo-v2-ava-0001.md b/models/intel/yolo-v2-ava-0001/description/yolo-v2-ava-0001.md index c995c986dc3..e99e3121e75 100644 --- a/models/intel/yolo-v2-ava-0001/description/yolo-v2-ava-0001.md +++ b/models/intel/yolo-v2-ava-0001/description/yolo-v2-ava-0001.md @@ -4,8 +4,6 @@ This is a reimplemented and retrained version of the [YOLO v2](https://arxiv.org/abs/1612.08242) object detection network trained with the VOC2012 training dataset. -## Example - ## Specification | Metric | Value | @@ -17,8 +15,6 @@ This is a reimplemented and retrained version of the [YOLO v2](https://arxiv.org For Average Precision metric description, see [The PASCAL Visual Object Classes (VOC) Challenge](https://doi.org/10.1007/s11263-009-0275-4). Tested on the VOC 2012 validation dataset. -## Performance - ## Inputs Name: `input`, shape: [1x3x416x416] - An input image in the format [BxCxHxW], diff --git a/models/intel/yolo-v2-ava-0001/model.yml b/models/intel/yolo-v2-ava-0001/model.yml index ae9f2fc5d54..f75abac06ba 100644 --- a/models/intel/yolo-v2-ava-0001/model.yml +++ b/models/intel/yolo-v2-ava-0001/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/yolo-v2-ava-0001.xml - size: 75647 - sha256: a47c27bc83ac29efb284f35a40d8643123ab093b6e2e8dbe0bbc31503ffbb0c7 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-ava-0001/FP32/yolo-v2-ava-0001.xml + size: 75678 + sha256: ac2f5977c556acb73c0beff5440abeeee5be984f193348aa4bc9a8774b3db0da + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-ava-0001/FP32/yolo-v2-ava-0001.xml - name: FP32/yolo-v2-ava-0001.bin size: 202580240 sha256: ec32cd3d02e629685dc818a8af5734630c1f778a8a715cef93444aeb1bc88132 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-ava-0001/FP32/yolo-v2-ava-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-ava-0001/FP32/yolo-v2-ava-0001.bin - name: FP16/yolo-v2-ava-0001.xml - size: 75618 - sha256: 3fd104830f8887fec9982f6fcff3ee6a231f74aed68e8ff6e9e2f08c7963c16c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-ava-0001/FP16/yolo-v2-ava-0001.xml + size: 75649 + sha256: c4ea86b73a4146e45265f94d7979882b09a9ed78f7871ce322f60ab60f155f39 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-ava-0001/FP16/yolo-v2-ava-0001.xml - name: FP16/yolo-v2-ava-0001.bin size: 101290122 sha256: 3d64e39d4c0378eaf870834a072725bc9e7320a5cc4ffa3422f13d0dcd170ddf - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-ava-0001/FP16/yolo-v2-ava-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-ava-0001/FP16/yolo-v2-ava-0001.bin - name: FP16-INT8/yolo-v2-ava-0001.xml - size: 180357 - sha256: 84719bd6f8f5104366af999386d677eb54f885a6106b618f2c1fb30fbdc1c4c1 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-ava-0001/FP16-INT8/yolo-v2-ava-0001.xml + size: 180872 + sha256: 1fda03897502bd625cce796112ed3678a549cd6ee3175e94461199e5676d777f + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-ava-0001/FP16-INT8/yolo-v2-ava-0001.xml - name: FP16-INT8/yolo-v2-ava-0001.bin size: 50697470 sha256: d8c16e38c27635f2054fe1d66ca38a893508136a4be43aad53e66f04725a70b8 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-ava-0001/FP16-INT8/yolo-v2-ava-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-ava-0001/FP16-INT8/yolo-v2-ava-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/yolo-v2-ava-sparse-35-0001/description/yolo-v2-ava-sparse-35-0001.md b/models/intel/yolo-v2-ava-sparse-35-0001/description/yolo-v2-ava-sparse-35-0001.md index c72c3f7b1ae..18d2594a9bd 100644 --- a/models/intel/yolo-v2-ava-sparse-35-0001/description/yolo-v2-ava-sparse-35-0001.md +++ b/models/intel/yolo-v2-ava-sparse-35-0001/description/yolo-v2-ava-sparse-35-0001.md @@ -5,8 +5,6 @@ This is a reimplemented and retrained version of the [YOLO v2](https://arxiv.org/abs/1612.08242) object detection network trained with the VOC2012 training dataset. [Network weight pruning](https://arxiv.org/abs/1710.01878) is applied to sparsify convolution layers (35% of network parameters are set to zeros). -## Example - ## Specification | Metric | Value | @@ -18,8 +16,6 @@ This is a reimplemented and retrained version of the [YOLO v2](https://arxiv.org For Average Precision metric description, see [The PASCAL Visual Object Classes (VOC) Challenge](https://doi.org/10.1007/s11263-009-0275-4). Tested on the VOC 2012 validation dataset. -## Performance - ## Inputs Name: `input`, shape: [1x3x416x416] - An input image in the format [BxCxHxW], diff --git a/models/intel/yolo-v2-ava-sparse-35-0001/model.yml b/models/intel/yolo-v2-ava-sparse-35-0001/model.yml index 3ce7ed31704..b1fed5b752b 100644 --- a/models/intel/yolo-v2-ava-sparse-35-0001/model.yml +++ b/models/intel/yolo-v2-ava-sparse-35-0001/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/yolo-v2-ava-sparse-35-0001.xml - size: 75667 - sha256: c1754f5d99520367ffb1011fb80d8ea422822f5c9f6f2a9fa7668d26a821941d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-ava-sparse-35-0001/FP32/yolo-v2-ava-sparse-35-0001.xml + size: 75698 + sha256: d6ebac563ac3fdeaddc33d76f6da4bd90137b69d89c2d27cb38c4f2074019035 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-ava-sparse-35-0001/FP32/yolo-v2-ava-sparse-35-0001.xml - name: FP32/yolo-v2-ava-sparse-35-0001.bin size: 202580240 sha256: 3ba29689fd746d99e758ba15e6285d4d6e10e06616ca3113f2f7fbb2c0f85511 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-ava-sparse-35-0001/FP32/yolo-v2-ava-sparse-35-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-ava-sparse-35-0001/FP32/yolo-v2-ava-sparse-35-0001.bin - name: FP16/yolo-v2-ava-sparse-35-0001.xml - size: 75638 - sha256: 56d9ae81eba87271b83202e74fdb73fa5c6ee8fb6e9ff6ec422e79dfa67ac789 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-ava-sparse-35-0001/FP16/yolo-v2-ava-sparse-35-0001.xml + size: 75669 + sha256: be5d4920827bd2ca8c17fb792f72d9384536777cc13a7e48dbb2b0826ec79bd2 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-ava-sparse-35-0001/FP16/yolo-v2-ava-sparse-35-0001.xml - name: FP16/yolo-v2-ava-sparse-35-0001.bin size: 101290122 sha256: 70b6f76b11edb38761d707555ed50183b36eece352bd01af5d10fdcda7a6ff3b - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-ava-sparse-35-0001/FP16/yolo-v2-ava-sparse-35-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-ava-sparse-35-0001/FP16/yolo-v2-ava-sparse-35-0001.bin - name: FP16-INT8/yolo-v2-ava-sparse-35-0001.xml - size: 180387 - sha256: 5666ba4725009494d663617aa22881788fef2cd75a61a9403871483045022dd6 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-ava-sparse-35-0001/FP16-INT8/yolo-v2-ava-sparse-35-0001.xml + size: 180902 + sha256: c30210705d2cd256ff8b703798fcf87aacb878e76c608486c5060be566e8532f + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-ava-sparse-35-0001/FP16-INT8/yolo-v2-ava-sparse-35-0001.xml - name: FP16-INT8/yolo-v2-ava-sparse-35-0001.bin size: 50697470 sha256: f786129538ced2e27d03bda6250e6ea8b3905b73151896c04bcda9f88ca0b02e - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-ava-sparse-35-0001/FP16-INT8/yolo-v2-ava-sparse-35-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-ava-sparse-35-0001/FP16-INT8/yolo-v2-ava-sparse-35-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/yolo-v2-ava-sparse-70-0001/description/yolo-v2-ava-sparse-70-0001.md b/models/intel/yolo-v2-ava-sparse-70-0001/description/yolo-v2-ava-sparse-70-0001.md index 35d0cdd8ae1..bfd42796d2d 100644 --- a/models/intel/yolo-v2-ava-sparse-70-0001/description/yolo-v2-ava-sparse-70-0001.md +++ b/models/intel/yolo-v2-ava-sparse-70-0001/description/yolo-v2-ava-sparse-70-0001.md @@ -5,8 +5,6 @@ This is a reimplemented and retrained version of the [YOLO v2](https://arxiv.org/abs/1612.08242) object detection network trained with the VOC2012 training dataset. [Network weight pruning](https://arxiv.org/abs/1710.01878) is applied to sparsify convolution layers (70% of network parameters are set to zeros). -## Example - ## Specification | Metric | Value | @@ -18,8 +16,6 @@ This is a reimplemented and retrained version of the [YOLO v2](https://arxiv.org For Average Precision metric description, see [The PASCAL Visual Object Classes (VOC) Challenge](https://doi.org/10.1007/s11263-009-0275-4). Tested on the VOC 2012 validation dataset. -## Performance - ## Inputs Name: `input`, shape: [1x3x416x416] - An input image in the format [BxCxHxW], diff --git a/models/intel/yolo-v2-ava-sparse-70-0001/model.yml b/models/intel/yolo-v2-ava-sparse-70-0001/model.yml index c886443f66b..f38864b2733 100644 --- a/models/intel/yolo-v2-ava-sparse-70-0001/model.yml +++ b/models/intel/yolo-v2-ava-sparse-70-0001/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/yolo-v2-ava-sparse-70-0001.xml - size: 75667 - sha256: 34c7f5bccf536e0e3e3877f04c030276ad056c06282ae26158eafba268f855e1 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-ava-sparse-70-0001/FP32/yolo-v2-ava-sparse-70-0001.xml + size: 75698 + sha256: 6d8207ad48e433618d8fae04dec74b06b4a9be94f3b4e298f4eeef1c030b72f9 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-ava-sparse-70-0001/FP32/yolo-v2-ava-sparse-70-0001.xml - name: FP32/yolo-v2-ava-sparse-70-0001.bin size: 202580240 sha256: 8af740a7af01a06561f599f4a0b0c9d7e423437bc6acab0f123bce170978e420 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-ava-sparse-70-0001/FP32/yolo-v2-ava-sparse-70-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-ava-sparse-70-0001/FP32/yolo-v2-ava-sparse-70-0001.bin - name: FP16/yolo-v2-ava-sparse-70-0001.xml - size: 75638 - sha256: 3b9a7dfddf8ed4a68555a29fca68f5ca668ec56ed48570cc5f89fd64bf62f893 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-ava-sparse-70-0001/FP16/yolo-v2-ava-sparse-70-0001.xml + size: 75669 + sha256: dcb69c5d6b2562a59ef3b6270f5369a263edb4e0ff9cfca42743faec0e05c23e + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-ava-sparse-70-0001/FP16/yolo-v2-ava-sparse-70-0001.xml - name: FP16/yolo-v2-ava-sparse-70-0001.bin size: 101290122 sha256: 4e377e55053fa15b52d8e4012418143c7430b8a337353ef1aeb88cbe9c50a7ff - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-ava-sparse-70-0001/FP16/yolo-v2-ava-sparse-70-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-ava-sparse-70-0001/FP16/yolo-v2-ava-sparse-70-0001.bin - name: FP16-INT8/yolo-v2-ava-sparse-70-0001.xml - size: 180387 - sha256: 74541b0026900cc228e6284cb00ed7711961ec2881bc7e6bd5276c7749f5fddf - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-ava-sparse-70-0001/FP16-INT8/yolo-v2-ava-sparse-70-0001.xml + size: 180902 + sha256: 7311ca364e2eb006c78f0b5d03af88017edd880a284039db9fac48f5ba927061 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-ava-sparse-70-0001/FP16-INT8/yolo-v2-ava-sparse-70-0001.xml - name: FP16-INT8/yolo-v2-ava-sparse-70-0001.bin size: 50697470 sha256: 8764f1f0d270a344c086e49d7d81ea8dc8e862a07362646ff2e42d88cddf13a6 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-ava-sparse-70-0001/FP16-INT8/yolo-v2-ava-sparse-70-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-ava-sparse-70-0001/FP16-INT8/yolo-v2-ava-sparse-70-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/yolo-v2-tiny-ava-0001/description/yolo-v2-tiny-ava-0001.md b/models/intel/yolo-v2-tiny-ava-0001/description/yolo-v2-tiny-ava-0001.md index 834599a0d54..54ff07acf9d 100644 --- a/models/intel/yolo-v2-tiny-ava-0001/description/yolo-v2-tiny-ava-0001.md +++ b/models/intel/yolo-v2-tiny-ava-0001/description/yolo-v2-tiny-ava-0001.md @@ -4,8 +4,6 @@ This is a reimplemented and retrained version of the [tiny YOLO v2](https://arxiv.org/abs/1612.08242) object detection network trained with the VOC2012 training dataset. -## Example - ## Specification | Metric | Value | @@ -17,8 +15,6 @@ This is a reimplemented and retrained version of the [tiny YOLO v2](https://arxi For Average Precision metric description, see [The PASCAL Visual Object Classes (VOC) Challenge](https://doi.org/10.1007/s11263-009-0275-4). Tested on the VOC 2012 validation dataset. -## Performance - ## Inputs Name: `input`, shape: [1x3x416x416] - An input image in the format [BxCxHxW], diff --git a/models/intel/yolo-v2-tiny-ava-0001/model.yml b/models/intel/yolo-v2-tiny-ava-0001/model.yml index 360f2fe0b5f..3c816cff782 100644 --- a/models/intel/yolo-v2-tiny-ava-0001/model.yml +++ b/models/intel/yolo-v2-tiny-ava-0001/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/yolo-v2-tiny-ava-0001.xml - size: 33098 - sha256: c5f2d47c97be06eed16aa512b67485f9c561dfd65c7dd01a1ab0f94d3b8f8f1d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-tiny-ava-0001/FP32/yolo-v2-tiny-ava-0001.xml + size: 33143 + sha256: 59f07c9b4da89a6a1550ac10bd6d774bec6f6b30ca25917cfa712665cdd3e88c + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-tiny-ava-0001/FP32/yolo-v2-tiny-ava-0001.xml - name: FP32/yolo-v2-tiny-ava-0001.bin size: 63434896 sha256: d7d0219f039d9621efccc3c43e6c74ad6222ee7ba526901e9975ba5661433322 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-tiny-ava-0001/FP32/yolo-v2-tiny-ava-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-tiny-ava-0001/FP32/yolo-v2-tiny-ava-0001.bin - name: FP16/yolo-v2-tiny-ava-0001.xml - size: 33077 - sha256: 3c95810c8595da9a37cdba854028a198bd9f74b13a98c9744c94afd24b23e982 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-tiny-ava-0001/FP16/yolo-v2-tiny-ava-0001.xml + size: 33122 + sha256: 39b9e60c533ed83dec1fc0c5b34ff5ba975c2e238d9b6e5afd6b4231304ba347 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-tiny-ava-0001/FP16/yolo-v2-tiny-ava-0001.xml - name: FP16/yolo-v2-tiny-ava-0001.bin size: 31717450 sha256: a28d0eced820152c696375390124d6e63ed56048190f29982a0d5fd2ce8d2cf4 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-tiny-ava-0001/FP16/yolo-v2-tiny-ava-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-tiny-ava-0001/FP16/yolo-v2-tiny-ava-0001.bin - name: FP16-INT8/yolo-v2-tiny-ava-0001.xml - size: 75015 - sha256: c563ea1ebeb2006db857c394e0ac1f4f42af7dfdff8a12670dfa7b4de6791dd8 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-tiny-ava-0001/FP16-INT8/yolo-v2-tiny-ava-0001.xml + size: 75250 + sha256: 3fb7d9cbd3fc74fcf724c072d8746c55d8520af6b7525504e773d3687e17cbde + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-tiny-ava-0001/FP16-INT8/yolo-v2-tiny-ava-0001.xml - name: FP16-INT8/yolo-v2-tiny-ava-0001.bin size: 15874678 sha256: f6dceee10667e199e04bb75fdf3b0b2a37ae5aadfb6f665b29b044c366a0d03f - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-tiny-ava-0001/FP16-INT8/yolo-v2-tiny-ava-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-tiny-ava-0001/FP16-INT8/yolo-v2-tiny-ava-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/yolo-v2-tiny-ava-sparse-30-0001/description/yolo-v2-tiny-ava-sparse-30-0001.md b/models/intel/yolo-v2-tiny-ava-sparse-30-0001/description/yolo-v2-tiny-ava-sparse-30-0001.md index c632728876a..ed20eaf2435 100644 --- a/models/intel/yolo-v2-tiny-ava-sparse-30-0001/description/yolo-v2-tiny-ava-sparse-30-0001.md +++ b/models/intel/yolo-v2-tiny-ava-sparse-30-0001/description/yolo-v2-tiny-ava-sparse-30-0001.md @@ -5,8 +5,6 @@ This is a reimplemented and retrained version of the [tiny YOLO v2](https://arxiv.org/abs/1612.08242) object detection network trained with the VOC2012 training dataset. [Network weight pruning](https://arxiv.org/abs/1710.01878) is applied to sparsify convolution layers (30% of network parameters are set to zeros). -## Example - ## Specification | Metric | Value | @@ -18,8 +16,6 @@ This is a reimplemented and retrained version of the [tiny YOLO v2](https://arxi For Average Precision metric description, see [The PASCAL Visual Object Classes (VOC) Challenge](https://doi.org/10.1007/s11263-009-0275-4). Tested on the VOC 2012 validation dataset. -## Performance - ## Inputs Name: `input`, shape: [1x3x416x416] - An input image in the format [BxCxHxW], diff --git a/models/intel/yolo-v2-tiny-ava-sparse-30-0001/model.yml b/models/intel/yolo-v2-tiny-ava-sparse-30-0001/model.yml index f44450dc15d..aa88bfe2cf0 100644 --- a/models/intel/yolo-v2-tiny-ava-sparse-30-0001/model.yml +++ b/models/intel/yolo-v2-tiny-ava-sparse-30-0001/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/yolo-v2-tiny-ava-sparse-30-0001.xml - size: 33118 - sha256: 235f4b92e414e2e48857befd8a8bf6cfac157d4eaac495eab47496bcdb627bfb - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-tiny-ava-sparse-30-0001/FP32/yolo-v2-tiny-ava-sparse-30-0001.xml + size: 33163 + sha256: bc563eb723dc8dcc764357b7e6cb9332fdee9f28bb89c955fbf832ac3be77ada + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-tiny-ava-sparse-30-0001/FP32/yolo-v2-tiny-ava-sparse-30-0001.xml - name: FP32/yolo-v2-tiny-ava-sparse-30-0001.bin size: 63434896 sha256: 89199208d5a6491141f1dc469b8b98d0c9d43de22b10f8ab57cbbc656c57d200 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-tiny-ava-sparse-30-0001/FP32/yolo-v2-tiny-ava-sparse-30-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-tiny-ava-sparse-30-0001/FP32/yolo-v2-tiny-ava-sparse-30-0001.bin - name: FP16/yolo-v2-tiny-ava-sparse-30-0001.xml - size: 33097 - sha256: 4f8852998ecca974d95d219e739c0c918678e53efc7a2a9e8df60896d06034ec - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-tiny-ava-sparse-30-0001/FP16/yolo-v2-tiny-ava-sparse-30-0001.xml + size: 33142 + sha256: d5430d298f4ae9ca26642f1e201e5a101a748ca9a145cc4afc4b6f2ba0076987 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-tiny-ava-sparse-30-0001/FP16/yolo-v2-tiny-ava-sparse-30-0001.xml - name: FP16/yolo-v2-tiny-ava-sparse-30-0001.bin size: 31717450 sha256: 026eaff315755ad66f7dca256f99b02e2aed68dcf3fcc2641d403dfd88d21f2d - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-tiny-ava-sparse-30-0001/FP16/yolo-v2-tiny-ava-sparse-30-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-tiny-ava-sparse-30-0001/FP16/yolo-v2-tiny-ava-sparse-30-0001.bin - name: FP16-INT8/yolo-v2-tiny-ava-sparse-30-0001.xml - size: 75045 - sha256: eeec04202c134e384209531a82eb54ce5dbad29bd32aed8211ab25998f4a85f7 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-tiny-ava-sparse-30-0001/FP16-INT8/yolo-v2-tiny-ava-sparse-30-0001.xml + size: 75280 + sha256: 02f52d142e963090eade613a374d341de1bf64b7bb84de62641b5ce77d115dc4 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-tiny-ava-sparse-30-0001/FP16-INT8/yolo-v2-tiny-ava-sparse-30-0001.xml - name: FP16-INT8/yolo-v2-tiny-ava-sparse-30-0001.bin size: 15874678 sha256: a28520da3895d3d2b33027cd15d9d8001f76f337552fecfbf03166227fe94f57 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-tiny-ava-sparse-30-0001/FP16-INT8/yolo-v2-tiny-ava-sparse-30-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-tiny-ava-sparse-30-0001/FP16-INT8/yolo-v2-tiny-ava-sparse-30-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/yolo-v2-tiny-ava-sparse-60-0001/description/yolo-v2-tiny-ava-sparse-60-0001.md b/models/intel/yolo-v2-tiny-ava-sparse-60-0001/description/yolo-v2-tiny-ava-sparse-60-0001.md index d77f2af6db9..1f5cc32d7f1 100644 --- a/models/intel/yolo-v2-tiny-ava-sparse-60-0001/description/yolo-v2-tiny-ava-sparse-60-0001.md +++ b/models/intel/yolo-v2-tiny-ava-sparse-60-0001/description/yolo-v2-tiny-ava-sparse-60-0001.md @@ -5,8 +5,6 @@ This is a reimplemented and retrained version of the [tiny YOLO v2](https://arxiv.org/abs/1612.08242) object detection network trained with the VOC2012 training dataset. [Network weight pruning](https://arxiv.org/abs/1710.01878) is applied to sparsify convolution layers (60% of network parameters are set to zeros). -## Example - ## Specification | Metric | Value | @@ -18,8 +16,6 @@ This is a reimplemented and retrained version of the [tiny YOLO v2](https://arxi For Average Precision metric description, see [The PASCAL Visual Object Classes (VOC) Challenge](https://doi.org/10.1007/s11263-009-0275-4). Tested on the VOC 2012 validation dataset. -## Performance - ## Inputs Name: `input`, shape: [1x3x416x416] - An input image in the format [BxCxHxW], diff --git a/models/intel/yolo-v2-tiny-ava-sparse-60-0001/model.yml b/models/intel/yolo-v2-tiny-ava-sparse-60-0001/model.yml index 2fea6b80421..d5c49c13a0c 100644 --- a/models/intel/yolo-v2-tiny-ava-sparse-60-0001/model.yml +++ b/models/intel/yolo-v2-tiny-ava-sparse-60-0001/model.yml @@ -17,28 +17,28 @@ description: >- task_type: detection files: - name: FP32/yolo-v2-tiny-ava-sparse-60-0001.xml - size: 33150 - sha256: 6dab95ea7393c4d8ccfde5f67205fbdbc978409b44ff066e76a1d374af9489aa - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-tiny-ava-sparse-60-0001/FP32/yolo-v2-tiny-ava-sparse-60-0001.xml + size: 33179 + sha256: 63072983f6dee52b753a5b4141388bc0738237c87a4a4d7447d6170dd3fc48c9 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-tiny-ava-sparse-60-0001/FP32/yolo-v2-tiny-ava-sparse-60-0001.xml - name: FP32/yolo-v2-tiny-ava-sparse-60-0001.bin size: 63434896 sha256: a75760129ebfa1954aa8f244020193bab0a7f6f85450435f696f602155eb80b6 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-tiny-ava-sparse-60-0001/FP32/yolo-v2-tiny-ava-sparse-60-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-tiny-ava-sparse-60-0001/FP32/yolo-v2-tiny-ava-sparse-60-0001.bin - name: FP16/yolo-v2-tiny-ava-sparse-60-0001.xml - size: 33129 - sha256: e53b40921749ead39c2e3096d2787f1813e70ba89f2b2087d2c9c22d6afa6a3c - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-tiny-ava-sparse-60-0001/FP16/yolo-v2-tiny-ava-sparse-60-0001.xml + size: 33158 + sha256: 8e4116afa2f8376469cdbf66ccee15fbdc5c11d417d0224e07c61570c64c8c1e + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-tiny-ava-sparse-60-0001/FP16/yolo-v2-tiny-ava-sparse-60-0001.xml - name: FP16/yolo-v2-tiny-ava-sparse-60-0001.bin size: 31717450 sha256: df0df94838247c45b8cd1918b52140aff0ffaa1cdecd5450e0f8ee261adaf757 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-tiny-ava-sparse-60-0001/FP16/yolo-v2-tiny-ava-sparse-60-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-tiny-ava-sparse-60-0001/FP16/yolo-v2-tiny-ava-sparse-60-0001.bin - name: FP16-INT8/yolo-v2-tiny-ava-sparse-60-0001.xml - size: 75061 - sha256: 024bea0b16513cc610604741ec8dd95c4b35de1fd31a3a435fa22dd9b8b42500 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-tiny-ava-sparse-60-0001/FP16-INT8/yolo-v2-tiny-ava-sparse-60-0001.xml + size: 75296 + sha256: 5c6c5be42542b24c3bff4d65620e0bef0876fb70a08a54a8ae69d30466d0c96f + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-tiny-ava-sparse-60-0001/FP16-INT8/yolo-v2-tiny-ava-sparse-60-0001.xml - name: FP16-INT8/yolo-v2-tiny-ava-sparse-60-0001.bin size: 15874678 sha256: 7037e6d2d29d8dd3832612d16dd295f03e97ca88e22765e1adbcccebbeedb281 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-tiny-ava-sparse-60-0001/FP16-INT8/yolo-v2-tiny-ava-sparse-60-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-tiny-ava-sparse-60-0001/FP16-INT8/yolo-v2-tiny-ava-sparse-60-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/intel/yolo-v2-tiny-vehicle-detection-0001/model.yml b/models/intel/yolo-v2-tiny-vehicle-detection-0001/model.yml index 9907e8502ca..d281c505054 100644 --- a/models/intel/yolo-v2-tiny-vehicle-detection-0001/model.yml +++ b/models/intel/yolo-v2-tiny-vehicle-detection-0001/model.yml @@ -13,32 +13,32 @@ # limitations under the License. description: >- - YOLO Tiny v2 (https://arxiv.org/pdf/1612.08242.pdf) fine-tuned for vehicles detection + YOLO Tiny v2 (https://arxiv.org/abs/1612.08242) fine-tuned for vehicles detection task_type: detection files: - name: FP32/yolo-v2-tiny-vehicle-detection-0001.xml - size: 31268 - sha256: 28a0e0955947e8c84ca2b29c1694c5c8e1c0875e899469f163e928adbebcece6 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-tiny-vehicle-detection-0001/FP32/yolo-v2-tiny-vehicle-detection-0001.xml + size: 31182 + sha256: e23d0c151ae08a631b8259784712d300e06bb3364c601e648c7e73d9d97b7bdc + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-tiny-vehicle-detection-0001/FP32/yolo-v2-tiny-vehicle-detection-0001.xml - name: FP32/yolo-v2-tiny-vehicle-detection-0001.bin size: 44918056 sha256: b15e36bcc6763676fd25db67c328242875f0257ef7faf2d3bd8cebfb032151f5 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-tiny-vehicle-detection-0001/FP32/yolo-v2-tiny-vehicle-detection-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-tiny-vehicle-detection-0001/FP32/yolo-v2-tiny-vehicle-detection-0001.bin - name: FP16/yolo-v2-tiny-vehicle-detection-0001.xml - size: 31248 - sha256: 114515b171abf53044825de32f59c20f048b0de650bc78121273aaeb9a818da7 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-tiny-vehicle-detection-0001/FP16/yolo-v2-tiny-vehicle-detection-0001.xml + size: 31162 + sha256: aa54cecd89fa5dfa83917d654c843968cee5803af928b0a6f33b67df4a09c119 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-tiny-vehicle-detection-0001/FP16/yolo-v2-tiny-vehicle-detection-0001.xml - name: FP16/yolo-v2-tiny-vehicle-detection-0001.bin size: 22459030 sha256: 15aee0ac39cdfeff0f8dfdb85e8b3152331df42d879ba76e9d3c5e7548ca3007 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-tiny-vehicle-detection-0001/FP16/yolo-v2-tiny-vehicle-detection-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-tiny-vehicle-detection-0001/FP16/yolo-v2-tiny-vehicle-detection-0001.bin - name: FP16-INT8/yolo-v2-tiny-vehicle-detection-0001.xml - size: 72265 - sha256: 952e3b6c2e76a39c2f397d6180474c04911a59e9fd6b7c2f2b9467b8b4c00800 - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-tiny-vehicle-detection-0001/FP16-INT8/yolo-v2-tiny-vehicle-detection-0001.xml + size: 72462 + sha256: a3f22e33d763f7f6846cba9a7d4ad649b700664ca79ae560c6ffa572f1f8a8e5 + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-tiny-vehicle-detection-0001/FP16-INT8/yolo-v2-tiny-vehicle-detection-0001.xml - name: FP16-INT8/yolo-v2-tiny-vehicle-detection-0001.bin size: 11244400 sha256: fef3b00120b62f500fc16bf3c652803f656d3bbfcb7c4ae2be773b5c4149cbaf - source: https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/2/yolo-v2-tiny-vehicle-detection-0001/FP16-INT8/yolo-v2-tiny-vehicle-detection-0001.bin + source: https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.2/models_bin/3/yolo-v2-tiny-vehicle-detection-0001/FP16-INT8/yolo-v2-tiny-vehicle-detection-0001.bin framework: dldt -license: https://raw.githubusercontent.com/opencv/open_model_zoo/master/LICENSE +license: https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE diff --git a/models/public/Sphereface/Sphereface.md b/models/public/Sphereface/Sphereface.md index 7ed3987a255..5ac0665be71 100644 --- a/models/public/Sphereface/Sphereface.md +++ b/models/public/Sphereface/Sphereface.md @@ -4,8 +4,6 @@ [Deep face recognition under open-set protocol](https://arxiv.org/abs/1704.08063) -## Example - ## Specification | Metric | Value | @@ -21,8 +19,6 @@ | ------ | ----- | | LFW accuracy | 98.8321%| -## Performance - ## Input ### Original model diff --git a/models/public/aclnet/accuracy-check.yml b/models/public/aclnet/accuracy-check.yml new file mode 100644 index 00000000000..fadd34a557e --- /dev/null +++ b/models/public/aclnet/accuracy-check.yml @@ -0,0 +1,23 @@ +models: + - name: aclnet + + launchers: + - framework: dlsdk + adapter: classification + + datasets: + - name: sound_classification + + preprocessing: + - type: clip_audio + duration: 1 + overlap: 50% + - type: audio_normalization + + metrics: + - type: accuracy + name: top@1 + top_k: 1 + - type: accuracy + name: top@5 + top_k: 5 diff --git a/models/public/aclnet/aclnet.md b/models/public/aclnet/aclnet.md index afbd19d8bc4..7e5c9964146 100644 --- a/models/public/aclnet/aclnet.md +++ b/models/public/aclnet/aclnet.md @@ -4,14 +4,12 @@ The `AclNet` model is designed to perform sound classification. The `AclNet` model is trained on an internal dataset of environmental sounds. -For details about the model, see this [paper](https://arxiv.org/pdf/1811.06669.pdf). +For details about the model, see this [paper](https://arxiv.org/abs/1811.06669). The model input is a segment of PCM audio samples in [N, C, 1, L] format. The model output for `AclNet` is the sound classifier output for the 53 different environmental sound classes from the internal sound database. -## Example - ## Specification | Metric | Value | @@ -23,9 +21,7 @@ The model output for `AclNet` is the sound classifier output for the 53 differen ## Accuracy -See this [publication](http://dcase.community/documents/workshop2019/proceedings/DCASE2019Workshop_Huang_52.pdf) and this [paper](https://arxiv.org/pdf/1811.06669.pdf). - -## Performance +See this [publication](http://dcase.community/documents/workshop2019/proceedings/DCASE2019Workshop_Huang_52.pdf) and this [paper](https://arxiv.org/abs/1811.06669). ## Input diff --git a/models/public/aclnet/model.yml b/models/public/aclnet/model.yml index ab8d96bef6d..05651365eb5 100644 --- a/models/public/aclnet/model.yml +++ b/models/public/aclnet/model.yml @@ -15,7 +15,7 @@ description: >- The "AclNet" model is designed to perform sound classification. The "AclNet" model is trained on an internal dataset of environmental sounds. For details about the - model, see this paper . + model, see this paper . The model input is a segment of PCM audio samples in [N, C, H, W] format with the shape [1, 1, 1, 16000]. diff --git a/models/public/alexnet/alexnet.md b/models/public/alexnet/alexnet.md index d7a7c4be9b5..acbc9870140 100644 --- a/models/public/alexnet/alexnet.md +++ b/models/public/alexnet/alexnet.md @@ -8,8 +8,6 @@ The model input is a blob that consists of a single image of 1x3x227x227 in BGR The model output for `alexnet` is the usual object classifier output for the 1000 different classifications matching those in the ImageNet database. -## Example - ## Specification | Metric | Value | @@ -28,8 +26,6 @@ The model output for `alexnet` is the usual object classifier output for the 100 See [the original model's documentation](https://github.com/BVLC/caffe/tree/master/models/bvlc_alexnet). -## Performance - ## Input ### Original model diff --git a/models/public/anti-spoof-mn3/accuracy-check.yml b/models/public/anti-spoof-mn3/accuracy-check.yml new file mode 100644 index 00000000000..4c78cb0d171 --- /dev/null +++ b/models/public/anti-spoof-mn3/accuracy-check.yml @@ -0,0 +1,18 @@ +models: + - name: anti-spoof-mn3 + + launchers: + - framework: dlsdk + adapter: classification + + datasets: + - name: antispoof_test_data + + preprocessing: + - type: resize + size: 128 + interpolation: CUBIC + + metrics: + - name: acer + type: acer_score diff --git a/models/public/anti-spoof-mn3/anti-spoof-mn3.md b/models/public/anti-spoof-mn3/anti-spoof-mn3.md new file mode 100644 index 00000000000..515683d1a38 --- /dev/null +++ b/models/public/anti-spoof-mn3/anti-spoof-mn3.md @@ -0,0 +1,69 @@ +# anti-spoof-mn3 + +## Use Case and High-Level Description + +The `anti-spoof-mn3` model is an anti-spoofing binary classificator based on the [MobileNetv3](https://arxiv.org/abs/1905.02244), trained on the [CelebA-Spoof dataset](https://arxiv.org/abs/2007.12342). It's a small, light model, trained to predict whether or not a spoof RGB image given to the input. A lot of advanced techniques have been tried and selected the best suit options for the task. +For details see original [repository](https://github.com/kirillProkofiev/light-weight-face-anti-spoofing). + +## Specification + +| Metric | Value | +|---------------------------------|-------------------------------------------| +| Type | Classification | +| GFlops | 0.15 | +| MParams | 3.02 | +| Source framework | PyTorch\* | + +## Accuracy + +| Metric | Original model | Converted model | +| ------ | -------------- | --------------- | +| ACER | 3.81% | 3.81% | + +## Input + +### Original Model + +Image, name: `actual_input_1` , shape: [1x3x128x128], format: [BxCxHxW], where: + + - B - batch size + - C - number of channels + - H - image height + - W - image width + + Expected color order: RGB. + Mean values: [151.2405,119.5950,107.8395], scale factor: [63.0105,56.4570,55.0035] + +### Converted Model + +Image, name: `actual_input_1` , shape: [1x3x128x128], format: [BxCxHxW], where: + + - B - batch size + - C - number of channels + - H - image height + - W - image width + + Expected color order: BGR. + +## Output + +### Original model + +Probabilities for two classes (0 class is a real person, 1 - is a spoof image). Name: `output1` Shape: [1,2], format: [BxC], + where: + + - B - batch size + - C - vector of probabilities. + +### Converted model + +Probabilities for two classes (0 class is a real person, 1 - is a spoof image). Name: `output1` Shape: [1,2], format: [BxC], + where: + + - B - batch size + - C - vector of probabilities. + +## Legal Information + +The original model is distributed under the +[MIT License](https://raw.githubusercontent.com/kirillProkofiev/light-weight-face-anti-spoofing/master/LICENSE). diff --git a/models/public/anti-spoof-mn3/model.yml b/models/public/anti-spoof-mn3/model.yml new file mode 100644 index 00000000000..6a6c838ba60 --- /dev/null +++ b/models/public/anti-spoof-mn3/model.yml @@ -0,0 +1,37 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + The `anti-spoof-mn3` model is an anti-spoofing binary classificator based on the MobileNetv3 , + trained on the Celeba_Spoof dataset . + It's a small, light model, trained to predict whether or not a spoof RGB image given + to the input. A lot of advanced techniques have been tried and selected the best + suit options for the task. For details see original repository . +task_type: classification +files: + - name: anti-spoof-mn3.onnx + size: 12270179 + sha256: c4c99af04603b62d7e44f6f4daeb33e0daeccc696008c0b1d62f6f5cebbb3262 + source: + $type: google_drive + id: 1KmM2vwGBuKxy7RE9hz1m5D0yyh2N9Amo +model_optimizer_args: + - --input_shape=[1,3,128,128] + - --input=actual_input_1 + - --mean_values=actual_input_1[151.2405,119.5950,107.8395] + - --scale_values=actual_input_1[63.0105,56.4570,55.0035] + - --reverse_input_channels + - --input_model=$dl_dir/anti-spoof-mn3.onnx +framework: onnx +license: https://raw.githubusercontent.com/kirillProkofiev/training_extensions/kp/antispoofing/LICENSE diff --git a/models/public/brain-tumor-segmentation-0001/brain-tumor-segmentation-0001.md b/models/public/brain-tumor-segmentation-0001/brain-tumor-segmentation-0001.md index cf4561a3c20..2d741a6e991 100644 --- a/models/public/brain-tumor-segmentation-0001/brain-tumor-segmentation-0001.md +++ b/models/public/brain-tumor-segmentation-0001/brain-tumor-segmentation-0001.md @@ -6,8 +6,6 @@ This model was created for participation in the [Brain Tumor Segmentation Challe The model is based on [the corresponding paper](https://arxiv.org/abs/1810.04008), where authors present deep cascaded approach for automatic brain tumor segmentation. The paper describes modifications to 3D UNet architecture and specific augmentation strategy to efficiently handle multimodal MRI input. Besides this, the approach to enhance segmentation quality with context obtained from models of the same topology operating on downscaled data is introduced. Each input modality has its own encoder which are later fused together to produce single output segmentation. -## Example - ## Specification | Metric | Value | @@ -36,8 +34,6 @@ The following accuracy metrics are measured on a `brain tumor` training subset o See [the original repository](https://github.com/lachinov/brats2018-graphlabunn). -## Performance - ## Input The model takes as an input four MRI modalities `T1`, `T2`, `T1ce`, `Flair`. The inputs are cropped, resamped and z-score normalized. You can find additional information on the BraTS 2018 [page](https://www.med.upenn.edu/sbia/brats2018/data.html) and [wiki](https://en.wikipedia.org/wiki/Magnetic_resonance_imaging). diff --git a/models/public/brain-tumor-segmentation-0002/brain-tumor-segmentation-0002.md b/models/public/brain-tumor-segmentation-0002/brain-tumor-segmentation-0002.md index abd21172880..93a24dc1243 100644 --- a/models/public/brain-tumor-segmentation-0002/brain-tumor-segmentation-0002.md +++ b/models/public/brain-tumor-segmentation-0002/brain-tumor-segmentation-0002.md @@ -4,8 +4,6 @@ This model was created for participation in the [Brain Tumor Segmentation Challenge](https://www.med.upenn.edu/cbica/brats2019/registration.html) (BraTS) 2019. It has the UNet architecture trained with residual blocks. -## Example - ## Specification | Metric | Value | @@ -47,8 +45,6 @@ The following accuracy metrics are measured on a `brain tumor` training subset o > **NOTE**: The accuracy achieved with ONNX\* model adapted for OpenVINO™ can slightly differ from the accuracy achieved with the original PyTorch model since the upsampling operation was changed from the `trilinear` to `nearest` mode. -## Performance - ## Input The model takes as an input four MRI modalities `T1`, `T1ce`, `T2`, `Flair`. Find additional information on the [BraTS 2019 page](https://www.med.upenn.edu/cbica/brats2019/registration.html) and [wiki](https://en.wikipedia.org/wiki/Magnetic_resonance_imaging). diff --git a/models/public/caffenet/caffenet.md b/models/public/caffenet/caffenet.md index b54d1c7065e..d75d6726a5c 100644 --- a/models/public/caffenet/caffenet.md +++ b/models/public/caffenet/caffenet.md @@ -4,8 +4,6 @@ CaffeNet\* model is used for classification. For details see [paper](https://arxiv.org/abs/1408.5093). -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ CaffeNet\* model is used for classification. For details see [paper](https://arx | Top 1 | 56.714%| | Top 5 | 79.916%| -## Performance - ## Input ### Original Model diff --git a/models/public/cocosnet/accuracy-check.yml b/models/public/cocosnet/accuracy-check.yml new file mode 100644 index 00000000000..1fa069960c3 --- /dev/null +++ b/models/public/cocosnet/accuracy-check.yml @@ -0,0 +1,64 @@ +evaluations: + - name: cocosnet + module: custom_evaluators.cocosnet_evaluator.CocosnetEvaluator + module_config: + network_info: + cocosnet_network: + adapter: + type: image_processing + mean: 127.5 + std: 127.5 + # For some GAN metrics (IS and FID) you need to use classification model as verification network. + # In our case it is Inception-V3 (googlenet-v3) model. Additional layer is needed for FID metric. + verification_network: + additional_layers: ["InceptionV3/Logits/AvgPool_1a_8x8/AvgPool"] + + launchers: + - framework: dlsdk + inputs: + - name: "input_seg_map" + type: INPUT + value: "(.*)ADE(.*)val(.*).png" + - name: "ref_image" + type: INPUT + value: "(.*)train(.*).jpg" + - name: "ref_seg_map" + type: INPUT + value: "(.*)ADE(.*)train(.*).png" + + datasets: + - name: cocosnet_image_translation + + preprocessing_mask: + - type: bgr_to_gray + - type: resize + size: 256 + interpolation: NEAREST + use_pillow: False + - type: one_hot_encoding + number_of_classes: 151 + axis: 2 + base: 0 + value: 1 + + preprocessing_image: + - type: resize + size: 256 + interpolation: BICUBIC + use_pillow: False + + postprocessing: + - type: resize + apply_to: prediction + + metrics: + - type: psnr + scale_border: 0 + presenter: print_vector + - type: ssim + presenter: print_vector + - type: fid + length: 2048 + eps: 0.000001 + - type: inception_score + length: 1001 diff --git a/models/public/cocosnet/cocosnet.md b/models/public/cocosnet/cocosnet.md new file mode 100644 index 00000000000..c5a19ab95a0 --- /dev/null +++ b/models/public/cocosnet/cocosnet.md @@ -0,0 +1,120 @@ +# cocosnet + +## Use Case and High-Level Description + +Cross-domain correspondence network is a exemplar-based image translation model, consisting of correspondence and translation parts. Model was pre-trained on ADE20k dataset. +For details see [paper](https://arxiv.org/abs/2004.05571) and [repository](https://github.com/microsoft/CoCosNet). + +## Specification + +| Metric | Value | +|---------------------------------|-------------------------------------------| +| Type | Image translation | +| GFLOPs | 1080.7032 | +| MParams | 167.9141 | +| Source framework | PyTorch\* | + +## Accuracy + +Metrics were calculated between generated images by model and real validation images from ADE20k dataset. +For some GAN metrics (IS and FID) you need to use classification model as verification network. +In our case it is [Inception-V3](../googlenet-v3/googlenet-v3.md) model. + +| Metric | Original model | Converted model | +| ------ | -------------- | --------------- | +| PSNR | 12.99dB | 12.93dB | +| SSIM | 0.34 | 0.34 | +| IS | 13.34 | 13.35 | +| FID | 33.27 | 33.14 | + +### Inputs + +1. name: "input_seg_map", shape: [1x151x256x256] - Input semantic segmentation mask (one-hot label map) in the format [BxCxHxW], + where: + - B - batch size + - C - number of classes (151 for ADE20k) + - H - mask height + - W - mask width + +2. name: "ref_image", shape: [1x3x256x256] - An reference image (exemplar) in the format [BxCxHxW], + where: + - B - batch size + - C - number of channels + - H - image height + - W - image width + + Expected color order is BGR (At original model expected color order is RGB). + +3. name: "ref_seg_map", shape: [1x151x256x256] - A mask (one-hot label map) for reference image in the format [BxCxHxW], + where: + - B - batch size + - C - number of classes (151 for ADE20k) + - H - mask height + - W - mask width + +### Output + +Image, name: "exemplar_based_output", shape: [1x3x256x256] - A result (generated) image based on exemplar in the format [BxCxHxW], + where: + - B - batch size + - C - number of channels + - H - image height + - W - image width + + Output color order is RGB. + +## Legal Information + +The original model is distributed under the following +[license](https://github.com/microsoft/CoCosNet/blob/master/LICENSE): + +``` +MIT License + +Copyright (c) Microsoft Corporation. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE +``` + +The Synchronized-BatchNorm-PyTorch (dependency for model) is distributed under the following +[license](https://github.com/vacancy/Synchronized-BatchNorm-PyTorch/blob/master/LICENSE): + +''' +MIT License + +Copyright (c) 2018 Jiayuan MAO + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +''' diff --git a/models/public/cocosnet/model.py b/models/public/cocosnet/model.py new file mode 100644 index 00000000000..09f011f4737 --- /dev/null +++ b/models/public/cocosnet/model.py @@ -0,0 +1,80 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import argparse +from torch import nn, load, cat + +import models.networks as networks + + +def remove_all_spectral_norm(item): + if isinstance(item, nn.Module): + try: + nn.utils.remove_spectral_norm(item) + except Exception: + pass + for child in item.children(): + remove_all_spectral_norm(child) + + +class Pix2PixModel(nn.Module): + def __init__(self, corr_weights, gen_weights): + super().__init__() + opt = argparse.Namespace(adaptor_kernel=3, + adaptor_nonlocal=False, + adaptor_res_deeper=False, + adaptor_se=False, + apex=False, + aspect_ratio=1, + CBN_intype='warp_mask', + crop_size=256, + eqlr_sn=False, + gpu_ids=[], + isTrain=False, + init_type='xavier', + init_variance=0.02, + maskmix=True, + mask_noise=False, + match_kernel=3, + netG='spade', + ngf=64, + norm_E='spectralinstance', + norm_G='spectralspadesyncbatch3x3', + noise_for_mask=False, + PONO=True, + PONO_C=True, + semantic_nc=151, + show_corr=False, + show_warpmask=False, + use_attention=True, + use_coordconv=False, + warp_bilinear=False, + warp_cycle_w=0.0, + warp_mask_losstype=True, + warp_patch=False, + warp_stride=4, + weight_domainC=0.0 + ) + self.correspondence = networks.define_Corr(opt) + corr_weights = load(corr_weights) + self.correspondence.load_state_dict(corr_weights) + self.generator = networks.define_G(opt) + gen_weights = load(gen_weights) + self.generator.load_state_dict(gen_weights) + remove_all_spectral_norm(self) + + def forward(self, input_semantics, ref_image, ref_semantics): + coor_out = self.correspondence(ref_image, None, input_semantics, ref_semantics, alpha=1) + warp_out = cat((coor_out['warp_out'], input_semantics), dim=1) + return self.generator(input_semantics, warp_out=warp_out) diff --git a/models/public/cocosnet/model.yml b/models/public/cocosnet/model.yml new file mode 100644 index 00000000000..3eaa806d8d4 --- /dev/null +++ b/models/public/cocosnet/model.yml @@ -0,0 +1,133 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + Cross-domain correspondence network is a exemplar-based image translation model, + consisting of correspondence and translation parts. Model was pre-trained on ADE20k + dataset. For details see paper and repository + . +task_type: image_translation +files: + - name: model_files/util/__init__.py + size: 72 + sha256: 12b307709a025b0afdfdd9e7ad584fbf21d9170be7c0a3f8432e24abae471af7 + source: https://raw.githubusercontent.com/microsoft/CoCosNet/33f98d092407094a15a08b0555d6f5359490cd3e/util/__init__.py + - name: model_files/util/util.py + size: 17551 + sha256: 9816d52d4d347be3d7006a0399d82414c1bfd514999355478617fcd4aac730d2 + source: https://raw.githubusercontent.com/microsoft/CoCosNet/33f98d092407094a15a08b0555d6f5359490cd3e/util/util.py + - name: model_files/models/networks/__init__.py + size: 2676 + sha256: c720d3133dc08052acd4c8005d2ac76b5db5b2d0d82bc616221e4251b4e3d299 + source: https://raw.githubusercontent.com/microsoft/CoCosNet/33f98d092407094a15a08b0555d6f5359490cd3e/models/networks/__init__.py + - name: model_files/models/networks/architecture.py + size: 7985 + sha256: 22295c075be850b08d0aa46b8c6af2fc0dfdf59930281bfe63a60b8c2445c050 + source: https://raw.githubusercontent.com/microsoft/CoCosNet/33f98d092407094a15a08b0555d6f5359490cd3e/models/networks/architecture.py + - name: model_files/models/networks/base_network.py + size: 2466 + sha256: 52d078a9e6c97586a373708e9de8be57c0636c6ab02a5ae0f01d7c4140894b82 + source: https://raw.githubusercontent.com/microsoft/CoCosNet/33f98d092407094a15a08b0555d6f5359490cd3e/models/networks/base_network.py + - name: model_files/models/networks/correspondence.py + size: 18453 + sha256: 99815130c1fb335595a8a9cba365f8d191aceb971f4c7ac8763620b75e799dd8 + source: https://raw.githubusercontent.com/microsoft/CoCosNet/33f98d092407094a15a08b0555d6f5359490cd3e/models/networks/correspondence.py + - name: model_files/models/networks/generator.py + size: 10874 + sha256: bc25f3d7eb0023558ea9b5bd99f6d4eed4b2577295f0812c69c394faf78c4433 + source: https://raw.githubusercontent.com/microsoft/CoCosNet/33f98d092407094a15a08b0555d6f5359490cd3e/models/networks/generator.py + - name: model_files/models/networks/normalization.py + size: 11279 + sha256: 87c1fd63375380d6a1521a333c8b2fc7f5d21b312172955fb7526e3542951f6a + source: https://raw.githubusercontent.com/microsoft/CoCosNet/33f98d092407094a15a08b0555d6f5359490cd3e/models/networks/normalization.py + - name: model_files/models/__init__.py + size: 1417 + sha256: 67f5b50d89b7f90e1afabc96c2d6498ab99973d2c6d1c69909ac20f7459629f0 + source: https://raw.githubusercontent.com/microsoft/CoCosNet/33f98d092407094a15a08b0555d6f5359490cd3e/models/__init__.py + - name: model_files/models/networks/sync_batchnorm/__init__.py + size: 507 + sha256: 50083d11a5c9710f9b7dbd4ca012f8e3721fd0c78f63a36a6a0a1a0d82a13ede + source: https://raw.githubusercontent.com/vacancy/Synchronized-BatchNorm-PyTorch/5768ead395820b8a625cbe0da0bb9f949748a5dd/sync_batchnorm/__init__.py + - name: model_files/models/networks/sync_batchnorm/batchnorm.py + size: 15944 + sha256: 9e474102c34cede3e08663acefbbd898eebd3c93fcf3312f82053950fad05e9e + source: https://raw.githubusercontent.com/vacancy/Synchronized-BatchNorm-PyTorch/5768ead395820b8a625cbe0da0bb9f949748a5dd/sync_batchnorm/batchnorm.py + - name: model_files/models/networks/sync_batchnorm/replicate.py + size: 3226 + sha256: 4498b873404fce05202d4f891262e249a95733816d3877e3aee3d2401138a6af + source: https://raw.githubusercontent.com/vacancy/Synchronized-BatchNorm-PyTorch/5768ead395820b8a625cbe0da0bb9f949748a5dd/sync_batchnorm/replicate.py + - name: model_files/models/networks/sync_batchnorm/comm.py + size: 4449 + sha256: 9d2e776a0398e5ac29ce13d43b7475300f70f409e56f3c38428029000557a57a + source: https://raw.githubusercontent.com/vacancy/Synchronized-BatchNorm-PyTorch/5768ead395820b8a625cbe0da0bb9f949748a5dd/sync_batchnorm/comm.py + - name: model_files/ckpt/latest_net_Corr.pth + size: 237624725 + sha256: 5deef28927dfc56e18c8510ffcdf0280b558987a38a2b455cda62242ecbe7971 + source: + $type: google_drive + id: 1yNCapBY7YqMoKeyVWwTwceqrEKHpUzYN + - name: model_files/ckpt/latest_net_G.pth + size: 387069636 + sha256: 9a77b52d0c34a279d6b4e7eff4bd00077543f7ffc2806b5b2a32222cfbccc655 + source: + $type: google_drive + id: 1zVG4SnR1uI8bC8fagZrgxNYCI5GRmJuR +postprocessing: + - $type: regex_replace + file: model_files/models/networks/normalization.py + pattern: 'x.var\((.*?)\)' + # use std instead var to support PyTorch < 1.7 + replacement: '(x.std(\g<1>) ** 2)' + - $type: regex_replace + file: model_files/models/networks/__init__.py + pattern: 'from models\.networks\.(ContextualLoss|loss|discriminator) ' + replacement: '# \g<0>' + - $type: regex_replace + file: model_files/models/networks/correspondence.py + pattern: '/ self.opt.down\)' + replacement: '// self.opt.down)' + # MO can only convert Squeeze with fixed dimensions + - $type: regex_replace + file: model_files/models/networks/correspondence.py + pattern: '\.squeeze\(\)' + replacement: '.squeeze(dim=0)' + # fix deprecated function usage + - $type: regex_replace + file: model_files/models/networks/generator.py + pattern: '\bF\.tanh\b' + replacement: 'torch.tanh' + - $type: regex_replace + file: model_files/util/util.py + pattern: 'colormap = scio.loadmat\(.\./util/color150.mat.\)\[.colors.\]' + replacement: "# colormap = scio.loadmat('./util/color150.mat')['colors']" +conversion_to_onnx_args: + - --model-path=$config_dir + - --model-path=$dl_dir/model_files + - --model-name=Pix2PixModel + - --import-module=model + - --input-shape=[1,151,256,256],[1,3,256,256],[1,151,256,256] + - --output-file=$conv_dir/cocosnet.onnx + - --model-param=corr_weights=r"$dl_dir/model_files/ckpt/latest_net_Corr.pth" + - --model-param=gen_weights=r"$dl_dir/model_files/ckpt/latest_net_G.pth" + - --input-names=input_seg_map,ref_image,ref_seg_map + - --output-names=exemplar_based_output +model_optimizer_args: + - --input_model=$conv_dir/cocosnet.onnx + - --input=input_seg_map,ref_image,ref_seg_map + - --output=exemplar_based_output + - --mean_values=ref_image[127.5,127.5,127.5] + - --scale_values=ref_image[127.5,127.5,127.5] + - --reverse_input_channels +framework: pytorch +license: https://raw.githubusercontent.com/microsoft/CoCosNet/33f98d092407094a15a08b0555d6f5359490cd3e/LICENSE diff --git a/models/public/colorization-siggraph/accuracy-check-pipelined.yml b/models/public/colorization-siggraph/accuracy-check-pipelined.yml new file mode 100644 index 00000000000..b6f4ae62a20 --- /dev/null +++ b/models/public/colorization-siggraph/accuracy-check-pipelined.yml @@ -0,0 +1,24 @@ +evaluations: + - name: colorization-siggraph + module: custom_evaluators.colorization_evaluator.ColorizationEvaluator + module_config: + network_info: + colorization_network: {} + + verification_network: + adapter: classification + + launchers: + - framework: dlsdk + + datasets: + - name: imagenet_1000_classes + reader: pillow_imread + + preprocessing: + - type: resize + size: 256 + use_pillow: True + interpolation: Bicubic + - type: normalization + std: 255 diff --git a/models/public/colorization-siggraph/accuracy-check.yml b/models/public/colorization-siggraph/accuracy-check.yml index b6f4ae62a20..6fbf62367cb 100644 --- a/models/public/colorization-siggraph/accuracy-check.yml +++ b/models/public/colorization-siggraph/accuracy-check.yml @@ -1,24 +1,36 @@ -evaluations: +models: - name: colorization-siggraph - module: custom_evaluators.colorization_evaluator.ColorizationEvaluator - module_config: - network_info: - colorization_network: {} - - verification_network: - adapter: classification - - launchers: - - framework: dlsdk - - datasets: - - name: imagenet_1000_classes - reader: pillow_imread - - preprocessing: - - type: resize - size: 256 - use_pillow: True - interpolation: Bicubic - - type: normalization - std: 255 + launchers: + - framework: dlsdk + adapter: + type: image_processing + std: 1 + cast_to_uint8: false + inputs: + - name: "user_map" + type: CONST_INPUT + value: 0 + shape: [1, 2, 256, 256] + - name: "user_ab" + type: CONST_INPUT + value: 0 + shape: [1, 1, 256, 256] + datasets: + - name: imagenet_colorization + subsample_size: 2000 + shuffle: False + preprocessing: + - type: resize + size: 256 + - type: bgr_to_lab + - type: select_channel + channel: 0 + postprocessing: + - type: colorization_recovery + - type: resize + apply_to: prediction + metrics: + - type: psnr + presenter: print_vector + - type: ssim + presenter: print_vector diff --git a/models/public/colorization-siggraph/colorization-siggraph.md b/models/public/colorization-siggraph/colorization-siggraph.md index b8dad829c04..9d7914faad3 100644 --- a/models/public/colorization-siggraph/colorization-siggraph.md +++ b/models/public/colorization-siggraph/colorization-siggraph.md @@ -9,8 +9,6 @@ For details about this family of models, check out the [repository](https://gith Model consumes as input L-channel of LAB-image (also user points and binary mask as optional inputs). Model give as output predict A- and B-channels of LAB-image. -## Example - ## Specification | Metric | Value | @@ -22,9 +20,16 @@ Model give as output predict A- and B-channels of LAB-image. ## Accuracy -The accuracy metrics were calculated on the ImageNet -validation dataset using [VGG16](https://arxiv.org/abs/1409.1556) Caffe -model and colorization as preprocessing. +The accuracy metrics were calculated between generated images by model and real validation images from ImageNet dataset. +Results are obtained on subset of 2000 images. + +| Metric | Value | +| ------ | --------- | +| PSNR | 27.73dB | +| SSIM | 0.92 | + +Also, metrics can be calculated using [VGG16](https://arxiv.org/abs/1409.1556) caffe model and colorization as preprocessing. +The results below are obtained on the validation images from ImageNet dataset. For preprocessing `rgb -> gray -> colorization` recieved values: @@ -33,8 +38,6 @@ For preprocessing `rgb -> gray -> colorization` recieved values: | Accuracy top-1 | 58.25% | 70.96% | | Accuracy top-5 | 81.78% | 89.88% | -## Performance - ## Input 1. Image, name - `data_l`, shape - `1,1,256,256`, format is `B,C,H,W` where: @@ -67,7 +70,7 @@ For preprocessing `rgb -> gray -> colorization` recieved values: from user-specified gray points with (a,b) = 0. If point(pixel) was specified the flag will be equal to 1. -> **NOTE**: You don't need to specify all 3 inputs to use the model. If you dont't want to use local user hints (user points), you can use only `data_l` input. +> **NOTE**: You don't need to specify all 3 inputs to use the model. If you dont't want to use local user hints (user points), you can use only `data_l` input. In this case, the remaining inputs (`user_ab` and `user_map`) must be filled with zeros. ## Output diff --git a/models/public/colorization-v2/accuracy-check-pipelined.yml b/models/public/colorization-v2/accuracy-check-pipelined.yml new file mode 100644 index 00000000000..3e3c17dc264 --- /dev/null +++ b/models/public/colorization-v2/accuracy-check-pipelined.yml @@ -0,0 +1,24 @@ +evaluations: + - name: colorization-v2 + module: custom_evaluators.colorization_evaluator.ColorizationEvaluator + module_config: + network_info: + colorization_network: {} + + verification_network: + adapter: classification + + launchers: + - framework: dlsdk + + datasets: + - name: imagenet_1000_classes + reader: pillow_imread + + preprocessing: + - type: resize + size: 256 + use_pillow: True + interpolation: Bicubic + - type: normalization + std: 255 diff --git a/models/public/colorization-v2/accuracy-check.yml b/models/public/colorization-v2/accuracy-check.yml index 3e3c17dc264..9d744da2fbc 100644 --- a/models/public/colorization-v2/accuracy-check.yml +++ b/models/public/colorization-v2/accuracy-check.yml @@ -1,24 +1,27 @@ -evaluations: +models: - name: colorization-v2 - module: custom_evaluators.colorization_evaluator.ColorizationEvaluator - module_config: - network_info: - colorization_network: {} - - verification_network: - adapter: classification - - launchers: - - framework: dlsdk - - datasets: - - name: imagenet_1000_classes - reader: pillow_imread - - preprocessing: - - type: resize - size: 256 - use_pillow: True - interpolation: Bicubic - - type: normalization - std: 255 + launchers: + - framework: dlsdk + adapter: + type: image_processing + std: 1 + cast_to_uint8: false + datasets: + - name: imagenet_colorization + subsample_size: 2000 + shuffle: False + preprocessing: + - type: resize + size: 256 + - type: bgr_to_lab + - type: select_channel + channel: 0 + postprocessing: + - type: colorization_recovery + - type: resize + apply_to: prediction + metrics: + - type: psnr + presenter: print_vector + - type: ssim + presenter: print_vector diff --git a/models/public/colorization-v2/colorization-v2.md b/models/public/colorization-v2/colorization-v2.md index e60d1dfb0cb..5205dc6b160 100644 --- a/models/public/colorization-v2/colorization-v2.md +++ b/models/public/colorization-v2/colorization-v2.md @@ -9,8 +9,6 @@ For details about this family of models, check out the [repository](https://gith Model consumes as input L-channel of LAB-image. Model give as output predict A- and B-channels of LAB-image. -## Example - ## Specification | Metric | Value | @@ -22,9 +20,16 @@ Model give as output predict A- and B-channels of LAB-image. ## Accuracy -The accuracy metrics calculated on ImageNet -validation dataset using [VGG16](https://arxiv.org/abs/1409.1556) caffe -model and colorization as preprocessing. +The accuracy metrics were calculated between generated images by model and real validation images from ImageNet dataset. +Results are obtained on subset of 2000 images. + +| Metric | Value | +| ------ | --------- | +| PSNR | 26.99dB | +| SSIM | 0.90 | + +Also, metrics can be calculated using [VGG16](https://arxiv.org/abs/1409.1556) caffe model and colorization as preprocessing. +The results below are obtained on the validation images from ImageNet dataset. For preprocessing `rgb -> gray -> colorization` recieved values: @@ -33,8 +38,6 @@ For preprocessing `rgb -> gray -> colorization` recieved values: | Accuracy top-1 | 57.75% | 70.96% | | Accuracy top-5 | 81.50% | 89.88% | -## Performance - ## Input ### Original model diff --git a/models/public/ctdet_coco_dlav0_384/accuracy-check.yml b/models/public/ctdet_coco_dlav0_384/accuracy-check.yml index cf89a07e11c..172a3aafc8c 100644 --- a/models/public/ctdet_coco_dlav0_384/accuracy-check.yml +++ b/models/public/ctdet_coco_dlav0_384/accuracy-check.yml @@ -4,9 +4,9 @@ models: - framework: dlsdk adapter: type: ctdet - center_heatmap_out: "508" - width_height_out: "514" - regression_out: "511" + center_heatmap_out: center_heatmap + width_height_out: width_height + regression_out: regression datasets: - name: ms_coco_detection_80_class_without_background diff --git a/models/public/ctdet_coco_dlav0_384/ctdet_coco_dlav0_384.md b/models/public/ctdet_coco_dlav0_384/ctdet_coco_dlav0_384.md index 64f1813bdea..dc3e3efb99c 100644 --- a/models/public/ctdet_coco_dlav0_384/ctdet_coco_dlav0_384.md +++ b/models/public/ctdet_coco_dlav0_384/ctdet_coco_dlav0_384.md @@ -2,41 +2,16 @@ ## Use Case and High-Level Description -CenterNet object detection model `ctdet_coco_dlav0_384` originally trained on PyTorch\* -then converted to ONNX\* format. CenterNet models an object as a single point - the center point of its bounding box +CenterNet object detection model `ctdet_coco_dlav0_384` originally trained with PyTorch\*. +CenterNet models an object as a single point - the center point of its bounding box and uses keypoint estimation to find center points and regresses to object size. For details see [paper](https://arxiv.org/abs/1904.07850), [repository](https://github.com/xingyizhou/CenterNet/). -### Steps to Reproduce PyTorch to ONNX Conversion -Model is provided in ONNX format, which was obtained by the following steps. - -1. Clone the original repository -```sh -git clone https://github.com/xingyizhou/CenterNet -cd CenterNet -``` -2. Checkout the commit that the conversion was tested on: -```sh -git checkout 8ef87b4 -``` -3. Apply the `pytorch-onnx.patch` patch -```sh -git apply /path/to/pytorch-onnx.patch -``` -4. Follow the original [installation steps](https://github.com/xingyizhou/CenterNet/blob/8ef87b4/readme/INSTALL.md) -5. Download the [pretrained weights](https://drive.google.com/file/d/18yBxWOlhTo32_swSug_HM4q3BeWgxp_N/view) -6. Run -```sh -python convert.py ctdet --load_model /path/to/downloaded/weights.pth --exp_id coco_dlav0_384 --arch dlav0_34 --input_res 384 --gpus -1 -``` - -## Example - ## Specification | Metric | Value | |---------------------------------|-------------------------------------------| -| Type | Classification | +| Type | Detection | | GFlops | 34.994 | | MParams | 17.911 | | Source framework | PyTorch\* | @@ -47,8 +22,6 @@ python convert.py ctdet --load_model /path/to/downloaded/weights.pth --exp_id co | ------ | -------------- | --------------- | | mAP | 41.81% | 41.61% | -## Performance - ## Input ### Original Model @@ -78,9 +51,9 @@ Expected color order: BGR. ## Output -1. Object center points heatmap, name: `508`. Contains predicted objects center point, for each of the 80 categories, according to MSCOCO\* dataset version with 80 categories of objects, without background label. -2. Object size output, name: `511`. Contains predicted width and height for each object. -3. Regression output, name: `514`. Contains offsets for each prediction. +1. Object center points heatmap, name: `center_heatmap`. Contains predicted objects center point, for each of the 80 categories, according to MSCOCO\* dataset version with 80 categories of objects, without background label. +2. Object size output, name: `width_height`. Contains predicted width and height for each object. +3. Regression output, name: `regression`. Contains offsets for each prediction. ## Legal Information diff --git a/models/public/ctdet_coco_dlav0_384/model.py b/models/public/ctdet_coco_dlav0_384/model.py new file mode 100644 index 00000000000..1373d365c22 --- /dev/null +++ b/models/public/ctdet_coco_dlav0_384/model.py @@ -0,0 +1,23 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opts import opts +from models.model import create_model, load_model + +def ctdet_dlav0_34(weights_path): + opt = opts().init(['ctdet', '--arch', 'dlav0_34']) + + return load_model( + create_model(opt.arch, opt.heads, opt.head_conv), + weights_path) diff --git a/models/public/ctdet_coco_dlav0_384/model.yml b/models/public/ctdet_coco_dlav0_384/model.yml index 2eff50823ee..541cc8f5ea5 100644 --- a/models/public/ctdet_coco_dlav0_384/model.yml +++ b/models/public/ctdet_coco_dlav0_384/model.yml @@ -13,24 +13,64 @@ # limitations under the License. description: >- - CenterNet object detection model "ctdet_coco_dlav0_384" originally trained on PyTorch* - then converted to ONNX* format. CenterNet models an object as a single point - the - center point of its bounding box and uses keypoint estimation to find center points - and regresses to object size. For details see paper , - repository . + CenterNet object detection model "ctdet_coco_dlav0_384" originally trained with + PyTorch*. CenterNet models an object as a single point - the center point of its + bounding box and uses keypoint estimation to find center points and regresses to + object size. For details see paper , repository + . task_type: detection files: - - name: ctdet_coco_dlav0_384.onnx - size: 74027749 - sha256: 4aabb6d13aa662ef6b7fd3a9fe914e1d133ec621945e6ab19597b624a72604a6 - source: https://download.01.org/opencv/public_models/122019/ctdet_coco_dlav0/ctdet_coco_dlav0_384.onnx + - name: ctdet_coco_dlav0_1x.pth + size: 221889662 + sha256: 23a4ff7102c47c427bc1f24cec2059b8d837a0253363978d467a70e643b699d3 + source: + $type: google_drive + id: 18yBxWOlhTo32_swSug_HM4q3BeWgxp_N + - name: CenterNet/src/lib/models/model.py + size: 3415 + sha256: 29f17e75eb1fb3f6a9f5ca632922bcf932b1f6c63732eb1cdd043b5f8f849d30 + source: https://github.com/xingyizhou/CenterNet/raw/8ef87b433529ac8f8bd4f95707f6bc05052c55e9/src/lib/models/model.py + - name: CenterNet/src/lib/models/networks/dlav0.py + size: 22682 + sha256: 44abd35b6e37fad46c4626d9eb0f5ea29f7b0ef539bd21e685f70e6e89fb398e + source: https://github.com/xingyizhou/CenterNet/raw/8ef87b433529ac8f8bd4f95707f6bc05052c55e9/src/lib/models/networks/dlav0.py + - name: CenterNet/src/lib/opts.py + size: 18696 + sha256: 71a7cdc93eb3a9520a1b23a69e5166cff56b45300f162608cb4eeb77ba1116ec + source: https://github.com/xingyizhou/CenterNet/raw/8ef87b433529ac8f8bd4f95707f6bc05052c55e9/src/lib/opts.py +postprocessing: + # disable imports and usages of components we don't need + - $type: regex_replace + file: CenterNet/src/lib/models/model.py + pattern: 'from \.networks\.(msra_resnet|pose_dla_dcn|resnet_dcn|large_hourglass)\b' + replacement: '# \g<0>' + - $type: regex_replace + file: CenterNet/src/lib/models/model.py + pattern: '''(res|dla|resdcn|hourglass)''' + replacement: '# \g<0>' + + # disable downloading of weights for the DLA model (they aren't needed) + - $type: regex_replace + file: CenterNet/src/lib/models/networks/dlav0.py + pattern: (?m)pretrained=True,$ + replacement: pretrained=False, +conversion_to_onnx_args: + - --model-path=$config_dir + - --model-path=$dl_dir/CenterNet/src/lib + - --import-module=model + - --model-name=ctdet_dlav0_34 + - --model-param=weights_path=r"$dl_dir/ctdet_coco_dlav0_1x.pth" + - --input-names=input.1 + - --input-shapes=1,3,384,384 + - --output-names=center_heatmap,width_height,regression + - --output-file=$conv_dir/ctdet_coco_dlav0_384.onnx model_optimizer_args: - --input_shape=[1,3,384,384] - --input=input.1 - --mean_values=input.1[104.04, 113.985, 119.85] - --scale_values=input.1[73.695, 69.87, 70.89] - - --output=508,511,514 - - --input_model=$dl_dir/ctdet_coco_dlav0_384.onnx -framework: onnx + - --output=center_heatmap,width_height,regression + - --input_model=$conv_dir/ctdet_coco_dlav0_384.onnx +framework: pytorch quantizable: yes license: https://raw.githubusercontent.com/xingyizhou/CenterNet/master/LICENSE diff --git a/models/public/ctdet_coco_dlav0_384/pytorch-onnx.patch b/models/public/ctdet_coco_dlav0_384/pytorch-onnx.patch deleted file mode 100644 index 241fbff9ae3..00000000000 --- a/models/public/ctdet_coco_dlav0_384/pytorch-onnx.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/src/convert.py b/src/convert.py -new file mode 100644 -index 0000000..16888b6 ---- /dev/null -+++ b/src/convert.py -@@ -0,0 +1,12 @@ -+import torch.onnx -+import onnx -+ -+import _init_paths -+from opts import opts -+from detectors.detector_factory import detector_factory -+ -+opt = opts().init() -+Detector = detector_factory[opt.task] -+detector = Detector(opt) -+input_shape = [1, 3, opt.input_res, opt.input_res] -+torch.onnx.export(detector.model, torch.randn(input_shape), 'ctdet_coco_dlav0_{}.onnx'.format(opt.input_res), export_params=True) -diff --git a/src/lib/models/networks/dlav0.py b/src/lib/models/networks/dlav0.py -index 3ff343c..99e2e88 100644 ---- a/src/lib/models/networks/dlav0.py -+++ b/src/lib/models/networks/dlav0.py -@@ -602,9 +602,9 @@ class DLASeg(nn.Module): - x = self.dla_up(x[self.first_level:]) - # x = self.fc(x) - # y = self.softmax(self.up(x)) -- ret = {} -- for head in self.heads: -- ret[head] = self.__getattr__(head)(x) -+ ret = [] -+ for head in sorted(self.heads.keys()): -+ ret.append(self.__getattr__(head)(x)) - return [ret] - - ''' diff --git a/models/public/ctdet_coco_dlav0_512/accuracy-check.yml b/models/public/ctdet_coco_dlav0_512/accuracy-check.yml index 4c2bf0193f9..caefdadb5b2 100644 --- a/models/public/ctdet_coco_dlav0_512/accuracy-check.yml +++ b/models/public/ctdet_coco_dlav0_512/accuracy-check.yml @@ -4,9 +4,9 @@ models: - framework: dlsdk adapter: type: ctdet - center_heatmap_out: "508" - width_height_out: "514" - regression_out: "511" + center_heatmap_out: center_heatmap + width_height_out: width_height + regression_out: regression datasets: diff --git a/models/public/ctdet_coco_dlav0_512/ctdet_coco_dlav0_512.md b/models/public/ctdet_coco_dlav0_512/ctdet_coco_dlav0_512.md index 65704062ff3..db9cbd5c6ac 100644 --- a/models/public/ctdet_coco_dlav0_512/ctdet_coco_dlav0_512.md +++ b/models/public/ctdet_coco_dlav0_512/ctdet_coco_dlav0_512.md @@ -2,41 +2,16 @@ ## Use Case and High-Level Description -CenterNet object detection model `ctdet_coco_dlav0_512` originally trained on PyTorch\* -then converted to ONNX\* format. CenterNet models an object as a single point - the center point of its bounding box +CenterNet object detection model `ctdet_coco_dlav0_512` originally trained with PyTorch\*. +CenterNet models an object as a single point - the center point of its bounding box and uses keypoint estimation to find center points and regresses to object size. For details see [paper](https://arxiv.org/abs/1904.07850), [repository](https://github.com/xingyizhou/CenterNet/). -### Steps to Reproduce PyTorch to ONNX Conversion -Model is provided in ONNX format, which was obtained by the following steps. - -1. Clone the original repository -```sh -git clone https://github.com/xingyizhou/CenterNet -cd CenterNet -``` -2. Checkout the commit that the conversion was tested on: -```sh -git checkout 8ef87b4 -``` -3. Apply the `pytorch-onnx.patch` patch -```sh -git apply /path/to/pytorch-onnx.patch -``` -4. Follow the original [installation steps](https://github.com/xingyizhou/CenterNet/blob/8ef87b4/readme/INSTALL.md) -5. Download the [pretrained weights](https://drive.google.com/file/d/18yBxWOlhTo32_swSug_HM4q3BeWgxp_N/view) -6. Run -```sh -python convert.py ctdet --load_model /path/to/downloaded/weights.pth --exp_id coco_dlav0_512 --arch dlav0_34 --input_res 512 --gpus -1 -``` - -## Example - ## Specification | Metric | Value | |---------------------------------|-------------------------------------------| -| Type | Classification | +| Type | Detection | | GFlops | 62.211 | | MParams | 17.911 | | Source framework | PyTorch\* | @@ -47,8 +22,6 @@ python convert.py ctdet --load_model /path/to/downloaded/weights.pth --exp_id co | ------ | -------------- | --------------- | | mAP | 44.2% | 44.28% | -## Performance - ## Input ### Original Model @@ -78,9 +51,9 @@ Expected color order: BGR. ## Output -1. Object center points heatmap, name: `508`. Contains predicted objects center point, for each of the 80 categories, according to MSCOCO\* dataset version with 80 categories of objects, without background label. -2. Object size output, name: `511`. Contains predicted width and height for each object. -3. Regression output, name: `514`. Contains offsets for each prediction. +1. Object center points heatmap, name: `center_heatmap`. Contains predicted objects center point, for each of the 80 categories, according to MSCOCO\* dataset version with 80 categories of objects, without background label. +2. Object size output, name: `width_height`. Contains predicted width and height for each object. +3. Regression output, name: `regression`. Contains offsets for each prediction. ## Legal Information diff --git a/models/public/ctdet_coco_dlav0_512/model.py b/models/public/ctdet_coco_dlav0_512/model.py new file mode 100644 index 00000000000..1373d365c22 --- /dev/null +++ b/models/public/ctdet_coco_dlav0_512/model.py @@ -0,0 +1,23 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opts import opts +from models.model import create_model, load_model + +def ctdet_dlav0_34(weights_path): + opt = opts().init(['ctdet', '--arch', 'dlav0_34']) + + return load_model( + create_model(opt.arch, opt.heads, opt.head_conv), + weights_path) diff --git a/models/public/ctdet_coco_dlav0_512/model.yml b/models/public/ctdet_coco_dlav0_512/model.yml index e2be29af869..25f531ba0d5 100644 --- a/models/public/ctdet_coco_dlav0_512/model.yml +++ b/models/public/ctdet_coco_dlav0_512/model.yml @@ -13,24 +13,64 @@ # limitations under the License. description: >- - CenterNet object detection model "ctdet_coco_dlav0_512" originally trained on PyTorch* - then converted to ONNX* format. CenterNet models an object as a single point - the - center point of its bounding box and uses keypoint estimation to find center points - and regresses to object size. For details see paper , - repository . + CenterNet object detection model "ctdet_coco_dlav0_512" originally trained with + PyTorch*. CenterNet models an object as a single point - the center point of its + bounding box and uses keypoint estimation to find center points and regresses to + object size. For details see paper , repository + . task_type: detection files: - - name: ctdet_coco_dlav0_512.onnx - size: 74027755 - sha256: 3b9acf09b197b3c118715d530f5aef4fa0de739d32a1b9b56b16ebb82f0c82b2 - source: https://download.01.org/opencv/public_models/122019/ctdet_coco_dlav0/ctdet_coco_dlav0_512.onnx + - name: ctdet_coco_dlav0_1x.pth + size: 221889662 + sha256: 23a4ff7102c47c427bc1f24cec2059b8d837a0253363978d467a70e643b699d3 + source: + $type: google_drive + id: 18yBxWOlhTo32_swSug_HM4q3BeWgxp_N + - name: CenterNet/src/lib/models/model.py + size: 3415 + sha256: 29f17e75eb1fb3f6a9f5ca632922bcf932b1f6c63732eb1cdd043b5f8f849d30 + source: https://github.com/xingyizhou/CenterNet/raw/8ef87b433529ac8f8bd4f95707f6bc05052c55e9/src/lib/models/model.py + - name: CenterNet/src/lib/models/networks/dlav0.py + size: 22682 + sha256: 44abd35b6e37fad46c4626d9eb0f5ea29f7b0ef539bd21e685f70e6e89fb398e + source: https://github.com/xingyizhou/CenterNet/raw/8ef87b433529ac8f8bd4f95707f6bc05052c55e9/src/lib/models/networks/dlav0.py + - name: CenterNet/src/lib/opts.py + size: 18696 + sha256: 71a7cdc93eb3a9520a1b23a69e5166cff56b45300f162608cb4eeb77ba1116ec + source: https://github.com/xingyizhou/CenterNet/raw/8ef87b433529ac8f8bd4f95707f6bc05052c55e9/src/lib/opts.py +postprocessing: + # disable imports and usages of components we don't need + - $type: regex_replace + file: CenterNet/src/lib/models/model.py + pattern: 'from \.networks\.(msra_resnet|pose_dla_dcn|resnet_dcn|large_hourglass)\b' + replacement: '# \g<0>' + - $type: regex_replace + file: CenterNet/src/lib/models/model.py + pattern: '''(res|dla|resdcn|hourglass)''' + replacement: '# \g<0>' + + # disable downloading of weights for the DLA model (they aren't needed) + - $type: regex_replace + file: CenterNet/src/lib/models/networks/dlav0.py + pattern: (?m)pretrained=True,$ + replacement: pretrained=False, +conversion_to_onnx_args: + - --model-path=$config_dir + - --model-path=$dl_dir/CenterNet/src/lib + - --import-module=model + - --model-name=ctdet_dlav0_34 + - --model-param=weights_path=r"$dl_dir/ctdet_coco_dlav0_1x.pth" + - --input-names=input.1 + - --input-shapes=1,3,512,512 + - --output-names=center_heatmap,width_height,regression + - --output-file=$conv_dir/ctdet_coco_dlav0_512.onnx model_optimizer_args: - --input_shape=[1,3,512,512] - --input=input.1 - --mean_values=input.1[104.04, 113.985, 119.85] - --scale_values=input.1[73.695, 69.87, 70.89] - - --output=508,511,514 - - --input_model=$dl_dir/ctdet_coco_dlav0_512.onnx -framework: onnx + - --output=center_heatmap,width_height,regression + - --input_model=$conv_dir/ctdet_coco_dlav0_512.onnx +framework: pytorch quantizable: yes license: https://raw.githubusercontent.com/xingyizhou/CenterNet/master/LICENSE diff --git a/models/public/ctdet_coco_dlav0_512/pytorch-onnx.patch b/models/public/ctdet_coco_dlav0_512/pytorch-onnx.patch deleted file mode 100644 index 241fbff9ae3..00000000000 --- a/models/public/ctdet_coco_dlav0_512/pytorch-onnx.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/src/convert.py b/src/convert.py -new file mode 100644 -index 0000000..16888b6 ---- /dev/null -+++ b/src/convert.py -@@ -0,0 +1,12 @@ -+import torch.onnx -+import onnx -+ -+import _init_paths -+from opts import opts -+from detectors.detector_factory import detector_factory -+ -+opt = opts().init() -+Detector = detector_factory[opt.task] -+detector = Detector(opt) -+input_shape = [1, 3, opt.input_res, opt.input_res] -+torch.onnx.export(detector.model, torch.randn(input_shape), 'ctdet_coco_dlav0_{}.onnx'.format(opt.input_res), export_params=True) -diff --git a/src/lib/models/networks/dlav0.py b/src/lib/models/networks/dlav0.py -index 3ff343c..99e2e88 100644 ---- a/src/lib/models/networks/dlav0.py -+++ b/src/lib/models/networks/dlav0.py -@@ -602,9 +602,9 @@ class DLASeg(nn.Module): - x = self.dla_up(x[self.first_level:]) - # x = self.fc(x) - # y = self.softmax(self.up(x)) -- ret = {} -- for head in self.heads: -- ret[head] = self.__getattr__(head)(x) -+ ret = [] -+ for head in sorted(self.heads.keys()): -+ ret.append(self.__getattr__(head)(x)) - return [ret] - - ''' diff --git a/models/public/ctpn/ctpn.md b/models/public/ctpn/ctpn.md index 3c5f0f81247..7114f21ea9f 100644 --- a/models/public/ctpn/ctpn.md +++ b/models/public/ctpn/ctpn.md @@ -4,8 +4,6 @@ Detecting Text in Natural Image with Connectionist Text Proposal Network. For details see [paper](https://arxiv.org/abs/1609.03605). -## Example - ## Specification | Metric | Value | @@ -21,8 +19,6 @@ Detecting Text in Natural Image with Connectionist Text Proposal Network. For de | ------ | ----- | | hmean | 73.67%| -## Performance - ## Input ### Original Model diff --git a/models/public/deeplabv3/deeplabv3.md b/models/public/deeplabv3/deeplabv3.md index 4fbf71e82fa..f3bde185a45 100644 --- a/models/public/deeplabv3/deeplabv3.md +++ b/models/public/deeplabv3/deeplabv3.md @@ -4,8 +4,6 @@ DeepLab is a state-of-art deep learning model for semantic image segmentation. For details see [paper](https://arxiv.org/abs/1706.05587). -## Example - ## Specification | Metric | Value | @@ -21,8 +19,6 @@ DeepLab is a state-of-art deep learning model for semantic image segmentation. F | ------ | ----- | | mean_iou | 66.85%| -## Performance - ## Input ### Original model @@ -73,4 +69,4 @@ Integer values in a range [0, 20], which represent an index of a predicted class The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/densenet-121-caffe2/densenet-121-caffe2.md b/models/public/densenet-121-caffe2/densenet-121-caffe2.md index e22b4299f95..a5a8c5a900c 100644 --- a/models/public/densenet-121-caffe2/densenet-121-caffe2.md +++ b/models/public/densenet-121-caffe2/densenet-121-caffe2.md @@ -8,8 +8,6 @@ was converted from Caffe\* to Caffe2\* format. For details see repository , paper . -## Example - ## Specification | Metric | Value | @@ -26,8 +24,6 @@ paper . | Top 1 | 74.904% | | Top 5 | 92.192% | -## Performance - ## Input ### Original model diff --git a/models/public/densenet-121-tf/accuracy-check.yml b/models/public/densenet-121-tf/accuracy-check.yml index 6b5b659e4ca..12568dc4bea 100644 --- a/models/public/densenet-121-tf/accuracy-check.yml +++ b/models/public/densenet-121-tf/accuracy-check.yml @@ -11,3 +11,10 @@ models: size: 256 - type: crop size: 224 + metrics: + - name: accuracy@top1 + type: accuracy + top_k: 1 + - name: accuracy@top5 + type: accuracy + top_k: 5 diff --git a/models/public/densenet-121-tf/densenet-121-tf.md b/models/public/densenet-121-tf/densenet-121-tf.md index 0a56874e2d3..cc59e48329a 100644 --- a/models/public/densenet-121-tf/densenet-121-tf.md +++ b/models/public/densenet-121-tf/densenet-121-tf.md @@ -2,53 +2,49 @@ ## Use Case and High-Level Description -This is a TensorFlow\* version of `densenet-121` model, one of the DenseNet\* -group of models designed to perform image classification. The weights were converted from DenseNet-Keras Models. For details, see [repository](https://github.com/pudae/tensorflow-densenet/) and [paper](https://arxiv.org/abs/1608.06993). - -## Example +This is a TensorFlow\* version of `densenet-121` model, one of the DenseNet\* group of models designed to perform image classification. +For details, see [TensorFlow\* API docs](https://www.tensorflow.org/api_docs/python/tf/keras/applications/DenseNet121), [repository](https://github.com/tensorflow/tensorflow) and [paper](https://arxiv.org/abs/1608.06993). ## Specification -| Metric | Value | -|---------------------------------|-------------------------------------------| -| Type | Classification | -| GFlops | 5.289 | -| MParams | 7.971 | -| Source framework | TensorFlow\* | +| Metric | Value | +|---------------------------------|-----------------| +| Type | Classification | +| GFlops | 5.7287 | +| MParams | 7.9714 | +| Source framework | TensorFlow\* | ## Accuracy | Metric | Value | | ------ | ----- | -| Top 1 | 74.29% | -| Top 5 | 91.98%| - -## Performance +| Top 1 | 74.46% | +| Top 5 | 92.13%| ## Input ### Original Model -Image, name: `Placeholder` , shape: [1x224x224x3], format: [BxHxWxC], - where: +Image, name: `input_1` , shape: [1x224x224x3], format: [BxHxWxC], +where: - - B - batch size - - H - image height - - W - image width - - C - number of channels +- `B` - batch size +- `H` - image height +- `W` - image width +- `C` - number of channels - Expected color order: RGB. - Mean values: [123.68, 116.78, 103.94], scale factor for each channel: 58.8235294 +Expected color order: RGB. +Mean values - [123.68, 116.78, 103.94], scale values - [58.395,57.12,57.375]. ### Converted Model -Image, name: `Placeholder`, shape: [1x3x224x224], [BxCxHxW], +Image, name: `input_1`, shape: [1x3x224x224], [BxCxHxW], where: - - B - batch size - - C - number of channels - - H - image height - - W - image width +- `B` - batch size +- `C` - number of channels +- `H` - image height +- `W` - image width Expected color order: BGR. @@ -56,14 +52,17 @@ Expected color order: BGR. ### Original Model -Floating point values in a range [0, 1], which represent probabilities for classes in a dataset. Name: `densenet121/predictions/Reshape_1`. +Object classifier according to ImageNet classes, name - `StatefulPartitionedCall/densenet121/predictions/Softmax`, shape - `1,1000`, output data format is `B,C` where: + +- `B` - batch size +- `C` - Predicted probabilities for each class in [0, 1] range ### Converted Model -Floating point values in a range [0, 1], which represent probabilities for classes in a dataset. Name: `densenet121/predictions/Reshape_1/Transpose`, shape - [1, 1, 1, 1000]. +The converted model has the same parameters as the original model. ## Legal Information The original model is distributed under the -[Apache License, Version 2.0](https://raw.githubusercontent.com/pudae/tensorflow-densenet/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TF-DenseNet.txt](../licenses/APACHE-2.0-TF-DenseNet.txt). +[Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/tensorflow/master/LICENSE). +A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). diff --git a/models/public/densenet-121-tf/model.yml b/models/public/densenet-121-tf/model.yml index 925133cc21f..e4f8e1f3aeb 100644 --- a/models/public/densenet-121-tf/model.yml +++ b/models/public/densenet-121-tf/model.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2019 Intel Corporation +# Copyright (c) 2020 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,29 +14,23 @@ description: >- This is a TensorFlow* version of "densenet-121" model, one of the DenseNet* group - of models designed to perform image classification. The weights were converted from - DenseNet-Keras Models. For details, see repository - and paper . + of models designed to perform image classification. For details, see TensorFlow* + API docs , + repository and paper . task_type: classification files: - - name: tf-densenet121.tar.gz - size: 30597420 - sha256: b31ec840358f1d20e1c6364d05ce463cb0bc0480042e663ad54547189501852d - source: - $type: google_drive - id: 0B_fUSpodN0t0eW1sVk1aeWREaDA -postprocessing: - - $type: unpack_archive - format: gztar - file: tf-densenet121.tar.gz + - name: densenet121_weights_tf_dim_ordering_tf_kernels.h5 + size: 33188688 + sha256: 86cf891d8ce2a713e59a1c6bfa9d3c006c7fdbb4355e8962482caa6d27daead7 + source: https://storage.googleapis.com/tensorflow/keras-applications/densenet/densenet121_weights_tf_dim_ordering_tf_kernels.h5 model_optimizer_args: - --reverse_input_channels - --input_shape=[1,224,224,3] - - --input=Placeholder - - --mean_values=Placeholder[123.68,116.78,103.94] - - --scale_values=Placeholder[58.8235294117647] - - --output=densenet121/predictions/Reshape_1 - - --input_meta_graph=$dl_dir/tf-densenet121.ckpt.meta + - --input=input_1 + - --mean_values=input_1[123.68,116.78,103.94] + - --scale_values=input_1[58.395,57.12,57.375] + - --output=StatefulPartitionedCall/densenet121/predictions/Softmax + - --saved_model_dir=$conv_dir/densenet-121.savedmodel framework: tf quantizable: yes -license: https://raw.githubusercontent.com/pudae/tensorflow-densenet/master/LICENSE +license: https://raw.githubusercontent.com/tensorflow/tensorflow/master/LICENSE diff --git a/models/public/densenet-121-tf/pre-convert.py b/models/public/densenet-121-tf/pre-convert.py new file mode 100755 index 00000000000..eeb9d8d691c --- /dev/null +++ b/models/public/densenet-121-tf/pre-convert.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import argparse +import tensorflow as tf + +from pathlib import Path + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('input_dir', type=Path) + parser.add_argument('output_dir', type=Path) + args = parser.parse_args() + + tf.keras.backend.set_image_data_format('channels_last') + + model = tf.keras.applications.DenseNet121( + weights=str(args.input_dir / 'densenet121_weights_tf_dim_ordering_tf_kernels.h5') + ) + model.save(filepath=args.output_dir / 'densenet-121.savedmodel') + + +if __name__ == '__main__': + main() diff --git a/models/public/densenet-121/densenet-121.md b/models/public/densenet-121/densenet-121.md index 1b2a3243aa2..08733d28bc9 100644 --- a/models/public/densenet-121/densenet-121.md +++ b/models/public/densenet-121/densenet-121.md @@ -9,8 +9,6 @@ been pretrained on the ImageNet image database. For details about this family of models, check out the [repository](https://github.com/shicai/DenseNet-Caffe). -## Example - ## Specification | Metric | Value | @@ -29,8 +27,6 @@ models, check out the [repository](https://github.com/shicai/DenseNet-Caffe). See [the original repository](https://github.com/shicai/DenseNet-Caffe). -## Performance - ## Input The model input is a blob that consists of a single image of 1x3x224x224 in BGR diff --git a/models/public/densenet-161-tf/densenet-161-tf.md b/models/public/densenet-161-tf/densenet-161-tf.md index 263d9217316..6a0e1c2a4c1 100644 --- a/models/public/densenet-161-tf/densenet-161-tf.md +++ b/models/public/densenet-161-tf/densenet-161-tf.md @@ -5,8 +5,6 @@ This is a TensorFlow\* version of `densenet-161` model, one of the DenseNet group of models designed to perform image classification. The weights were converted from DenseNet-Keras Models. For details see [repository](https://github.com/pudae/tensorflow-densenet/), [paper](https://arxiv.org/abs/1608.06993). -## Example - ## Specification | Metric | Value | @@ -23,8 +21,6 @@ group of models designed to perform image classification. The weights were conve | Top 1 | 76.446% | | Top 5 | 93.228%| -## Performance - ## Input ### Original Model diff --git a/models/public/densenet-161/densenet-161.md b/models/public/densenet-161/densenet-161.md index b53e7fbc4b0..551a9ea835b 100644 --- a/models/public/densenet-161/densenet-161.md +++ b/models/public/densenet-161/densenet-161.md @@ -18,8 +18,6 @@ by 0.017. The model output for `densenet-161` is the typical object classifier output for the 1000 different classifications matching those in the ImageNet database. -## Example - ## Specification | Metric | Value | @@ -38,8 +36,6 @@ the 1000 different classifications matching those in the ImageNet database. See [the original repository](https://github.com/shicai/DenseNet-Caffe). -## Performance - ## Input ### Original model diff --git a/models/public/densenet-169-tf/accuracy-check.yml b/models/public/densenet-169-tf/accuracy-check.yml index 9645dfc7e90..dfe82f1a4e4 100644 --- a/models/public/densenet-169-tf/accuracy-check.yml +++ b/models/public/densenet-169-tf/accuracy-check.yml @@ -11,3 +11,10 @@ models: size: 256 - type: crop size: 224 + metrics: + - name: accuracy@top1 + type: accuracy + top_k: 1 + - name: accuracy@top5 + type: accuracy + top_k: 5 diff --git a/models/public/densenet-169-tf/densenet-169-tf.md b/models/public/densenet-169-tf/densenet-169-tf.md index 84a02ce28ac..bec12364c77 100644 --- a/models/public/densenet-169-tf/densenet-169-tf.md +++ b/models/public/densenet-169-tf/densenet-169-tf.md @@ -2,53 +2,49 @@ ## Use Case and High-Level Description -This is a TensorFlow\* version of `densenet-169` model, one of the DenseNet -group of models designed to perform image classification. The weights were converted from DenseNet-Keras Models. For details, see [repository](https://github.com/pudae/tensorflow-densenet/) and [paper](https://arxiv.org/abs/1608.06993). - -## Example +This is a TensorFlow\* version of `densenet-169` model, one of the DenseNet\* group of models designed to perform image classification. +For details, see [TensorFlow\* API docs](https://www.tensorflow.org/api_docs/python/tf/keras/applications/DenseNet169), [repository](https://github.com/tensorflow/tensorflow) and [paper](https://arxiv.org/abs/1608.06993). ## Specification -| Metric | Value | -|---------------------------------|-------------------------------------------| -| Type | Classification | -| GFlops | 6.16 | -| MParams | 14.139 | -| Source framework | TensorFlow\* | +| Metric | Value | +|---------------------------------|-----------------| +| Type | Classification | +| GFlops | 6.7932 | +| MParams | 14.1389 | +| Source framework | TensorFlow\* | ## Accuracy | Metric | Value | | ------ | ----- | -| Top 1 | 75.76% | -| Top 5 | 92.81%| - -## Performance +| Top 1 | 76.14%| +| Top 5 | 93.12%| ## Input ### Original Model -Name: `Placeholder` , shape: [1x224x224x3]. An input image is the [BxHxWxC] format, - where: +Image, name: `input_1` , shape: [1x224x224x3], format: [BxHxWxC], +where: - - B - batch size - - H - image height - - W - image width - - C - number of channels +- `B` - batch size +- `H` - image height +- `W` - image width +- `C` - number of channels - Expected color order: RGB. - Mean values: [123.68, 116.78, 103.94], scale factor for each channel: 58.8235294 +Expected color order: RGB. +Mean values - [123.68, 116.78, 103.94], scale values - [58.395,57.12,57.375]. ### Converted Model -Name: `Placeholder`, shape: [1x3x224x224]. An input image is in the [BxCxHxW] format, +Image, name: `input_1`, shape: [1x3x224x224], [BxCxHxW], where: - - B - batch size - - C - number of channels - - H - image height - - W - image width +- `B` - batch size +- `C` - number of channels +- `H` - image height +- `W` - image width Expected color order: BGR. @@ -56,13 +52,17 @@ Expected color order: BGR. ### Original Model -Name:`densenet169/predictions/Reshape_1`. Contains floating point values in a range [0, 1], which represent probabilities for classes in a dataset. +Object classifier according to ImageNet classes, name - `StatefulPartitionedCall/densenet169/predictions/Softmax`, shape - `1,1000`, output data format is `B,C` where: + +- `B` - batch size +- `C` - Predicted probabilities for each class in [0, 1] range ### Converted Model -Name: `densenet169/predictions/Reshape_1/Transpose`, shape: [1, 1, 1, 1000]. Contains floating point values in a range [0, 1], which represent probabilities for classes in a dataset. +The converted model has the same parameters as the original model. ## Legal Information + The original model is distributed under the -[Apache License, Version 2.0](https://raw.githubusercontent.com/pudae/tensorflow-densenet/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TF-DenseNet.txt](../licenses/APACHE-2.0-TF-DenseNet.txt). +[Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/tensorflow/master/LICENSE). +A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). diff --git a/models/public/densenet-169-tf/model.yml b/models/public/densenet-169-tf/model.yml index f65130a7393..67d03990aa8 100644 --- a/models/public/densenet-169-tf/model.yml +++ b/models/public/densenet-169-tf/model.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2019 Intel Corporation +# Copyright (c) 2020 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,30 +13,24 @@ # limitations under the License. description: >- - This is a TensorFlow* version of "densenet-169" model, one of the DenseNet group - of models designed to perform image classification. The weights were converted from - DenseNet-Keras Models. For details, see repository - and paper . + This is a TensorFlow* version of "densenet-169" model, one of the DenseNet* group + of models designed to perform image classification. For details, see TensorFlow* + API docs , + repository and paper . task_type: classification files: - - name: tf-densenet169.tar.gz - size: 54307314 - sha256: 6f20b51077c49cb87df11d181b055a0aec1d27f969b84b4ed8115dd4933fccd4 - source: - $type: google_drive - id: 0B_fUSpodN0t0TDB5Ti1PeTZMM2c -postprocessing: - - $type: unpack_archive - format: gztar - file: tf-densenet169.tar.gz + - name: densenet169_weights_tf_dim_ordering_tf_kernels.h5 + size: 58541896 + sha256: ae45d067431199a76e935bfa14a8becf0a77724f203ad07ce6bb1721236391cc + source: https://storage.googleapis.com/tensorflow/keras-applications/densenet/densenet169_weights_tf_dim_ordering_tf_kernels.h5 model_optimizer_args: - --reverse_input_channels - --input_shape=[1,224,224,3] - - --input=Placeholder - - --mean_values=Placeholder[123.68,116.78,103.94] - - --scale_values=Placeholder[58.8235294117647] - - --output=densenet169/predictions/Reshape_1 - - --input_meta_graph=$dl_dir/tf-densenet169.ckpt.meta + - --input=input_1 + - --mean_values=input_1[123.68,116.78,103.94] + - --scale_values=input_1[58.395,57.12,57.375] + - --output=StatefulPartitionedCall/densenet169/predictions/Softmax + - --saved_model_dir=$conv_dir/densenet-169.savedmodel framework: tf quantizable: yes -license: https://raw.githubusercontent.com/pudae/tensorflow-densenet/master/LICENSE +license: https://raw.githubusercontent.com/tensorflow/tensorflow/master/LICENSE diff --git a/models/public/densenet-169-tf/pre-convert.py b/models/public/densenet-169-tf/pre-convert.py new file mode 100755 index 00000000000..e9a805f7c9c --- /dev/null +++ b/models/public/densenet-169-tf/pre-convert.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import argparse +import tensorflow as tf + +from pathlib import Path + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('input_dir', type=Path) + parser.add_argument('output_dir', type=Path) + args = parser.parse_args() + + tf.keras.backend.set_image_data_format('channels_last') + + model = tf.keras.applications.DenseNet169( + weights=str(args.input_dir / 'densenet169_weights_tf_dim_ordering_tf_kernels.h5') + ) + model.save(filepath=args.output_dir/ 'densenet-169.savedmodel') + + +if __name__ == '__main__': + main() diff --git a/models/public/densenet-169/densenet-169.md b/models/public/densenet-169/densenet-169.md index 59e2532ece6..5b40b9d497e 100644 --- a/models/public/densenet-169/densenet-169.md +++ b/models/public/densenet-169/densenet-169.md @@ -18,8 +18,6 @@ by 0.017. The model output for `densenet-169` is the typical object classifier output for the 1000 different classifications matching those in the ImageNet database. -## Example - ## Specification | Metric | Value | @@ -38,8 +36,6 @@ the 1000 different classifications matching those in the ImageNet database. See [the original repository](https://github.com/shicai/DenseNet-Caffe). -## Performance - ## Input ### Original model diff --git a/models/public/densenet-201-tf/accuracy-check.yml b/models/public/densenet-201-tf/accuracy-check.yml new file mode 100644 index 00000000000..fcfb2933593 --- /dev/null +++ b/models/public/densenet-201-tf/accuracy-check.yml @@ -0,0 +1,20 @@ +models: + - name: densenet-201-tf + launchers: + - framework: dlsdk + adapter: classification + + datasets: + - name: imagenet_1000_classes + preprocessing: + - type: resize + size: 256 + - type: crop + size: 224 + metrics: + - name: accuracy@top1 + type: accuracy + top_k: 1 + - name: accuracy@top5 + type: accuracy + top_k: 5 diff --git a/models/public/densenet-201-tf/densenet-201-tf.md b/models/public/densenet-201-tf/densenet-201-tf.md new file mode 100644 index 00000000000..3e3951332e1 --- /dev/null +++ b/models/public/densenet-201-tf/densenet-201-tf.md @@ -0,0 +1,68 @@ +# densenet-201-tf + +## Use Case and High-Level Description + +This is a TensorFlow\* version of `densenet-201` model, one of the DenseNet\* group of models designed to perform image classification. +For details, see [TensorFlow\* API docs](https://www.tensorflow.org/api_docs/python/tf/keras/applications/DenseNet201), [repository](https://github.com/tensorflow/tensorflow) and [paper](https://arxiv.org/abs/1608.06993). + +## Specification + +| Metric | Value | +|---------------------------------|-----------------| +| Type | Classification | +| GFlops | 8.6786 | +| MParams | 20.0013 | +| Source framework | TensorFlow\* | + +## Accuracy + +| Metric | Value | +| ------ | ----- | +| Top 1 | 76.93%| +| Top 5 | 93.56%| + +## Input + +### Original Model + +Image, name: `input_1` , shape: [1x224x224x3], format: [BxHxWxC], +where: + +- `B` - batch size +- `H` - image height +- `W` - image width +- `C` - number of channels + +Expected color order: RGB. +Mean values - [123.68, 116.78, 103.94], scale values - [58.395,57.12,57.375]. + +### Converted Model + +Image, name: `input_1`, shape: [1x3x224x224], [BxCxHxW], +where: + +- `B` - batch size +- `C` - number of channels +- `H` - image height +- `W` - image width + +Expected color order: BGR. + +## Output + +### Original Model + +Object classifier according to ImageNet classes, name - `StatefulPartitionedCall/densenet201/predictions/Softmax`, shape - `1,1000`, output data format is `B,C` where: + +- `B` - batch size +- `C` - Predicted probabilities for each class in [0, 1] range + +### Converted Model + +The converted model has the same parameters as the original model. + +## Legal Information + +The original model is distributed under the +[Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/tensorflow/master/LICENSE). +A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). diff --git a/models/public/densenet-201-tf/model.yml b/models/public/densenet-201-tf/model.yml new file mode 100644 index 00000000000..3aa498b5870 --- /dev/null +++ b/models/public/densenet-201-tf/model.yml @@ -0,0 +1,36 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + This is a TensorFlow* version of "densenet-201" model, one of the DenseNet* group + of models designed to perform image classification. For details, see TensorFlow* + API docs , + repository and paper . +task_type: classification +files: + - name: densenet201_weights_tf_dim_ordering_tf_kernels.h5 + size: 82524592 + sha256: 1cbd33a37b0b14afad2ff7f578e1ccaa123427d9b9d6923a2ceacaef49210536 + source: https://storage.googleapis.com/tensorflow/keras-applications/densenet/densenet201_weights_tf_dim_ordering_tf_kernels.h5 +model_optimizer_args: + - --reverse_input_channels + - --input_shape=[1,224,224,3] + - --input=input_1 + - --mean_values=input_1[123.68,116.78,103.94] + - --scale_values=input_1[58.395,57.12,57.375] + - --output=StatefulPartitionedCall/densenet201/predictions/Softmax + - --saved_model_dir=$conv_dir/densenet-201.savedmodel +framework: tf +quantizable: yes +license: https://raw.githubusercontent.com/tensorflow/tensorflow/master/LICENSE diff --git a/models/public/densenet-201-tf/pre-convert.py b/models/public/densenet-201-tf/pre-convert.py new file mode 100755 index 00000000000..54dab30a19d --- /dev/null +++ b/models/public/densenet-201-tf/pre-convert.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import argparse +import tensorflow as tf + +from pathlib import Path + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('input_dir', type=Path) + parser.add_argument('output_dir', type=Path) + args = parser.parse_args() + + tf.keras.backend.set_image_data_format('channels_last') + + model = tf.keras.applications.DenseNet201( + weights=str(args.input_dir / 'densenet201_weights_tf_dim_ordering_tf_kernels.h5') + ) + model.save(filepath=args.output_dir / 'densenet-201.savedmodel') + + +if __name__ == '__main__': + main() diff --git a/models/public/densenet-201/densenet-201.md b/models/public/densenet-201/densenet-201.md index d0d5721d645..f766d74e9fd 100644 --- a/models/public/densenet-201/densenet-201.md +++ b/models/public/densenet-201/densenet-201.md @@ -18,8 +18,6 @@ by 0.017. The model output for `densenet-201` is the typical object classifier output for the 1000 different classifications matching those in the ImageNet database. -## Example - ## Specification | Metric | Value | @@ -38,8 +36,6 @@ the 1000 different classifications matching those in the ImageNet database. See [the original repository](https://github.com/shicai/DenseNet-Caffe). -## Performance - ## Input ### Original model diff --git a/models/public/dla-34/accuracy-check.yml b/models/public/dla-34/accuracy-check.yml new file mode 100644 index 00000000000..b3ff76600f3 --- /dev/null +++ b/models/public/dla-34/accuracy-check.yml @@ -0,0 +1,49 @@ +models: + - name: dla-34 + + launchers: + - framework: onnx_runtime + model: dla-34.onnx + adapter: classification + inputs: + - name: data + type: INPUT + shape: 1,3,224,224 + + datasets: + - name: imagenet_1000_classes + reader: pillow_imread + + preprocessing: + - type: resize + size: 256 + aspect_ratio_scale: greater + use_pillow: True + interpolation: BILINEAR + - type: crop + size: 224 + use_pillow: True + - type: normalization + mean: (123.675,116.28,103.53) + std: (58.395,57.12,57.375) + + - name: dla-34 + + launchers: + - framework: dlsdk + adapter: classification + + datasets: + - name: imagenet_1000_classes + reader: pillow_imread + + preprocessing: + - type: rgb_to_bgr + - type: resize + size: 256 + aspect_ratio_scale: greater + use_pillow: True + interpolation: BILINEAR + - type: crop + size: 224 + use_pillow: True diff --git a/models/public/dla-34/dla-34.md b/models/public/dla-34/dla-34.md new file mode 100644 index 00000000000..29f00b5c061 --- /dev/null +++ b/models/public/dla-34/dla-34.md @@ -0,0 +1,100 @@ +# dla-34 + +## Use Case and High-Level Description + +The `dla-34` model is one of the [DLA](https://arxiv.org/pdf/1707.06484) +models designed to perform image classification. This model was pretrained in PyTorch\*. All DLA (Deep Layer Aggregation) classification models have been pretrained on the ImageNet\* dataset. For details about this family of models, check out the [Code for the CVPR Paper "Deep Layer Aggregation"](https://github.com/ucbdrive/dla). + +## Specification + +| Metric | Value | +| ---------------- | -------------- | +| Type | Classification | +| GFLOPs | 6.1368 | +| MParams | 15.7344 | +| Source framework | PyTorch\* | + +## Accuracy + +| Metric | Original model | Converted model | +| ------ | -------------- | --------------- | +| Top 1 | 74.64% | 74.64% | +| Top 5 | 92.06% | 92.06% | + +## Input + +### Original model + +Image, name - `data`, shape - `1,3,224,224`, format is `B,C,H,W` where: + +- `B` - batch size +- `C` - channel +- `H` - height +- `W` - width + +Channel order is `RGB`. +Mean values - [123.675,116.28,103.53], scale values - [58.395,57.12,57.375]. + +### Converted model + +Image, name - `data`, shape - `1,3,224,224`, format is `B,C,H,W` where: + +- `B` - batch size +- `C` - channel +- `H` - height +- `W` - width + +Channel order is `BGR` + +## Output + +### Original model + +Object classifier according to ImageNet classes, name - `prob`, shape - `1,1000`, output data format is `B,C` where: + +- `B` - batch size +- `C` - Predicted probabilities for each class in [0, 1] range + +### Converted model + +Object classifier according to ImageNet classes, name - `prob`, shape - `1,1000`, output data format is `B,C` where: + +- `B` - batch size +- `C` - Predicted probabilities for each class in [0, 1] range + +## Legal Information + +The original model is distributed under the following +[license](https://raw.githubusercontent.com/ucbdrive/dla/master/LICENSE): + +``` +BSD 3-Clause License + +Copyright (c) 2018, Fisher Yu +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +``` diff --git a/models/public/dla-34/model.yml b/models/public/dla-34/model.yml new file mode 100644 index 00000000000..1790c0c7d54 --- /dev/null +++ b/models/public/dla-34/model.yml @@ -0,0 +1,53 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + The "dla-34" model is one of the DLA models designed + to perform image classification. This model was pretrained in PyTorch*. All DLA + (Deep Layer Aggregation) classification models have been pretrained on the ImageNet* + dataset. For details about this family of models, check out the Code for the CVPR + Paper "Deep Layer Aggregation" . +task_type: classification +files: + - name: dla.py + size: 14499 + sha256: cd3ea73af97f3456034f58392cc695fd6961f939adf9c80c1977e721efd7f8bc + source: https://raw.githubusercontent.com/ucbdrive/dla/master/dla.py + - name: dataset.py + size: 1776 + sha256: 6821c636a1a955417fc2beade5d73409a9eceb546ca004c993f913a818cbfb90 + source: https://raw.githubusercontent.com/ucbdrive/dla/master/dataset.py + - name: ckpt/dla34.pth + size: 63228658 + sha256: ba72cf86426e6333d9e8c6c7a8cae5549879212e48ae3aaad4bc8a7d009c34e1 + source: http://dl.yf.io/dla/models/imagenet/dla34-ba72cf86.pth +conversion_to_onnx_args: + - --model-path=$dl_dir + - --model-name=dla34 + - --import-module=dla + - --weights=$dl_dir/ckpt/dla34.pth + - --input-shape=1,3,224,224 + - --input-names=data + - --output-names=prob + - --output-file=$conv_dir/dla-34.onnx +model_optimizer_args: + - --reverse_input_channels + - --input_shape=[1,3,224,224] + - --input=data + - --mean_values=data[123.675,116.28,103.53] + - --scale_values=data[58.395,57.12,57.375] + - --output=prob + - --input_model=$conv_dir/dla-34.onnx +framework: pytorch +license: https://raw.githubusercontent.com/ucbdrive/dla/master/LICENSE diff --git a/models/public/efficientdet-d0-tf/accuracy-check.yml b/models/public/efficientdet-d0-tf/accuracy-check.yml new file mode 100644 index 00000000000..755eff391ad --- /dev/null +++ b/models/public/efficientdet-d0-tf/accuracy-check.yml @@ -0,0 +1,23 @@ +models: + - name: efficientdet-d0-tf + launchers: + - framework: dlsdk + adapter: ssd + datasets: + - name: ms_coco_detection_90_class_without_background + preprocessing: + - type: resize + aspect_ratio_scale: fit_to_window + size: 512 + - type: padding + size: 512 + pad_type: right_bottom + + postprocessing: + - type: faster_rcnn_postprocessing_resize + size: 512 + - type: shift_labels + offset: 1 + + metrics: + - type: coco_precision diff --git a/models/public/efficientdet-d0-tf/efficientdet-d0-tf.md b/models/public/efficientdet-d0-tf/efficientdet-d0-tf.md new file mode 100644 index 00000000000..a6b6bdb08cf --- /dev/null +++ b/models/public/efficientdet-d0-tf/efficientdet-d0-tf.md @@ -0,0 +1,82 @@ +# efficientdet-d0-tf + +## Use Case and High-Level Description + +The "efficientdet-d0-tf" model is one of the [EfficientDet](https://arxiv.org/abs/1911.09070) +models designed to perform object detection. This model was pretrained in TensorFlow\*. +All the EfficientDet models have been pretrained on the MSCOCO\* image database. +For details about this family of models, check out the Google AutoML [repository] +(https://github.com/google/automl/tree/master/efficientdet). + +## Specification + +| Metric | Value | +|-------------------|-----------------| +| Type | Object detection| +| GFLOPs | 2.54 | +| MParams | 3.9 | +| Source framework | TensorFlow\* | + +## Accuracy + +| Metric | Converted model | +| ------ | --------------- | +| [COCO\* mAP (0.5:0.05:0.95)](http://cocodataset.org/#detection-eval) | 31.95%| + +## Input + +### Original Model + +Image, name - `image_arrays`, shape - `[1x512x512x3]`, format is `[BxHxWxC]`, where: + +- `B` - batch size +- `H` - height +- `W` - width +- `C` - channel + +Channel order is `RGB`. + +### Converted Model + +Image, name - `image_arrays/placeholder_port_0`, shape - `[1x3x512x512]`, format is `[BxCxHxW]`, where: + +- `B` - batch size +- `C` - channel +- `H` - height +- `W` - width + +Channel order is `BGR`. + +## Output + +### Original Model + +The array of summary detection information, name: `detections`, shape: [1, N, 7], where N is the number of detected +bounding boxes. For each detection, the description has the format: +[`image_id`, `y_min`, `x_min`, `y_max`, `x_max`, `confidence`, `label`], + where: + + - `image_id` - ID of the image in the batch + - (`x_min`, `y_min`) - coordinates of the top left bounding box corner + - (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner + - `confidence` - confidence for the predicted class + - `label` - predicted class ID, starting from 1 + +### Converted Model + +The array of summary detection information, name: `detections`, shape: [1, 1, N, 7], where N is the number of detected +bounding boxes. For each detection, the description has the format: +[`image_id`, `label`, `conf`, `x_min`, `y_min`, `x_max`, `y_max`], + where: + + - `image_id` - ID of the image in the batch + - `label` - predicted class ID, starting from 0 + - `conf` - confidence for the predicted class + - (`x_min`, `y_min`) - coordinates of the top left bounding box corner (coordinates stored in normalized format, in range [0, 1]) + - (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner (coordinates stored in normalized format, in range [0, 1]) + +## Legal Information + +The original model is distributed under the +[Apache License, Version 2.0](https://raw.githubusercontent.com/google/automl/master/LICENSE). +A copy of the license is provided in [APACHE-2.0-TF-AutoML.txt](../licenses/APACHE-2.0-TF-AutoML.txt). diff --git a/models/public/efficientdet-d0-tf/model.yml b/models/public/efficientdet-d0-tf/model.yml new file mode 100644 index 00000000000..df5a5bca7cf --- /dev/null +++ b/models/public/efficientdet-d0-tf/model.yml @@ -0,0 +1,120 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + The "efficientdet-d0-tf" model is one of the EfficientDet + models designed to perform object detection. This model was pretrained in TensorFlow*. + All the EfficientDet models have been pretrained on the MSCOCO* image database. + For details about this family of models, check out the Google AutoML repository + . +task_type: detection +files: + - name: efficientdet-d0.tar.gz + size: 28828936 + sha256: 74794c937aa1fa2f559c2393d22b251b1f7135a49b108bd0414bc4f4800ca15d + source: https://storage.googleapis.com/cloud-tpu-checkpoints/efficientdet/coco2/efficientdet-d0.tar.gz + - name: model/model_inspect.py + size: 20388 + sha256: 6c68fe02f10d62dd87c2fc550b41c3df5cce52f0449be22e0699fbf209e3cbc1 + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/model_inspect.py + - name: model/hparams_config.py + size: 13750 + sha256: a7f9a3215a864e2f393addefc997ceba1d78ccba4909390310c453e391c9710b + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/hparams_config.py + - name: model/inference.py + size: 25076 + sha256: 1f0a633de186f9b786979ead00921b910e9853bb33717328f76c1f71af8be997 + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/inference.py + - name: model/dataloader.py + size: 19251 + sha256: 5e4bdfc1a746dd2fffe6a0d7bd83ea6422b2883fce5e8e7fb7ed381e919c11a9 + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/dataloader.py + - name: model/nms_np.py + size: 11404 + sha256: e72ffbab850f9a267f9cc5ae480a4ee0936402fd109dfd3c2fa7b5644e71245f + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/nms_np.py + - name: model/utils.py + size: 25677 + sha256: eb68091efcf989a908225c2af6d7f632f90c6602659ab06dea628cbdcabdd403 + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/utils.py + - name: model/keras/efficientdet_keras.py + size: 32414 + sha256: 4b60b29aabae4365bb9d77b40698a974de9fd4d998f9be94df12b184c0e09ca9 + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/keras/efficientdet_keras.py + - name: model/backbone/efficientnet_builder.py + size: 11609 + sha256: 868b9b4cd06c39e1ec15ea1005c36771676f30003c034a0bed4d06e00932905c + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/backbone/efficientnet_builder.py + - name: model/backbone/efficientnet_model.py + size: 27419 + sha256: 0a488e70c46bfa6d98fec66b4c518e0b3a25eedd8ca836123f4ef335dd12bf0c + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/backbone/efficientnet_model.py + - name: model/backbone/backbone_factory.py + size: 2963 + sha256: 3babe95f1bd104fdb1f54e49e68e2a12478933058d6a09c2a46401e80fab06c9 + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/backbone/backbone_factory.py + - name: model/keras/anchors.py + size: 9175 + sha256: a88000a453e1ec1194cff2155a1148ef1c2ca87ad563cff2f412f1a597c3ffd7 + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/keras/anchors.py + - name: model/keras/util_keras.py + size: 2198 + sha256: 81e21202054018d7616ab1d0f41eceaf8b4e31a6d6ee88cb53c251abea9fa582 + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/keras/util_keras.py + - name: model/keras/fpn_configs.py + size: 6120 + sha256: 245cdd3308141fbb6d2b04b850d45fabb56a0f8ac74c857c7dd0d38238664f0d + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/keras/fpn_configs.py + - name: model/keras/postprocess.py + size: 17677 + sha256: 7ca776128887a813089dfc81a61cd4e82b4c3add100a5bafc1951f7dedd1fb4b + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/keras/postprocess.py +postprocessing: + # disable imports that aren't needed for this model and code that uses them + - $type: regex_replace + file: model/inference.py + pattern: '(import det_model_fn|from (keras import label_util|visualize)|from PIL)' + replacement: '# \g<0>' + - $type: regex_replace + file: model/hparams_config.py + pattern: 'import yaml' + replacement: '# \g<0>' + - $type: regex_replace + file: model/model_inspect.py + pattern: 'from PIL' + replacement: '# \g<0>' + - $type: regex_replace + file: model/backbone/backbone_factory.py + pattern: 'from backbone import efficientnet_lite_builder' + replacement: '# \g<0>' + - $type: regex_replace + file: model/dataloader.py + pattern: 'from (object_detection|keras)' + replacement: '# \g<0>' + - $type: regex_replace + file: model/keras/anchors.py + pattern: 'from object_detection' + replacement: '# \g<0>' + + - $type: unpack_archive + format: gztar + file: efficientdet-d0.tar.gz +model_optimizer_args: + - --input_shape=[1,512,512,3] + - --input=image_arrays + - --reverse_input_channels + - --input_model=$conv_dir/efficientdet-d0_saved_model/efficientdet-d0_frozen.pb + - --transformations_config=$mo_dir/extensions/front/tf/automl_efficientdet.json +framework: tf +license: https://raw.githubusercontent.com/google/automl/master/LICENSE diff --git a/models/public/efficientdet-d0-tf/pre-convert.py b/models/public/efficientdet-d0-tf/pre-convert.py new file mode 100755 index 00000000000..59f2ed5c31a --- /dev/null +++ b/models/public/efficientdet-d0-tf/pre-convert.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import argparse +import subprocess +import sys + +from pathlib import Path + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('input_dir', type=Path) + parser.add_argument('output_dir', type=Path) + args = parser.parse_args() + + subprocess.run([sys.executable, '--', + str(args.input_dir / 'model/model_inspect.py'), + "--runmode=saved_model", + "--model_name=efficientdet-d0", + "--ckpt_path={}".format(args.input_dir / "efficientdet-d0"), + "--saved_model_dir={}".format(args.output_dir / "efficientdet-d0_saved_model") + ], check=True) + +if __name__ == '__main__': + main() diff --git a/models/public/efficientdet-d1-tf/accuracy-check.yml b/models/public/efficientdet-d1-tf/accuracy-check.yml new file mode 100644 index 00000000000..7a091625a47 --- /dev/null +++ b/models/public/efficientdet-d1-tf/accuracy-check.yml @@ -0,0 +1,23 @@ +models: + - name: efficientdet-d1-tf + launchers: + - framework: dlsdk + adapter: ssd + datasets: + - name: ms_coco_detection_90_class_without_background + preprocessing: + - type: resize + aspect_ratio_scale: fit_to_window + size: 640 + - type: padding + size: 640 + pad_type: right_bottom + + postprocessing: + - type: faster_rcnn_postprocessing_resize + size: 640 + - type: shift_labels + offset: 1 + + metrics: + - type: coco_precision diff --git a/models/public/efficientdet-d1-tf/efficientdet-d1-tf.md b/models/public/efficientdet-d1-tf/efficientdet-d1-tf.md new file mode 100644 index 00000000000..1888667dac1 --- /dev/null +++ b/models/public/efficientdet-d1-tf/efficientdet-d1-tf.md @@ -0,0 +1,82 @@ +# efficientdet-d1-tf + +## Use Case and High-Level Description + +The "efficientdet-d1-tf" model is one of the [EfficientDet](https://arxiv.org/abs/1911.09070) +models designed to perform object detection. This model was pretrained in TensorFlow\*. +All the EfficientDet models have been pretrained on the MSCOCO\* image database. +For details about this family of models, check out the Google AutoML [repository] +(https://github.com/google/automl/tree/master/efficientdet). + +## Specification + +| Metric | Value | +|-------------------|-----------------| +| Type | Object detection| +| GFLOPs | 6.1 | +| MParams | 6.6 | +| Source framework | TensorFlow\* | + +## Accuracy + +| Metric | Converted model | +| ------ | --------------- | +| [COCO\* mAP (0.5:0.05:0.95)](http://cocodataset.org/#detection-eval) | 37.54%| + +## Input + +### Original Model + +Image, name - `image_arrays`, shape - `[1x640x640x3]`, format is `[BxHxWxC]`, where: + +- `B` - batch size +- `H` - height +- `W` - width +- `C` - channel + +Channel order is `RGB`. + +### Converted Model + +Image, name - `image_arrays/placeholder_port_0`, shape - `[1x3x640x640]`, format is `[BxCxHxW]`, where: + +- `B` - batch size +- `C` - channel +- `H` - height +- `W` - width + +Channel order is `BGR`. + +## Output + +### Original Model + +The array of summary detection information, name: `detections`, shape: [1, N, 7], where N is the number of detected +bounding boxes. For each detection, the description has the format: +[`image_id`, `y_min`, `x_min`, `y_max`, `x_max`, `confidence`, `label`], + where: + + - `image_id` - ID of the image in the batch + - (`x_min`, `y_min`) - coordinates of the top left bounding box corner + - (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner + - `confidence` - confidence for the predicted class + - `label` - predicted class ID, starting from 1 + +### Converted Model + +The array of summary detection information, name: `detections`, shape: [1, 1, N, 7], where N is the number of detected +bounding boxes. For each detection, the description has the format: +[`image_id`, `label`, `conf`, `x_min`, `y_min`, `x_max`, `y_max`], + where: + + - `image_id` - ID of the image in the batch + - `label` - predicted class ID, starting from 0 + - `conf` - confidence for the predicted class + - (`x_min`, `y_min`) - coordinates of the top left bounding box corner (coordinates stored in normalized format, in range [0, 1]) + - (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner (coordinates stored in normalized format, in range [0, 1]) + +## Legal Information + +The original model is distributed under the +[Apache License, Version 2.0](https://raw.githubusercontent.com/google/automl/master/LICENSE). +A copy of the license is provided in [APACHE-2.0-TF-AutoML.txt](../licenses/APACHE-2.0-TF-AutoML.txt). diff --git a/models/public/efficientdet-d1-tf/model.yml b/models/public/efficientdet-d1-tf/model.yml new file mode 100644 index 00000000000..c2c06cf391c --- /dev/null +++ b/models/public/efficientdet-d1-tf/model.yml @@ -0,0 +1,120 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + The "efficientdet-d1-tf" model is one of the EfficientDet + models designed to perform object detection. This model was pretrained in TensorFlow*. + All the EfficientDet models have been pretrained on the MSCOCO* image database. + For details about this family of models, check out the Google AutoML repository + . +task_type: detection +files: + - name: efficientdet-d1.tar.gz + size: 48828228 + sha256: 31d8741da9840ab8bddfaa041d395d84a8c1e4e54db01cf8d277471afad5d6e0 + source: https://storage.googleapis.com/cloud-tpu-checkpoints/efficientdet/coco2/efficientdet-d1.tar.gz + - name: model/model_inspect.py + size: 20388 + sha256: 6c68fe02f10d62dd87c2fc550b41c3df5cce52f0449be22e0699fbf209e3cbc1 + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/model_inspect.py + - name: model/hparams_config.py + size: 13750 + sha256: a7f9a3215a864e2f393addefc997ceba1d78ccba4909390310c453e391c9710b + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/hparams_config.py + - name: model/inference.py + size: 25076 + sha256: 1f0a633de186f9b786979ead00921b910e9853bb33717328f76c1f71af8be997 + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/inference.py + - name: model/dataloader.py + size: 19251 + sha256: 5e4bdfc1a746dd2fffe6a0d7bd83ea6422b2883fce5e8e7fb7ed381e919c11a9 + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/dataloader.py + - name: model/nms_np.py + size: 11404 + sha256: e72ffbab850f9a267f9cc5ae480a4ee0936402fd109dfd3c2fa7b5644e71245f + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/nms_np.py + - name: model/utils.py + size: 25677 + sha256: eb68091efcf989a908225c2af6d7f632f90c6602659ab06dea628cbdcabdd403 + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/utils.py + - name: model/keras/efficientdet_keras.py + size: 32414 + sha256: 4b60b29aabae4365bb9d77b40698a974de9fd4d998f9be94df12b184c0e09ca9 + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/keras/efficientdet_keras.py + - name: model/backbone/efficientnet_builder.py + size: 11609 + sha256: 868b9b4cd06c39e1ec15ea1005c36771676f30003c034a0bed4d06e00932905c + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/backbone/efficientnet_builder.py + - name: model/backbone/efficientnet_model.py + size: 27419 + sha256: 0a488e70c46bfa6d98fec66b4c518e0b3a25eedd8ca836123f4ef335dd12bf0c + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/backbone/efficientnet_model.py + - name: model/backbone/backbone_factory.py + size: 2963 + sha256: 3babe95f1bd104fdb1f54e49e68e2a12478933058d6a09c2a46401e80fab06c9 + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/backbone/backbone_factory.py + - name: model/keras/anchors.py + size: 9175 + sha256: a88000a453e1ec1194cff2155a1148ef1c2ca87ad563cff2f412f1a597c3ffd7 + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/keras/anchors.py + - name: model/keras/util_keras.py + size: 2198 + sha256: 81e21202054018d7616ab1d0f41eceaf8b4e31a6d6ee88cb53c251abea9fa582 + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/keras/util_keras.py + - name: model/keras/fpn_configs.py + size: 6120 + sha256: 245cdd3308141fbb6d2b04b850d45fabb56a0f8ac74c857c7dd0d38238664f0d + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/keras/fpn_configs.py + - name: model/keras/postprocess.py + size: 17677 + sha256: 7ca776128887a813089dfc81a61cd4e82b4c3add100a5bafc1951f7dedd1fb4b + source: https://raw.githubusercontent.com/google/automl/341af7d4da7805c3a874877484e133f33c420ec5/efficientdet/keras/postprocess.py +postprocessing: + # disable imports that aren't needed for this model and code that uses them + - $type: regex_replace + file: model/inference.py + pattern: '(import det_model_fn|from (keras import label_util|visualize)|from PIL)' + replacement: '# \g<0>' + - $type: regex_replace + file: model/hparams_config.py + pattern: 'import yaml' + replacement: '# \g<0>' + - $type: regex_replace + file: model/model_inspect.py + pattern: 'from PIL' + replacement: '# \g<0>' + - $type: regex_replace + file: model/backbone/backbone_factory.py + pattern: 'from backbone import efficientnet_lite_builder' + replacement: '# \g<0>' + - $type: regex_replace + file: model/dataloader.py + pattern: 'from (object_detection|keras)' + replacement: '# \g<0>' + - $type: regex_replace + file: model/keras/anchors.py + pattern: 'from object_detection' + replacement: '# \g<0>' + + - $type: unpack_archive + format: gztar + file: efficientdet-d1.tar.gz +model_optimizer_args: + - --input_shape=[1,640,640,3] + - --input=image_arrays + - --reverse_input_channels + - --input_model=$conv_dir/efficientdet-d1_saved_model/efficientdet-d1_frozen.pb + - --transformations_config=$mo_dir/extensions/front/tf/automl_efficientdet.json +framework: tf +license: https://raw.githubusercontent.com/google/automl/master/LICENSE diff --git a/models/public/efficientdet-d1-tf/pre-convert.py b/models/public/efficientdet-d1-tf/pre-convert.py new file mode 100755 index 00000000000..66989144b4e --- /dev/null +++ b/models/public/efficientdet-d1-tf/pre-convert.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import argparse +import subprocess +import sys + +from pathlib import Path + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('input_dir', type=Path) + parser.add_argument('output_dir', type=Path) + args = parser.parse_args() + + subprocess.run([sys.executable, '--', + str(args.input_dir / 'model/model_inspect.py'), + "--runmode=saved_model", + "--model_name=efficientdet-d1", + "--ckpt_path={}".format(args.input_dir / "efficientdet-d1"), + "--saved_model_dir={}".format(args.output_dir / "efficientdet-d1_saved_model") + ], check=True) + +if __name__ == '__main__': + main() diff --git a/models/public/efficientnet-b0-pytorch/efficientnet-b0-pytorch.md b/models/public/efficientnet-b0-pytorch/efficientnet-b0-pytorch.md index b0a8c08a1ad..2f4a63fddb2 100644 --- a/models/public/efficientnet-b0-pytorch/efficientnet-b0-pytorch.md +++ b/models/public/efficientnet-b0-pytorch/efficientnet-b0-pytorch.md @@ -12,8 +12,6 @@ order. Before passing the image blob to the network, do the following: The model output for `efficientnet-b0-pytorch` is the typical object classifier output for 1000 different classifications matching those in the ImageNet database. -## Example - ## Specification | Metric | Value | @@ -30,8 +28,6 @@ The model output for `efficientnet-b0-pytorch` is the typical object classifier | Top 1 | 76.91% | 76.91% | | Top 5 | 93.21% | 93.21% | -## Performance - ## Input ### Original Model diff --git a/models/public/efficientnet-b0/efficientnet-b0.md b/models/public/efficientnet-b0/efficientnet-b0.md index 6f4a131e629..0ad661c6bcc 100644 --- a/models/public/efficientnet-b0/efficientnet-b0.md +++ b/models/public/efficientnet-b0/efficientnet-b0.md @@ -8,8 +8,6 @@ This model was pretrained in TensorFlow\*. All the EfficientNet models have been pretrained on the ImageNet\* image database. For details about this family of models, check out the [TensorFlow Cloud TPU repository](https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet). -## Example - ## Specification | Metric | Value | @@ -26,8 +24,6 @@ For details about this family of models, check out the [TensorFlow Cloud TPU rep | Top 1 | 75.70% | 75.70% | | Top 5 | 92.76% | 92.76% | -## Performance - ## Input ### Original Model diff --git a/models/public/efficientnet-b0_auto_aug/efficientnet-b0_auto_aug.md b/models/public/efficientnet-b0_auto_aug/efficientnet-b0_auto_aug.md index b96eb7afe54..7d4af31660c 100644 --- a/models/public/efficientnet-b0_auto_aug/efficientnet-b0_auto_aug.md +++ b/models/public/efficientnet-b0_auto_aug/efficientnet-b0_auto_aug.md @@ -9,8 +9,6 @@ This model was pretrained in TensorFlow\*. All the EfficientNet models have been pretrained on the ImageNet\* image database. For details about this family of models, check out the [TensorFlow Cloud TPU repository](https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet). -## Example - ## Specification | Metric | Value | @@ -27,8 +25,6 @@ For details about this family of models, check out the [TensorFlow Cloud TPU rep | Top 1 | 76.43% | 76.43% | | Top 5 | 93.04% | 93.04% | -## Performance - ## Input ### Original Model diff --git a/models/public/efficientnet-b5-pytorch/efficientnet-b5-pytorch.md b/models/public/efficientnet-b5-pytorch/efficientnet-b5-pytorch.md index 2167d8cdfe5..46bd6fb4fb9 100644 --- a/models/public/efficientnet-b5-pytorch/efficientnet-b5-pytorch.md +++ b/models/public/efficientnet-b5-pytorch/efficientnet-b5-pytorch.md @@ -14,8 +14,6 @@ order. Before passing the image blob to the network, do the following: The model output for `efficientnet-b5-pytorch` is the typical object classifier output for the 1000 different classifications matching those in the ImageNet database. -## Example - ## Specification | Metric | Value | @@ -32,8 +30,6 @@ the 1000 different classifications matching those in the ImageNet database. | Top 1 | 83.69% | 83.69% | | Top 5 | 96.71% | 96.71% | -## Performance - ## Input ### Original Model diff --git a/models/public/efficientnet-b5/efficientnet-b5.md b/models/public/efficientnet-b5/efficientnet-b5.md index ea7cd1f06a8..fe03daf3e88 100644 --- a/models/public/efficientnet-b5/efficientnet-b5.md +++ b/models/public/efficientnet-b5/efficientnet-b5.md @@ -8,8 +8,6 @@ This model was pretrained in TensorFlow\*. All the EfficientNet models have been pretrained on the ImageNet\* image database. For details about this family of models, check out the [TensorFlow Cloud TPU repository](https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet). -## Example - ## Specification | Metric | Value | @@ -26,8 +24,6 @@ For details about this family of models, check out the [TensorFlow Cloud TPU rep | Top 1 | 83.33% | 83.33% | | Top 5 | 96.67% | 96.67% | -## Performance - ## Input ### Original Model diff --git a/models/public/efficientnet-b7-pytorch/efficientnet-b7-pytorch.md b/models/public/efficientnet-b7-pytorch/efficientnet-b7-pytorch.md index 5987b7af516..cd35c2eae31 100644 --- a/models/public/efficientnet-b7-pytorch/efficientnet-b7-pytorch.md +++ b/models/public/efficientnet-b7-pytorch/efficientnet-b7-pytorch.md @@ -13,8 +13,6 @@ order. Before passing the image blob to the network, do the following: The model output for `efficientnet-b7-pytorch` is the typical object classifier output for the 1000 different classifications matching those in the ImageNet database. -## Example - ## Specification | Metric | Value | @@ -31,8 +29,6 @@ the 1000 different classifications matching those in the ImageNet database. | Top 1 | 84.42% | 84.42% | | Top 5 | 96.91% | 96.91% | -## Performance - ## Input ### Original Model diff --git a/models/public/efficientnet-b7_auto_aug/efficientnet-b7_auto_aug.md b/models/public/efficientnet-b7_auto_aug/efficientnet-b7_auto_aug.md index fde832520a1..578793710e2 100644 --- a/models/public/efficientnet-b7_auto_aug/efficientnet-b7_auto_aug.md +++ b/models/public/efficientnet-b7_auto_aug/efficientnet-b7_auto_aug.md @@ -9,8 +9,6 @@ This model was pretrained in TensorFlow\*. All the EfficientNet models have been pretrained on the ImageNet\* image database. For details about this family of models, check out the [TensorFlow Cloud TPU repository](https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet). -## Example - ## Specification | Metric | Value | @@ -27,8 +25,6 @@ For details about this family of models, check out the [TensorFlow Cloud TPU rep | Top 1 | 84.68% | 84.68% | | Top 5 | 97.09% | 97.09% | -## Performance - ## Input ### Original Model diff --git a/models/public/face-detection-retail-0044/face-detection-retail-0044.md b/models/public/face-detection-retail-0044/face-detection-retail-0044.md index b6de46a9dc2..a42f9ac3d4f 100644 --- a/models/public/face-detection-retail-0044/face-detection-retail-0044.md +++ b/models/public/face-detection-retail-0044/face-detection-retail-0044.md @@ -25,8 +25,6 @@ Average Precision (AP) is defined as an area under the curve. All numbers were evaluated by taking into account only faces bigger than 60 x 60 pixels. -## Performance - ## Inputs ### Original Model diff --git a/models/public/face-recognition-mobilefacenet-arcface/accuracy-check.yml b/models/public/face-recognition-mobilefacenet-arcface/accuracy-check.yml index cb87bb9c940..78007d9ddcc 100644 --- a/models/public/face-recognition-mobilefacenet-arcface/accuracy-check.yml +++ b/models/public/face-recognition-mobilefacenet-arcface/accuracy-check.yml @@ -11,14 +11,10 @@ models: shape: 3, 112, 112 datasets: - - name: lfw + - name: lfw_bin preprocessing: - type: bgr_to_rgb - - type: point_alignment - size: 400 - - type: resize - size: 112 metrics: - type: pairwise_accuracy_subsets @@ -30,10 +26,7 @@ models: adapter: reid datasets: - - name: lfw + - name: lfw_bin - preprocessing: - - type: point_alignment - size: 400 - - type: resize - size: 112 + metrics: + - type: pairwise_accuracy_subsets diff --git a/models/public/face-recognition-mobilefacenet-arcface/face-recognition-mobilefacenet-arcface.md b/models/public/face-recognition-mobilefacenet-arcface/face-recognition-mobilefacenet-arcface.md index 1d987122123..4e0d8747fc6 100644 --- a/models/public/face-recognition-mobilefacenet-arcface/face-recognition-mobilefacenet-arcface.md +++ b/models/public/face-recognition-mobilefacenet-arcface/face-recognition-mobilefacenet-arcface.md @@ -6,8 +6,6 @@ The original name of the model is [MobileFaceNet,ArcFace@ms1m-refine-v1](https:/ [Deep face recognition net with MobileFaceNet backbone and Arcface loss](https://arxiv.org/abs/1801.07698) -## Example - ## Specification | Metric | Value | @@ -21,9 +19,7 @@ The original name of the model is [MobileFaceNet,ArcFace@ms1m-refine-v1](https:/ | Metric | Value | | ------ | ----- | -| LFW accuracy | 98.8695%| - -## Performance +| LFW accuracy | 99.50%| ## Input diff --git a/models/public/face-recognition-resnet100-arcface/accuracy-check.yml b/models/public/face-recognition-resnet100-arcface/accuracy-check.yml index 5c0bdb72cbc..286038f0b38 100644 --- a/models/public/face-recognition-resnet100-arcface/accuracy-check.yml +++ b/models/public/face-recognition-resnet100-arcface/accuracy-check.yml @@ -15,10 +15,6 @@ models: preprocessing: - type: bgr_to_rgb - - type: point_alignment - size: 400 - - type: resize - size: 112 metrics: - type: pairwise_accuracy_subsets @@ -30,10 +26,7 @@ models: adapter: reid datasets: - - name: lfw + - name: lfw_bin - preprocessing: - - type: point_alignment - size: 400 - - type: resize - size: 112 + metrics: + - type: pairwise_accuracy_subsets diff --git a/models/public/face-recognition-resnet100-arcface/face-recognition-resnet100-arcface.md b/models/public/face-recognition-resnet100-arcface/face-recognition-resnet100-arcface.md index 64aa022386d..6247ed8aab7 100644 --- a/models/public/face-recognition-resnet100-arcface/face-recognition-resnet100-arcface.md +++ b/models/public/face-recognition-resnet100-arcface/face-recognition-resnet100-arcface.md @@ -6,8 +6,6 @@ The original name of the model is [LResNet100E-IR,ArcFace@ms1m-refine-v2](https: [Deep face recognition net with ResNet100 backbone and Arcface loss](https://arxiv.org/abs/1801.07698) -## Example - ## Specification | Metric | Value | @@ -21,9 +19,7 @@ The original name of the model is [LResNet100E-IR,ArcFace@ms1m-refine-v2](https: | Metric | Value | | ------ | ----- | -| LFW accuracy| 99.0218%| - -## Performance +| LFW accuracy| 99.77%| ## Input diff --git a/models/public/face-recognition-resnet34-arcface/accuracy-check.yml b/models/public/face-recognition-resnet34-arcface/accuracy-check.yml index 0892fa76f5f..0107864f646 100644 --- a/models/public/face-recognition-resnet34-arcface/accuracy-check.yml +++ b/models/public/face-recognition-resnet34-arcface/accuracy-check.yml @@ -11,29 +11,22 @@ models: shape: 3, 112, 112 datasets: - - name: lfw + - name: lfw_bin preprocessing: - type: bgr_to_rgb - - type: point_alignment - size: 400 - - type: resize - size: 112 metrics: - type: pairwise_accuracy_subsets - - name: face-recognition-resnet34-arcface-mx + - name: face-recognition-resnet34-arcface launchers: - framework: dlsdk adapter: reid datasets: - - name: lfw + - name: lfw_bin - preprocessing: - - type: point_alignment - size: 400 - - type: resize - size: 112 + metrics: + - type: pairwise_accuracy_subsets diff --git a/models/public/face-recognition-resnet34-arcface/face-recognition-resnet34-arcface.md b/models/public/face-recognition-resnet34-arcface/face-recognition-resnet34-arcface.md index c503f275d3f..544faa360bb 100644 --- a/models/public/face-recognition-resnet34-arcface/face-recognition-resnet34-arcface.md +++ b/models/public/face-recognition-resnet34-arcface/face-recognition-resnet34-arcface.md @@ -6,8 +6,6 @@ The original name of the model is [LResNet34E-IR,ArcFace@ms1m-refine-v1](https:/ [Deep face recognition net with ResNet34 backbone and Arcface loss](https://arxiv.org/abs/1801.07698) -## Example - ## Specification | Metric | Value | @@ -21,9 +19,7 @@ The original name of the model is [LResNet34E-IR,ArcFace@ms1m-refine-v1](https:/ | Metric | Value | | ------ | ----- | -| LFW accuracy| 98.7488%| - -## Performance +| LFW accuracy| 99.65%| ## Input diff --git a/models/public/face-recognition-resnet50-arcface/accuracy-check.yml b/models/public/face-recognition-resnet50-arcface/accuracy-check.yml index 070544241f5..8f9975b0ff7 100644 --- a/models/public/face-recognition-resnet50-arcface/accuracy-check.yml +++ b/models/public/face-recognition-resnet50-arcface/accuracy-check.yml @@ -11,14 +11,10 @@ models: shape: 3, 112, 112 datasets: - - name: lfw + - name: lfw_bin preprocessing: - type: bgr_to_rgb - - type: point_alignment - size: 400 - - type: resize - size: 112 metrics: - type: pairwise_accuracy_subsets @@ -30,10 +26,7 @@ models: adapter: reid datasets: - - name: lfw + - name: lfw_bin - preprocessing: - - type: point_alignment - size: 400 - - type: resize - size: 112 + metrics: + - type: pairwise_accuracy_subsets diff --git a/models/public/face-recognition-resnet50-arcface/face-recognition-resnet50-arcface.md b/models/public/face-recognition-resnet50-arcface/face-recognition-resnet50-arcface.md index dbf8f85a404..44f912eef93 100644 --- a/models/public/face-recognition-resnet50-arcface/face-recognition-resnet50-arcface.md +++ b/models/public/face-recognition-resnet50-arcface/face-recognition-resnet50-arcface.md @@ -6,8 +6,6 @@ The original name of the model is [LResNet50E-IR,ArcFace@ms1m-refine-v1](https:/ [Deep face recognition net with ResNet50 backbone and Arcface loss](https://arxiv.org/abs/1801.07698) -## Example - ## Specification | Metric | Value | @@ -21,9 +19,7 @@ The original name of the model is [LResNet50E-IR,ArcFace@ms1m-refine-v1](https:/ | Metric | Value | | ------ | ----- | -| LFW accuracy | 98.8835%| - -## Performance +| LFW accuracy | 99.80%| ## Input diff --git a/models/public/faceboxes-pytorch/faceboxes-pytorch.md b/models/public/faceboxes-pytorch/faceboxes-pytorch.md index e65ddded534..9e81b4033ed 100644 --- a/models/public/faceboxes-pytorch/faceboxes-pytorch.md +++ b/models/public/faceboxes-pytorch/faceboxes-pytorch.md @@ -3,9 +3,7 @@ ## Use Case and High-Level Description FaceBoxes: A CPU Real-time Face Detector with High Accuracy. For details see -the [repository](https://github.com/zisianw/FaceBoxes.PyTorch), [paper](https://arxiv.org/pdf/1708.05234.pdf) - -## Example +the [repository](https://github.com/zisianw/FaceBoxes.PyTorch), [paper](https://arxiv.org/abs/1708.05234) ## Specification @@ -22,8 +20,6 @@ the [repository](https://github.com/zisianw/FaceBoxes.PyTorch), [paper](https:// | ------ | ----- | | mAP | 83.565%| -## Performance - ## Input ### Original model diff --git a/models/public/faceboxes-pytorch/model.yml b/models/public/faceboxes-pytorch/model.yml index 10ad3b683b2..2dda18846ff 100644 --- a/models/public/faceboxes-pytorch/model.yml +++ b/models/public/faceboxes-pytorch/model.yml @@ -14,7 +14,7 @@ description: >- FaceBoxes: A CPU Real-time Face Detector with High Accuracy. For details see the - repository , paper + repository , paper task_type: detection files: - name: faceboxes.py diff --git a/models/public/facenet-20180408-102900/accuracy-check.yml b/models/public/facenet-20180408-102900/accuracy-check.yml index 87ab7bf2ec7..3c511ca544f 100644 --- a/models/public/facenet-20180408-102900/accuracy-check.yml +++ b/models/public/facenet-20180408-102900/accuracy-check.yml @@ -3,13 +3,19 @@ models: launchers: - framework: dlsdk - adapter: reid + adapter: + type: reid + joining_method: concatenation datasets: - - name: lfw + - name: lfw_mtcnn_align preprocessing: - - type: point_alignment - size: 400 - - type: resize - size: 160 + - type: flip + mode: vertical + merge_with_original: True + metrics: + - type: pairwise_accuracy_subsets + min_score: best_train_threshold + distance_method: 'cosine_distance' + subtract_mean: True diff --git a/models/public/facenet-20180408-102900/facenet-20180408-102900.md b/models/public/facenet-20180408-102900/facenet-20180408-102900.md index 64dcdf4f606..2988d9233cb 100644 --- a/models/public/facenet-20180408-102900/facenet-20180408-102900.md +++ b/models/public/facenet-20180408-102900/facenet-20180408-102900.md @@ -4,8 +4,6 @@ FaceNet: A Unified Embedding for Face Recognition and Clustering. For details see the [repository](https://github.com/davidsandberg/facenet/), [paper](https://arxiv.org/abs/1503.03832) -## Example - ## Specification | Metric | Value | @@ -19,9 +17,7 @@ FaceNet: A Unified Embedding for Face Recognition and Clustering. For details se | Metric | Value | | ------ | ----- | -| LFW accuracy| 98.4522%| - -## Performance +| LFW accuracy| 99.14%| ## Input diff --git a/models/public/fast-neural-style-mosaic-onnx/accuracy-check.yml b/models/public/fast-neural-style-mosaic-onnx/accuracy-check.yml index a6760c64ca4..cf3cdd40b9c 100644 --- a/models/public/fast-neural-style-mosaic-onnx/accuracy-check.yml +++ b/models/public/fast-neural-style-mosaic-onnx/accuracy-check.yml @@ -1,5 +1,5 @@ models: - - name: style_transfer + - name: fast-neural-style-mosaic-onnx launchers: - framework: onnx_runtime model: fast-neural-style-mosaic-onnx.onnx diff --git a/models/public/fast-neural-style-mosaic-onnx/fast-neural-style-mosaic-onnx.md b/models/public/fast-neural-style-mosaic-onnx/fast-neural-style-mosaic-onnx.md index aac4a448546..95accd36620 100644 --- a/models/public/fast-neural-style-mosaic-onnx/fast-neural-style-mosaic-onnx.md +++ b/models/public/fast-neural-style-mosaic-onnx/fast-neural-style-mosaic-onnx.md @@ -6,13 +6,10 @@ The `fast-neural-style-mosaic-onnx` model is one of the style transfer models designed to mix the content of an image with the style of another image. The model uses the method described in [Perceptual Losses for Real-Time Style Transfer and Super-Resolution](https://arxiv.org/abs/1603.08155) along with -[Instance Normalization](https://arxiv.org/pdf/1607.08022.pdf). Original ONNX +[Instance Normalization](https://arxiv.org/abs/1607.08022). Original ONNX models are provided in the [repository](https://github.com/onnx/models). -## Example - - ## Specification | Metric | Value | @@ -30,8 +27,6 @@ Accuracy metrics are obtained on MS COCO val2017 dataset. Images were resized to | ------ | -------------- | ---------------------- | ---------------------- | | PSNR | 12.03dB | 12.03dB | 12.04dB | -## Performance - ## Input ### Original model diff --git a/models/public/fast-neural-style-mosaic-onnx/model.yml b/models/public/fast-neural-style-mosaic-onnx/model.yml index ecdf7036b45..813b2fad6f0 100644 --- a/models/public/fast-neural-style-mosaic-onnx/model.yml +++ b/models/public/fast-neural-style-mosaic-onnx/model.yml @@ -17,7 +17,7 @@ description: >- models designed to mix the content of an image with the style of another image. The model uses the method described in Perceptual Losses for Real-Time Style Transfer and Super-Resolution - along with Instance Normalization . + along with Instance Normalization . task_type: "style_transfer" files: - name: fast-neural-style-mosaic-onnx.onnx diff --git a/models/public/faster_rcnn_inception_resnet_v2_atrous_coco/faster_rcnn_inception_resnet_v2_atrous_coco.md b/models/public/faster_rcnn_inception_resnet_v2_atrous_coco/faster_rcnn_inception_resnet_v2_atrous_coco.md index 686834cb612..58e2b847703 100644 --- a/models/public/faster_rcnn_inception_resnet_v2_atrous_coco/faster_rcnn_inception_resnet_v2_atrous_coco.md +++ b/models/public/faster_rcnn_inception_resnet_v2_atrous_coco/faster_rcnn_inception_resnet_v2_atrous_coco.md @@ -2,9 +2,7 @@ ## Use Case and High-Level Description -Faster R-CNN with Inception Resnet v2 Atrous version. Used for object detection. For details see the [paper](https://arxiv.org/abs/1506.01497v3). - -## Example +Faster R-CNN with Inception Resnet v2 Atrous version. Used for object detection. For details see the [paper](https://arxiv.org/abs/1506.01497). ## Specification @@ -22,8 +20,6 @@ Faster R-CNN with Inception Resnet v2 Atrous version. Used for object detection. | coco_precision | 36.76% | | mAP| 52.41%| -## Performance - ## Input ### Original Model @@ -82,4 +78,4 @@ bounding boxes. For each detection, the description has the format: The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/faster_rcnn_inception_resnet_v2_atrous_coco/model.yml b/models/public/faster_rcnn_inception_resnet_v2_atrous_coco/model.yml index 011da21442f..caa81c147f3 100644 --- a/models/public/faster_rcnn_inception_resnet_v2_atrous_coco/model.yml +++ b/models/public/faster_rcnn_inception_resnet_v2_atrous_coco/model.yml @@ -14,7 +14,7 @@ description: >- Faster R-CNN with Inception Resnet v2 Atrous version. Used for object detection. - For details see the paper . + For details see the paper . task_type: detection files: - name: faster_rcnn_inception_resnet_v2_atrous_coco_2018_01_28.tar.gz diff --git a/models/public/faster_rcnn_inception_v2_coco/faster_rcnn_inception_v2_coco.md b/models/public/faster_rcnn_inception_v2_coco/faster_rcnn_inception_v2_coco.md index 7087b71f28b..0828ca91619 100644 --- a/models/public/faster_rcnn_inception_v2_coco/faster_rcnn_inception_v2_coco.md +++ b/models/public/faster_rcnn_inception_v2_coco/faster_rcnn_inception_v2_coco.md @@ -2,9 +2,7 @@ ## Use Case and High-Level Description -Faster R-CNN with Inception v2. Used for object detection. For details, see the [paper](https://arxiv.org/abs/1506.01497v3). - -## Example +Faster R-CNN with Inception v2. Used for object detection. For details, see the [paper](https://arxiv.org/abs/1506.01497). ## Specification @@ -22,8 +20,6 @@ Faster R-CNN with Inception v2. Used for object detection. For details, see the | coco_precision | 25.65%| | mAP| 40.04%| -## Performance - ## Input ### Original Model @@ -82,4 +78,4 @@ bounding boxes. For each detection, the description has the format: The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/faster_rcnn_inception_v2_coco/model.yml b/models/public/faster_rcnn_inception_v2_coco/model.yml index 95ca31f1562..c4b89040bdc 100644 --- a/models/public/faster_rcnn_inception_v2_coco/model.yml +++ b/models/public/faster_rcnn_inception_v2_coco/model.yml @@ -14,7 +14,7 @@ description: >- Faster R-CNN with Inception v2. Used for object detection. For details, see the - paper . + paper . task_type: detection files: - name: faster_rcnn_inception_v2_coco.tar.gz diff --git a/models/public/faster_rcnn_resnet101_coco/faster_rcnn_resnet101_coco.md b/models/public/faster_rcnn_resnet101_coco/faster_rcnn_resnet101_coco.md index eab151ff6d2..a06bd94a39f 100644 --- a/models/public/faster_rcnn_resnet101_coco/faster_rcnn_resnet101_coco.md +++ b/models/public/faster_rcnn_resnet101_coco/faster_rcnn_resnet101_coco.md @@ -2,9 +2,7 @@ ## Use Case and High-Level Description -Faster R-CNN Resnet-101 model. Used for object detection. For details, see the [paper](https://arxiv.org/abs/1506.01497v3). - -## Example +Faster R-CNN Resnet-101 model. Used for object detection. For details, see the [paper](https://arxiv.org/abs/1506.01497). ## Specification @@ -22,8 +20,6 @@ Faster R-CNN Resnet-101 model. Used for object detection. For details, see the [ | coco_precision | 30.95%| | mAP| 47.21%| -## Performance - ## Input ### Original Model @@ -82,4 +78,4 @@ bounding boxes. For each detection, the description has the format: The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/faster_rcnn_resnet101_coco/model.yml b/models/public/faster_rcnn_resnet101_coco/model.yml index 8474bd8e48f..3820f05d99f 100644 --- a/models/public/faster_rcnn_resnet101_coco/model.yml +++ b/models/public/faster_rcnn_resnet101_coco/model.yml @@ -14,7 +14,7 @@ description: >- Faster R-CNN Resnet-101 model. Used for object detection. For details, see the paper - . + . task_type: detection files: - name: faster_rcnn_resnet101_coco.tar.gz diff --git a/models/public/faster_rcnn_resnet50_coco/faster_rcnn_resnet50_coco.md b/models/public/faster_rcnn_resnet50_coco/faster_rcnn_resnet50_coco.md index 1433361f861..c4866628e61 100644 --- a/models/public/faster_rcnn_resnet50_coco/faster_rcnn_resnet50_coco.md +++ b/models/public/faster_rcnn_resnet50_coco/faster_rcnn_resnet50_coco.md @@ -2,9 +2,7 @@ ## Use Case and High-Level Description -Faster R-CNN Resnet-50 model. Used for object detection. For details, see the [paper](https://arxiv.org/abs/1506.01497v3). - -## Example +Faster R-CNN Resnet-50 model. Used for object detection. For details, see the [paper](https://arxiv.org/abs/1506.01497). ## Specification @@ -22,8 +20,6 @@ Faster R-CNN Resnet-50 model. Used for object detection. For details, see the [p | coco_precision | 27.47%| | mAP| 42.87%| -## Performance - ## Input ### Original Model @@ -82,4 +78,4 @@ bounding boxes. For each detection, the description has the format: The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/faster_rcnn_resnet50_coco/model.yml b/models/public/faster_rcnn_resnet50_coco/model.yml index 5744b458927..45557247af3 100644 --- a/models/public/faster_rcnn_resnet50_coco/model.yml +++ b/models/public/faster_rcnn_resnet50_coco/model.yml @@ -14,7 +14,7 @@ description: >- Faster R-CNN Resnet-50 model. Used for object detection. For details, see the paper - . + . task_type: detection files: - name: faster_rcnn_resnet50_coco_2018_01_28.tar.gz diff --git a/models/public/forward-tacotron/description/forward-tacotron.md b/models/public/forward-tacotron/description/forward-tacotron.md new file mode 100644 index 00000000000..08e46c236d3 --- /dev/null +++ b/models/public/forward-tacotron/description/forward-tacotron.md @@ -0,0 +1,127 @@ +# forward-tacotron (composite) + +## Use Case and High-Level Description + +ForwardTacotron is a model for the text-to-speech task originally trained in PyTorch\* +then converted to ONNX\* format. The model was trained on LJSpeech dataset. ForwardTacotron performs mel-spectrogram regression from text. +For details see [paper](https://arxiv.org/abs/1703.10135), [paper](https://arxiv.org/abs/1905.09263), [repository](https://github.com/as-ideas/ForwardTacotron). + +## ONNX Models +We provide pretrained models in ONNX format for user convenience. + +### Steps to Reproduce training in PyTorch and Conversion to ONNX +Model is provided in ONNX format, which was obtained by the following steps. + +1. Clone the original repository +```sh +git clone https://github.com/as-ideas/ForwardTacotron +cd ForwardTacotron +``` +2. Checkout the commit that the conversion was tested on: +```sh +git checkout 78789c1aa845057bb2f799e702b1be76bf7defd0 +``` +3. Follow README.md and train ForwardTacotron model. +4. Copy provided script `forward_to_onnx.py` to ForwardTacotron root directory. +5. Run provided script for conversion ForwardTacotron to onnx format +```sh +python3 forward_to_onnx.py --tts_weights checkpoints/ljspeech_tts.forward/fast_speech_stepK_weights.pyt +``` +Notes: + 1. Since ONNX doesn't support the build_index operation from PyTorch pipeline, the model is divided into two parts: `forward_tacotron_duration_prediction.onnx, forward_tacotron_regression.onnx`. + 2. We stopped training of the Tacotron model in 183K iteration for alignment generation and stopped ForwardTacotron training in 290K iteration. + +## Composite model specification + +| Metric | Value | +|---------------------------------|-------------------------------------------| +| Source framework | PyTorch* | + +### Accuracy + +Subjective + +## forward-tacotron-duration-prediction model specification + +The forward-tacotron-duration-prediction model accepts preprocessed text (see text_to_sequence in [repository](https://github.com/as-ideas/ForwardTacotron/blob/78789c1aa845057bb2f799e702b1be76bf7defd0/utils/text/__init__.py)) and produces processed embeddings and +duration in time for every processed embedding. + +| Metric | Value | +|---------------------------------|-------------------------------------------| +| GOPs | 6.66 | +| MParams | 13.81 | + +### Input + +Sequence, name: `input_seq`, shape: [1x241], format: [BxC] +where: + + - B - batch size + - C - number of symbols in sequence (letters or phonemes) + +### Output + +1. Duration for input symbols, name: `duration`, shape: [1, 241, 1], format [BxCxH]. Contains predicted duration for each of the symbol in sequence. + - B - batch size + - C - number of symbols in sequence (letters or phonemes) + - H - empty dimension. +2. Processed embeddings, name: `embeddings`, shape: [1, 241, 512], format [BxCxH]. Contains processed embeddings for each symbol in sequence. + - B - batch size + - C - number of symbols in sequence (letters or phonemes) + - H - height of the intermediate feature map. + +## forward-tacotron-regression model specification + +The forward-tacotron-regression model accepts aligned by duration processed embeddings (for example: if duration is [2, 3] and processed embeddings is [[1, 2], [3, 4]], aligned embeddings is [[1, 2], [1, 2], [1,2], [3, 4], [3, 4]]) and produces mel-spectrogram. + +| Metric | Value | +|---------------------------------|-------------------------------------------| +| GOPs | 4.91 | +| MParams | 3.05 | + +### Input + +Processed embeddigs aligned by durations, name: `data`, shape: [1x805x512], format: [BxTxC] +where: + + - B - batch size + - T - time in mel-spectrogram + - C - processed embedding dimension + +### Output + +Mel-spectrogram, name: `mel`, shape: [80x805], format: [CxT] +where: + + - T - time in mel-spectrogram + - C - number of mels in mel-spectrogram + +## Legal Information + +The original model is distributed under the following +[license](https://github.com/as-ideas/ForwardTacotron/blob/78789c1aa845057bb2f799e702b1be76bf7defd0/LICENSE): + +``` +MIT License + +Copyright (c) 2020 Axel Springer AI. All rights reserved. +Copyright (c) 2019 fatchord (https://github.com/fatchord) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +``` diff --git a/models/public/forward-tacotron/forward-tacotron-duration-prediction/accuracy-check.yml b/models/public/forward-tacotron/forward-tacotron-duration-prediction/accuracy-check.yml new file mode 100644 index 00000000000..784de770cbf --- /dev/null +++ b/models/public/forward-tacotron/forward-tacotron-duration-prediction/accuracy-check.yml @@ -0,0 +1,14 @@ +models: + - name: forward-tacotron-duration-prediction + launchers: + - framework: dlsdk + adapter: + type: multi_output_regression + outputs: + - duration + - embeddings + datasets: + - name: tacotron-io-duration-prediction + metrics: + - type: mae + presenter: print_vector diff --git a/models/public/forward-tacotron/forward-tacotron-duration-prediction/model.yml b/models/public/forward-tacotron/forward-tacotron-duration-prediction/model.yml new file mode 100644 index 00000000000..9c9bec20d3e --- /dev/null +++ b/models/public/forward-tacotron/forward-tacotron-duration-prediction/model.yml @@ -0,0 +1,33 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + ForwardTacotron model for text to speech task. Duration prediction part. +task_type: text_to_speech +files: + - name: forward-tacotron-duration-prediction.zip + size: 54840281 + sha256: bab718d6bb997f7b0dd807f98647cd8958cf9b811571301a34865a623af25bb1 + source: https://download.01.org/opencv/public_models/102020/forward-tacotron/forward-tacotron-duration-prediction.zip +postprocessing: + - $type: unpack_archive + format: zip + file: forward-tacotron-duration-prediction.zip +model_optimizer_args: + - --input_shape=[1,241] + - --input=input_seq + - --output=embeddings,duration + - --input_model=$dl_dir/forward-tacotron-duration-prediction/forward_tacotron_duration_prediction.onnx +framework: onnx +license: https://github.com/as-ideas/ForwardTacotron/blob/master/LICENSE diff --git a/models/public/forward-tacotron/forward-tacotron-regression/accuracy-check.yml b/models/public/forward-tacotron/forward-tacotron-regression/accuracy-check.yml new file mode 100644 index 00000000000..385d89df1a6 --- /dev/null +++ b/models/public/forward-tacotron/forward-tacotron-regression/accuracy-check.yml @@ -0,0 +1,17 @@ +models: + - name: forward-tacotron-regression + launchers: + - framework: dlsdk + adapter: + type: multi_output_regression + outputs: + - mel + inputs: + - name: 'data' + type: INPUT + layout: NHWC + datasets: + - name: tacotron-io-regression + metrics: + - type: mae + presenter: print_vector diff --git a/models/public/forward-tacotron/forward-tacotron-regression/model.yml b/models/public/forward-tacotron/forward-tacotron-regression/model.yml new file mode 100644 index 00000000000..cf93170ea46 --- /dev/null +++ b/models/public/forward-tacotron/forward-tacotron-regression/model.yml @@ -0,0 +1,34 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + ForwardTacotron model for text to speech task. Regression part. +task_type: text_to_speech +files: + - name: forward-tacotron-regression.zip + size: 29948456 + sha256: 4a087de0f6126335f804bd4b15b672778d824e0f3538f6cc08710291c753ad29 + source: https://download.01.org/opencv/public_models/102020/forward-tacotron/forward-tacotron-regression.zip +postprocessing: + - $type: unpack_archive + format: zip + file: forward-tacotron-regression.zip +model_optimizer_args: + - --input_shape=[1,805,512] + - --input=data + - --output=mel + - --input_model=$dl_dir/forward-tacotron-regression/forward_tacotron_regression.onnx +framework: onnx + +license: https://github.com/as-ideas/ForwardTacotron/blob/master/LICENSE diff --git a/models/public/forward-tacotron/forward_to_onnx.py b/models/public/forward-tacotron/forward_to_onnx.py new file mode 100755 index 00000000000..63ee233a2a2 --- /dev/null +++ b/models/public/forward-tacotron/forward_to_onnx.py @@ -0,0 +1,223 @@ +#!/usr/bin/env python3 +import os +import argparse + +import numpy as np +import torch +import torch.nn as nn + +from models.forward_tacotron import ForwardTacotron +from utils import hparams as hp +from utils.text.symbols import symbols +from utils.paths import Paths +from utils.text import text_to_sequence + + +################################################################################################## + +class FixedLengthRegulator(nn.Module): + + def __init__(self): + super().__init__() + + def forward(self, x, dur): + return self.expand(x, dur) + + @staticmethod + def build_index(duration, x): + duration[duration<0]=0 + tot_duration = duration.cumsum(1).detach().cpu().numpy().astype('int') + max_duration = int(tot_duration.max().item()) + index = np.zeros([x.shape[0], max_duration, x.shape[2]], dtype='long') + + for i in range(tot_duration.shape[0]): + pos = 0 + for j in range(tot_duration.shape[1]): + pos1 = int(tot_duration[i, j]) + index[i, pos:pos1, :] = j + pos = pos1 + index[i, pos:, :] = j + return torch.LongTensor(index).to(duration.device) + + def expand(self, x, dur): + idx = self.build_index(dur, x) + y = torch.gather(x, 1, idx) + return y + + +class CBHGWrapper(nn.Module): + """Class for changing forward pass in CBHG layer: MaxPool1d to MaxPool2d.""" + def __init__(self, model): + super().__init__() + + # List of all rnns to call `flatten_parameters()` on + self.cbhg = model + self.maxpool = nn.MaxPool2d(kernel_size=(2, 1), stride=1, padding=(1, 0)) + + def forward(self, x): + # Save these for later + residual = x + seq_len = x.size(-1) + conv_bank = [] + + # Convolution Bank + for conv in self.cbhg.conv1d_bank: + c = conv(x) # Convolution + conv_bank.append(c[:, :, :seq_len]) + + # Stack along the channel axis + conv_bank = torch.cat(conv_bank, dim=1) + + # dump the last padding to fit residual + conv_bank = conv_bank.unsqueeze(-1) + x = self.maxpool(conv_bank) + x = x.squeeze(-1) + x = x[:, :, :seq_len] + + # Conv1d projections + x = self.cbhg.conv_project1(x) + x = self.cbhg.conv_project2(x) + + # Residual Connect + x = x + residual + + # Through the highways + x = x.transpose(1, 2) + if self.cbhg.highway_mismatch is True: + x = self.cbhg.pre_highway(x) + for h in self.cbhg.highways: x = h(x) + + x, _ = self.cbhg.rnn(x) + return x + + +class DurationPredictor(nn.Module): + def __init__(self, model): + super().__init__() + self.model = model + self.model.prenet = CBHGWrapper(self.model.prenet) + self.model.lr = FixedLengthRegulator() + + def forward(self, x, alpha=1.0): + x = self.model.embedding(x) + dur = self.model.dur_pred(x, alpha=alpha) + + x = x.transpose(1, 2) + x = self.model.prenet(x) + + return x, dur + + def lr(self, x, dur): + return self.model.lr(x, dur) + + + + +class Tacotron(nn.Module): + def __init__(self, model): + super().__init__() + self.model = model + self.model.postnet = CBHGWrapper(self.model.postnet) + + def forward(self, x): + x, _ = self.model.lstm(x) + x = self.model.lin(x) + x = x.transpose(1, 2) + + x_post = self.model.postnet(x) + x_post = self.model.post_proj(x_post) + x_post = x_post.transpose(1, 2) + x_post = x_post.squeeze() + + return x_post + + +def main(): + # Parse Arguments + parser = argparse.ArgumentParser(description='TTS Generator') + + parser.add_argument('--tts_weights', type=str, help='[string/path] Load in different FastSpeech weights') + + parser.add_argument('--hp_file', metavar='FILE', default='hparams.py', + help='The file to use for the hyperparameters') + parser.add_argument('--alpha', type=float, default=1., + help='Parameter for controlling length regulator for speedup ' + 'or slow-down of generated speech, e.g. alpha=2.0 is double-time') + + if not os.path.exists('onnx'): + os.mkdir('onnx') + + args = parser.parse_args() + + + hp.configure(args.hp_file) + + input_text = "the forms of printed letters should be beautiful, and that their arrangement on the page should be reasonable and a help to the shapeliness of the letters themselves." + tts_weights = args.tts_weights + + paths = Paths(hp.data_path, hp.voc_model_id, hp.tts_model_id) + + device = torch.device('cpu') + print('Using device:', device) + + print('\nInitialising Forward TTS Model...\n') + tts_model = ForwardTacotron(embed_dims=hp.forward_embed_dims, + num_chars=len(symbols), + durpred_rnn_dims=hp.forward_durpred_rnn_dims, + durpred_conv_dims=hp.forward_durpred_conv_dims, + rnn_dim=hp.forward_rnn_dims, + postnet_k=hp.forward_postnet_K, + postnet_dims=hp.forward_postnet_dims, + prenet_k=hp.forward_prenet_K, + prenet_dims=hp.forward_prenet_dims, + highways=hp.forward_num_highways, + dropout=hp.forward_dropout, + n_mels=hp.num_mels).to(device) + + tts_load_path = tts_weights or paths.forward_latest_weights + tts_model.load(tts_load_path) + + + encoder = DurationPredictor(tts_model) + decoder = Tacotron(tts_model) + + tts_model.eval() + encoder.eval() + decoder.eval() + + opset_version = 10 + + with torch.no_grad(): + input_seq = text_to_sequence(input_text.strip(), hp.tts_cleaner_names) + input_seq = torch.as_tensor(input_seq, dtype=torch.long, device=device).unsqueeze(0) + + ''' + FIRST STEP: predict symbols duration + ''' + torch.onnx.export(encoder, input_seq, "./onnx/forward_tacotron_duration_prediction.onnx", + opset_version=opset_version, + do_constant_folding=True, + input_names=["input_seq"], + output_names=["embeddings", "duration"]) + + + x, durations = encoder(input_seq) + + ''' + SECOND STEP: expand symbols by durations + ''' + x = encoder.lr(x, durations) + + ''' + THIRD STEP: generate mel + ''' + torch.onnx.export(decoder, x, "./onnx/forward_tacotron_regression.onnx", + opset_version=opset_version, + do_constant_folding=True, + input_names=["data"], + output_names=["mel"]) + + print('Done!') + +if __name__ == '__main__': + main() diff --git a/models/public/gmcnn-places2-tf/accuracy-check.yml b/models/public/gmcnn-places2-tf/accuracy-check.yml index 85122fbcf8b..059e8e59b60 100644 --- a/models/public/gmcnn-places2-tf/accuracy-check.yml +++ b/models/public/gmcnn-places2-tf/accuracy-check.yml @@ -13,12 +13,14 @@ models: value: '.*mask' datasets: - - name: inpainting_free_form_masks - preprocessing: - - type: crop - dst_width: 680 - dst_height: 512 - - type: custom_mask + - name: inpainting_rect_masks + + metrics: + - type: psnr + scale_border: 0 + presenter: print_vector + - type: ssim + presenter: print_vector - name: gmcnn-places2-tf diff --git a/models/public/gmcnn-places2-tf/gmcnn-places2-tf.md b/models/public/gmcnn-places2-tf/gmcnn-places2-tf.md index 974c7e166e1..60b6168b674 100644 --- a/models/public/gmcnn-places2-tf/gmcnn-places2-tf.md +++ b/models/public/gmcnn-places2-tf/gmcnn-places2-tf.md @@ -30,8 +30,6 @@ git apply path/to/freeze_model.patch python3 freeze_model.py --ckpt_dir path/to/downloaded_weights --save_dir path/to/save_directory ``` -## Example - ## Specification | Metric | Value | @@ -50,8 +48,6 @@ and disguised at random positions with pre-generated free-form masks. | ------ | -------------- | | PSNR | 33.41dB | -## Performance - ## Input ### Original Model diff --git a/models/public/googlenet-v1-tf/freeze.py.patch b/models/public/googlenet-v1-tf/freeze.py.patch deleted file mode 100644 index 693e86bb7f4..00000000000 --- a/models/public/googlenet-v1-tf/freeze.py.patch +++ /dev/null @@ -1,56 +0,0 @@ -diff --git a/research/slim/freeze.py b/research/slim/freeze.py -new file mode 100644 -index 0000000..411001d ---- /dev/null -+++ b/research/slim/freeze.py -@@ -0,0 +1,62 @@ -+import argparse -+import os -+import tensorflow as tf -+from tensorflow.python.framework import graph_io -+ -+from nets import nets_factory -+ -+def parse_args(): -+ """Parse input arguments""" -+ -+ parser = argparse.ArgumentParser(description='Freeze models from TF Slim') -+ -+ parser.add_argument('--ckpt', type=str, required=True, -+ help='Path to .ckpt file') -+ parser.add_argument('--name', type=str, required=True, -+ help='Model name') -+ parser.add_argument('--num_classes', type=int, required=True, -+ help='Number of classes') -+ parser.add_argument('--output', type=str, required=True, -+ help='Name of output node') -+ return parser.parse_args() -+ -+def convert(model_name, ckpt, num_classes, output=None): -+ tf.logging.set_verbosity(tf.logging.INFO) -+ -+ with tf.Graph().as_default() as graph, tf.Session() as sess: -+ network_fn = nets_factory.get_network_fn(model_name, num_classes=num_classes, is_training=False) -+ -+ size = network_fn.default_image_size -+ placeholder = tf.placeholder(name='input', dtype=tf.float32, shape=(1, size, size, 3)) -+ network_fn(placeholder) -+ -+ frozen = ckpt.replace('ckpt', 'frozen.pb') -+ -+ tf.train.Saver().restore(sess, ckpt) -+ frozen_graph_def = tf.graph_util.convert_variables_to_constants( -+ sess, graph.as_graph_def(), [output]) -+ -+ print('Writing {}'.format(frozen)) -+ graph_io.write_graph(frozen_graph_def, os.path.dirname(frozen), frozen, as_text=False) -+ -+def main(): -+ args = parse_args() -+ convert(args.name, args.ckpt, args.num_classes, args.output) -+ -+ print('Done') -+ -+ -+if __name__ == '__main__': -+ main() diff --git a/models/public/googlenet-v1-tf/googlenet-v1-tf.md b/models/public/googlenet-v1-tf/googlenet-v1-tf.md index c96af8350bd..26f9fa89e1d 100644 --- a/models/public/googlenet-v1-tf/googlenet-v1-tf.md +++ b/models/public/googlenet-v1-tf/googlenet-v1-tf.md @@ -4,36 +4,8 @@ The `googlenet-v1-tf` model is one of the Inception family, designed to perform image classification. Like the other Inception models, the `googlenet-v1-tf` model has been pretrained on the ImageNet image database. -Originally redistributed as a checkpoint file, was converted to frozen graph. For details about this family of models, check out the [paper](https://arxiv.org/abs/1602.07261), [repository](https://github.com/tensorflow/models/tree/master/research/slim). -### Steps to Reproduce Conversion to Frozen Graph - -1. Clone the original repository -```sh -git clone https://github.com/tensorflow/models.git -cd models/research/slim -``` -2. Checkout the commit that the conversion was tested on: -```sh -git checkout 5d36f19 -``` -3. Apply `freeze.py.patch` patch -```sh -git apply path/to/freeze.py.patch -``` -4. Download the [pretrained weights](http://download.tensorflow.org/models/inception_v1_2016_08_28.tar.gz) -5. Install the dependencies: -```sh -pip install tensorflow==1.14.0 -``` -6. Run -```sh -python3 freeze.py --ckpt path/to/inception_v1.ckpt --name inception_v1 --num_classes 1001 --output InceptionV1/Logits/Predictions/Softmax -``` - -## Example - ## Specification | Metric | Value | @@ -50,8 +22,6 @@ python3 freeze.py --ckpt path/to/inception_v1.ckpt --name inception_v1 --num_cla | Top 1 | 69.81% | 69.81% | | Top 5 | 89.61% | 89.61% | -## Performance - ## Input ### Original model @@ -97,4 +67,8 @@ Object classifier according to ImageNet classes, name - `InceptionV1/Logits/Pred The original model is distributed under the [Apache License, Version 2.0](https://github.com/tensorflow/models/blob/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). + +The original model uses the TF-Slim library, which is distributed under the +[Apache License, Version 2.0](https://github.com/google-research/tf-slim/blob/master/LICENSE). +A copy of the license is provided in [APACHE-2.0-TFSlim.txt](../licenses/APACHE-2.0-TFSlim.txt). diff --git a/models/public/googlenet-v1-tf/model.yml b/models/public/googlenet-v1-tf/model.yml index 1ec7486c6a3..35b30fa0f40 100644 --- a/models/public/googlenet-v1-tf/model.yml +++ b/models/public/googlenet-v1-tf/model.yml @@ -19,17 +19,71 @@ description: >- For details about this family of models, check out the paper. task_type: classification files: - - name: inception_v1.frozen.pb - size: 26735789 - sha256: 5098978b1c82717bb4d1702b200d715f6e1e37121fdf51795ff5d8a228a26485 - source: https://download.01.org/opencv/public_models/012020/googlenet-v1-tf/inception_v1.frozen.pb + - name: inception_v1_2016_08_28.tar.gz + size: 24642554 + sha256: 7a620c430fcaba8f8f716241f5148c4c47c035cce4e49ef02cfbe6cd1adf96a6 + source: http://download.tensorflow.org/models/inception_v1_2016_08_28.tar.gz + - name: models/research/slim/nets/inception.py + size: 1676 + sha256: 626dc8ed0bd747d9f523062bdb0301b9740a4a31363c1601c9157834ac4ea3e9 + source: https://github.com/tensorflow/models/raw/d4a6670ade6ebd007b7974f85d70c4c879ba99d6/research/slim/nets/inception.py + - name: models/research/slim/nets/inception_utils.py + size: 3079 + sha256: 746d308f90dd3feae2b46298bcc64a836a999c617e10523310416ce6ec275659 + source: https://github.com/tensorflow/models/raw/d4a6670ade6ebd007b7974f85d70c4c879ba99d6/research/slim/nets/inception_utils.py + - name: models/research/slim/nets/inception_v1.py + size: 16875 + sha256: af1613056b50df10da13be66a859c35d72886facd07d175be47ccd5c9380a8ce + source: https://github.com/tensorflow/models/raw/d4a6670ade6ebd007b7974f85d70c4c879ba99d6/research/slim/nets/inception_v1.py + - name: models/research/slim/nets/nets_factory.py + size: 7253 + sha256: ec4ea091ece9ad0f89fdc1da05397ae0a0be7c46ebefa02834d59a5c908d426a + source: https://github.com/tensorflow/models/raw/d4a6670ade6ebd007b7974f85d70c4c879ba99d6/research/slim/nets/nets_factory.py + - name: models/research/slim/tf_slim-1.1.0-py2.py3-none-any.whl + size: 352133 + sha256: fa2bab63b3925bd42601102e7f178dce997f525742596bf404fa8a6918e146ff + source: https://files.pythonhosted.org/packages/02/97/b0f4a64df018ca018cc035d44f2ef08f91e2e8aa67271f6f19633a015ff7/tf_slim-1.1.0-py2.py3-none-any.whl +postprocessing: + - $type: unpack_archive + format: gztar + file: inception_v1_2016_08_28.tar.gz + - $type: unpack_archive + format: zip + file: models/research/slim/tf_slim-1.1.0-py2.py3-none-any.whl + + # disable imports for models we don't need + - $type: regex_replace + pattern: 'from nets(\.[\w.]+)? import (?!inception)' + replacement: '# \g<0>' + file: models/research/slim/nets/nets_factory.py + - $type: regex_replace + pattern: '''(?!inception_v1)\w+'':' + replacement: '# \g<0>' + file: models/research/slim/nets/nets_factory.py + - $type: regex_replace + pattern: 'from nets\.inception_(?!v1)' + replacement: '# \g<0>' + file: models/research/slim/nets/inception.py + + # inception_v3_arg_scope and inception_v1_arg_scope are the same object, + # but v3 would require us to download another file + - $type: regex_replace + pattern: '(?<=''inception_v1'': inception\.)inception_v3_arg_scope' + replacement: 'inception_v1_arg_scope' + file: models/research/slim/nets/nets_factory.py + + # replace deprecated API usage + - $type: regex_replace + pattern: '\blayer\.apply\b' + replacement: 'layer' + file: models/research/slim/tf_slim/layers/layers.py model_optimizer_args: - --input_shape=[1,224,224,3] - --input=input - --mean_values=input[127.5,127.5,127.5] - --scale_values=input[127.5] - --output=InceptionV1/Logits/Predictions/Softmax - - --input_model=$dl_dir/inception_v1.frozen.pb + - --input_model=$conv_dir/inception_v1.frozen.pb - --reverse_input_channels framework: tf quantizable: yes diff --git a/models/public/googlenet-v1-tf/pre-convert.py b/models/public/googlenet-v1-tf/pre-convert.py new file mode 100755 index 00000000000..833be2ad02a --- /dev/null +++ b/models/public/googlenet-v1-tf/pre-convert.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import argparse +import importlib +import sys + +from pathlib import Path + +import tensorflow.compat.v1 as tf + +NETWORK_NAME = 'inception_v1' + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('input_dir', type=Path) + parser.add_argument('output_dir', type=Path) + args = parser.parse_args() + + sys.path.append(str(args.input_dir / 'models/research/slim')) + nets_factory = importlib.import_module('nets.nets_factory') + + with tf.Session() as sess: + network_fn = nets_factory.get_network_fn(NETWORK_NAME, num_classes=1001) + size = network_fn.default_image_size + + _, end_points = network_fn(tf.placeholder( + name='input', dtype=tf.float32, shape=(1, size, size, 3))) + + tf.train.Saver().restore(sess, str(args.input_dir / (NETWORK_NAME + '.ckpt'))) + frozen_graph_def = tf.graph_util.convert_variables_to_constants( + sess, tf.get_default_graph().as_graph_def(), [end_points['Predictions'].op.name]) + + tf.io.write_graph(frozen_graph_def, str(args.output_dir), + NETWORK_NAME + '.frozen.pb', as_text=False) + +if __name__ == '__main__': + main() diff --git a/models/public/googlenet-v1/googlenet-v1.md b/models/public/googlenet-v1/googlenet-v1.md index 2a058307682..c5140621911 100644 --- a/models/public/googlenet-v1/googlenet-v1.md +++ b/models/public/googlenet-v1/googlenet-v1.md @@ -8,8 +8,6 @@ The model input is a blob that consists of a single image of 1x3x224x224 in BGR The model output for `googlenet-v1` is the typical object classifier output for the 1000 different classifications matching those in the ImageNet database. -## Example - ## Specification | Metric | Value | @@ -28,8 +26,6 @@ The model output for `googlenet-v1` is the typical object classifier output for See [the original repository](https://github.com/BVLC/caffe/tree/master/models/bvlc_googlenet). -## Performance - ## Input ### Original model diff --git a/models/public/googlenet-v2-tf/freeze.py.patch b/models/public/googlenet-v2-tf/freeze.py.patch deleted file mode 100644 index 693e86bb7f4..00000000000 --- a/models/public/googlenet-v2-tf/freeze.py.patch +++ /dev/null @@ -1,56 +0,0 @@ -diff --git a/research/slim/freeze.py b/research/slim/freeze.py -new file mode 100644 -index 0000000..411001d ---- /dev/null -+++ b/research/slim/freeze.py -@@ -0,0 +1,62 @@ -+import argparse -+import os -+import tensorflow as tf -+from tensorflow.python.framework import graph_io -+ -+from nets import nets_factory -+ -+def parse_args(): -+ """Parse input arguments""" -+ -+ parser = argparse.ArgumentParser(description='Freeze models from TF Slim') -+ -+ parser.add_argument('--ckpt', type=str, required=True, -+ help='Path to .ckpt file') -+ parser.add_argument('--name', type=str, required=True, -+ help='Model name') -+ parser.add_argument('--num_classes', type=int, required=True, -+ help='Number of classes') -+ parser.add_argument('--output', type=str, required=True, -+ help='Name of output node') -+ return parser.parse_args() -+ -+def convert(model_name, ckpt, num_classes, output=None): -+ tf.logging.set_verbosity(tf.logging.INFO) -+ -+ with tf.Graph().as_default() as graph, tf.Session() as sess: -+ network_fn = nets_factory.get_network_fn(model_name, num_classes=num_classes, is_training=False) -+ -+ size = network_fn.default_image_size -+ placeholder = tf.placeholder(name='input', dtype=tf.float32, shape=(1, size, size, 3)) -+ network_fn(placeholder) -+ -+ frozen = ckpt.replace('ckpt', 'frozen.pb') -+ -+ tf.train.Saver().restore(sess, ckpt) -+ frozen_graph_def = tf.graph_util.convert_variables_to_constants( -+ sess, graph.as_graph_def(), [output]) -+ -+ print('Writing {}'.format(frozen)) -+ graph_io.write_graph(frozen_graph_def, os.path.dirname(frozen), frozen, as_text=False) -+ -+def main(): -+ args = parse_args() -+ convert(args.name, args.ckpt, args.num_classes, args.output) -+ -+ print('Done') -+ -+ -+if __name__ == '__main__': -+ main() diff --git a/models/public/googlenet-v2-tf/googlenet-v2-tf.md b/models/public/googlenet-v2-tf/googlenet-v2-tf.md index 48365ecef82..1282ad35e4b 100644 --- a/models/public/googlenet-v2-tf/googlenet-v2-tf.md +++ b/models/public/googlenet-v2-tf/googlenet-v2-tf.md @@ -4,36 +4,8 @@ The `googlenet-v2-tf` model is one of the Inception family, designed to perform image classification. Like the other Inception models, the `googlenet-v2-tf` model has been pretrained on the ImageNet image database. -Originally redistributed as a checkpoint file, was converted to frozen graph. For details about this family of models, check out the [paper](https://arxiv.org/abs/1602.07261), [repository](https://github.com/tensorflow/models/tree/master/research/slim). -### Steps to Reproduce Conversion to Frozen Graph - -1. Clone the original repository -```sh -git clone https://github.com/tensorflow/models.git -cd models/research/slim -``` -2. Checkout the commit that the conversion was tested on: -```sh -git checkout 5d36f19 -``` -3. Apply `freeze.py.patch` patch -```sh -git apply path/to/freeze.py.patch -``` -4. Download the [pretrained weights](http://download.tensorflow.org/models/inception_v2_2016_08_28.tar.gz) -5. Install the dependencies: -```sh -pip install tensorflow==1.14.0 -``` -6. Run -```sh -python3 freeze.py --ckpt path/to/inception_v2.ckpt --name inception_v2 --num_classes 1001 --output InceptionV2/Predictions/Softmax -``` - -## Example - ## Specification | Metric | Value | @@ -50,8 +22,6 @@ python3 freeze.py --ckpt path/to/inception_v2.ckpt --name inception_v2 --num_cla | Top 1 | 74.09% | 74.09% | | Top 5 | 91.80% | 91.80% | -## Performance - ## Input ### Original model @@ -97,4 +67,8 @@ Object classifier according to ImageNet classes, name - `InceptionV2/Predictions The original model is distributed under the [Apache License, Version 2.0](https://github.com/tensorflow/models/blob/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). + +The original model uses the TF-Slim library, which is distributed under the +[Apache License, Version 2.0](https://github.com/google-research/tf-slim/blob/master/LICENSE). +A copy of the license is provided in [APACHE-2.0-TFSlim.txt](../licenses/APACHE-2.0-TFSlim.txt). diff --git a/models/public/googlenet-v2-tf/model.yml b/models/public/googlenet-v2-tf/model.yml index 0b4a5acf00f..cf718f946af 100644 --- a/models/public/googlenet-v2-tf/model.yml +++ b/models/public/googlenet-v2-tf/model.yml @@ -19,17 +19,71 @@ description: >- For details about this family of models, check out the paper. task_type: classification files: - - name: inception_v2.frozen.pb - size: 45039908 - sha256: a2a044405ffd222150818e9dfd495dfcaf169bddca84c919aa825696e71b37a0 - source: https://download.01.org/opencv/public_models/042020/googlenet-v2-tf/inception_v2.frozen.pb + - name: inception_v2_2016_08_28.tar.gz + size: 41577079 + sha256: 3b9d269984402003d8330affc4e1463c0b4cfd536339ad12446a48d72477480a + source: http://download.tensorflow.org/models/inception_v2_2016_08_28.tar.gz + - name: models/research/slim/nets/inception.py + size: 1676 + sha256: 626dc8ed0bd747d9f523062bdb0301b9740a4a31363c1601c9157834ac4ea3e9 + source: https://github.com/tensorflow/models/raw/d4a6670ade6ebd007b7974f85d70c4c879ba99d6/research/slim/nets/inception.py + - name: models/research/slim/nets/inception_utils.py + size: 3079 + sha256: 746d308f90dd3feae2b46298bcc64a836a999c617e10523310416ce6ec275659 + source: https://github.com/tensorflow/models/raw/d4a6670ade6ebd007b7974f85d70c4c879ba99d6/research/slim/nets/inception_utils.py + - name: models/research/slim/nets/inception_v2.py + size: 26623 + sha256: 918e9eb16f05e83365d6f34354f523f9f0815adf61b6bcc640fb3165b43c012e + source: https://github.com/tensorflow/models/raw/d4a6670ade6ebd007b7974f85d70c4c879ba99d6/research/slim/nets/inception_v2.py + - name: models/research/slim/nets/nets_factory.py + size: 7253 + sha256: ec4ea091ece9ad0f89fdc1da05397ae0a0be7c46ebefa02834d59a5c908d426a + source: https://github.com/tensorflow/models/raw/d4a6670ade6ebd007b7974f85d70c4c879ba99d6/research/slim/nets/nets_factory.py + - name: models/research/slim/tf_slim-1.1.0-py2.py3-none-any.whl + size: 352133 + sha256: fa2bab63b3925bd42601102e7f178dce997f525742596bf404fa8a6918e146ff + source: https://files.pythonhosted.org/packages/02/97/b0f4a64df018ca018cc035d44f2ef08f91e2e8aa67271f6f19633a015ff7/tf_slim-1.1.0-py2.py3-none-any.whl +postprocessing: + - $type: unpack_archive + format: gztar + file: inception_v2_2016_08_28.tar.gz + - $type: unpack_archive + format: zip + file: models/research/slim/tf_slim-1.1.0-py2.py3-none-any.whl + + # disable imports for models we don't need + - $type: regex_replace + pattern: 'from nets(\.[\w.]+)? import (?!inception)' + replacement: '# \g<0>' + file: models/research/slim/nets/nets_factory.py + - $type: regex_replace + pattern: '''(?!inception_v2)\w+'':' + replacement: '# \g<0>' + file: models/research/slim/nets/nets_factory.py + - $type: regex_replace + pattern: 'from nets\.inception_(?!v2)' + replacement: '# \g<0>' + file: models/research/slim/nets/inception.py + + # inception_v3_arg_scope and inception_v2_arg_scope are the same object, + # but v3 would require us to download another file + - $type: regex_replace + pattern: '(?<=''inception_v2'': inception\.)inception_v3_arg_scope' + replacement: 'inception_v2_arg_scope' + file: models/research/slim/nets/nets_factory.py + + # replace deprecated API usage + - $type: regex_replace + pattern: '\blayer\.apply\b' + replacement: 'layer' + file: models/research/slim/tf_slim/layers/layers.py model_optimizer_args: - --input_shape=[1,224,224,3] - --input=input - --mean_values=input[127.5,127.5,127.5] - --scale_values=input[127.5] - --output=InceptionV2/Predictions/Softmax - - --input_model=$dl_dir/inception_v2.frozen.pb + - --input_model=$conv_dir/inception_v2.frozen.pb - --reverse_input_channels framework: tf license: https://github.com/tensorflow/models/blob/master/LICENSE diff --git a/models/public/googlenet-v2-tf/pre-convert.py b/models/public/googlenet-v2-tf/pre-convert.py new file mode 100755 index 00000000000..4eace1da528 --- /dev/null +++ b/models/public/googlenet-v2-tf/pre-convert.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import argparse +import importlib +import sys + +from pathlib import Path + +import tensorflow.compat.v1 as tf + +NETWORK_NAME = 'inception_v2' + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('input_dir', type=Path) + parser.add_argument('output_dir', type=Path) + args = parser.parse_args() + + sys.path.append(str(args.input_dir / 'models/research/slim')) + nets_factory = importlib.import_module('nets.nets_factory') + + with tf.Session() as sess: + network_fn = nets_factory.get_network_fn(NETWORK_NAME, num_classes=1001) + size = network_fn.default_image_size + + _, end_points = network_fn(tf.placeholder( + name='input', dtype=tf.float32, shape=(1, size, size, 3))) + + tf.train.Saver().restore(sess, str(args.input_dir / (NETWORK_NAME + '.ckpt'))) + frozen_graph_def = tf.graph_util.convert_variables_to_constants( + sess, tf.get_default_graph().as_graph_def(), [end_points['Predictions'].op.name]) + + tf.io.write_graph(frozen_graph_def, str(args.output_dir), + NETWORK_NAME + '.frozen.pb', as_text=False) + +if __name__ == '__main__': + main() diff --git a/models/public/googlenet-v2/googlenet-v2.md b/models/public/googlenet-v2/googlenet-v2.md index d717f97843d..8510a796338 100644 --- a/models/public/googlenet-v2/googlenet-v2.md +++ b/models/public/googlenet-v2/googlenet-v2.md @@ -8,8 +8,6 @@ The model input is a blob that consists of a single image of 1x3x224x224 in BGR The model output for `googlenet-v2` is the typical object classifier output for the 1000 different classifications matching those in the ImageNet database. -## Example - ## Specification | Metric | Value | @@ -28,8 +26,6 @@ The model output for `googlenet-v2` is the typical object classifier output for See [the original repository](https://github.com/lim0606/caffe-googlenet-bn). -## Performance - ## Input ### Original model diff --git a/models/public/googlenet-v3-pytorch/accuracy-check.yml b/models/public/googlenet-v3-pytorch/accuracy-check.yml index 8b018ee9f5c..27432752444 100644 --- a/models/public/googlenet-v3-pytorch/accuracy-check.yml +++ b/models/public/googlenet-v3-pytorch/accuracy-check.yml @@ -8,7 +8,7 @@ models: inputs: - name: data type: INPUT - shape: 1,3,224,224 + shape: 1,3,299,299 datasets: - name: imagenet_1000_classes @@ -25,8 +25,8 @@ models: size: 299 use_pillow: true - type: normalization - mean: 127.5 - std: 127.5 + mean: [123.675, 116.28, 103.53] + std: [58.395, 57.12, 57.375] - name: googlenet-v3-pytorch diff --git a/models/public/googlenet-v3-pytorch/googlenet-v3-pytorch.md b/models/public/googlenet-v3-pytorch/googlenet-v3-pytorch.md index 4cdf77a3cfe..550c3371916 100644 --- a/models/public/googlenet-v3-pytorch/googlenet-v3-pytorch.md +++ b/models/public/googlenet-v3-pytorch/googlenet-v3-pytorch.md @@ -13,8 +13,6 @@ in RGB order. The model output is typical object classifier for the 1000 different classifications matching with those in the ImageNet database. -## Example - ## Specification | Metric | Value | @@ -28,10 +26,8 @@ matching with those in the ImageNet database. | Metric | Value | | ------ | ----- | -| Top 1 | 77.45%| -| Top 5 | 93.56%| - -## Performance +| Top 1 | 77.69%| +| Top 5 | 93.7%| ## Input @@ -47,7 +43,7 @@ Image, name - `data`, shape - [1x3x299x299], format [BxCxHxW], Expected color order - `RGB`. -Mean values - [127.5, 127.5, 127.5], scale factor for each channel - 127.5 +Mean values - [123.675,116.28,103.53], scale values - [58.395,57.12,57.375]. ### Converted model diff --git a/models/public/googlenet-v3-pytorch/model.yml b/models/public/googlenet-v3-pytorch/model.yml index 72217b7f3c0..dacbf6f4b49 100644 --- a/models/public/googlenet-v3-pytorch/model.yml +++ b/models/public/googlenet-v3-pytorch/model.yml @@ -40,8 +40,8 @@ conversion_to_onnx_args: - --output-names=prob model_optimizer_args: - --input=data - - --mean_values=data[127.5] - - --scale_values=data[127.5] + - --mean_values=data[123.675,116.28,103.53] + - --scale_values=data[58.395,57.12,57.375] - --reverse_input_channels - --output=prob - --input_model=$conv_dir/googlenet-v3.onnx diff --git a/models/public/googlenet-v3/googlenet-v3.md b/models/public/googlenet-v3/googlenet-v3.md index 5a87a29e984..ea5e5f9ba71 100644 --- a/models/public/googlenet-v3/googlenet-v3.md +++ b/models/public/googlenet-v3/googlenet-v3.md @@ -4,8 +4,6 @@ The `googlenet-v3` model is the first of the Inception family of models designed to perform image classification. For details about this family of models, check out the [paper](https://arxiv.org/abs/1602.07261). -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ The `googlenet-v3` model is the first of the Inception family of models designed | Top 1 | 77.904% | | Top 5 | 93.808%| -## Performance - ## Input ### Original Model @@ -62,4 +58,4 @@ Object classifier according to ImageNet classes, name: `InceptionV3/Predictions/ The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/googlenet-v4-tf/freeze.py.patch b/models/public/googlenet-v4-tf/freeze.py.patch deleted file mode 100644 index a4c8ab04b23..00000000000 --- a/models/public/googlenet-v4-tf/freeze.py.patch +++ /dev/null @@ -1,57 +0,0 @@ -diff --git a/research/slim/freeze.py b/research/slim/freeze.py -new file mode 100644 -index 0000000..411001d ---- /dev/null -+++ b/research/slim/freeze.py -@@ -0,0 +1,62 @@ -+import argparse -+import os -+import tensorflow as tf -+from tensorflow.python.framework import graph_io -+ -+from nets import nets_factory -+ -+def parse_args(): -+ """Parse input arguments""" -+ -+ parser = argparse.ArgumentParser(description='Freeze models from TF Slim') -+ -+ parser.add_argument('--ckpt', type=str, required=True, -+ help='Path to .ckpt file') -+ parser.add_argument('--name', type=str, required=True, -+ help='Model name') -+ parser.add_argument('--num_classes', type=int, required=True, -+ help='Number of classes') -+ parser.add_argument('--output', type=str, required=True, -+ help='Name of output node') -+ return parser.parse_args() -+ -+def convert(model_name, ckpt, num_classes, output=None): -+ tf.logging.set_verbosity(tf.logging.INFO) -+ -+ with tf.Graph().as_default() as graph, tf.Session() as sess: -+ network_fn = nets_factory.get_network_fn(model_name, num_classes=num_classes, is_training=False) -+ -+ size = network_fn.default_image_size -+ placeholder = tf.placeholder(name='input', dtype=tf.float32, shape=(1, size, size, 3)) -+ network_fn(placeholder) -+ -+ frozen = ckpt.replace('ckpt', 'frozen.pb') -+ -+ tf.train.Saver().restore(sess, ckpt) -+ frozen_graph_def = tf.graph_util.convert_variables_to_constants( -+ sess, graph.as_graph_def(), [output]) -+ -+ print('Writing {}'.format(frozen)) -+ graph_io.write_graph(frozen_graph_def, os.path.dirname(frozen), frozen, as_text=False) -+ -+ -+def main(): -+ args = parse_args() -+ convert(args.name, args.ckpt, args.num_classes, args.output) -+ -+ print('Done') -+ -+ -+if __name__ == '__main__': -+ main() diff --git a/models/public/googlenet-v4-tf/googlenet-v4-tf.md b/models/public/googlenet-v4-tf/googlenet-v4-tf.md index 79e62149105..02954cb135d 100644 --- a/models/public/googlenet-v4-tf/googlenet-v4-tf.md +++ b/models/public/googlenet-v4-tf/googlenet-v4-tf.md @@ -4,36 +4,8 @@ The `googlenet-v4-tf` model is the most recent of the Inception family of models designed to perform image classification. Like the other Inception models, the `googlenet-v4-tf` model has been pretrained on the ImageNet image database. -Originally redistributed as a checkpoint file, was converted to frozen graph. For details about this family of models, check out the [paper](https://arxiv.org/abs/1602.07261), [repository](https://github.com/tensorflow/models/tree/master/research/slim). -### Steps to Reproduce Conversion to Frozen Graph - -1. Clone the original repository -```sh -git clone https://github.com/tensorflow/models.git -cd models/research/slim -``` -2. Checkout the commit that the conversion was tested on: -```sh -git checkout 5d36f19 -``` -3. Apply `freeze.py.patch` patch -```sh -git apply path/to/freeze.py.patch -``` -4. Download the [pretrained weights](http://download.tensorflow.org/models/inception_v4_2016_09_09.tar.gz) -5. Install the dependencies: -```sh -pip install tensorflow==1.14.0 -``` -6. Run -```sh -python3 freeze.py --ckpt path/to/inception_v4.ckpt --name inception_v4 --num_classes 1001 --output InceptionV4/Logits/Predictions -``` - -## Example - ## Specification | Metric | Value | @@ -50,8 +22,6 @@ python3 freeze.py --ckpt path/to/inception_v4.ckpt --name inception_v4 --num_cla | Top 1 | 80.21% | 80.21% | | Top 5 | 95.20% | 95.20% | -## Performance - ## Input ### Original model @@ -97,4 +67,8 @@ Object classifier according to ImageNet classes, name - `InceptionV4/Logits/Pred The original model is distributed under the [Apache License, Version 2.0](https://github.com/tensorflow/models/blob/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). + +The original model uses the TF-Slim library, which is distributed under the +[Apache License, Version 2.0](https://github.com/google-research/tf-slim/blob/master/LICENSE). +A copy of the license is provided in [APACHE-2.0-TFSlim.txt](../licenses/APACHE-2.0-TFSlim.txt). diff --git a/models/public/googlenet-v4-tf/model.yml b/models/public/googlenet-v4-tf/model.yml index 15442a6507b..24b81a4256c 100644 --- a/models/public/googlenet-v4-tf/model.yml +++ b/models/public/googlenet-v4-tf/model.yml @@ -19,17 +19,68 @@ description: >- For details about this family of models, check out the paper. task_type: classification files: - - name: inception_v4.frozen.pb - size: 171245469 - sha256: 51fedf837e57f18c110c6a55e4e929bb065541533208392207c3f0de9f77d53c - source: https://download.01.org/opencv/public_models/012020/googlenet-v4-tf/inception_v4.frozen.pb + - name: inception_v4_2016_09_09.tar.gz + size: 171177982 + sha256: 272a2b24f68b2e51f3081479df075dd62b019ccda630e998fb7f6cf314c0f304 + source: http://download.tensorflow.org/models/inception_v4_2016_09_09.tar.gz + - name: models/research/slim/nets/inception.py + size: 1676 + sha256: 626dc8ed0bd747d9f523062bdb0301b9740a4a31363c1601c9157834ac4ea3e9 + source: https://github.com/tensorflow/models/raw/d4a6670ade6ebd007b7974f85d70c4c879ba99d6/research/slim/nets/inception.py + - name: models/research/slim/nets/inception_utils.py + size: 3079 + sha256: 746d308f90dd3feae2b46298bcc64a836a999c617e10523310416ce6ec275659 + source: https://github.com/tensorflow/models/raw/d4a6670ade6ebd007b7974f85d70c4c879ba99d6/research/slim/nets/inception_utils.py + - name: models/research/slim/nets/inception_v4.py + size: 16519 + sha256: 6d17559d084293080a597dca031c994454737f35937cf04901fc271de36170f4 + source: https://github.com/tensorflow/models/raw/d4a6670ade6ebd007b7974f85d70c4c879ba99d6/research/slim/nets/inception_v4.py + - name: models/research/slim/nets/nets_factory.py + size: 7253 + sha256: ec4ea091ece9ad0f89fdc1da05397ae0a0be7c46ebefa02834d59a5c908d426a + source: https://github.com/tensorflow/models/raw/d4a6670ade6ebd007b7974f85d70c4c879ba99d6/research/slim/nets/nets_factory.py + - name: models/research/slim/tf_slim-1.1.0-py2.py3-none-any.whl + size: 352133 + sha256: fa2bab63b3925bd42601102e7f178dce997f525742596bf404fa8a6918e146ff + source: https://files.pythonhosted.org/packages/02/97/b0f4a64df018ca018cc035d44f2ef08f91e2e8aa67271f6f19633a015ff7/tf_slim-1.1.0-py2.py3-none-any.whl +postprocessing: + - $type: unpack_archive + format: gztar + file: inception_v4_2016_09_09.tar.gz + - $type: unpack_archive + format: zip + file: models/research/slim/tf_slim-1.1.0-py2.py3-none-any.whl + + # disable imports for models we don't need + - $type: regex_replace + pattern: 'from nets(\.[\w.]+)? import (?!inception)' + replacement: '# \g<0>' + file: models/research/slim/nets/nets_factory.py + - $type: regex_replace + pattern: '''(?!inception_v4)\w+'':' + replacement: '# \g<0>' + file: models/research/slim/nets/nets_factory.py + - $type: regex_replace + pattern: 'from nets\.inception_(?!v4)' + replacement: '# \g<0>' + file: models/research/slim/nets/inception.py + + # replace deprecated API usage + - $type: regex_replace + pattern: '\blayer\.apply\b' + replacement: 'layer' + file: models/research/slim/tf_slim/layers/layers.py + - $type: regex_replace + pattern: '\bcore_layers\.flatten\b' + replacement: 'tf.keras.layers.Flatten()' + file: models/research/slim/tf_slim/layers/layers.py model_optimizer_args: - --input_shape=[1,299,299,3] - --input=input - --mean_values=input[127.5,127.5,127.5] - --scale_values=input[127.5] - --output=InceptionV4/Logits/Predictions - - --input_model=$dl_dir/inception_v4.frozen.pb + - --input_model=$conv_dir/inception_v4.frozen.pb - --reverse_input_channels framework: tf quantizable: yes diff --git a/models/public/googlenet-v4-tf/pre-convert.py b/models/public/googlenet-v4-tf/pre-convert.py new file mode 100755 index 00000000000..5e4004b1eef --- /dev/null +++ b/models/public/googlenet-v4-tf/pre-convert.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import argparse +import importlib +import sys + +from pathlib import Path + +import tensorflow.compat.v1 as tf + +NETWORK_NAME = 'inception_v4' + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('input_dir', type=Path) + parser.add_argument('output_dir', type=Path) + args = parser.parse_args() + + sys.path.append(str(args.input_dir / 'models/research/slim')) + nets_factory = importlib.import_module('nets.nets_factory') + + with tf.Session() as sess: + network_fn = nets_factory.get_network_fn(NETWORK_NAME, num_classes=1001) + size = network_fn.default_image_size + + _, end_points = network_fn(tf.placeholder( + name='input', dtype=tf.float32, shape=(1, size, size, 3))) + + tf.train.Saver().restore(sess, str(args.input_dir / (NETWORK_NAME + '.ckpt'))) + frozen_graph_def = tf.graph_util.convert_variables_to_constants( + sess, tf.get_default_graph().as_graph_def(), [end_points['Predictions'].op.name]) + + tf.io.write_graph(frozen_graph_def, str(args.output_dir), + NETWORK_NAME + '.frozen.pb', as_text=False) + +if __name__ == '__main__': + main() diff --git a/models/public/hbonet-0.25/hbonet-0.25.md b/models/public/hbonet-0.25/hbonet-0.25.md index d319a873729..42269a30823 100644 --- a/models/public/hbonet-0.25/hbonet-0.25.md +++ b/models/public/hbonet-0.25/hbonet-0.25.md @@ -4,8 +4,6 @@ The `hbonet-0.25` model is one of the classification models from [repository](https://github.com/d-li14/HBONet) with `width_mult=0.25` -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ The `hbonet-0.25` model is one of the classification models from [repository](ht | Top 1 | 57.30% | | Top 5 | 79.80% | -## Performance - ## Input ### Original Model diff --git a/models/public/hbonet-0.5/hbonet-0.5.md b/models/public/hbonet-0.5/hbonet-0.5.md index 5806b164e73..789c9c37098 100644 --- a/models/public/hbonet-0.5/hbonet-0.5.md +++ b/models/public/hbonet-0.5/hbonet-0.5.md @@ -4,8 +4,6 @@ The `hbonet-0.5` model is one of the classification models from [repository](https://github.com/d-li14/HBONet) with `width_mult=0.5` -## Example - ## Specification | Metric | Value | @@ -23,8 +21,6 @@ The `hbonet-0.5` model is one of the classification models from [repository](htt | Top 5 | 86.90% | -## Performance - ## Input ### Original Model diff --git a/models/public/hbonet-1.0/hbonet-1.0.md b/models/public/hbonet-1.0/hbonet-1.0.md index efa94d86dbd..1c71e1ef9c4 100644 --- a/models/public/hbonet-1.0/hbonet-1.0.md +++ b/models/public/hbonet-1.0/hbonet-1.0.md @@ -4,8 +4,6 @@ The `hbonet-1.0` model is one of the classification models from [repository](https://github.com/d-li14/HBONet) with `width_mult=1.0` -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ The `hbonet-1.0` model is one of the classification models from [repository](htt | Top 1 | 73.10% | | Top 5 | 91.00% | -## Performance - ## Input ### Original Model diff --git a/models/public/hrnet-v2-c1-segmentation/hrnet-v2-c1-segmentation.md b/models/public/hrnet-v2-c1-segmentation/hrnet-v2-c1-segmentation.md index 04d334faf56..a1b421c859d 100644 --- a/models/public/hrnet-v2-c1-segmentation/hrnet-v2-c1-segmentation.md +++ b/models/public/hrnet-v2-c1-segmentation/hrnet-v2-c1-segmentation.md @@ -8,8 +8,6 @@ This is PyTorch\* implementation based on retaining high resolution representati and pretrained on ADE20k dataset. For details about implementation of model, check out the [Semantic Segmentation on MIT ADE20K dataset in PyTorch](https://github.com/CSAILVision/semantic-segmentation-pytorch) repository. -## Example - ## Specification | Metric | Value | @@ -26,8 +24,6 @@ For details about implementation of model, check out the [Semantic Segmentation | Pixel accuracy | 77.69% | 77.69% | | mean IoU | 33.02% | 33.02% | -## Performance - ## Input ### Original Model diff --git a/models/public/human-pose-estimation-3d-0001/description/human-pose-estimation-3d-0001.md b/models/public/human-pose-estimation-3d-0001/description/human-pose-estimation-3d-0001.md index 4b9338a8ae0..d2627248a1b 100644 --- a/models/public/human-pose-estimation-3d-0001/description/human-pose-estimation-3d-0001.md +++ b/models/public/human-pose-estimation-3d-0001/description/human-pose-estimation-3d-0001.md @@ -17,8 +17,6 @@ Multi-person 3D human pose estimation model based on the [Lightweight OpenPose]( | MParams | 5.074 | | Source framework | PyTorch\* | -## Performance - ## Inputs Name: `data`, shape: `[1x3x256x448]`. An input image in the `[BxCxHxW]` format, @@ -39,6 +37,6 @@ The net outputs three blobs with the following shapes: `[1, 57, 32, 56]`, `[1, 1 The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/opencv/openvino_training_extensions/develop/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../../licenses/APACHE-2.0.txt). +A copy of the license is provided in [APACHE-2.0.txt](../../licenses/APACHE-2.0.txt). [*] Other names and brands may be claimed as the property of others. diff --git a/models/public/i3d-rgb-tf/accuracy-check.yml b/models/public/i3d-rgb-tf/accuracy-check.yml index d042ddaa715..23e25f3a3e9 100644 --- a/models/public/i3d-rgb-tf/accuracy-check.yml +++ b/models/public/i3d-rgb-tf/accuracy-check.yml @@ -1,5 +1,5 @@ models: - - name: i3d-rgb + - name: i3d-rgb-tf launchers: - framework: dlsdk adapter: classification diff --git a/models/public/inception-resnet-v2-tf/inception-resnet-v2-tf.md b/models/public/inception-resnet-v2-tf/inception-resnet-v2-tf.md index 9414b3d9f0d..95bb9ad5519 100644 --- a/models/public/inception-resnet-v2-tf/inception-resnet-v2-tf.md +++ b/models/public/inception-resnet-v2-tf/inception-resnet-v2-tf.md @@ -4,8 +4,6 @@ The `inception-resnet-v2` model is one of the Inception family of models designed to perform image classification. For details about this family of models, check out the [paper](https://arxiv.org/abs/1602.07261). -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ The `inception-resnet-v2` model is one of the Inception family of models designe | Top 1 | 80.14% | | Top 5 | 95.10% | -## Performance - ## Input ### Original Model @@ -69,4 +65,4 @@ Probabilities for all dataset classes (0 class is background). Probabilities are The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/index.md b/models/public/index.md index 58e0af3990e..771f2838bc8 100644 --- a/models/public/index.md +++ b/models/public/index.md @@ -12,11 +12,13 @@ The models can be downloaded via Model Downloader | Model Name | Implementation | OMZ Model Name | Accuracy | GFlops | mParams | | --------------------------- | -----------------------------------| -------------- | -------- | ------ | ------- | | AlexNet | Caffe\* | [alexnet](./alexnet/alexnet.md) | 56.598%/79.812% | 1.5 | 60.965 | +| AntiSpoofNet | PyTorch\* | [anti-spoof-mn3](./anti-spoof-mn3/anti-spoof-mn3.md) | 3.81% | 0.15 | 3.02 | | CaffeNet | Caffe\* | [caffenet](./caffenet/caffenet.md) | 56.714%/79.916% | 1.5 | 60.965 | -| DenseNet 121 | Caffe\*
TensorFlow\*
Caffe2\*| [densenet-121](./densenet-121/densenet-121.md)
[densenet-121-tf](./densenet-121-tf/densenet-121-tf.md)
[densenet-121-caffe2](./densenet-121-caffe2/densenet-121-caffe2.md) | 74.42%/92.136%
74.29%/91.98%
74.904%/92.192% | 5.289~5.724 | 7.971 | +| DenseNet 121 | Caffe\*
TensorFlow\*
Caffe2\*| [densenet-121](./densenet-121/densenet-121.md)
[densenet-121-tf](./densenet-121-tf/densenet-121-tf.md)
[densenet-121-caffe2](./densenet-121-caffe2/densenet-121-caffe2.md) | 74.42%/92.136%
74.46%/92.13%
74.904%/92.192% | 5.723~5.7287 | 7.971 | | DenseNet 161 | Caffe\*
TensorFlow\* | [densenet-161](./densenet-161/densenet-161.md)
[densenet-161-tf](./densenet-161-tf/densenet-161-tf.md) | 77.55%/93.92%
76.446%/93.228%| 14.128~15.561 | 28.666 | -| DenseNet 169 | Caffe\*
TensorFlow\* | [densenet-169](./densenet-169/densenet-169.md)
[densenet-169-tf](./densenet-169-tf/densenet-169-tf.md) | 76.106%/93.106%
75.76%/92.81%| 6.16~6.788 | 14.139 | -| DenseNet 201 | Caffe\* | [densenet-201](./densenet-201/densenet-201.md)| 76.886%/93.556% | 8.673 | 20.001 | +| DenseNet 169 | Caffe\*
TensorFlow\* | [densenet-169](./densenet-169/densenet-169.md)
[densenet-169-tf](./densenet-169-tf/densenet-169-tf.md) | 76.106%/93.106%
76.14%/93.12%| 6.788~6.7932 | 14.139 | +| DenseNet 201 | Caffe\*
TensorFlow\* | [densenet-201](./densenet-201/densenet-201.md)
[densenet-201-tf](./densenet-201-tf/densenet-201-tf.md)| 76.886%/93.556%
76.93%/93.56% | 8.673~8.6786 | 20.001 | +| DLA 34 | PyTorch\* | [dla-34](./dla-34/dla-34.md) | 74.64%/92.06% | 6.1368 | 15.7344 | | EfficientNet B0 | TensorFlow\*
PyTorch\* | [efficientnet-b0](./efficientnet-b0/efficientnet-b0.md)
[efficientnet-b0-pytorch](./efficientnet-b0-pytorch/efficientnet-b0-pytorch.md) | 75.70%/92.76%
76.91%/93.21% | 0.819 | 5.268 | | EfficientNet B0 AutoAugment | TensorFlow\* | [efficientnet-b0_auto_aug](./efficientnet-b0_auto_aug/efficientnet-b0_auto_aug.md) | 76.43%/93.04% | 0.819 | 5.268 | | EfficientNet B5 | TensorFlow\*
PyTorch\* | [efficientnet-b5](./efficientnet-b5/efficientnet-b5.md)
[efficientnet-b5-pytorch](./efficientnet-b5-pytorch/efficientnet-b5-pytorch.md) | 83.33%/96.67%
83.69%/96.71% | 21.252 | 30.303 | @@ -27,7 +29,7 @@ The models can be downloaded via Model Downloader | HBONet 0.25 | PyTorch\* | [hbonet-0.25](./hbonet-0.25/hbonet-0.25.md) | 57.3%/79.8% | 0.0758 | 1.9299 | | Inception (GoogleNet) V1 | Caffe\*
TensorFlow\* | [googlenet-v1](./googlenet-v1/googlenet-v1.md)
[googlenet-v1-tf](./googlenet-v1-tf/googlenet-v1-tf.md) | 68.928%/89.144%
69.814%/89.6% | 3.016~3.266 | 6.619~6.999 | | Inception (GoogleNet) V2 | Caffe\*
TensorFlow\* | [googlenet-v2](./googlenet-v2/googlenet-v2.md)
[googlenet-v2-tf](./googlenet-v2-tf/googlenet-v2-tf.md) | 72.024%/90.844%
74.084%/91.798%| 4.058 | 11.185 | -| Inception (GoogleNet) V3 | TensorFlow\*
PyTorch\* | [googlenet-v3](./googlenet-v3/googlenet-v3.md)
[googlenet-v3-pytorch](./googlenet-v3-pytorch/googlenet-v3-pytorch.md) | 77.904%/93.808%
77.696%/93.696% | 11.469 | 23.817 | +| Inception (GoogleNet) V3 | TensorFlow\*
PyTorch\* | [googlenet-v3](./googlenet-v3/googlenet-v3.md)
[googlenet-v3-pytorch](./googlenet-v3-pytorch/googlenet-v3-pytorch.md) | 77.904%/93.808%
77.69%/93.7% | 11.469 | 23.817 | | Inception (GoogleNet) V4 | TensorFlow\* | [googlenet-v4-tf](./googlenet-v4-tf/googlenet-v4-tf.md) | 80.204%/95.21% | 24.584 | 42.648 | | Inception-ResNet V2 | TensorFlow\* | [inception-resnet-v2-tf](./inception-resnet-v2-tf/inception-resnet-v2-tf.md) | 80.14%/95.10% | 22.227 | 30.223 | | MobileNet V1 0.25 128 | Caffe\* | [mobilenet-v1-0.25-128](./mobilenet-v1-0.25-128/mobilenet-v1-0.25-128.md) | 40.54%/65% | 0.028 | 0.468 | @@ -39,6 +41,7 @@ The models can be downloaded via Model Downloader | MobileNet V3 Small 1.0 | TensorFlow\* | [mobilenet-v3-small-1.0-224-tf](./mobilenet-v3-small-1.0-224-tf/mobilenet-v3-small-1.0-224-tf.md) | 67.36%/87.45% | 0.121 | 2.537 | | MobileNet V3 Large 1.0 | TensorFlow\* | [mobilenet-v3-large-1.0-224-tf](./mobilenet-v3-large-1.0-224-tf/mobilenet-v3-large-1.0-224-tf.md) | 75.70%/92.76% | 0.4536 | 5.4721 | | DenseNet 121, alpha=0.125 | MXNet\* | [octave-densenet-121-0.125](./octave-densenet-121-0.125/octave-densenet-121-0.125.md) | 76.066%/93.044% | 4.883 | 7.977 | +| RegNetX-3.2GF | PyTorch\* | [regnetx-3.2gf](./regnetx-3.2gf/regnetx-3.2gf.md) | 78.17%/94.08% | 6.3893 | 15.2653 | | ResNet 26, alpha=0.25 | MXNet\* | [octave-resnet-26-0.25](./octave-resnet-26-0.25/octave-resnet-26-0.25.md) | 76.076%/92.584%| 3.768 | 15.99 | | ResNet 50, alpha=0.125 | MXNet\* | [octave-resnet-50-0.125](./octave-resnet-50-0.125/octave-resnet-50-0.125.md) | 78.19%/93.862% | 7.221 | 25.551 | | ResNet 101, alpha=0.125 | MXNet\* | [octave-resnet-101-0.125](./octave-resnet-101-0.125/octave-resnet-101-0.125.md) | 79.182%/94.42% | 13.387 | 44.543 | @@ -51,6 +54,7 @@ The models can be downloaded via Model Downloader | ResNet 18 | PyTorch\* | [resnet-18-pytorch](./resnet-18-pytorch/resnet-18-pytorch.md) | 69.754%/89.088% | 3.637 | 11.68 | | ResNet 34 | PyTorch\* | [resnet-34-pytorch](./resnet-34-pytorch/resnet-34-pytorch.md) | 73.30%/91.42% | 7.3409 | 21.7892 | | ResNet 50 | PyTorch\*
Caffe2\*
TensorFlow\*| [resnet-50-pytorch](./resnet-50-pytorch/resnet-50-pytorch.md)
[resnet-50-caffe2](./resnet-50-caffe2/resnet-50-caffe2.md)
[resnet-50-tf](./resnet-50-tf/resnet-50-tf.md)| 75.168%/92.212%
76.128%/92.858%
76.38%/93.188%
76.17%/92.98% | 6.996~8.216 | 25.53 | +| ReXNet V1 x1.0 | PyTorch\* | [rexnet-v1-x1.0](./rexnet-v1-x1.0/rexnet-v1-x1.0.md) | 77.86%/93.87% | 0.8325 | 4.7779 | | SE-Inception | Caffe\* | [se-inception](./se-inception/se-inception.md) | 75.996%/92.964% | 4.091 | 11.922 | | SE-ResNet 50 | Caffe\* | [se-resnet-50](./se-resnet-50/se-resnet-50.md) | 77.596%/93.85% | 7.775 | 28.061 | | SE-ResNet 101 | Caffe\* | [se-resnet-101](./se-resnet-101/se-resnet-101.md) | 78.252%/94.206% | 15.239 | 49.274 | @@ -111,6 +115,8 @@ SSD-based and provide reasonable accuracy/performance trade-offs. | CTPN | TensorFlow\* | [ctpn](./ctpn/ctpn.md) | 73.67% | 55.813 | 17.237 | | CenterNet (CTDET with DLAV0) 384x384 | ONNX\* | [ctdet_coco_dlav0_384](./ctdet_coco_dlav0_384/ctdet_coco_dlav0_384.md)| 41.6105%| 34.994 | 17.911 | | CenterNet (CTDET with DLAV0) 512x512 | ONNX\* | [ctdet_coco_dlav0_512](./ctdet_coco_dlav0_512/ctdet_coco_dlav0_512.md)| 44.2756%| 62.211 | 17.911 | +| EfficientDet-D0 | TensorFlow\* | [efficientdet-d0-tf](./efficientdet-d0-tf/efficientdet-d0-tf.md)| 31.95% | 2.54 | 3.9 | +| EfficientDet-D1 | TensorFlow\* | [efficientdet-d1-tf](./efficientdet-d1-tf/efficientdet-d1-tf.md)| 37.54% | 6.1 | 6.6 | | FaceBoxes | PyTorch\* | [faceboxes-pytorch](./faceboxes-pytorch/faceboxes-pytorch.md)|83.565% | 1.8975 | 1.0059 | | Faster R-CNN with Inception-ResNet v2| TensorFlow\* | [faster_rcnn_inception_resnet_v2_atrous_coco](./faster_rcnn_inception_resnet_v2_atrous_coco/faster_rcnn_inception_resnet_v2_atrous_coco.md)| 36.76%/52.41% | 30.687 | 13.307 | | Faster R-CNN with Inception v2 | TensorFlow\* | [faster_rcnn_inception_v2_coco](./faster_rcnn_inception_v2_coco/faster_rcnn_inception_v2_coco.md) | 25.65%/40.04%| 30.687 | 13.307 | @@ -129,6 +135,7 @@ SSD-based and provide reasonable accuracy/performance trade-offs. | SSD lite with MobileNet V2 | TensorFlow\* | [ssdlite_mobilenet_v2](./ssdlite_mobilenet_v2/ssdlite_mobilenet_v2.md) | 24.2946% | 1.525 | 4.475 | | SSD with ResNet-50 V1 FPN | TensorFlow\* | [ssd_resnet50_v1_fpn_coco](./ssd_resnet50_v1_fpn_coco/ssd_resnet50_v1_fpn_coco.md)| 38.4557% | 178.6807 | 59.9326 | | SSD with ResNet 34 1200x1200 | PyTorch\* | [ssd-resnet34-1200-onnx](./ssd-resnet34-1200-onnx/ssd-resnet34-1200-onnx.md) | 20.7198%/39.2752% | 433.411 | 20.058 | +| SSH | MXNet\* | [ssh-mxnet](./ssh-mxnet/ssh-mxnet.md) | 84.80% | 267.0594 | 19.7684 | | RetinaFace-R50 | MXNet\* | [retinaface-resnet50](./retinaface-resnet50/retinaface-resnet50.md) | 87.2902% | 100.8478 | 29.427 | | RetinaFace-Anti-Cov | MXNet\* | [retinaface-anti-cov](./retinaface-anti-cov/retinaface-anti-cov.md) | 77.1531% | 2.7781 | 0.5955 | | YOLO v1 Tiny | TensorFlow.js\* | [yolo-v1-tiny-tf](./yolo-v1-tiny-tf/yolo-v1-tiny-tf.md) | 72.1716% | 6.9883 | 15.8587 | @@ -142,7 +149,7 @@ SSD-based and provide reasonable accuracy/performance trade-offs. | Model Name | Implementation | OMZ Model Name | Accuracy | GFlops | mParams | | ------------------------------------ | -------------- | -------------- | -------- |------ | ------- | -| FaceNet | TensorFlow\* | [facenet-20180408-102900](./facenet-20180408-102900/facenet-20180408-102900.md) | 98.4522% | 2.846 | 23.469 | +| FaceNet | TensorFlow\* | [facenet-20180408-102900](./facenet-20180408-102900/facenet-20180408-102900.md) | 99.14% | 2.846 | 23.469 | | LResNet34E-IR,ArcFace@ms1m-refine-v1 | MXNet\* | [face-recognition-resnet34-arcface](./face-recognition-resnet34-arcface/face-recognition-resnet34-arcface.md) | 98.7488%| 8.934 | 34.129 | | LResNet50E-IR,ArcFace@ms1m-refine-v1 | MXNet\* | [face-recognition-resnet50-arcface](./face-recognition-resnet50-arcface/face-recognition-resnet50-arcface.md) | 98.8835%| 12.637 | 43.576 | | LResNet100E-IR,ArcFace@ms1m-refine-v2| MXNet\* | [face-recognition-resnet100-arcface](./face-recognition-resnet100-arcface/face-recognition-resnet100-arcface.md) | 99.0218%| 24.209 | 65.131 | @@ -172,7 +179,7 @@ Since this task contains - in the general setting - some ambiguity, the resultin | Model Name | Implementation | OMZ Model Name | Accuracy | GFlops | mParams | | --------------------------- | -------------- | ----------------------------- | -------- | --------- | ------- | -| midasnet | PyTorch\* | [midasnet](./midasnet/midasnet.md)| 7.5878| 207.4915 | 104.0814 | +| midasnet | PyTorch\* | [midasnet](./midasnet/midasnet.md)| 0.07071 | 207.25144 | 104.081 | | FCRN ResNet50-Upproj | TensorFlow\* | [fcrn-dp-nyu-depth-v2-tf](./fcrn-dp-nyu-depth-v2-tf/fcrn-dp-nyu-depth-v2-tf.md)| 0.573 | 63.5421 | 34.5255 | ## Image Inpainting @@ -206,8 +213,8 @@ Colorization task is to predict colors of scene from grayscale image. | Model Name | Implementation | OMZ Model Name | Accuracy | GFlops | mParams | | ------------------------- | ---------------| -------------- | -------- | ------ | ------- | -| colorization-v2 | PyTorch\* | [colorization-v2](./colorization-v2/colorization-v2.md) | 57.75%/81.50% | 83.6045 | 32.2360 | -| colorization-siggraph | PyTorch\* | [colorization-siggraph](./colorization-siggraph/colorization-siggraph.md) | 58.25%/81.78% | 150.5441 | 34.0511 | +| colorization-v2 | PyTorch\* | [colorization-v2](./colorization-v2/colorization-v2.md) | 26.99dB | 83.6045 | 32.2360 | +| colorization-siggraph | PyTorch\* | [colorization-siggraph](./colorization-siggraph/colorization-siggraph.md) | 27.73dB | 150.5441 | 34.0511 | ## Sound Classification @@ -224,6 +231,15 @@ The task of speech recognition is to recognize and translate spoken language int | Model Name | Implementation | OMZ Model Name | Accuracy | GFlops | mParams | | ----------------- | -------------- | ------------------------------------------------------------ | -------- | ------ | ------- | | DeepSpeech V0.6.1 | TensorFlow\* | [mozilla-deepspeech-0.6.1](./mozilla-deepspeech-0.6.1/mozilla-deepspeech-0.6.1.md) | 7.55% | 0.0472 | 47.2 | +| DeepSpeech V0.8.2 | TensorFlow\* | [mozilla-deepspeech-0.8.2](./mozilla-deepspeech-0.8.2/mozilla-deepspeech-0.8.2.md) | 6.13% | 0.0472 | 47.2 | + +## Image Translation + +The task of image translation is to generate the output based on exemplar. + +| Model Name | Implementation | OMZ Model Name | Accuracy | GFlops | mParams | +| -----------| -------------- | ---------------------------------- | -------- | --------- | -------- | +| CoCosNet | PyTorch\* | [cocosnet](./cocosnet/cocosnet.md) | 12.93dB | 1080.7032 | 167.9141 | ## Legal Information diff --git a/models/public/license-plate-recognition-barrier-0007/license-plate-recognition-barrier-0007.md b/models/public/license-plate-recognition-barrier-0007/license-plate-recognition-barrier-0007.md index f0f7687eb3f..43f79d7e335 100644 --- a/models/public/license-plate-recognition-barrier-0007/license-plate-recognition-barrier-0007.md +++ b/models/public/license-plate-recognition-barrier-0007/license-plate-recognition-barrier-0007.md @@ -7,7 +7,7 @@ Chinese license plates in traffic. ## Validation Dataset - Internal -1165 Chinese plates from different provinces +300320 Sythetic Chinese plates i.e. the plate text on them consists of symbols generated randomly (but to conform to the plate requirements in terms of the number of characters, sequence, shape, placement, etc.). The “real-looking” appearance of the plates (rotation, dirt, color, lightening, etc.) is achieved by a style transfer procedure. ## Example @@ -22,7 +22,7 @@ Chinese license plates in traffic. | Rotation in-plane | ±10˚ | | Rotation out-of-plane | Yaw: ±45˚ / Pitch: ±45˚ | | Min plate width | 94 pixels | -| Ratio of correct reads | 90.12% | +| Ratio of correct reads | 98% | | GFlops | 0.347 | | MParams | 1.435 | | Source framework | TensorFlow* | @@ -32,8 +32,6 @@ Chinese license plates in traffic. Only "blue" license plates, which are common in public, were tested thoroughly. Other types of license plates may underperform. -## Performance - ## Inputs ### Original Model diff --git a/models/public/licenses/APACHE-2.0-TF-AutoML.txt b/models/public/licenses/APACHE-2.0-TF-AutoML.txt new file mode 100644 index 00000000000..c5101efccb3 --- /dev/null +++ b/models/public/licenses/APACHE-2.0-TF-AutoML.txt @@ -0,0 +1,203 @@ +Copyright 2020 Google Research. All rights reserved. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2020, Google Research. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/models/public/licenses/APACHE-2.0-TF-Models.txt b/models/public/licenses/APACHE-2.0-TF-Models.txt new file mode 100644 index 00000000000..43fcf7bf1f1 --- /dev/null +++ b/models/public/licenses/APACHE-2.0-TF-Models.txt @@ -0,0 +1,203 @@ +Copyright 2016 The TensorFlow Authors. All rights reserved. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016, The Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/models/public/licenses/APACHE-2.0-TFSlim.txt b/models/public/licenses/APACHE-2.0-TFSlim.txt new file mode 100644 index 00000000000..505e523ba2d --- /dev/null +++ b/models/public/licenses/APACHE-2.0-TFSlim.txt @@ -0,0 +1,203 @@ +Copyright 2018 The TF-Agents Authors. All rights reserved. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/models/public/licenses/APACHE-2.0-TensorFlow.txt b/models/public/licenses/APACHE-2.0-TensorFlow.txt index 43fcf7bf1f1..40f8c347693 100644 --- a/models/public/licenses/APACHE-2.0-TensorFlow.txt +++ b/models/public/licenses/APACHE-2.0-TensorFlow.txt @@ -1,4 +1,4 @@ -Copyright 2016 The TensorFlow Authors. All rights reserved. +Copyright 2019 The TensorFlow Authors. All rights reserved. Apache License Version 2.0, January 2004 @@ -188,7 +188,7 @@ Copyright 2016 The TensorFlow Authors. All rights reserved. same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2016, The Authors. + Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/models/public/mask_rcnn_inception_resnet_v2_atrous_coco/mask_rcnn_inception_resnet_v2_atrous_coco.md b/models/public/mask_rcnn_inception_resnet_v2_atrous_coco/mask_rcnn_inception_resnet_v2_atrous_coco.md index 1961c592863..23a57d6ac67 100644 --- a/models/public/mask_rcnn_inception_resnet_v2_atrous_coco/mask_rcnn_inception_resnet_v2_atrous_coco.md +++ b/models/public/mask_rcnn_inception_resnet_v2_atrous_coco/mask_rcnn_inception_resnet_v2_atrous_coco.md @@ -4,8 +4,6 @@ Mask R-CNN Inception Resnet V2 Atrous is trained on COCO dataset and used for object instance segmentation. For details, see a [paper](https://arxiv.org/abs/1703.06870). -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ Mask R-CNN Inception Resnet V2 Atrous is trained on COCO dataset and used for o | coco_orig_precision | 39.8619%| | coco_orig_segm_precision | 35.3628%| -## Performance - ## Input ### Original Model @@ -84,4 +80,4 @@ bounding boxes. For each detection, the description has the format: The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/mask_rcnn_inception_v2_coco/mask_rcnn_inception_v2_coco.md b/models/public/mask_rcnn_inception_v2_coco/mask_rcnn_inception_v2_coco.md index e79607afeec..767178f7c54 100644 --- a/models/public/mask_rcnn_inception_v2_coco/mask_rcnn_inception_v2_coco.md +++ b/models/public/mask_rcnn_inception_v2_coco/mask_rcnn_inception_v2_coco.md @@ -5,8 +5,6 @@ Mask R-CNN Inception V2 trained on the COCO dataset. The model is used for object instance segmentation. For details, see a [paper](https://arxiv.org/abs/1703.06870). -## Example - ## Specification | Metric | Value | @@ -23,8 +21,6 @@ For details, see a [paper](https://arxiv.org/abs/1703.06870). | coco_orig_precision | 27.1199%| | coco_orig_segm_precision | 21.4805%| -## Performance - ## Input ### Original Model @@ -90,4 +86,4 @@ bounding boxes. The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/mask_rcnn_resnet101_atrous_coco/mask_rcnn_resnet101_atrous_coco.md b/models/public/mask_rcnn_resnet101_atrous_coco/mask_rcnn_resnet101_atrous_coco.md index 97a8c97d495..21100b0e539 100644 --- a/models/public/mask_rcnn_resnet101_atrous_coco/mask_rcnn_resnet101_atrous_coco.md +++ b/models/public/mask_rcnn_resnet101_atrous_coco/mask_rcnn_resnet101_atrous_coco.md @@ -4,8 +4,6 @@ Mask R-CNN Resnet101 Atrous is trained on COCO dataset and used for object instance segmentation. For details, see a [paper](https://arxiv.org/abs/1703.06870). -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ Mask R-CNN Resnet101 Atrous is trained on COCO dataset and used for object insta | coco_orig_precision | 34.9191%| | coco_orig_segm_precision | 31.301%| -## Performance - ## Input ### Original Model @@ -84,4 +80,4 @@ bounding boxes. For each detection, the description has the format: The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/mask_rcnn_resnet50_atrous_coco/mask_rcnn_resnet50_atrous_coco.md b/models/public/mask_rcnn_resnet50_atrous_coco/mask_rcnn_resnet50_atrous_coco.md index 7d445fe9d47..daed624cc90 100644 --- a/models/public/mask_rcnn_resnet50_atrous_coco/mask_rcnn_resnet50_atrous_coco.md +++ b/models/public/mask_rcnn_resnet50_atrous_coco/mask_rcnn_resnet50_atrous_coco.md @@ -5,8 +5,6 @@ Mask R-CNN Resnet50 Atrous trained on COCO dataset. It is used for object instance segmentation. For details, see the [paper](https://arxiv.org/abs/1703.06870). -## Example - ## Specification | Metric | Value | @@ -23,8 +21,6 @@ For details, see the [paper](https://arxiv.org/abs/1703.06870). | coco_orig_precision | 29.7512%| | coco_orig_segm_precision | 27.4597%| -## Performance - ## Input ### Original Model @@ -85,4 +81,4 @@ bounding boxes. For each detection, the description has the format: The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/midasnet/midasnet.md b/models/public/midasnet/midasnet.md index d2edefab141..4d796714dcf 100644 --- a/models/public/midasnet/midasnet.md +++ b/models/public/midasnet/midasnet.md @@ -11,11 +11,6 @@ The model input is a blob that consists of a single image of "1x3x384x384" in `R The model output is an inverse depth map that is defined up to an unknown scale factor. -> **NOTE**: Originally the model weights are stored at [Google Drive](https://drive.google.com/file/d/1Jf7qRG9N8IW8CaZ7gPisO5RtlLl63mNA), -which is unstable to download from due to weights size. Weights were additionally uploaded to -[https://download.01.org/opencv/public_models](https://download.01.org/opencv/public_models), -OpenVINO [Model Downloader](../../../tools/downloader/README.md) uses this location for downloading. - ## Example See [here](https://github.com/intel-isl/MiDaS) @@ -25,15 +20,15 @@ See [here](https://github.com/intel-isl/MiDaS) | Metric | Value | |-------------------|---------------| | Type | Monodepth | -| GFLOPs | 207.4915 | -| MParams | 104.0814 | +| GFLOPs | 207.25144 | +| MParams | 104.081 | | Source framework | PyTorch\* | ## Accuracy -| Metric | Value | -| ------ | ----- | -| rmse | 7.5878| +| Metric | Value | +| ------ | ------- | +| rmse | 0.07071 | ## Input diff --git a/models/public/midasnet/model.yml b/models/public/midasnet/model.yml index f242b05260b..128b002397d 100644 --- a/models/public/midasnet/model.yml +++ b/models/public/midasnet/model.yml @@ -36,9 +36,9 @@ files: sha256: ba87812d0b5b247966471511d2d1a47fd6f492afb372bc49af6de3a46f4cf6c7 source: https://raw.githubusercontent.com/intel-isl/MiDaS/ffb70fd13361434114383ce7eb898c2f5bec6176/models/blocks.py - name: model.pt - size: 422397766 - sha256: 5237e007f53f05d0a66f40590abfead08dbb662629089e3462daf741ac9932d6 - source: https://download.01.org/opencv/public_models/032020/midasnet/model-001.pt + size: 422509849 + sha256: 933c46ec14e4041122852d8d0acf822ff9f4b94fd07f0ff42fa593f135d57cab + source: https://github.com/intel-isl/MiDaS/releases/download/v2_1/model-openvino.pt framework: pytorch postprocessing: - $type: regex_replace diff --git a/models/public/mobilefacedet-v1-mxnet/mobilefacedet-v1-mxnet.md b/models/public/mobilefacedet-v1-mxnet/mobilefacedet-v1-mxnet.md index 46c8e03c019..82ff7154acc 100644 --- a/models/public/mobilefacedet-v1-mxnet/mobilefacedet-v1-mxnet.md +++ b/models/public/mobilefacedet-v1-mxnet/mobilefacedet-v1-mxnet.md @@ -2,7 +2,7 @@ ## Use Case and High-Level Description - MobileFace Detection V1 is a Light and Fast Face Detector for Edge Devices (LFFD) model based on Yolo V3 architecture and trained with MXNet\*. For details see the [repository](https://github.com/becauseofAI/MobileFace) and [paper](https://arxiv.org/pdf/1904.10633.pdf). + MobileFace Detection V1 is a Light and Fast Face Detector for Edge Devices (LFFD) model based on Yolo V3 architecture and trained with MXNet\*. For details see the [repository](https://github.com/becauseofAI/MobileFace) and [paper](https://arxiv.org/abs/1904.10633). ## Specification diff --git a/models/public/mobilefacedet-v1-mxnet/model.yml b/models/public/mobilefacedet-v1-mxnet/model.yml index 81089bc2dee..0c9ae902cd1 100644 --- a/models/public/mobilefacedet-v1-mxnet/model.yml +++ b/models/public/mobilefacedet-v1-mxnet/model.yml @@ -15,7 +15,7 @@ description: >- MobileFace Detection V1 is a Light and Fast Face Detector for Edge Devices (LFFD) model based on Yolo V3 architecture and trained with MXNet*. For details see the - repository and paper . + repository and paper . task_type: detection files: - name: mobilefacedet_v1_mxnet-symbol.json diff --git a/models/public/mobilenet-ssd/mobilenet-ssd.md b/models/public/mobilenet-ssd/mobilenet-ssd.md index a8b6bdc5d0b..4b8a88902b9 100644 --- a/models/public/mobilenet-ssd/mobilenet-ssd.md +++ b/models/public/mobilenet-ssd/mobilenet-ssd.md @@ -8,8 +8,6 @@ The model input is a blob that consists of a single image of 1x3x300x300 in BGR The model output is a typical vector containing the tracked object data, as previously described. -## Example - ## Specification | Metric | Value | @@ -27,8 +25,6 @@ The model output is a typical vector containing the tracked object data, as prev See [the original repository](https://github.com/chuanqi305/MobileNet-SSD). -## Performance - ## Input ### Original model diff --git a/models/public/mobilenet-v1-0.25-128/mobilenet-v1-0.25-128.md b/models/public/mobilenet-v1-0.25-128/mobilenet-v1-0.25-128.md index 6d02724c0fd..c51e0d84d61 100644 --- a/models/public/mobilenet-v1-0.25-128/mobilenet-v1-0.25-128.md +++ b/models/public/mobilenet-v1-0.25-128/mobilenet-v1-0.25-128.md @@ -4,8 +4,6 @@ `mobilenet-v1-0.25-128` is one of MobileNets - small, low-latency, low-power models parameterized to meet the resource constraints of a variety of use cases. They can be built upon for classification, detection, embeddings and segmentation similar to how other popular large scale models are used. For details, see [paper](https://arxiv.org/abs/1704.04861). -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ | Top 1 | 40.54%| | Top 5 | 65% | -## Performance - ## Input ### Original Model @@ -69,4 +65,4 @@ Probabilities for all dataset classes (0 class is background). Probabilities are The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/mobilenet-v1-0.50-160/mobilenet-v1-0.50-160.md b/models/public/mobilenet-v1-0.50-160/mobilenet-v1-0.50-160.md index cec5946131f..bc61b159fd0 100644 --- a/models/public/mobilenet-v1-0.50-160/mobilenet-v1-0.50-160.md +++ b/models/public/mobilenet-v1-0.50-160/mobilenet-v1-0.50-160.md @@ -4,8 +4,6 @@ `mobilenet-v1-0.50-160` is one of MobileNets - small, low-latency, low-power models parameterized to meet the resource constraints of a variety of use cases. They can be built upon for classification, detection, embeddings and segmentation similar to how other popular large scale models are used. For details, see [paper](https://arxiv.org/abs/1704.04861). -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ | Top 1 | 59.86%| | Top 5 | 82.04%| -## Performance - ## Input ### Original Model @@ -69,4 +65,4 @@ Probabilities for all dataset classes (0 class is background). Probabilities are The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/mobilenet-v1-0.50-224/accuracy-check.yml b/models/public/mobilenet-v1-0.50-224/accuracy-check.yml index 49e8a71b316..9f168e8675c 100644 --- a/models/public/mobilenet-v1-0.50-224/accuracy-check.yml +++ b/models/public/mobilenet-v1-0.50-224/accuracy-check.yml @@ -18,7 +18,7 @@ models: mean: 127.5 std: 127.5 - - name: mobilenet-v1-0.50-244 + - name: mobilenet-v1-0.50-224 launchers: - framework: dlsdk adapter: classification diff --git a/models/public/mobilenet-v1-0.50-224/mobilenet-v1-0.50-224.md b/models/public/mobilenet-v1-0.50-224/mobilenet-v1-0.50-224.md index f830fabf75f..caa888e5e0b 100644 --- a/models/public/mobilenet-v1-0.50-224/mobilenet-v1-0.50-224.md +++ b/models/public/mobilenet-v1-0.50-224/mobilenet-v1-0.50-224.md @@ -4,8 +4,6 @@ `mobilenet-v1-0.50-224` is one of MobileNets - small, low-latency, low-power models parameterized to meet the resource constraints of a variety of use cases. They can be built upon for classification, detection, embeddings and segmentation similar to how other popular large scale models are used. For details, see [paper](https://arxiv.org/abs/1704.04861). -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ | Top 1 | 63.042%| | Top 5 | 84.934%| -## Performance - ## Input ### Original Model @@ -69,4 +65,4 @@ Probabilities for all dataset classes (0 class is background). Probabilities are The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/mobilenet-v1-1.0-224-tf/mobilenet-v1-1.0-224-tf.md b/models/public/mobilenet-v1-1.0-224-tf/mobilenet-v1-1.0-224-tf.md index 04d94f868a6..68f3e58d320 100644 --- a/models/public/mobilenet-v1-1.0-224-tf/mobilenet-v1-1.0-224-tf.md +++ b/models/public/mobilenet-v1-1.0-224-tf/mobilenet-v1-1.0-224-tf.md @@ -4,8 +4,6 @@ `mobilenet-v1-1.0-224` is one of MobileNets - small, low-latency, low-power models parameterized to meet the resource constraints of a variety of use cases. They can be built upon for classification, detection, embeddings and segmentation similar to how other popular large scale models are used. For details, see the [paper](https://arxiv.org/abs/1704.04861). -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ | Top 1 | 71.03%| | Top 5 | 89.94%| -## Performance - ## Input ### Original Model @@ -68,4 +64,4 @@ Probabilities for all dataset classes (0 class is background). Probabilities are The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/mobilenet-v1-1.0-224/mobilenet-v1-1.0-224.md b/models/public/mobilenet-v1-1.0-224/mobilenet-v1-1.0-224.md index 1da3386b603..421fb3a88e5 100644 --- a/models/public/mobilenet-v1-1.0-224/mobilenet-v1-1.0-224.md +++ b/models/public/mobilenet-v1-1.0-224/mobilenet-v1-1.0-224.md @@ -4,8 +4,6 @@ `mobilenet-v1-1.0-224` is one of [MobileNet V1 architecture](https://arxiv.org/abs/1704.04861) with the width multiplier 1.0 and resolution 224. It is small, low-latency, low-power models parameterized to meet the resource constraints of a variety of use cases. They can be built upon for classification, detection, embeddings and segmentation similar to how other popular large scale models are used. -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ | Top 1 | 69.496%| | Top 5 | 89.224%| -## Performance - ## Input ### Original model diff --git a/models/public/mobilenet-v2-1.0-224/mobilenet-v2-1.0-224.md b/models/public/mobilenet-v2-1.0-224/mobilenet-v2-1.0-224.md index 7c065ac3611..3732bd481b3 100644 --- a/models/public/mobilenet-v2-1.0-224/mobilenet-v2-1.0-224.md +++ b/models/public/mobilenet-v2-1.0-224/mobilenet-v2-1.0-224.md @@ -4,8 +4,6 @@ `mobilenet-v2-1.0-224` is one of MobileNet\* models, which are small, low-latency, low-power, and parameterized to meet the resource constraints of a variety of use cases. They can be used for classification, detection, embeddings, and segmentation like other popular large-scale models. For details, see the [paper](https://arxiv.org/abs/1704.04861). -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ | Top 1 | 71.85%| | Top 5 | 90.69%| -## Performance - ## Input ### Original Model @@ -70,4 +66,4 @@ Shape: [1,1001], format: [BxC], The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/mobilenet-v2-1.4-224/mobilenet-v2-1.4-224.md b/models/public/mobilenet-v2-1.4-224/mobilenet-v2-1.4-224.md index 87e094a1b75..4f5cc6ac15e 100644 --- a/models/public/mobilenet-v2-1.4-224/mobilenet-v2-1.4-224.md +++ b/models/public/mobilenet-v2-1.4-224/mobilenet-v2-1.4-224.md @@ -4,8 +4,6 @@ `mobilenet-v2-1.4-224` is one of MobileNets - small, low-latency, low-power models parameterized to meet the resource constraints of a variety of use cases. They can be built upon for classification, detection, embeddings and segmentation similar to how other popular large scale models are used. For details, see the [paper](https://arxiv.org/abs/1704.04861). -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ | Top 1 | 74.09%| | Top 5 | 91.97%| -## Performance - ## Input ### Original Model @@ -67,4 +63,4 @@ Probabilities for all dataset classes (0 class is background). Probabilities are The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/mobilenet-v2-pytorch/mobilenet-v2-pytorch.md b/models/public/mobilenet-v2-pytorch/mobilenet-v2-pytorch.md index 59102a28158..63cbd3b7e8d 100644 --- a/models/public/mobilenet-v2-pytorch/mobilenet-v2-pytorch.md +++ b/models/public/mobilenet-v2-pytorch/mobilenet-v2-pytorch.md @@ -13,8 +13,6 @@ in RGB order. The model output is typical object classifier for the 1000 different classifications matching with those in the ImageNet database. -## Example - ## Specification | Metric | Value | @@ -31,8 +29,6 @@ matching with those in the ImageNet database. | Top 1 | 71.9% | 71.9% | | Top 5 | 90.3% | 90.3% | -## Performance - ## Input ### Original model diff --git a/models/public/mobilenet-v2/mobilenet-v2.md b/models/public/mobilenet-v2/mobilenet-v2.md index ea53318bd4b..f5a9b0a84b7 100644 --- a/models/public/mobilenet-v2/mobilenet-v2.md +++ b/models/public/mobilenet-v2/mobilenet-v2.md @@ -4,8 +4,6 @@ [MobileNet V2](https://arxiv.org/abs/1801.04381) -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ | Top 1 | 71.218%| | Top 5 | 90.178%| -## Performance - ## Input ### Original Model diff --git a/models/public/mobilenet-v3-large-1.0-224-tf/mobilenet-v3-large-1.0-224-tf.md b/models/public/mobilenet-v3-large-1.0-224-tf/mobilenet-v3-large-1.0-224-tf.md index 936716c8558..2768b258a80 100644 --- a/models/public/mobilenet-v3-large-1.0-224-tf/mobilenet-v3-large-1.0-224-tf.md +++ b/models/public/mobilenet-v3-large-1.0-224-tf/mobilenet-v3-large-1.0-224-tf.md @@ -7,8 +7,6 @@ based on a combination of complementary search techniques as well as a novel arc `mobilenet-v3-large-1.0-224-tf` is targeted for high resource use cases. For details see [paper](https://arxiv.org/abs/1905.02244). -## Example - ## Specification | Metric | Value | @@ -25,8 +23,6 @@ For details see [paper](https://arxiv.org/abs/1905.02244). | Top 1 | 75.70% | 75.70% | | Top 5 | 92.76% | 92.76% | -## Performance - ## Input ### Original Model @@ -76,4 +72,4 @@ shape: [1,1001], format: [BxC], The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/mobilenet-v3-small-1.0-224-tf/mobilenet-v3-small-1.0-224-tf.md b/models/public/mobilenet-v3-small-1.0-224-tf/mobilenet-v3-small-1.0-224-tf.md index 54aeca1bcc1..3ef0377ef49 100644 --- a/models/public/mobilenet-v3-small-1.0-224-tf/mobilenet-v3-small-1.0-224-tf.md +++ b/models/public/mobilenet-v3-small-1.0-224-tf/mobilenet-v3-small-1.0-224-tf.md @@ -7,8 +7,6 @@ based on a combination of complementary search techniques as well as a novel arc `mobilenet-v3-small-1.0-224-tf` is targeted for low resource use cases. For details see [paper](https://arxiv.org/abs/1905.02244). -## Example - ## Specification | Metric | Value | @@ -25,8 +23,6 @@ For details see [paper](https://arxiv.org/abs/1905.02244). | Top 1 | 67.36% | 67.36% | | Top 5 | 87.45% | 87.45% | -## Performance - ## Input ### Original Model @@ -76,4 +72,4 @@ shape: [1,1001], format: [BxC], The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/mozilla-deepspeech-0.6.1/accuracy-check.yml b/models/public/mozilla-deepspeech-0.6.1/accuracy-check.yml index 61600029a80..e02a5c10315 100644 --- a/models/public/mozilla-deepspeech-0.6.1/accuracy-check.yml +++ b/models/public/mozilla-deepspeech-0.6.1/accuracy-check.yml @@ -1,5 +1,5 @@ models: - - name: mozilla-deepspeech-0.6.1-with-lm + - name: mozilla-deepspeech-0.6.1 launchers: - framework: dlsdk adapter: diff --git a/models/public/mozilla-deepspeech-0.6.1/mozilla-deepspeech-0.6.1.md b/models/public/mozilla-deepspeech-0.6.1/mozilla-deepspeech-0.6.1.md index ae70a76c4f8..0a3a8353517 100644 --- a/models/public/mozilla-deepspeech-0.6.1/mozilla-deepspeech-0.6.1.md +++ b/models/public/mozilla-deepspeech-0.6.1/mozilla-deepspeech-0.6.1.md @@ -10,8 +10,6 @@ For details on the original DeepSpeech, see paper . -## Example - ## Specification | Metric | Value | @@ -32,8 +30,6 @@ For details on this model, see " to provide path to deepspeech-0.8.2-models.kenlm + # deepspeech-0.8.2-models.kenlm is generated from deepspeech-0.8.2-models.scorer by scorer_to_kenlm.py script. + lm_file: deepspeech-0.8.2-models.kenlm + lm_alpha: 0.93128901720047 + lm_beta: 1.1834137439727783 + inputs: + - name: input_node + type: INPUT + layout: NHWC + - name: previous_state_c + type: LSTM_INPUT + value: 'cudnn_lstm/rnn/multi_rnn_cell/cell_0/cudnn_compatible_lstm_cell/BlockLSTM/TensorIterator.2' + - name: previous_state_h + type: LSTM_INPUT + value: 'cudnn_lstm/rnn/multi_rnn_cell/cell_0/cudnn_compatible_lstm_cell/BlockLSTM/TensorIterator.1' + datasets: + - name: librispeech-test-clean + reader: + type: wav_reader + preprocessing: + - type: audio_normalization + int16mode: True + - type: clip_audio + duration: 512 samples + overlap: 192 samples + - type: hanning_window + base: 512 + - type: audio_spectrogram + fftbase: 512 + magnitude_squared: True + skip_channels: True + - type: audio_triangle_filtering + base: 257 + filterbank_channel_count: 40 + lower_frequency_limit: 20 + upper_frequency_limit: 8000 + sample_rate: 16000 + - type: audio_dct + filterbank_channel_count: 40 + numceps: 26 + - type: clip_cepstrum + context: 9 + numceps: 26 + - type: pack_cepstrum + step: 16 + metrics: + - type: wer diff --git a/models/public/mozilla-deepspeech-0.8.2/accuracy-check.yml b/models/public/mozilla-deepspeech-0.8.2/accuracy-check.yml new file mode 100644 index 00000000000..59e2808fd35 --- /dev/null +++ b/models/public/mozilla-deepspeech-0.8.2/accuracy-check.yml @@ -0,0 +1,58 @@ +models: + - name: mozilla-deepspeech-0.8.2 + launchers: + - framework: dlsdk + adapter: + type: ctc_beam_search_decoder_with_lm + probability_out: logits + logarithmic_prob: False + beam_size: 32 + + # Use option "accuracy_check [...] --model_attributes " to provide path to deepspeech-0.8.2-models.kenlm + # deepspeech-0.8.2-models.kenlm is generated from deepspeech-0.8.2-models.scorer by scorer_to_kenlm.py script. + lm_file: deepspeech-0.8.2-models.kenlm + lm_alpha: 0.93128901720047 + lm_beta: 1.1834137439727783 + lm_vocabulary_offset: 941209108 + inputs: + - name: input_node + type: INPUT + layout: NHWC + - name: previous_state_c + type: LSTM_INPUT + value: 'cudnn_lstm/rnn/multi_rnn_cell/cell_0/cudnn_compatible_lstm_cell/BlockLSTM/TensorIterator.2' + - name: previous_state_h + type: LSTM_INPUT + value: 'cudnn_lstm/rnn/multi_rnn_cell/cell_0/cudnn_compatible_lstm_cell/BlockLSTM/TensorIterator.1' + datasets: + - name: librispeech-test-clean + reader: + type: wav_reader + preprocessing: + - type: audio_normalization + int16mode: True + - type: clip_audio + duration: 512 samples + overlap: 192 samples + - type: hanning_window + base: 512 + - type: audio_spectrogram + fftbase: 512 + magnitude_squared: True + skip_channels: True + - type: audio_triangle_filtering + base: 257 + filterbank_channel_count: 40 + lower_frequency_limit: 20 + upper_frequency_limit: 8000 + sample_rate: 16000 + - type: audio_dct + filterbank_channel_count: 40 + numceps: 26 + - type: clip_cepstrum + context: 9 + numceps: 26 + - type: pack_cepstrum + step: 16 + metrics: + - type: wer diff --git a/models/public/mozilla-deepspeech-0.8.2/mds_convert_utils/__init__.py b/models/public/mozilla-deepspeech-0.8.2/mds_convert_utils/__init__.py new file mode 100644 index 00000000000..3d57325530b --- /dev/null +++ b/models/public/mozilla-deepspeech-0.8.2/mds_convert_utils/__init__.py @@ -0,0 +1,15 @@ +# +# Copyright (C) 2020 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +# +from .parse_trie_v6 import ( + kenlm_v5_insert_vocabulary, + scorer_cut_trie_v6, + trie_v6_extract_vocabulary, +) + +__all__ = [ + 'kenlm_v5_insert_vocabulary', + 'scorer_cut_trie_v6', + 'trie_v6_extract_vocabulary', +] diff --git a/models/public/mozilla-deepspeech-0.8.2/mds_convert_utils/memmapped_file_system_pb2.py b/models/public/mozilla-deepspeech-0.8.2/mds_convert_utils/memmapped_file_system_pb2.py new file mode 100644 index 00000000000..adf66c33408 --- /dev/null +++ b/models/public/mozilla-deepspeech-0.8.2/mds_convert_utils/memmapped_file_system_pb2.py @@ -0,0 +1,125 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: memmapped_file_system.proto from Tensorflow 1.15.3, https://github.com/tensorflow/tensorflow/blob/v1.15.3/tensorflow/core/util/memmapped_file_system.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='memmapped_file_system.proto', + package='tensorflow', + syntax='proto3', + serialized_pb=_b('\n\x1bmemmapped_file_system.proto\x12\ntensorflow\"S\n#MemmappedFileSystemDirectoryElement\x12\x0e\n\x06offset\x18\x01 \x01(\x04\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0e\n\x06length\x18\x03 \x01(\x04\"`\n\x1cMemmappedFileSystemDirectory\x12@\n\x07\x65lement\x18\x01 \x03(\x0b\x32/.tensorflow.MemmappedFileSystemDirectoryElementB\x03\xf8\x01\x01\x62\x06proto3') +) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + + +_MEMMAPPEDFILESYSTEMDIRECTORYELEMENT = _descriptor.Descriptor( + name='MemmappedFileSystemDirectoryElement', + full_name='tensorflow.MemmappedFileSystemDirectoryElement', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='offset', full_name='tensorflow.MemmappedFileSystemDirectoryElement.offset', index=0, + number=1, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='name', full_name='tensorflow.MemmappedFileSystemDirectoryElement.name', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='length', full_name='tensorflow.MemmappedFileSystemDirectoryElement.length', index=2, + number=3, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=43, + serialized_end=126, +) + + +_MEMMAPPEDFILESYSTEMDIRECTORY = _descriptor.Descriptor( + name='MemmappedFileSystemDirectory', + full_name='tensorflow.MemmappedFileSystemDirectory', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='element', full_name='tensorflow.MemmappedFileSystemDirectory.element', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=128, + serialized_end=224, +) + +_MEMMAPPEDFILESYSTEMDIRECTORY.fields_by_name['element'].message_type = _MEMMAPPEDFILESYSTEMDIRECTORYELEMENT +DESCRIPTOR.message_types_by_name['MemmappedFileSystemDirectoryElement'] = _MEMMAPPEDFILESYSTEMDIRECTORYELEMENT +DESCRIPTOR.message_types_by_name['MemmappedFileSystemDirectory'] = _MEMMAPPEDFILESYSTEMDIRECTORY + +MemmappedFileSystemDirectoryElement = _reflection.GeneratedProtocolMessageType('MemmappedFileSystemDirectoryElement', (_message.Message,), dict( + DESCRIPTOR = _MEMMAPPEDFILESYSTEMDIRECTORYELEMENT, + __module__ = 'memmapped_file_system_pb2' + # @@protoc_insertion_point(class_scope:tensorflow.MemmappedFileSystemDirectoryElement) + )) +_sym_db.RegisterMessage(MemmappedFileSystemDirectoryElement) + +MemmappedFileSystemDirectory = _reflection.GeneratedProtocolMessageType('MemmappedFileSystemDirectory', (_message.Message,), dict( + DESCRIPTOR = _MEMMAPPEDFILESYSTEMDIRECTORY, + __module__ = 'memmapped_file_system_pb2' + # @@protoc_insertion_point(class_scope:tensorflow.MemmappedFileSystemDirectory) + )) +_sym_db.RegisterMessage(MemmappedFileSystemDirectory) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\370\001\001')) +# @@protoc_insertion_point(module_scope) diff --git a/models/public/mozilla-deepspeech-0.8.2/mds_convert_utils/parse_openfst.py b/models/public/mozilla-deepspeech-0.8.2/mds_convert_utils/parse_openfst.py new file mode 100644 index 00000000000..0ff169ce0ab --- /dev/null +++ b/models/public/mozilla-deepspeech-0.8.2/mds_convert_utils/parse_openfst.py @@ -0,0 +1,58 @@ +# +# Copyright (C) 2020 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +# +from .struct_utils import parse_format, align_pos + + +def parse_string(data, pos=0): + (length,), pos = parse_format(' 1: + raise ValueError("Found more than one OpenFst TRIE signature in LM file, cannot decide which one is right") + return matches[0].start() + + +def scorer_cut_trie_v6(data, trie_offset=None): + """ + Cut scorer file from Mozilla DeepSpeech v0.7.x/v0.8.x into kenlm and trie sections. + """ + if trie_offset is None: + trie_offset = find_trie_v6_offset(data) + kenlm_data, trie_data = data[:trie_offset], data[trie_offset:] + return kenlm_data, trie_data, trie_offset + + +def trie_v6_extract_vocabulary(data, alphabet=None, base_offset=0, max_num_words=10000000): + if alphabet is None: + alphabet = DEFAULT_ALPHABET + fst, _ = parse_trie_v6(data, pos=0, base_offset=base_offset) + vocabulary = traverse_fst(fst, alphabet, max_num_words=max_num_words) + return vocabulary, fst['meta'] + + +def parse_trie_v6(data, pos=0, base_offset=0): + (magic, version, is_utf8_mode, alpha, beta), pos = parse_format('<4si?dd', data, pos) + if magic != b'EIRT': + raise ValueError("Not a ds_ctcdecoder TRIE section: wrong section signature") + if version != 6: + raise ValueError("Wrong ds_ctcdecoder TRIE section version: version {}, expected version 6".format(version)) + if is_utf8_mode: + raise ValueError("UTF-8 mode language model: UTF-8 mode was not tested, stopping") + fst, pos = parse_openfst(data, pos, base_offset=base_offset) + fst['meta'].update(alpha=alpha, beta=beta) + return fst, pos + + +def traverse_fst(fst, alphabet, max_num_words): + graph = states_arcs_to_arc_dict(fst['states'], fst['arcs']) + vocabulary = [] + + init_state = fst['meta']['start_state'] + cur_prefix = [] + def process_words(state, prefix): + out_arcs = graph[state].items() + if len(out_arcs) == 0: + word = b''.join(prefix) + vocabulary.append(word) + if len(vocabulary) > max_num_words: + raise RuntimeError("Number of words in vocabulary exceeds limit ({}), stopping".format(max_num_words)) + return + prefix.append(None) + for in_label, next_state in out_arcs: + prefix[-1] = alphabet[in_label - 1] + process_words(next_state, prefix) + prefix.pop() + process_words(init_state, cur_prefix) + return vocabulary + + +def states_arcs_to_arc_dict(states, arcs): + graph = [] # list(state -> dict(in_label -> state)) + for state_desc in states: + weight, first_arc, num_arcs, num_in_eps, num_out_eps = state_desc # pylint: disable=unused-variable + if num_in_eps != 0 or num_out_eps != 0: + raise ValueError("epsilon arcs are not allowed") + + out_arcs = OrderedDict() + for arc_desc in arcs[first_arc : first_arc + num_arcs]: + in_label, out_label, weight, next_state = arc_desc + if in_label != out_label: + raise ValueError("FST format changed: out_label differs from in_label") + out_arcs[in_label] = next_state + graph.append(out_arcs) + + return graph + + +def kenlm_v5_insert_vocabulary(data_kenlm, vocabulary, drop_final_spaces=True): + kenlm_signature = b'mmap lm http://kheafield.com/code format version 5\n\0' + with_vocab_offset = 0x64 + num_words_offset = 0x6c + + if not data_kenlm.startswith(kenlm_signature): + raise ValueError("Wrong signature in kenlm section: either broken file, or unsupported kenlm version") + with_vocab = bool(data_kenlm[with_vocab_offset]) + (num_words,), _ = parse_format(', and + raise ValueError("number of words in kenlm header does not match vocabulary size: {} != {}" + .format(num_words, len(vocabulary) + 3)) + + vocab_offset = len(data_kenlm) + data_kenlm = [data_kenlm[:with_vocab_offset], b'\1', data_kenlm[with_vocab_offset + 1:]] + data_kenlm.append(convert_vocabulary_to_kenlm_format(vocabulary, drop_final_spaces=drop_final_spaces)) + + return b''.join(data_kenlm), vocab_offset + + +def convert_vocabulary_to_kenlm_format(vocabulary, drop_final_spaces=True): + # Unlike kenlm, we don't sort words in MurMurHash order. Our demo doesn't care about word order. + data_vocab = [b'\0\0\0'] + + if drop_final_spaces: + if not all(word.endswith(b' ') for word in vocabulary): + raise ValueError("Some words in vocabulary don't end with a space") + data_vocab += [word[:-1] + b'\0' for word in vocabulary] + else: + data_vocab += [word + b'\0' for word in vocabulary] + + return b''.join(data_vocab) diff --git a/models/public/mozilla-deepspeech-0.8.2/mds_convert_utils/struct_utils.py b/models/public/mozilla-deepspeech-0.8.2/mds_convert_utils/struct_utils.py new file mode 100644 index 00000000000..2482f225b62 --- /dev/null +++ b/models/public/mozilla-deepspeech-0.8.2/mds_convert_utils/struct_utils.py @@ -0,0 +1,18 @@ +# +# Copyright (C) 2020 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +# +import struct + + +__all__ = ['parse_format', 'align_pos'] + + +def parse_format(format_, data, pos=0, align=None, pos_base_offset=0): + len_ = struct.calcsize(format_) + return struct.unpack(format_, data[pos : pos + len_]), pos + struct.calcsize(format_) + + +def align_pos(pos, align, base_offset=0): + pos += (-(pos + base_offset)) % align + return pos diff --git a/models/public/mozilla-deepspeech-0.8.2/model.yml b/models/public/mozilla-deepspeech-0.8.2/model.yml new file mode 100644 index 00000000000..34a1e2b8f9f --- /dev/null +++ b/models/public/mozilla-deepspeech-0.8.2/model.yml @@ -0,0 +1,38 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + "mozilla-deepspeech-0.8.2" is a speech recognition neural network pre-trained by Mozilla + based on DeepSpeech architecture (CTC decoder with beam search and n-gram language model) + with modified neural network. + For details on the original DeepSpeech see paper . +task_type: speech_recognition +files: + - name: deepspeech-0.8.2-models.pbmm + size: 188915984 + sha256: f1ad4347b276b7f0f35bc47954feb7240fad913f3a1b85605628ab6d6209b0c9 + source: https://github.com/mozilla/DeepSpeech/releases/download/v0.8.2/deepspeech-0.8.2-models.pbmm + - name: deepspeech-0.8.2-models.scorer + size: 953363776 + sha256: d0cf926ab9cab54a8a7d70003b931b2d62ebd9105ed392d1ec9c840029867799 + source: https://github.com/mozilla/DeepSpeech/releases/download/v0.8.2/deepspeech-0.8.2-models.scorer +model_optimizer_args: + - --input_model=$conv_dir/deepspeech-0.8.2-models.pb + - --freeze_placeholder_with_value=input_lengths->[16] + - --input=input_node,previous_state_h,previous_state_c + - --input_shape=[1,16,19,26],[1,2048],[1,2048] + - --output=logits,cudnn_lstm/rnn/multi_rnn_cell/cell_0/cudnn_compatible_lstm_cell/GatherNd,cudnn_lstm/rnn/multi_rnn_cell/cell_0/cudnn_compatible_lstm_cell/GatherNd_1 + - --disable_nhwc_to_nchw +framework: tf +license: https://raw.githubusercontent.com/mozilla/DeepSpeech/master/LICENSE diff --git a/models/public/mozilla-deepspeech-0.8.2/mozilla-deepspeech-0.8.2.md b/models/public/mozilla-deepspeech-0.8.2/mozilla-deepspeech-0.8.2.md new file mode 100644 index 00000000000..0acaca1738b --- /dev/null +++ b/models/public/mozilla-deepspeech-0.8.2/mozilla-deepspeech-0.8.2.md @@ -0,0 +1,114 @@ +# mozilla-deepspeech-0.8.2 + +## Use Case and High-Level Description + +"mozilla-deepspeech-0.8.2" is a speech recognition neural network pre-trained by Mozilla +based on DeepSpeech architecture (CTC decoder with beam search and n-gram language model) +with changed neural network topology. + +For details on the original DeepSpeech, see paper . + +For details on this model, see . + +## Specification + +| Metric | Value | +|---------------------------------|-------------------------------------------| +| Type | Speech recognition | +| GFlops per audio frame | 0.0472 | +| GFlops per second of audio | 2.36 | +| MParams | 47.2 | +| Source framework | TensorFlow\* | + +## Accuracy + +| Metric | Value | Parameters | +| ---------------------------- | ---------- | ---------------------------------------------------------------- | +| WER @ LibriSpeech test-clean | 8.39% | with LM, beam_width = 32, Python CTC decoder, accuracy checker | +| WER @ LibriSpeech test-clean | **6.13%** | with LM, **beam_width = 500**, C++ CTC decoder, accuracy checker | +| WER @ LibriSpeech test-clean | **6.15%** | with LM, **beam_width = 500**, C++ CTC decoder, demo | + +*NB*: beam_width=32 is a low value for a CTC decoder, and was used to achieve reasonable evaluation time with Python CTC decoder in Accuracy Checker. +Increasing beam_width improves WER metric and slows down decoding. Speech recognition demo has a faster C++ CTC decoder module. + +## Input + +### Original Model + + 1. Audio MFCC coefficients, name: `input_node` , shape: [1x16x19x26], format: [BxNxTxC], where: + + - B - batch size, fixed to 1 + - N - `input_lengths` (see below) - number of audio frames in this section of audio + - T - context frames: along with the current frame, the network expects 9 preceding frames and 9 succeeding frames. The absent context frames are filled with zeros. + - C - 26 MFCC coefficients per each frame + + See [`accuracy-check.yml`](accuracy-check.yml) for all audio preprocessing and feature extraction parameters. + + 1. Number of audio frames, INT32 value, name: `input_lengths`, shape [1]. + + 1. LSTM in-state (*c*) vector, name: `previous_state_c`, shape: [1x2048], format: [BxC]. + + 1. LSTM input (*h*, a.k.a hidden state) vector, name: `previous_state_h`, shape: [1x2048], format: [BxC]. + +When splitting a long audio into chunks, these two last inputs must be fed with the corresponding outputs from the previous chunk. +Chunk processing order must be from early to late audio positions. + +### Converted Model + + 1. Audio MFCC coefficients, name: `input_node` , shape: [1x16x19x26], format: [BxNxTxC], where: + + - B - batch size, fixed to 1 + - N - number of audio frames in this section of audio, fixed to 16 + - T - context frames: along with the current frame, the network expects 9 preceding frames and 9 succeeding frames. The absent context frames are filled with zeros. + - C - 26 MFCC coefficients in each frame + + See [`accuracy-check.yml`](accuracy-check.yml) for all audio preprocessing and feature extraction parameters. + + 1. LSTM in-state vector, name: `previous_state_c`, shape: [1x2048], format: [BxC]. + + 1. LSTM input vector, name: `previous_state_h`, shape: [1x2048], format: [BxC]. + +When splitting a long audio into chunks, these two last inputs must be fed with the corresponding outputs from the previous chunk. +Chunk processing order must be from early to late audio positions. + +## Output + +### Original Model + + 1. Per-frame probabilities (after softmax) for every symbol in the alphabet, name: `logits`, shape: [16x1x29], format: [NxBxC] + + - N - number of audio frames in this section of audio + - B - batch size, fixed to 1 + - C - alphabet size, including the CTC blank symbol + + The per-frame probabilities are to be decoded with a CTC decoder. + The alphabet is: 0 = space, 1...26 = "a" to "z", 27 = apostrophe, 28 = CTC blank symbol. + + *NB*: `logits` is probabilities after softmax, despite its name. + + 1. LSTM out-state vector, name: `new_state_c`, shape: [1x2048], format: [BxC]. See Inputs. + + 1. LSTM output vector, name: `new_state_h`, shape: [1x2048], format: [BxC]. See Inputs. + +### Converted Model + + 1. Per-frame probabilities (after softmax) for every symbol in the alphabet, name: `logits`, shape: [16x1x29], format: [NxBxC] + + - N - number of audio frames in this section of audio, fixed to 16 + - B - batch size, fixed to 1 + - C - alphabet size, including the CTC blank symbol + + The per-frame probabilities are to be decoded with a CTC decoder. + The alphabet is: 0 = space, 1...26 = "a" to "z", 27 = apostrophe, 28 = CTC blank symbol. + + *NB*: `logits` is probabilities after softmax, despite its name. + + 1. LSTM out-state vector, name: `cudnn_lstm/rnn/multi_rnn_cell/cell_0/cudnn_compatible_lstm_cell/BlockLSTM/TensorIterator.2` (for `new_state_c`), shape: [1x2048], format: [BxC]. See Inputs. + + 1. LSTM output vector, name: `cudnn_lstm/rnn/multi_rnn_cell/cell_0/cudnn_compatible_lstm_cell/BlockLSTM/TensorIterator.1` (for `new_state_h`), shape: [1x2048], format: [BxC]. See Inputs. + +## Legal Information + +The original model is distributed under the +[Mozilla Public License, Version 2.0](https://raw.githubusercontent.com/mozilla/DeepSpeech/master/LICENSE). +A copy of the license is provided in [MPL-2.0-Mozilla-Deepspeech.txt](../licenses/MPL-2.0-Mozilla-Deepspeech.txt). diff --git a/models/public/mozilla-deepspeech-0.8.2/pbmm_to_pb.py b/models/public/mozilla-deepspeech-0.8.2/pbmm_to_pb.py new file mode 100755 index 00000000000..35268b12079 --- /dev/null +++ b/models/public/mozilla-deepspeech-0.8.2/pbmm_to_pb.py @@ -0,0 +1,79 @@ +#! /usr/bin/env python3 +# +# Copyright (C) 2020 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +# +import argparse + +from pathlib import Path + +from tensorflow.compat.v1 import GraphDef + +from mds_convert_utils.memmapped_file_system_pb2 import MemmappedFileSystemDirectory + + +def parse_args(): + parser = argparse.ArgumentParser( + description="Convert memory-mapped Tensorflow protobuf format into plain Tensorflow protobuf (GraphDef)") + parser.add_argument('input', type=Path, help="Input .pbmm filename") + parser.add_argument('output', type=Path, help="Output .pb filename") + return parser.parse_args() + + +def load_memmapped_fs(data): + data_directory_ofs = int.from_bytes(data[-8:], 'little') + data_directory = data[data_directory_ofs:-8] + + directory_pb = MemmappedFileSystemDirectory() + directory_pb.ParseFromString(data_directory) + + return { + entry.name: data[entry.offset : entry.offset + entry.length] + for entry in directory_pb.element + } + + +def convert_node(node, mmfs): + """ + node is changed in place. + """ + node.op = 'Const' + # region_name is bytes here, while it is string in MemmappedFileSystemDirectory + region_name = node.attr['memory_region_name'].s.decode('utf-8') + dtype = node.attr['dtype'].type + shape = node.attr['shape'].shape + del node.attr['memory_region_name'] + del node.attr['shape'] + # keep node.attr['dtype'] + node.attr['value'].tensor.dtype = dtype + node.attr['value'].tensor.tensor_shape.CopyFrom(shape) + node.attr['value'].tensor.tensor_content = mmfs[region_name] + + +def undo_mmap(graph_def, mmfs): + """ + graph_def is changed in place. + """ + for node in graph_def.node: + if node.op == 'ImmutableConst': + convert_node(node, mmfs) + + +def main(): + args = parse_args() + + data = args.input.read_bytes() + + mmfs = load_memmapped_fs(data) + ROOT = 'memmapped_package://.' + + graph_def = GraphDef() + graph_def.ParseFromString(mmfs[ROOT]) + + undo_mmap(graph_def, mmfs) + + args.output.write_bytes(graph_def.SerializeToString()) + + +if __name__ == '__main__': + main() diff --git a/models/public/mozilla-deepspeech-0.8.2/pre-convert.py b/models/public/mozilla-deepspeech-0.8.2/pre-convert.py new file mode 100755 index 00000000000..d241b57ed29 --- /dev/null +++ b/models/public/mozilla-deepspeech-0.8.2/pre-convert.py @@ -0,0 +1,38 @@ +#! /usr/bin/env python3 +# +# Copyright (C) 2020 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +# +# This script is automatically executed by open_model_zoo/tools/downloader/converter.py, +# and runs pbmm_to_pb.py and scorer_to_kenlm.py. +# +import sys +import argparse +import subprocess + +from pathlib import Path + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('input_dir', type=Path) + parser.add_argument('output_dir', type=Path) + args = parser.parse_args() + + subprocess.run([ + sys.executable, '--', + str(Path(sys.argv[0]).with_name('pbmm_to_pb.py')), '--', + str(args.input_dir / 'deepspeech-0.8.2-models.pbmm'), + str(args.output_dir / 'deepspeech-0.8.2-models.pb'), + ], check=True) + + subprocess.run([ + sys.executable, '--', + str(Path(sys.argv[0]).with_name('scorer_to_kenlm.py')), '--', + str(args.input_dir / 'deepspeech-0.8.2-models.scorer'), + str(args.output_dir / 'deepspeech-0.8.2-models.kenlm'), + ], check=True) + + +if __name__ == '__main__': + main() diff --git a/models/public/mozilla-deepspeech-0.8.2/scorer_to_kenlm.py b/models/public/mozilla-deepspeech-0.8.2/scorer_to_kenlm.py new file mode 100755 index 00000000000..198049cafa5 --- /dev/null +++ b/models/public/mozilla-deepspeech-0.8.2/scorer_to_kenlm.py @@ -0,0 +1,46 @@ +#! /usr/bin/env python3 +# +# Copyright (C) 2020 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +# +import argparse + +from pathlib import Path + +from mds_convert_utils import scorer_cut_trie_v6, trie_v6_extract_vocabulary, kenlm_v5_insert_vocabulary + + +def parse_args(): + parser = argparse.ArgumentParser( + description="Convert Mozilla DeepSpeech LM scorer from v0.7.x/0.8.x format to v0.6.1 format") + parser.add_argument('input', type=Path, help="Input filename") + parser.add_argument('output', type=Path, help="Output filename") + parser.add_argument('--trie-offset', type=int, default=None, help="TRIE section offset (optional)") + parser.add_argument('--no-drop-space', action='store_true', + help="Don't remove space at the end of each vocabulary word") + return parser.parse_args() + + +def main(): + args = parse_args() + + data_scorer = args.input.read_bytes() + + data_scorer, data_trie, trie_offset = scorer_cut_trie_v6(data_scorer, trie_offset=args.trie_offset) + vocabulary, metadata = trie_v6_extract_vocabulary(data_trie, base_offset=trie_offset) + data_scorer, vocab_offset = kenlm_v5_insert_vocabulary(data_scorer, vocabulary, + drop_final_spaces=not args.no_drop_space) + + # pylint: disable=bad-function-call + print('# Language model parameters:') + print('lm_alpha:', metadata['alpha']) + print('lm_beta:', metadata['beta']) + if vocab_offset is not None: + print('lm_vocabulary_offset:', vocab_offset) + # pylint: enable=bad-function-call + + args.output.write_bytes(data_scorer) + + +if __name__ == '__main__': + main() diff --git a/models/public/mtcnn/mtcnn.md b/models/public/mtcnn/mtcnn.md index 7ad19b76980..07819c93fb1 100644 --- a/models/public/mtcnn/mtcnn.md +++ b/models/public/mtcnn/mtcnn.md @@ -34,8 +34,6 @@ The model output is a blob with a vector containing the first pass of face data. | MParams | 0.007 | -### Performance - ### Input #### Original model @@ -88,8 +86,6 @@ The model output is a blob with a vector containing the refined face data. If th | MParams | 0.1 | -### Performance - ### Input #### Original model @@ -142,8 +138,6 @@ The model output is a blob with a vector containing the output face data. | MParams | 0.389 | -### Performance - ### Input #### Original model diff --git a/models/public/octave-densenet-121-0.125/octave-densenet-121-0.125.md b/models/public/octave-densenet-121-0.125/octave-densenet-121-0.125.md index 713dc84fd7b..223de5908f1 100644 --- a/models/public/octave-densenet-121-0.125/octave-densenet-121-0.125.md +++ b/models/public/octave-densenet-121-0.125/octave-densenet-121-0.125.md @@ -5,8 +5,6 @@ The `octave-densenet-121-0.125` model is a modification of [`densenet-121`](https://arxiv.org/abs/1608.06993) with Octave convolutions from [Drop an Octave: Reducing Spatial Redundancy in Convolutional Neural Networks with Octave Convolution](https://arxiv.org/abs/1904.05049) with `alpha=0.125`. Like the original model, this model is designed for image classification. For details about family of Octave Convolution models, check out the [repository](https://github.com/facebookresearch/OctConv). -## Example - ## Specification | Metric | Value | @@ -23,8 +21,6 @@ The `octave-densenet-121-0.125` model is a modification of [`densenet-121`](http | Top 1 | 76.066%| | Top 5 | 93.044%| -## Performance - ## Input A blob that consists of a single image of `1x3x224x224` in `RGB `order. Before passing the image blob into the network, subtract RGB mean values as follows: [124,117,104]. In addition, values must be divided by 0.0167. diff --git a/models/public/octave-resnet-101-0.125/octave-resnet-101-0.125.md b/models/public/octave-resnet-101-0.125/octave-resnet-101-0.125.md index d356d4f5abe..480524a50ba 100644 --- a/models/public/octave-resnet-101-0.125/octave-resnet-101-0.125.md +++ b/models/public/octave-resnet-101-0.125/octave-resnet-101-0.125.md @@ -5,8 +5,6 @@ The `octave-resnet-101-0.125` model is a modification of [ResNet-101](https://arxiv.org/abs/1512.03385) with Octave convolutions from [Drop an Octave: Reducing Spatial Redundancy in Convolutional Neural Networks with Octave Convolution](https://arxiv.org/abs/1904.05049) with `alpha=0.125`. Like the original model, this model is designed for image classification. For details about family of Octave Convolution models, check out the [repository](https://github.com/facebookresearch/OctConv). -## Example - ## Specification | Metric | Value | @@ -23,8 +21,6 @@ The `octave-resnet-101-0.125` model is a modification of [ResNet-101](https://ar | Top 1 | 79.182%| | Top 5 | 94.42%| -## Performance - ## Input A blob that consists of a single image of `1x3x224x224` in `RGB` order. Before passing the image blob into the network, subtract RGB mean values as follows: [124,117,104]. In addition, values must be divided by 0.0167. diff --git a/models/public/octave-resnet-200-0.125/octave-resnet-200-0.125.md b/models/public/octave-resnet-200-0.125/octave-resnet-200-0.125.md index f52246d13b7..2f6d3cf106d 100644 --- a/models/public/octave-resnet-200-0.125/octave-resnet-200-0.125.md +++ b/models/public/octave-resnet-200-0.125/octave-resnet-200-0.125.md @@ -4,8 +4,6 @@ The `octave-resnet-200-0.125` model is a modification of [`resnet-200`](https://arxiv.org/abs/1512.03385) with Octave convolutions from [Drop an Octave: Reducing Spatial Redundancy in Convolutional Neural Networks with Octave Convolution](https://arxiv.org/abs/1904.05049) with `alpha=0.125`. Like the original model, this model is designed for image classification. For details about family of Octave Convolution models, check out the [repository](https://github.com/facebookresearch/OctConv). -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ The `octave-resnet-200-0.125` model is a modification of [`resnet-200`](https:// | Top 1 | 79.99%| | Top 5 | 94.866%| -## Performance - ## Input A blob that consists of a single image of `1x3x224x224` in `RGB` order. Before passing the image blob into the network, subtract RGB mean values as follows: [124,117,104]. In addition, values must be divided by 0.0167. diff --git a/models/public/octave-resnet-26-0.25/octave-resnet-26-0.25.md b/models/public/octave-resnet-26-0.25/octave-resnet-26-0.25.md index 4bcb513002e..af677883d81 100644 --- a/models/public/octave-resnet-26-0.25/octave-resnet-26-0.25.md +++ b/models/public/octave-resnet-26-0.25/octave-resnet-26-0.25.md @@ -5,8 +5,6 @@ The `octave-resnet-26-0.25` model is a modification of [`resnet-26`](https://arxiv.org/abs/1512.03385) with Octave convolutions from [Drop an Octave: Reducing Spatial Redundancy in Convolutional Neural Networks with Octave Convolution](https://arxiv.org/abs/1904.05049) with `alpha=0.25`. Like the original model, this model is designed for image classification. For details about family of Octave Convolution models, check out the [repository](https://github.com/facebookresearch/OctConv). -## Example - ## Specification | Metric | Value | @@ -23,8 +21,6 @@ The `octave-resnet-26-0.25` model is a modification of [`resnet-26`](https://arx | Top 1 | 76.076%| | Top 5 | 92.584%| -## Performance - ## Input A blob that consists of a single image of `1x3x224x224` in `RGB` order. Before passing the image blob into the network, subtract RGB mean values as follows: [124,117,104]. In addition, values must be divided by 0.0167. diff --git a/models/public/octave-resnet-50-0.125/octave-resnet-50-0.125.md b/models/public/octave-resnet-50-0.125/octave-resnet-50-0.125.md index 544f9661699..a186384e54e 100644 --- a/models/public/octave-resnet-50-0.125/octave-resnet-50-0.125.md +++ b/models/public/octave-resnet-50-0.125/octave-resnet-50-0.125.md @@ -8,8 +8,6 @@ The model input is a blob that consists of a single image of 1x3x224x224 in RGB The model output for `octave-resnet-50-0.125` is the typical object classifier output for the 1000 different classifications matching those in the ImageNet database. -## Example - ## Specification | Metric | Value | @@ -26,8 +24,6 @@ The model output for `octave-resnet-50-0.125` is the typical object classifier o | Top 1 | 78.19%| | Top 5 | 93.862%| -## Performance - ## Input ### Original Model diff --git a/models/public/octave-resnext-101-0.25/octave-resnext-101-0.25.md b/models/public/octave-resnext-101-0.25/octave-resnext-101-0.25.md index d17566f8fd5..5be3b2f720b 100644 --- a/models/public/octave-resnext-101-0.25/octave-resnext-101-0.25.md +++ b/models/public/octave-resnext-101-0.25/octave-resnext-101-0.25.md @@ -4,8 +4,6 @@ The `octave-resnext-101-0.25` model is a modification of [`resnext-101`](https://arxiv.org/abs/1611.05431) with Octave convolutions from [Drop an Octave: Reducing Spatial Redundancy in Convolutional Neural Networks with Octave Convolution](https://arxiv.org/abs/1904.05049) with `alpha=0.25`. Like the original model, this model is designed for image classification. For details about family of Octave Convolution models, check out the [repository](https://github.com/facebookresearch/OctConv). -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ The `octave-resnext-101-0.25` model is a modification of [`resnext-101`](https:/ | Top 1 | 79.556%| | Top 5 | 94.444%| -## Performance - ## Input A blob that consists of a single image of `1x3x224x224` in `RGB` order. Before passing the image blob into the network, subtract `RGB` mean values as follows: [124,117,104]. In addition, values must be divided by 0.0167. diff --git a/models/public/octave-resnext-50-0.25/accuracy-check.yml b/models/public/octave-resnext-50-0.25/accuracy-check.yml index 80d06040122..4f0872d51a9 100644 --- a/models/public/octave-resnext-50-0.25/accuracy-check.yml +++ b/models/public/octave-resnext-50-0.25/accuracy-check.yml @@ -37,17 +37,6 @@ models: launchers: - framework: dlsdk - tags: - - FP32 - model: public/octave-resnext-50-0.25/FP32/octave-resnext-50-0.25.xml - weights: public/octave-resnext-50-0.25/FP32/octave-resnext-50-0.25.bin - adapter: classification - - - framework: dlsdk - tags: - - FP16 - model: public/octave-resnext-50-0.25/FP16/octave-resnext-50-0.25.xml - weights: public/octave-resnext-50-0.25/FP16/octave-resnext-50-0.25.bin adapter: classification datasets: diff --git a/models/public/octave-resnext-50-0.25/octave-resnext-50-0.25.md b/models/public/octave-resnext-50-0.25/octave-resnext-50-0.25.md index 1b43b9bb426..f6b6bcd7e3c 100644 --- a/models/public/octave-resnext-50-0.25/octave-resnext-50-0.25.md +++ b/models/public/octave-resnext-50-0.25/octave-resnext-50-0.25.md @@ -4,8 +4,6 @@ The `octave-resnext-50-0.25` model is a modification of [`resnext-50`](https://arxiv.org/abs/1611.05431) with Octave convolutions from [Drop an Octave: Reducing Spatial Redundancy in Convolutional Neural Networks with Octave Convolution](https://arxiv.org/abs/1904.05049) with `alpha=0.25`. Like the original model, this model is designed for image classification. For details about family of Octave Convolution models, check out the [repository](https://github.com/facebookresearch/OctConv). -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ The `octave-resnext-50-0.25` model is a modification of [`resnext-50`](https://a | Top 1 | 78.772%| | Top 5 | 94.18%| -## Performance - ## Input A blob that consists of a single image of `1x3x224x224` in `RGB` order. Before passing the image blob into the network, subtract RGB mean values as follows: [124,117,104]. In addition, values must be divided by 0.0167. diff --git a/models/public/octave-se-resnet-50-0.125/octave-se-resnet-50-0.125.md b/models/public/octave-se-resnet-50-0.125/octave-se-resnet-50-0.125.md index 3c4f98168a8..b796fd4af2a 100644 --- a/models/public/octave-se-resnet-50-0.125/octave-se-resnet-50-0.125.md +++ b/models/public/octave-se-resnet-50-0.125/octave-se-resnet-50-0.125.md @@ -8,8 +8,6 @@ The model input is a blob that consists of a single image of 1x3x224x224 in RGB The model output for `octave-se-resnet-50-0.125` is the typical object classifier output for the 1000 different classifications matching those in the ImageNet database. -## Example - ## Specification | Metric | Value | @@ -26,8 +24,6 @@ The model output for `octave-se-resnet-50-0.125` is the typical object classifie | Top 1 | 78.706%| | Top 5 | 94.09% | -## Performance - ## Input ### Original model diff --git a/models/public/open-closed-eye-0001/description/open-closed-eye-0001.md b/models/public/open-closed-eye-0001/description/open-closed-eye-0001.md index b9ae6e318a4..84cf99edc9f 100644 --- a/models/public/open-closed-eye-0001/description/open-closed-eye-0001.md +++ b/models/public/open-closed-eye-0001/description/open-closed-eye-0001.md @@ -23,8 +23,6 @@ Fully convolutional network for recognition of eye state ('open', 'closed'). [MRL Eye Dataset](http://mrl.cs.vsb.cz/eyedataset) is used for training and validation (each 10th image is used for test). -## Performance - ## Inputs 1. name: "input.1" , shape: [1x3x32x32] - An input image in [1xCxHxW] format. Expected color order is BGR. diff --git a/models/public/pelee-coco/model.yml b/models/public/pelee-coco/model.yml index c5d97c35879..af2469ee4a3 100644 --- a/models/public/pelee-coco/model.yml +++ b/models/public/pelee-coco/model.yml @@ -13,7 +13,7 @@ # limitations under the License. description: >- - The Pelee is a Real-Time Object Detection + The Pelee is a Real-Time Object Detection System on Mobile Devices based on Single Shot Detection approach. The model is implemented using the Caffe* framework and trained on MSCOCO* dataset. For details about this model, check out the repository . diff --git a/models/public/pelee-coco/pelee-coco.md b/models/public/pelee-coco/pelee-coco.md index eaf8b2d4f91..5fec5fc0cbf 100644 --- a/models/public/pelee-coco/pelee-coco.md +++ b/models/public/pelee-coco/pelee-coco.md @@ -1,7 +1,7 @@ # pelee-coco ## Use Case and High-Level Description -The [Pelee](https://arxiv.org/pdf/1804.06882.pdf) is a Real-Time Object Detection System on Mobile Devices +The [Pelee](https://arxiv.org/abs/1804.06882) is a Real-Time Object Detection System on Mobile Devices based on Single Shot Detection approach. The model is implemented using the Caffe\* framework and trained on MSCOCO\* dataset. For details about this model, check out the [repository](https://github.com/Robert-JunWang/Pelee). @@ -23,8 +23,6 @@ For details about this model, check out the [repository](https://github.com/Robe See [here](https://github.com/Robert-JunWang/Pelee). -## Performance - ## Input ### Original model diff --git a/models/public/regnetx-3.2gf/accuracy-check.yml b/models/public/regnetx-3.2gf/accuracy-check.yml new file mode 100644 index 00000000000..e2239c9eeaf --- /dev/null +++ b/models/public/regnetx-3.2gf/accuracy-check.yml @@ -0,0 +1,44 @@ +models: + - name: regnetx-3.2gf + + launchers: + - framework: onnx_runtime + model: regnetx-3.2gf.onnx + adapter: classification + inputs: + - name: data + type: INPUT + shape: 1,3,224,224 + + datasets: + - name: imagenet_1000_classes + preprocessing: + - type: resize + size: 256 + aspect_ratio_scale: greater + use_pillow: True + interpolation: BICUBIC + - type: crop + size: 224 + use_pillow: True + - type: normalization + mean: (103.53,116.28,123.675) + std: (57.375,57.12,58.395) + + - name: regnetx-3.2gf + + launchers: + - framework: dlsdk + adapter: classification + + datasets: + - name: imagenet_1000_classes + preprocessing: + - type: resize + size: 256 + aspect_ratio_scale: greater + use_pillow: True + interpolation: BICUBIC + - type: crop + size: 224 + use_pillow: True diff --git a/models/public/regnetx-3.2gf/model.yml b/models/public/regnetx-3.2gf/model.yml new file mode 100644 index 00000000000..ad260e83456 --- /dev/null +++ b/models/public/regnetx-3.2gf/model.yml @@ -0,0 +1,107 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + The "regnetx-3.2gf" model is one of the RegNetX design space + models designed to perform image classification. The RegNet design space provides + simple and fast networks that work well across a wide range of flop regimes. This + model was pretrained in PyTorch*. All RegNet classification models have been pretrained + on the ImageNet* dataset. For details about this family of models, check out the + Codebase for Image Classification Research . +task_type: classification +files: + - name: pycls/__init__.py + size: 0 + sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + source: https://raw.githubusercontent.com/facebookresearch/pycls/ca89a79161e437deca8f39f31ceaef3b05873f30/pycls/__init__.py + - name: pycls/core/__init__.py + size: 0 + sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + source: https://raw.githubusercontent.com/facebookresearch/pycls/ca89a79161e437deca8f39f31ceaef3b05873f30/pycls/core/__init__.py + - name: pycls/core/checkpoint.py + size: 3497 + sha256: 4b2e2221b17cc50e93c4f952fe447de419dbd605429ffb5cade44322a66bc019 + source: https://raw.githubusercontent.com/facebookresearch/pycls/ca89a79161e437deca8f39f31ceaef3b05873f30/pycls/core/checkpoint.py + - name: pycls/core/net.py + size: 3924 + sha256: 40f39e68d462d9d001177a54966d8f63f8ebd9172e70df1916841119442b0f0a + source: https://raw.githubusercontent.com/facebookresearch/pycls/ca89a79161e437deca8f39f31ceaef3b05873f30/pycls/core/net.py + - name: pycls/core/distributed.py + size: 5410 + sha256: a56e582f13999f1ec48413abad6538199389997c2e0fa9e1ea2189cbffe598ab + source: https://raw.githubusercontent.com/facebookresearch/pycls/ca89a79161e437deca8f39f31ceaef3b05873f30/pycls/core/distributed.py + - name: pycls/core/config.py + size: 10502 + sha256: 88262db4930481b217baa9469ac347e49255866e010c3721a2b0dacd25d7af50 + source: https://raw.githubusercontent.com/facebookresearch/pycls/ca89a79161e437deca8f39f31ceaef3b05873f30/pycls/core/config.py + - name: pycls/core/io.py + size: 2603 + sha256: c1e5463515448b26b3d946b0ae2d09dd25d79b4d77a64c7b6e06c5ff4423cc2b + source: https://raw.githubusercontent.com/facebookresearch/pycls/ca89a79161e437deca8f39f31ceaef3b05873f30/pycls/core/io.py + - name: pycls/models/__init__.py + size: 317 + sha256: d6ec4228397f264cad1b2731620a17f5c7e5312dde6ae38c5d2168c4e287c063 + source: https://raw.githubusercontent.com/facebookresearch/pycls/ca89a79161e437deca8f39f31ceaef3b05873f30/pycls/models/__init__.py + - name: pycls/models/blocks.py + size: 6752 + sha256: af87685d354323f7c8762f0682573e7b43b6e19d242f5f43d1d20eeadb4321cd + source: https://raw.githubusercontent.com/facebookresearch/pycls/ca89a79161e437deca8f39f31ceaef3b05873f30/pycls/models/blocks.py + - name: pycls/models/anynet.py + size: 11457 + sha256: 93c69e0983e7020e2b14cf03b97f50d7c54cde3036bd5c7edd17367e5c1b32b5 + source: https://raw.githubusercontent.com/facebookresearch/pycls/ca89a79161e437deca8f39f31ceaef3b05873f30/pycls/models/anynet.py + - name: pycls/models/regnet.py + size: 2602 + sha256: 3204c754001e69acbc127feef56099fc4bc9a38852a198a70d577a5f079276c2 + source: https://raw.githubusercontent.com/facebookresearch/pycls/ca89a79161e437deca8f39f31ceaef3b05873f30/pycls/models/regnet.py + - name: pycls/models/model_zoo.py + size: 8982 + sha256: 1e7298b43cb21a2843b163f9861393b9fafc1e5104a3ed892dff6fe22ea45d3b + source: https://raw.githubusercontent.com/facebookresearch/pycls/ca89a79161e437deca8f39f31ceaef3b05873f30/pycls/models/model_zoo.py + - name: ckpt/regnetx-3.2gf.pyth + size: 122749825 + sha256: 371c9802319a59857ec9829890963f704436b170921ce88e6d3eb1ba4fe6ee2c + source: https://dl.fbaipublicfiles.com/pycls/dds_baselines/160906139/RegNetX-3.2GF_dds_8gpu.pyth +postprocessing: + - $type: regex_replace + file: pycls/models/model_zoo.py + pattern: 'import pycls\.core\.builders as builders' + replacement: 'from pycls.models.regnet import RegNet' + - $type: regex_replace + file: pycls/models/model_zoo.py + pattern: 'builders\.build_model\(\)' + replacement: 'RegNet()' + - $type: regex_replace + file: pycls/models/__init__.py + pattern: 'from *' + replacement: '# \g<0>' +conversion_to_onnx_args: + - --model-path=$dl_dir + - --model-name=regnetx + - --import-module=pycls.models.model_zoo + - --model-param=name="RegNetX-3.2GF" + - --model-param=pretrained=True + - --input-shape=1,3,224,224 + - --input-names=data + - --output-names=prob + - --output-file=$conv_dir/regnetx-3.2gf.onnx +model_optimizer_args: + - --input_shape=[1,3,224,224] + - --input=data + - --mean_values=data[103.53,116.28,123.675] + - --scale_values=data[57.375,57.12,58.395] + - --output=prob + - --input_model=$conv_dir/regnetx-3.2gf.onnx +framework: pytorch +license: https://raw.githubusercontent.com/facebookresearch/pycls/master/LICENSE diff --git a/models/public/regnetx-3.2gf/regnetx-3.2gf.md b/models/public/regnetx-3.2gf/regnetx-3.2gf.md new file mode 100644 index 00000000000..636d1abf4d4 --- /dev/null +++ b/models/public/regnetx-3.2gf/regnetx-3.2gf.md @@ -0,0 +1,93 @@ +# regnetx-3.2gf + +## Use Case and High-Level Description + +The `regnetx-3.2gf` model is one of the [RegNetX design space](https://arxiv.org/pdf/2003.13678) +models designed to perform image classification. The RegNet design space provides simple and fast networks that work well across a wide +range of flop regimes. This model was pretrained in PyTorch\*. All RegNet classification models have been pretrained on the ImageNet\* dataset. For details about this family of models, check out the [Codebase for Image Classification Research](https://github.com/facebookresearch/pycls). + +## Specification + +| Metric | Value | +| ---------------- | -------------- | +| Type | Classification | +| GFLOPs | 6.3893 | +| MParams | 15.2653 | +| Source framework | PyTorch\* | + +## Accuracy + +| Metric | Original model | Converted model | +| ------ | -------------- | --------------- | +| Top 1 | 78.15% | 78.15% | +| Top 5 | 94.09% | 94.09% | + +## Input + +### Original model + +Image, name - `data`, shape - `1,3,224,224`, format is `B,C,H,W` where: + +- `B` - batch size +- `C` - channel +- `H` - height +- `W` - width + +Channel order is `BGR`. +Mean values - [103.53,116.28,123.675], scale values - [57.375,57.12,58.395]. + +### Converted model + +Image, name - `data`, shape - `1,3,224,224`, format is `B,C,H,W` where: + +- `B` - batch size +- `C` - channel +- `H` - height +- `W` - width + +Channel order is `BGR` + +## Output + +### Original model + +Object classifier according to ImageNet classes, name - `prob`, shape - `1,1000`, output data format is `B,C` where: + +- `B` - batch size +- `C` - Predicted probabilities for each class in [0, 1] range + +### Converted model + +Object classifier according to ImageNet classes, name - `prob`, shape - `1,1000`, output data format is `B,C` where: + +- `B` - batch size +- `C` - Predicted probabilities for each class in [0, 1] range + +## Legal Information + +The original model is distributed under the following +[license](https://raw.githubusercontent.com/facebookresearch/pycls/master/LICENSE): + +``` +MIT License + +Copyright (c) Facebook, Inc. and its affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +``` diff --git a/models/public/resnest-50-pytorch/model.yml b/models/public/resnest-50-pytorch/model.yml index f7792899eee..2a2c86e6fe2 100644 --- a/models/public/resnest-50-pytorch/model.yml +++ b/models/public/resnest-50-pytorch/model.yml @@ -24,7 +24,7 @@ description: >- with those in the ImageNet database. For details see repository and paper - . + . task_type: classification files: - name: resnest50-528c19ca.pth diff --git a/models/public/resnest-50-pytorch/resnest-50-pytorch.md b/models/public/resnest-50-pytorch/resnest-50-pytorch.md index a643386fc42..b9d825dbd88 100644 --- a/models/public/resnest-50-pytorch/resnest-50-pytorch.md +++ b/models/public/resnest-50-pytorch/resnest-50-pytorch.md @@ -8,9 +8,7 @@ The model input is a blob that consists of a single image of "1x3x224x224" in RG The model output is typical object classifier for the 1000 different classifications matching with those in the ImageNet database. -For details see [repository](https://github.com/zhanghang1989/ResNeSt) and [paper](https://arxiv.org/pdf/2004.08955.pdf). - -## Example +For details see [repository](https://github.com/zhanghang1989/ResNeSt) and [paper](https://arxiv.org/abs/2004.08955). ## Specification @@ -28,8 +26,6 @@ For details see [repository](https://github.com/zhanghang1989/ResNeSt) and [pape | Top 1 | 81.11% | | Top 5 | 95.36% | -## Performance - ## Input ### Original model diff --git a/models/public/resnet-18-pytorch/accuracy-check.yml b/models/public/resnet-18-pytorch/accuracy-check.yml index 9802b069abe..d8e0b3f21ff 100644 --- a/models/public/resnet-18-pytorch/accuracy-check.yml +++ b/models/public/resnet-18-pytorch/accuracy-check.yml @@ -1,5 +1,5 @@ models: - - name: resnet-18 + - name: resnet-18-pytorch launchers: - framework: onnx_runtime @@ -39,7 +39,7 @@ models: # Reference metric from PyTorch (pytorch v1.3.1, torchvision v0.4.2) top-1 69.76% top-5 89.08% - - name: resnet-18 + - name: resnet-18-pytorch launchers: - framework: dlsdk diff --git a/models/public/resnet-18-pytorch/resnet-18-pytorch.md b/models/public/resnet-18-pytorch/resnet-18-pytorch.md index 701ab78035b..6b12f421e17 100644 --- a/models/public/resnet-18-pytorch/resnet-18-pytorch.md +++ b/models/public/resnet-18-pytorch/resnet-18-pytorch.md @@ -13,8 +13,6 @@ in RGB order. The model output is typical object classifier for the 1000 different classifications matching with those in the ImageNet database. -## Example - ## Specification | Metric | Value | @@ -31,8 +29,6 @@ matching with those in the ImageNet database. | Top 1 | 69.754%| | Top 5 | 89.088%| -## Performance - ## Input ### Original model diff --git a/models/public/resnet-34-pytorch/resnet-34-pytorch.md b/models/public/resnet-34-pytorch/resnet-34-pytorch.md index d62c5576542..1b19adc7346 100644 --- a/models/public/resnet-34-pytorch/resnet-34-pytorch.md +++ b/models/public/resnet-34-pytorch/resnet-34-pytorch.md @@ -13,8 +13,6 @@ in RGB order. The model output is typical object classifier for the 1000 different classifications matching with those in the ImageNet database. -## Example - ## Specification | Metric | Value | @@ -31,8 +29,6 @@ matching with those in the ImageNet database. | Top 1 | 73.30% | | Top 5 | 91.42% | -## Performance - ## Input ### Original model diff --git a/models/public/resnet-50-caffe2/resnet-50-caffe2.md b/models/public/resnet-50-caffe2/resnet-50-caffe2.md index 4713c658407..ef746394ed6 100644 --- a/models/public/resnet-50-caffe2/resnet-50-caffe2.md +++ b/models/public/resnet-50-caffe2/resnet-50-caffe2.md @@ -7,8 +7,6 @@ This model was converted from Caffe\* to Caffe2\* format. For details see repository , paper . -## Example - ## Specification | Metric | Value | @@ -25,8 +23,6 @@ paper . | Top 1 | 76.38% | | Top 5 | 93.188%| -## Performance - ## Input ### Original model diff --git a/models/public/resnet-50-pytorch/resnet-50-pytorch.md b/models/public/resnet-50-pytorch/resnet-50-pytorch.md index 39f679323c7..30c9edd2f91 100644 --- a/models/public/resnet-50-pytorch/resnet-50-pytorch.md +++ b/models/public/resnet-50-pytorch/resnet-50-pytorch.md @@ -13,8 +13,6 @@ in RGB order. The model output is typical object classifier for the 1000 different classifications matching with those in the ImageNet database. -## Example - ## Specification | Metric | Value | @@ -31,8 +29,6 @@ matching with those in the ImageNet database. | Top 1 | 76.128%| | Top 5 | 92.858%| -## Performance - ## Input ### Original model diff --git a/models/public/resnet-50-tf/freeze_saved_model.py b/models/public/resnet-50-tf/freeze_saved_model.py index c6a3452e54a..4f852715c2e 100644 --- a/models/public/resnet-50-tf/freeze_saved_model.py +++ b/models/public/resnet-50-tf/freeze_saved_model.py @@ -1,7 +1,6 @@ import argparse import tensorflow.compat.v1 as tf -from tensorflow.python.framework import graph_io from tensorflow.python.tools import optimize_for_inference_lib def parse_args(): diff --git a/models/public/resnet-50-tf/resnet-50-tf.md b/models/public/resnet-50-tf/resnet-50-tf.md index 84cb4722c79..c51531781db 100644 --- a/models/public/resnet-50-tf/resnet-50-tf.md +++ b/models/public/resnet-50-tf/resnet-50-tf.md @@ -12,13 +12,11 @@ For details see [paper](https://arxiv.org/abs/1512.03385), 1. Install TensorFlow\*, version 1.14.0. 2. Download [pretrained weights](http://download.tensorflow.org/models/official/20181001_resnet/savedmodels/resnet_v1_fp32_savedmodel_NHWC_jpg.tar.gz) -3. Run example conversion code, available at [freeze_saved_model.py](./freeze_saved_model.py) +3. Run example conversion code, available at [freeze_saved_model.py](https://github.com/openvinotoolkit/open_model_zoo/blob/master/models/public/resnet-50-tf/freeze_saved_model.py) ```sh python3 freeze_saved_model.py --saved_model_dir path/to/downloaded/saved_model --save_file path/to/resulting/frozen_graph.pb ``` -## Example - ## Specification | Metric | Value | @@ -35,8 +33,6 @@ python3 freeze_saved_model.py --saved_model_dir path/to/downloaded/saved_model - | Top 1 | 76.45% | 76.17% | | Top 5 | 93.05% | 92.98% | -## Performance - ## Input ### Original Model @@ -82,4 +78,4 @@ Object classifier according to ImageNet classes, name: `softmax_tensor`, shape: The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/retinanet-tf/retinanet-tf.md b/models/public/retinanet-tf/retinanet-tf.md index 8a4e90c177c..a4841e6ccdf 100644 --- a/models/public/retinanet-tf/retinanet-tf.md +++ b/models/public/retinanet-tf/retinanet-tf.md @@ -29,8 +29,6 @@ converted to TensorFlow\* protobuf format. For details, see [paper](https://arxi python keras_to_tensorflow.py --input_model=.h5 --output_model=.pb ``` -## Example - ## Specification | Metric | Value | @@ -46,8 +44,6 @@ converted to TensorFlow\* protobuf format. For details, see [paper](https://arxi | ------ | ----- | | coco_precision | 33.15%| -## Performance - ## Input ### Original Model diff --git a/models/public/rexnet-v1-x1.0/accuracy-check.yml b/models/public/rexnet-v1-x1.0/accuracy-check.yml new file mode 100644 index 00000000000..7eb19a1fffb --- /dev/null +++ b/models/public/rexnet-v1-x1.0/accuracy-check.yml @@ -0,0 +1,64 @@ +models: + - name: rexnet-v1-x1.0 + + launchers: + - framework: onnx_runtime + model: rexnet-v1-x1.0.onnx + adapter: classification + inputs: + - name: input.1 + type: INPUT + + datasets: + - name: imagenet_1000_classes + reader: pillow_imread + + preprocessing: + - type: resize + size: 256 + aspect_ratio_scale: greater + use_pillow: True + interpolation: BICUBIC + - type: crop + use_pillow: True + size: 224 + - type: normalization + mean: [123.675, 116.28, 103.53] + std: [58.395, 57.12, 57.375] + + metrics: + - name: accuracy@top1 + type: accuracy + top_k: 1 + - name: accuracy@top5 + type: accuracy + top_k: 5 + + - name: rexnet-v1-x1.0 + + launchers: + - framework: dlsdk + adapter: classification + + datasets: + - name: imagenet_1000_classes + reader: pillow_imread + + preprocessing: + - type: resize + size: 256 + aspect_ratio_scale: greater + use_pillow: True + interpolation: BICUBIC + - type: crop + use_pillow: True + size: 224 + - type: rgb_to_bgr + + metrics: + - name: accuracy@top1 + type: accuracy + top_k: 1 + - name: accuracy@top5 + type: accuracy + top_k: 5 diff --git a/models/public/rexnet-v1-x1.0/model.yml b/models/public/rexnet-v1-x1.0/model.yml new file mode 100644 index 00000000000..c780c14f639 --- /dev/null +++ b/models/public/rexnet-v1-x1.0/model.yml @@ -0,0 +1,63 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + ReXNet V1 x1.0 is network from Rank eXpansion Network (ReXNet) models family, derived + from research to mitigate the representational bottleneck. It is image classification + model pretrained on ImageNet dataset. + + The model input is a blob that consists of a single image of "1x3x224x224" in RGB + order. + + The model output is typical object classifier for the 1000 different classifications matching + with those in the ImageNet database. + + For details see repository and paper . +task_type: classification +files: + - name: rexnetv1_1.0x.pth + size: 19428695 + sha256: 30b1700f2cda11f6d07eb1c414bab30879b8eb0d8c6571254fc3e65bf911ee46 + source: + $type: google_drive + id: 1xeIJ3wb83uOowU008ykYj6wDX2dsncA9 + - name: rexnetv1.py + size: 6335 + sha256: 26ed1b143947f2d10198c7dba515c313719400daf05ea1efea434d8e61779331 + source: https://raw.githubusercontent.com/clovaai/rexnet/104f2184754d97b8050f24bdf39f650b3e80cad8/rexnetv1.py +postprocessing: + - $type: regex_replace + file: rexnetv1.py + pattern: 'USE_MEMORY_EFFICIENT_SWISH = True' + replacement: 'USE_MEMORY_EFFICIENT_SWISH = False' +framework: pytorch +conversion_to_onnx_args: + - --model-path=$dl_dir + - --model-name=ReXNetV1 + - --weights=$dl_dir/rexnetv1_1.0x.pth + - --import-module=rexnetv1 + - --model-param=width_mult=1.0 + - --input-shape=1,3,224,224 + - --output-file=$conv_dir/rexnet-v1-x1.0.onnx + - --input-names=input.1 + - --output-names=prob +model_optimizer_args: + - --input_shape=[1,3,224,224] + - --input_model=$conv_dir/rexnet-v1-x1.0.onnx + - --input=input.1 + - --mean_values=input.1[123.675,116.28,103.53] + - --scale_values=input.1[58.395,57.12,57.375] + - --reverse_input_channels + - --output=prob +license: https://raw.githubusercontent.com/clovaai/rexnet/master/LICENSE diff --git a/models/public/rexnet-v1-x1.0/rexnet-v1-x1.0.md b/models/public/rexnet-v1-x1.0/rexnet-v1-x1.0.md new file mode 100644 index 00000000000..54d3e27afcd --- /dev/null +++ b/models/public/rexnet-v1-x1.0/rexnet-v1-x1.0.md @@ -0,0 +1,92 @@ +# rexnet-v1-x1.0 + +## Use Case and High-Level Description + +ReXNet V1 x1.0 is network from Rank eXpansion Network (ReXNet) models family, derived from research to mitigate the representational bottleneck. It is image classification model pretrained on ImageNet dataset. + +The model input is a blob that consists of a single image of "1x3x224x224" in RGB order. + +The model output is typical object classifier for the 1000 different classifications matching with those in the ImageNet database. + +For details see [repository](https://github.com/clovaai/rexnet) and [paper](https://arxiv.org/pdf/2007.00992.pdf). + +## Specification + +| Metric | Value | +| ---------------- | -------------- | +| Type | Classification | +| GFLOPs | 0.8325 | +| MParams | 4.7779 | +| Source framework | PyTorch\* | + +## Accuracy + +| Metric | Value | +| ------ | ------ | +| Top 1 | 77.86% | +| Top 5 | 93.87% | + +## Input + +### Original model + +Image, name - `input.1`, shape - `1,3,224,224`, format is `B,C,H,W` where: + +- `B` - batch size +- `C` - channel +- `H` - height +- `W` - width + +Channel order is `RGB`. +Mean values - [123.675,116.28,103.53], scale values - [58.395,57.12,57.375]. + +### Converted model + +Image, name - `input.1`, shape - `1,3,224,224`, format is `B,C,H,W` where: + +- `B` - batch size +- `C` - channel +- `H` - height +- `W` - width + +Channel order is `BGR`. + +## Output + +### Original model + +Object classifier according to ImageNet classes, name - `prob`, shape - `1,1000`, output data format is `B,C` where: + +- `B` - batch size +- `C` - Predicted probabilities for each class in [0, 1] range + +### Converted model + +The converted model has the same parameters as the original model. + +## Legal Information + +The original model is distributed under +[MIT license](https://raw.githubusercontent.com/clovaai/rexnet/master/LICENSE): + +``` +Copyright (c) 2020-present NAVER Corp. + + Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +``` diff --git a/models/public/rfcn-resnet101-coco-tf/rfcn-resnet101-coco-tf.md b/models/public/rfcn-resnet101-coco-tf/rfcn-resnet101-coco-tf.md index 4663678800b..b3acaebca90 100644 --- a/models/public/rfcn-resnet101-coco-tf/rfcn-resnet101-coco-tf.md +++ b/models/public/rfcn-resnet101-coco-tf/rfcn-resnet101-coco-tf.md @@ -4,8 +4,6 @@ R-FCN Resnet-101 model, pretrained on COCO\* dataset. Used for object detection. For details, see the [paper](https://arxiv.org/abs/1605.06409). -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ R-FCN Resnet-101 model, pretrained on COCO\* dataset. Used for object detection. | coco_precision | 28.40%| | mAP | 45.02%| -## Performance - ## Input ### Original Model @@ -82,4 +78,4 @@ bounding boxes. For each detection, the description has the format: The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/se-inception/se-inception.md b/models/public/se-inception/se-inception.md index 23030384744..602b33a05b0 100644 --- a/models/public/se-inception/se-inception.md +++ b/models/public/se-inception/se-inception.md @@ -4,8 +4,6 @@ [BN-Inception with Squeeze-and-Excitation blocks](https://arxiv.org/abs/1709.01507) -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ | Top 1 | 75.996%| | Top 5 | 92.964%| -## Performance - ## Input ### Original model diff --git a/models/public/se-resnet-101/se-resnet-101.md b/models/public/se-resnet-101/se-resnet-101.md index cd3c37199fe..519b705d874 100644 --- a/models/public/se-resnet-101/se-resnet-101.md +++ b/models/public/se-resnet-101/se-resnet-101.md @@ -4,8 +4,6 @@ [ResNet-101 with Squeeze-and-Excitation blocks](https://arxiv.org/abs/1709.01507) -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ | Top 1 | 78.252%| | Top 5 | 94.206%| -## Performance - ## Input ### Original model diff --git a/models/public/se-resnet-152/se-resnet-152.md b/models/public/se-resnet-152/se-resnet-152.md index 384b4d9daee..2b687ea860b 100644 --- a/models/public/se-resnet-152/se-resnet-152.md +++ b/models/public/se-resnet-152/se-resnet-152.md @@ -4,8 +4,6 @@ [ResNet-152 with Squeeze-and-Excitation blocks](https://arxiv.org/abs/1709.01507) -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ | Top 1 | 78.506%| | Top 5 | 94.45% | -## Performance - ## Input ### Original model diff --git a/models/public/se-resnet-50/se-resnet-50.md b/models/public/se-resnet-50/se-resnet-50.md index 52c848c84e9..c7597a30467 100644 --- a/models/public/se-resnet-50/se-resnet-50.md +++ b/models/public/se-resnet-50/se-resnet-50.md @@ -4,8 +4,6 @@ [ResNet-50 with Squeeze-and-Excitation blocks](https://arxiv.org/abs/1709.01507) -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ | Top 1 | 77.596%| | Top 5 | 93.85% | -## Performance - ## Input ### Original Model diff --git a/models/public/se-resnext-101/se-resnext-101.md b/models/public/se-resnext-101/se-resnext-101.md index e5f368824f2..676d8b707d4 100644 --- a/models/public/se-resnext-101/se-resnext-101.md +++ b/models/public/se-resnext-101/se-resnext-101.md @@ -4,8 +4,6 @@ [ResNext-101 with Squeeze-and-Excitation blocks](https://arxiv.org/abs/1709.01507) -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ | Top 1 | 80.168%| | Top 5 | 95.19% | -## Performance - ## Input ### Original model diff --git a/models/public/se-resnext-50/se-resnext-50.md b/models/public/se-resnext-50/se-resnext-50.md index 6108b4260c6..034bfb5720c 100644 --- a/models/public/se-resnext-50/se-resnext-50.md +++ b/models/public/se-resnext-50/se-resnext-50.md @@ -4,8 +4,6 @@ [ResNext-50 with Squeeze-and-Excitation blocks](https://arxiv.org/abs/1709.01507) -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ | Top 1 | 78.968%| | Top 5 | 94.63% | -## Performance - ## Input ### Original model diff --git a/models/public/shufflenet-v2-x1.0/model.yml b/models/public/shufflenet-v2-x1.0/model.yml index ce8e93c840f..1ceff1570ea 100644 --- a/models/public/shufflenet-v2-x1.0/model.yml +++ b/models/public/shufflenet-v2-x1.0/model.yml @@ -15,7 +15,7 @@ description: >- Shufflenet V2 x1.0 is image classification model pretrained on ImageNet dataset. This is PyTorch implementation based on architecture described in paper "ShuffleNet - V2: Practical Guidelines for Efficient CNN Architecture Design" + V2: Practical Guidelines for Efficient CNN Architecture Design" in TorchVision package (see here ). The model input is a blob that consists of a single image of "1x3x224x224" in RGB diff --git a/models/public/shufflenet-v2-x1.0/shufflenet-v2-x1.0.md b/models/public/shufflenet-v2-x1.0/shufflenet-v2-x1.0.md index 018fc77cc84..fb2c207b9a4 100644 --- a/models/public/shufflenet-v2-x1.0/shufflenet-v2-x1.0.md +++ b/models/public/shufflenet-v2-x1.0/shufflenet-v2-x1.0.md @@ -2,14 +2,12 @@ ## Use Case and High-Level Description -Shufflenet V2 x1.0 is image classification model pretrained on ImageNet dataset. This is PyTorch implementation based on architecture described in paper ["ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design"](https://arxiv.org/pdf/1807.11164.pdf) in TorchVision package (see [here](https://github.com/pytorch/vision)). +Shufflenet V2 x1.0 is image classification model pretrained on ImageNet dataset. This is PyTorch implementation based on architecture described in paper ["ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design"](https://arxiv.org/abs/1807.11164) in TorchVision package (see [here](https://github.com/pytorch/vision)). The model input is a blob that consists of a single image of "1x3x224x224" in RGB order. The model output is typical object classifier for the 1000 different classifications matching with those in the ImageNet database. -## Example - ## Specification | Metric | Value | @@ -26,8 +24,6 @@ The model output is typical object classifier for the 1000 different classificat | Top 1 | 69.36% | | Top 5 | 88.32% | -## Performance - ## Input ### Original model diff --git a/models/public/single-human-pose-estimation-0001/description/single-human-pose-estimation-0001.md b/models/public/single-human-pose-estimation-0001/description/single-human-pose-estimation-0001.md index 4ac73ed61ec..a8a95b3e57a 100644 --- a/models/public/single-human-pose-estimation-0001/description/single-human-pose-estimation-0001.md +++ b/models/public/single-human-pose-estimation-0001/description/single-human-pose-estimation-0001.md @@ -53,6 +53,6 @@ The net outputs tensor with shapes: [1x17x48x36]. ( For every keypoint own heatm ## Legal Information The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/opencv/openvino_training_extensions/develop/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../../licenses/APACHE-2.0.txt). +A copy of the license is provided in [APACHE-2.0.txt](../../licenses/APACHE-2.0.txt). [*] Other names and brands may be claimed as the property of others. diff --git a/models/public/squeezenet1.0/squeezenet1.0.md b/models/public/squeezenet1.0/squeezenet1.0.md index df48a433afe..f2a77edbaa9 100644 --- a/models/public/squeezenet1.0/squeezenet1.0.md +++ b/models/public/squeezenet1.0/squeezenet1.0.md @@ -8,8 +8,6 @@ The model input is a blob that consists of a single image of 1x3x227x227 in BGR The model output for `squeezenet1.0` is the typical object classifier output for the 1000 different classifications matching those in the ImageNet database. -## Example - ## Specification | Metric | Value | @@ -26,8 +24,6 @@ The model output for `squeezenet1.0` is the typical object classifier output for | Top 1 | 57.684%| | Top 5 | 80.38% | -## Performance - ## Input ### Original model diff --git a/models/public/squeezenet1.1-caffe2/squeezenet1.1-caffe2.md b/models/public/squeezenet1.1-caffe2/squeezenet1.1-caffe2.md index dae4e22fac1..3b9ea0abe22 100644 --- a/models/public/squeezenet1.1-caffe2/squeezenet1.1-caffe2.md +++ b/models/public/squeezenet1.1-caffe2/squeezenet1.1-caffe2.md @@ -7,8 +7,6 @@ This model was converted from Caffe\* to Caffe2\* format. For details see repository , paper . -## Example - ## Specification | Metric | Value | @@ -25,8 +23,6 @@ paper . | Top 1 | 56.502%| | Top 5 | 79.576%| -## Performance - ## Input ### Original model diff --git a/models/public/squeezenet1.1/squeezenet1.1.md b/models/public/squeezenet1.1/squeezenet1.1.md index d73d455b5c2..20cba3eb7c0 100644 --- a/models/public/squeezenet1.1/squeezenet1.1.md +++ b/models/public/squeezenet1.1/squeezenet1.1.md @@ -8,8 +8,6 @@ The model input is a blob that consists of a single image of 1x3x227x227 in BGR The model output for `squeezenet1.1` is the typical object classifier output for the 1000 different classifications matching those in the ImageNet database. -## Example - ## Specification | Metric | Value | @@ -26,8 +24,6 @@ The model output for `squeezenet1.1` is the typical object classifier output for | Top 1 | 58.382%| | Top 5 | 81% | -## Performance - ## Input ### Original model diff --git a/models/public/ssd-resnet34-1200-onnx/ssd-resnet34-1200-onnx.md b/models/public/ssd-resnet34-1200-onnx/ssd-resnet34-1200-onnx.md index dd7b7e900e7..2ca41511c4e 100644 --- a/models/public/ssd-resnet34-1200-onnx/ssd-resnet34-1200-onnx.md +++ b/models/public/ssd-resnet34-1200-onnx/ssd-resnet34-1200-onnx.md @@ -4,8 +4,6 @@ The `ssd-resnet-34-1200-onnx` model is a multiscale SSD based on ResNet-34 backbone network intended to perform object detection. The model has been trained from the Common Objects in Context (COCO) image dataset. This model is pretrained in PyTorch\* framework and converted to ONNX\* format. For additional information refer to [repository](https://github.com/mlperf/inference/tree/master/vision/classification_and_detection). -## Example - ## Specification | Metric | Value | @@ -22,8 +20,6 @@ The `ssd-resnet-34-1200-onnx` model is a multiscale SSD based on ResNet-34 backb | coco_precision | 20.7198%| | mAP | 39.2752% | -## Performance - ## Input Note that original model expects image in `RGB` format, converted model - in `BGR` format. diff --git a/models/public/ssd300/ssd300.md b/models/public/ssd300/ssd300.md index a95d62c9844..1a9c61e2a2a 100644 --- a/models/public/ssd300/ssd300.md +++ b/models/public/ssd300/ssd300.md @@ -2,11 +2,14 @@ ## Use Case and High-Level Description -The "ssd300" model is a [Single-Shot multibox Detection (SSD)](https://arxiv.org/abs/1512.02325) network intended to perform detection. This model is implemented using the Caffe\* framework. For details about this model, check out the [repository](https://github.com/weiliu89/caffe/tree/ssd). +The `ssd300` model is the Caffe\* framework implementation of [Single-Shot multibox Detection (SSD)](https://arxiv.org/abs/1512.02325) algorithm with 300x300 input resolution and `VGG-16` backbone. The network intended to perform visual object detection. This model is pretrained on VOC2007 + VOC2012 + COCO dataset and is able to detect 20 [PASCAL VOC2012](http://host.robots.ox.ac.uk/pascal/VOC/voc2012) object classes: -The model input is a blob that consists of a single image of 1x3x300x300 in BGR order. The BGR mean values need to be subtracted as follows: [104.0,117.0,123.0] before passing the image blob into the network. +- Person: person +- Animal: bird, cat, cow, dog, horse, sheep +- Vehicle: aeroplane, bicycle, boat, bus, car, motorbike, train +- Indoor: bottle, chair, dining table, potted plant, sofa, tv/monitor -The model output is a typical vector containing the tracked object data, as previously described. +For details about this model, check out the [repository](https://github.com/weiliu89/caffe/tree/ssd). ## Example @@ -19,17 +22,15 @@ See [here](https://github.com/weiliu89/caffe/tree/ssd). | Type | Detection | | GFLOPs | 62.815 | | MParams | 26.285 | -| Source framework | Caffe\* | +| Source framework | Caffe\* | ## Accuracy +The accuracy results were obtained on validation data from VOC2012 dataset. + | Metric | Value | | ------ | ----- | -| mAP | 85.0791%| - -See [here](https://github.com/weiliu89/caffe/tree/ssd). - -## Performance +| mAP | 85.0791%| ## Input @@ -60,25 +61,25 @@ Channel order is `BGR`. ### Original model -The array of detection summary info, name - `detection_out`, shape - `1, 1, N, 7`, where N is the number of detected bounding boxes. For each detection, the description has the format: +The array of detection summary info, name - `detection_out`, shape - `1, 1, N, 7`, where N is the number of detected bounding boxes. For each detection, the description has the format: [`image_id`, `label`, `conf`, `x_min`, `y_min`, `x_max`, `y_max`], where: - `image_id` - ID of the image in the batch -- `label` - predicted class ID -- `conf` - confidence for the predicted class +- `label` - predicted class ID (1..20 - PASCAL VOC defined class ids). Mapping to class names provided by [voc.txt](../../../data/dataset_classes/voc.txt) file. +- `conf` - confidence for the predicted class, in [0, 1] range - (`x_min`, `y_min`) - coordinates of the top left bounding box corner (coordinates are in normalized format, in range [0, 1]) -- (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner (coordinates are in normalized format, in range [0, 1]) +- (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner (coordinates are in normalized format, in range [0, 1]) ### Converted model -The array of detection summary info, name - `detection_out`, shape - `1, 1, N, 7`, where N is the number of detected bounding boxes. For each detection, the description has the format: +The array of detection summary info, name - `detection_out`, shape - `1, 1, N, 7`, where N is the number of detected bounding boxes. For each detection, the description has the format: [`image_id`, `label`, `conf`, `x_min`, `y_min`, `x_max`, `y_max`], where: - `image_id` - ID of the image in the batch -- `label` - predicted class ID -- `conf` - confidence for the predicted class +- `label` - predicted class ID (1..20 - PASCAL VOC defined class ids). Mapping to class names provided by [voc.txt](../../../data/dataset_classes/voc.txt) file. +- `conf` - confidence for the predicted class in [0, 1] range - (`x_min`, `y_min`) - coordinates of the top left bounding box corner (coordinates are in normalized format, in range [0, 1]) -- (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner (coordinates are in normalized format, in range [0, 1]) +- (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner (coordinates are in normalized format, in range [0, 1]) ## Legal Information diff --git a/models/public/ssd512/ssd512.md b/models/public/ssd512/ssd512.md index cac785e0056..172ea9ea7d7 100644 --- a/models/public/ssd512/ssd512.md +++ b/models/public/ssd512/ssd512.md @@ -2,11 +2,14 @@ ## Use Case and High-Level Description -The `ssd512` model is a [Single-Shot multibox Detection (SSD)](https://arxiv.org/abs/1512.02325) network intended to perform detection. This model is implemented using the Caffe\*framework. For details about this model, check out the [repository](https://github.com/weiliu89/caffe/tree/ssd). +The `ssd512` model is the Caffe\* framework implementation of [Single-Shot multibox Detection (SSD)](https://arxiv.org/abs/1512.02325) algorithm with 512x512 input resolution and `VGG-16` backbone. The network intended to perform visual object detection. This model is pretrained on VOC2007 + VOC2012 + COCO dataset and is able to detect 20 [PASCAL VOC2012](http://host.robots.ox.ac.uk/pascal/VOC/voc2012) object classes: -The model input is a blob that consists of a single image of 1x3x512x512 in BGR order. The BGR mean values need to be subtracted as follows: [104.0,117.0,123.0] before passing the image blob into the network. +- Person: person +- Animal: bird, cat, cow, dog, horse, sheep +- Vehicle: aeroplane, bicycle, boat, bus, car, motorbike, train +- Indoor: bottle, chair, dining table, potted plant, sofa, tv/monitor -The model output is a typical vector containing the tracked object data, as previously described. +For details about this model, check out the [repository](https://github.com/weiliu89/caffe/tree/ssd). ## Example @@ -19,17 +22,15 @@ See [here](https://github.com/weiliu89/caffe/tree/ssd). | Type | Detection | | GFLOPs | 180.611 | | MParams | 27.189 | -| Source framework | Caffe\* | +| Source framework | Caffe\* | ## Accuracy +The accuracy results were obtained on validation data from VOC2012 dataset. + | Metric | Value | | ------ | ----- | -| mAP | 90.3845%| - -See [here](https://github.com/weiliu89/caffe/tree/ssd). - -## Performance +| mAP | 90.3845%| ## Input @@ -60,25 +61,25 @@ Channel order is `BGR`. ### Original model -The array of detection summary info, name - `detection_out`, shape - `1, 1, N, 7`, where N is the number of detected bounding boxes. For each detection, the description has the format: +The array of detection summary info, name - `detection_out`, shape - `1, 1, N, 7`, where N is the number of detected bounding boxes. For each detection, the description has the format: [`image_id`, `label`, `conf`, `x_min`, `y_min`, `x_max`, `y_max`], where: - `image_id` - ID of the image in the batch -- `label` - predicted class ID -- `conf` - confidence for the predicted class +- `label` - predicted class ID (1..20 - PASCAL VOC defined class ids). Mapping to class names provided by [voc.txt](../../../data/dataset_classes/voc.txt) file. +- `conf` - confidence for the predicted class, in [0, 1] range - (`x_min`, `y_min`) - coordinates of the top left bounding box corner (coordinates are in normalized format, in range [0, 1]) -- (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner (coordinates are in normalized format, in range [0, 1]) +- (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner (coordinates are in normalized format, in range [0, 1]) ### Converted model -The array of detection summary info, name - `detection_out`, shape - `1, 1, N, 7`, where N is the number of detected bounding boxes. For each detection, the description has the format: +The array of detection summary info, name - `detection_out`, shape - `1, 1, N, 7`, where N is the number of detected bounding boxes. For each detection, the description has the format: [`image_id`, `label`, `conf`, `x_min`, `y_min`, `x_max`, `y_max`], where: - `image_id` - ID of the image in the batch -- `label` - predicted class ID -- `conf` - confidence for the predicted class +- `label` - predicted class ID (1..20 - PASCAL VOC defined class ids). Mapping to class names provided by [voc.txt](../../../data/dataset_classes/voc.txt) file. +- `conf` - confidence for the predicted class, in [0, 1] range - (`x_min`, `y_min`) - coordinates of the top left bounding box corner (coordinates are in normalized format, in range [0, 1]) -- (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner (coordinates are in normalized format, in range [0, 1]) +- (`x_max`, `y_max`) - coordinates of the bottom right bounding box corner (coordinates are in normalized format, in range [0, 1]) ## Legal Information diff --git a/models/public/ssd_mobilenet_v1_coco/ssd_mobilenet_v1_coco.md b/models/public/ssd_mobilenet_v1_coco/ssd_mobilenet_v1_coco.md index 01457733f6c..bfc7ebf90fe 100644 --- a/models/public/ssd_mobilenet_v1_coco/ssd_mobilenet_v1_coco.md +++ b/models/public/ssd_mobilenet_v1_coco/ssd_mobilenet_v1_coco.md @@ -4,8 +4,6 @@ The `ssd_mobilenet_v1_coco` model is a [Single-Shot multibox Detection (SSD)](https://arxiv.org/abs/1801.04381) network intended to perform object detection. The difference between this model and the `mobilenet-ssd` is that there the `mobilenet-ssd` can only detect face, the `ssd_mobilenet_v1_coco` model can detect objects. -## Example - ## Specification | Metric | Value | @@ -21,8 +19,6 @@ The `ssd_mobilenet_v1_coco` model is a [Single-Shot multibox Detection (SSD)](ht | ------ | ----- | | coco_precision | 23.3212%| -## Performance - ## Input ### Original model @@ -75,4 +71,4 @@ bounding boxes. For each detection, the description has the format: The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/ssd_mobilenet_v1_fpn_coco/ssd_mobilenet_v1_fpn_coco.md b/models/public/ssd_mobilenet_v1_fpn_coco/ssd_mobilenet_v1_fpn_coco.md index 420eacca34b..48b608d8219 100644 --- a/models/public/ssd_mobilenet_v1_fpn_coco/ssd_mobilenet_v1_fpn_coco.md +++ b/models/public/ssd_mobilenet_v1_fpn_coco/ssd_mobilenet_v1_fpn_coco.md @@ -4,8 +4,6 @@ MobileNetV1 FPN is used for object detection. For details, see the [paper](https://arxiv.org/abs/1807.03284). -## Example - ## Specification | Metric | Value | @@ -21,8 +19,6 @@ MobileNetV1 FPN is used for object detection. For details, see the [paper](https | ------ | ----- | | coco_precision | 35.5453%| -## Performance - ## Input ### Original Model @@ -77,4 +73,4 @@ where: The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/ssd_mobilenet_v2_coco/ssd_mobilenet_v2_coco.md b/models/public/ssd_mobilenet_v2_coco/ssd_mobilenet_v2_coco.md index 3edf24f6efe..5e9acae7151 100644 --- a/models/public/ssd_mobilenet_v2_coco/ssd_mobilenet_v2_coco.md +++ b/models/public/ssd_mobilenet_v2_coco/ssd_mobilenet_v2_coco.md @@ -8,8 +8,6 @@ The model input is a blob that consists of a single image of 1x3x300x300 in RGB The model output is a typical vector containing the tracked object data, as previously described. Note that the "class_id" data is now significant and should be used to determine the classification for any detected object. -## Example - ## Specification | Metric | Value | @@ -25,8 +23,6 @@ The model output is a typical vector containing the tracked object data, as prev | ------ | ----- | | coco_precision | 24.9452%| -## Performance - ## Input Note that original model expects image in `RGB` format, converted model - in `BGR` format. @@ -80,4 +76,4 @@ The array of summary detection information, name - `detection_out`, shape - `1, The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/ssd_resnet50_v1_fpn_coco/ssd_resnet50_v1_fpn_coco.md b/models/public/ssd_resnet50_v1_fpn_coco/ssd_resnet50_v1_fpn_coco.md index 7013e79d753..288607b8343 100644 --- a/models/public/ssd_resnet50_v1_fpn_coco/ssd_resnet50_v1_fpn_coco.md +++ b/models/public/ssd_resnet50_v1_fpn_coco/ssd_resnet50_v1_fpn_coco.md @@ -7,8 +7,6 @@ The model has been trained from the Common Objects in Context (COCO) image datas For details see the [repository](https://github.com/tensorflow/models/tree/master/research/object_detection) and [paper](https://arxiv.org/abs/1708.02002). -## Example - ## Specification | Metric | Value | @@ -24,8 +22,6 @@ and [paper](https://arxiv.org/abs/1708.02002). | ------ | ----- | | coco_precision | 38.4557% | -## Performance - ## Input ### Original model @@ -77,4 +73,4 @@ The array of summary detection information, name - `detection_out`, shape - `[1 The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/ssdlite_mobilenet_v2/ssdlite_mobilenet_v2.md b/models/public/ssdlite_mobilenet_v2/ssdlite_mobilenet_v2.md index 7a24883763a..cf826687230 100644 --- a/models/public/ssdlite_mobilenet_v2/ssdlite_mobilenet_v2.md +++ b/models/public/ssdlite_mobilenet_v2/ssdlite_mobilenet_v2.md @@ -4,8 +4,6 @@ The `ssdlite_mobilenet_v2` model is used for object detection. For details, see the [paper](https://arxiv.org/abs/1801.04381), MobileNetV2: Inverted Residuals and Linear Bottlenecks. -## Example - ## Specification | Metric | Value | @@ -21,8 +19,6 @@ The `ssdlite_mobilenet_v2` model is used for object detection. For details, see | ------ | ----- | | coco_precision | 24.2946%| -## Performance - ## Input ### Original Model @@ -75,4 +71,4 @@ bounding boxes. For each detection, the description has the format: The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/tensorflow/models/master/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../licenses/APACHE-2.0-TensorFlow.txt). +A copy of the license is provided in [APACHE-2.0-TF-Models.txt](../licenses/APACHE-2.0-TF-Models.txt). diff --git a/models/public/ssh-mxnet/accuracy-check.yml b/models/public/ssh-mxnet/accuracy-check.yml new file mode 100644 index 00000000000..75566e6506a --- /dev/null +++ b/models/public/ssh-mxnet/accuracy-check.yml @@ -0,0 +1,35 @@ +models: + - name: ssh-mxnet + launchers: + - framework: dlsdk + adapter: + type: retinaface + bboxes_outputs: + - rpn_bbox_pred_stride32 + - rpn_bbox_pred_stride16 + - rpn_bbox_pred_stride8 + scores_outputs: + - rpn_cls_prob_reshape_stride32 + - rpn_cls_prob_reshape_stride16 + - rpn_cls_prob_reshape_stride8 + keep_top_k: 1000 + nms_threshold: 0.3 + include_boundaries: True + datasets: + - name: wider + preprocessing: + - type: resize + size: 640 + postprocessing: + - type: cast_to_int + - type: clip_boxes + size: 1024 + apply_to: annotation + - type: filter + apply_to: annotation + height_range: 64, 1024 + is_empty: True + metrics: + - type: map + ignore_difficult: True + include_boundaries: True diff --git a/models/public/ssh-mxnet/model.yml b/models/public/ssh-mxnet/model.yml new file mode 100644 index 00000000000..72550166002 --- /dev/null +++ b/models/public/ssh-mxnet/model.yml @@ -0,0 +1,35 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + SSH: Single Stage Headless Face Detector. More details provided in the repository + and paper . +task_type: detection +files: + - name: ssh-model-final.zip + size: 73316283 + sha256: 1ac43c830fe8f5de069a35101cc38b03751c8502e9c62e9a945424a05e25dc6c + source: https://www.dropbox.com/s/06zmchmq4iwj6rt/ssh-model-final.zip?dl=1 +postprocessing: + - $type: unpack_archive + format: zip + file: ssh-model-final.zip +model_optimizer_args: + - --input_shape=[1,3,640,640] + - --input=data + - --input_model=$dl_dir/sshb-0000.params + - --mean_values=data[123.68,116.779,103.939] + - --reverse_input_channels +framework: mxnet +license: https://raw.githubusercontent.com/deepinsight/mxnet-SSH/master/LICENSE diff --git a/models/public/ssh-mxnet/ssh-mxnet.md b/models/public/ssh-mxnet/ssh-mxnet.md new file mode 100644 index 00000000000..9798445eb52 --- /dev/null +++ b/models/public/ssh-mxnet/ssh-mxnet.md @@ -0,0 +1,101 @@ +# ssh-mxnet + +## Use Case and High-Level Description + +SSH: Single Stage Headless Face Detector. More details provided in the [repository](https://github.com/deepinsight/mxnet-SSH) and [paper](https://arxiv.org/abs/1708.03979). + +## Specification + +| Metric | Value | +|---------------------------------------------------------------|-----------------| +| Type | Object detection| +| GFLOPs | 267.0594 | +| MParams | 19.7684 | +| Source framework | MXNet\* | + +## Accuracy + +| Metric | Value | +| ------ | ----- | +| mAP | 84.80%| + +## Input + +### Original model: +Image, name - `data` , shape - [1x3x640x640], format [BxCxHxW], where: + +- B - batch size +- C - number of channels +- H - image height +- W - image width + +Expected color order - RGB. +Mean values - [123.68, 116.779, 103.939] + +### Converted model: +Image, name - `data` , shape - [1x3x640x640], format [BxCxHxW], where: + +- B - batch size +- C - number of channels +- H - image height +- W - image width + +Expected color order - BGR. + +## Output + +### Original model +Model outputs are floating points tensors: +1. name: `rpn_cls_prob_reshape_stride32`, shape: `1, 4, 20, 20`, format: `[B, Ax2, H, W]`, represents detection scores from Feature Pyramid Network (FPN) level with stride 32 for 2 classes: background and face. + +2. name: `rpn_bbox_pred_stride32`, shape: `1, 8, 20, 20`, format: `[B, Ax4, H, W]`, represents *detection box deltas* from Feature Pyramid Network (FPN) level with stride 32. + +5. name: `rpn_cls_prob_reshape_stride16`, shape: `1, 4, 40, 40`, format: `[B, Ax2, H, W]`, represents detection scores from Feature Pyramid Network (FPN) level with stride 16 for 2 classes: background and face. + +6. name: `rpn_bbox_pred_stride16`, shape: `1, 8, 40, 40`, format: `[B, Ax4, H, W]`, represents *detection box deltas* from Feature Pyramid Network (FPN) level with stride 16. + +9. name: `rpn_cls_prob_reshape_stride8`, shape: `1, 4, 80, 80`, format: `[B, Ax2, H, W]`, represents detection scores from Feature Pyramid Network (FPN) level with stride 8 for 2 classes: background and face. + +10. name: `rpn_bbox_pred_stride8`, shape: `1, 8, 80, 80`, format: `[B, Ax4, H, W]`, represents detection box deltas from Feature Pyramid Network (FPN) level with stride 8. + +For each output format: +- `B` - batch size +- `A` - number of anchors +- `H` - feature height +- `W` - feature width + +Detection box deltas have format `[dx, dy, dh, dw]`, where: +- `(dx, dy)` - regression for left-upper corner of bounding box, +- `(dh, dw)` - regression by height and width of bounding box. + +### Converted model +The converted model has the same parameters as the original model. + +## Legal Information + +The original model is distributed under the following +[license](https://raw.githubusercontent.com/deepinsight/mxnet-SSH/master/LICENSE): + +``` +MIT License + +Copyright (c) 2018 Deep Insight + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +``` diff --git a/models/public/vehicle-license-plate-detection-barrier-0123/description/vehicle-license-plate-detection-barrier-0123.md b/models/public/vehicle-license-plate-detection-barrier-0123/description/vehicle-license-plate-detection-barrier-0123.md index 60c3325def9..53bbc85ef1a 100644 --- a/models/public/vehicle-license-plate-detection-barrier-0123/description/vehicle-license-plate-detection-barrier-0123.md +++ b/models/public/vehicle-license-plate-detection-barrier-0123/description/vehicle-license-plate-detection-barrier-0123.md @@ -26,8 +26,6 @@ Average Precision (AP) is defined as an area under the [precision/recall](https://en.wikipedia.org/wiki/Precision_and_recall) curve. Validation dataset is BIT-Vehicle. -## Performance - ## Input ### Original Model @@ -81,6 +79,6 @@ The net outputs a blob with the shape: [1, 1, N, 7], where N is the number of de ## Legal Information The original model is distributed under the [Apache License, Version 2.0](https://raw.githubusercontent.com/opencv/openvino_training_extensions/develop/LICENSE). -A copy of the license is provided in [APACHE-2.0-TensorFlow.txt](../../licenses/APACHE-2.0.txt). +A copy of the license is provided in [APACHE-2.0.txt](../../licenses/APACHE-2.0.txt). [*] Other names and brands may be claimed as the property of others. diff --git a/models/public/vehicle-reid-0001/vehicle-reid-0001.md b/models/public/vehicle-reid-0001/vehicle-reid-0001.md index e12e17d7e26..10e369928e2 100644 --- a/models/public/vehicle-reid-0001/vehicle-reid-0001.md +++ b/models/public/vehicle-reid-0001/vehicle-reid-0001.md @@ -27,8 +27,6 @@ Mean Average Precision (mAP) is the mean across Average Precision (AP) of all qu AP is defined as the area under the [precision and recall](https://en.wikipedia.org/wiki/Precision_and_recall) curve. -## Performance - ## Input ### Original Model diff --git a/models/public/vgg16/vgg16.md b/models/public/vgg16/vgg16.md index 548d741e10c..ffb358d424e 100644 --- a/models/public/vgg16/vgg16.md +++ b/models/public/vgg16/vgg16.md @@ -8,8 +8,6 @@ The model input is a blob that consists of a single image of "1x3x224x224" in BG The model output for `vgg16` is the typical object classifier output for the 1000 different classifications matching those in the ImageNet database. -## Example - ## Specification | Metric | Value | @@ -26,8 +24,6 @@ The model output for `vgg16` is the typical object classifier output for the 100 | Top 1 | 70.968%| | Top 5 | 89.878%| -## Performance - ## Input ### Original mode diff --git a/models/public/vgg19-caffe2/vgg19-caffe2.md b/models/public/vgg19-caffe2/vgg19-caffe2.md index 00321351696..784661bbe9b 100644 --- a/models/public/vgg19-caffe2/vgg19-caffe2.md +++ b/models/public/vgg19-caffe2/vgg19-caffe2.md @@ -6,7 +6,6 @@ This is a Caffe2\* version of `vgg19` model, designed to perform image classific This model was converted from Caffe\* to Caffe2\* format. For details see repository , paper . -## Example ## Specification @@ -24,8 +23,6 @@ paper . | Top 1 | 71.062%| | Top 5 | 89.832%| -## Performance - ## Input ### Original mode diff --git a/models/public/vgg19/vgg19.md b/models/public/vgg19/vgg19.md index 1ad436f517c..99fe4f67947 100644 --- a/models/public/vgg19/vgg19.md +++ b/models/public/vgg19/vgg19.md @@ -8,8 +8,6 @@ The model input is a blob that consists of a single image of 1x3x224x224 in BGR The model output for `vgg19` is the typical object classifier output for the 1000 different classifications matching those in the ImageNet database. -## Example - ## Specification | Metric | Value | @@ -26,8 +24,6 @@ The model output for `vgg19` is the typical object classifier output for the 100 | Top 1 | 71.062%| | Top 5 | 89.832%| -## Performance - ## Input ### Original mode diff --git a/models/public/wavernn/0001-Added-batch-norm-fusing-to-conv-layers.patch b/models/public/wavernn/0001-Added-batch-norm-fusing-to-conv-layers.patch new file mode 100644 index 00000000000..925d3cb2ccc --- /dev/null +++ b/models/public/wavernn/0001-Added-batch-norm-fusing-to-conv-layers.patch @@ -0,0 +1,139 @@ +diff --git a/models/fatchord_version.py b/models/fatchord_version.py +index d43e6ad..e5f7591 100644 +--- a/models/fatchord_version.py ++++ b/models/fatchord_version.py +@@ -10,6 +10,28 @@ from pathlib import Path + from typing import Union + + ++def fuse(conv, bn): ++ w = conv.weight ++ mean = bn.running_mean ++ var_sqrt = torch.sqrt(bn.running_var + bn.eps) ++ beta = bn.weight ++ gamma = bn.bias ++ if conv.bias is not None: ++ b = conv.bias ++ else: ++ b = mean.new_zeros(mean.shape) ++ w = w * (beta / var_sqrt).reshape([conv.out_channels, 1, 1]) ++ b = (b - mean)/var_sqrt * beta + gamma ++ fused_conv = nn.Conv1d(conv.in_channels, ++ conv.out_channels, ++ conv.kernel_size, ++ conv.stride, ++ conv.padding, ++ bias=True) ++ fused_conv.weight = nn.Parameter(w) ++ fused_conv.bias = nn.Parameter(b) ++ return fused_conv ++ + class ResBlock(nn.Module): + def __init__(self, dims): + super().__init__() +@@ -17,16 +39,28 @@ class ResBlock(nn.Module): + self.conv2 = nn.Conv1d(dims, dims, kernel_size=1, bias=False) + self.batch_norm1 = nn.BatchNorm1d(dims) + self.batch_norm2 = nn.BatchNorm1d(dims) ++ self.fused = False + + def forward(self, x): + residual = x +- x = self.conv1(x) +- x = self.batch_norm1(x) +- x = F.relu(x) +- x = self.conv2(x) +- x = self.batch_norm2(x) ++ ++ if self.fused: ++ x = self.conv1_f(x) ++ x = F.relu(x) ++ x = self.conv2_f(x) ++ else: ++ x = self.conv1(x) ++ x = self.batch_norm1(x) ++ x = F.relu(x) ++ x = self.conv2(x) ++ x = self.batch_norm2(x) + return x + residual + ++ def fuse(self): ++ self.conv1_f = fuse(self.conv1, self.batch_norm1) ++ self.conv2_f = fuse(self.conv2, self.batch_norm2) ++ self.fused = True ++ + + class MelResNet(nn.Module): + def __init__(self, res_blocks, in_dims, compute_dims, res_out_dims, pad): +@@ -38,27 +72,34 @@ class MelResNet(nn.Module): + for i in range(res_blocks): + self.layers.append(ResBlock(compute_dims)) + self.conv_out = nn.Conv1d(compute_dims, res_out_dims, kernel_size=1) ++ self.fused = False + + def forward(self, x): +- x = self.conv_in(x) +- x = self.batch_norm(x) ++ if self.fused: ++ x = self.conv_in_f(x) ++ else: ++ x = self.conv_in(x) ++ x = self.batch_norm(x) + x = F.relu(x) + for f in self.layers: x = f(x) + x = self.conv_out(x) + return x + ++ def fuse(self): ++ self.conv_in_f = fuse(self.conv_in, self.batch_norm) ++ self.fused = True ++ ++ for l in self.layers: ++ l.fuse() + +-class Stretch2d(nn.Module): +- def __init__(self, x_scale, y_scale): ++ ++class StretchUpsample(nn.Module): ++ def __init__(self, x_scale): + super().__init__() +- self.x_scale = x_scale +- self.y_scale = y_scale ++ self.upsample = nn.Upsample(scale_factor=x_scale) + + def forward(self, x): +- b, c, h, w = x.size() +- x = x.unsqueeze(-1).unsqueeze(3) +- x = x.repeat(1, 1, 1, self.y_scale, 1, self.x_scale) +- return x.view(b, c, h * self.y_scale, w * self.x_scale) ++ return self.upsample(x) + + + class UpsampleNetwork(nn.Module): +@@ -68,12 +109,12 @@ class UpsampleNetwork(nn.Module): + total_scale = np.cumproduct(upsample_scales)[-1] + self.indent = pad * total_scale + self.resnet = MelResNet(res_blocks, feat_dims, compute_dims, res_out_dims, pad) +- self.resnet_stretch = Stretch2d(total_scale, 1) ++ self.resnet_stretch = StretchUpsample((1,total_scale)) + self.up_layers = nn.ModuleList() + for scale in upsample_scales: + k_size = (1, scale * 2 + 1) + padding = (0, scale) +- stretch = Stretch2d(scale, 1) ++ stretch = StretchUpsample((1, scale)) + conv = nn.Conv2d(1, 1, kernel_size=k_size, padding=padding, bias=False) + conv.weight.data.fill_(1. / k_size[1]) + self.up_layers.append(stretch) +@@ -88,6 +129,9 @@ class UpsampleNetwork(nn.Module): + m = m.squeeze(1)[:, :, self.indent:-self.indent] + return m.transpose(1, 2), aux.transpose(1, 2) + ++ def fuse(self): ++ self.resnet.fuse() ++ + + class WaveRNN(nn.Module): + def __init__(self, rnn_dims, fc_dims, bits, pad, upsample_factors, +-- +2.7.4 diff --git a/models/public/wavernn/description/wavernn.md b/models/public/wavernn/description/wavernn.md new file mode 100644 index 00000000000..7612f60439a --- /dev/null +++ b/models/public/wavernn/description/wavernn.md @@ -0,0 +1,131 @@ +# wavernn (composite) + +## Use Case and High-Level Description + +WaveRNN is a model for the text-to-speech task originally trained in PyTorch\* +then converted to ONNX\* format. The model was trained on LJSpeech dataset. +WaveRNN performs waveform regression from mel-spectrogram. +For details see [paper](https://arxiv.org/abs/1703.10135), [repository](https://github.com/as-ideas/ForwardTacotron). + +## ONNX Models +We provide pretrained models in ONNX format for user convenience. + +### Steps to Reproduce PyTorch to ONNX Conversion +Model is provided in ONNX format, which was obtained by the following steps. + +1. Clone the original repository +```sh +git clone https://github.com/as-ideas/ForwardTacotron +cd ForwardTacotron +``` +2. Checkout the commit that the conversion was tested on: +```sh +git checkout 78789c1aa845057bb2f799e702b1be76bf7defd0 +``` +3. Follow README.md and preprocess LJSpeech dataset. +4. Copy provided script `wavernn_to_onnx.py` to ForwardTacotron root directory, and apply git patch `0001-Added-batch-norm-fusing-to-conv-layers.patch`. +5. Download WaveRNN model from https://github.com/fatchord/WaveRNN/tree/master/pretrained/ and extract in to pretrained directory. +```sh +mkdir pretrained +wget https://raw.githubusercontent.com/fatchord/WaveRNN/master/pretrained/ljspeech.wavernn.mol.800k.zip +unzip ljspeech.wavernn.mol.800k.zip -d pretrained && mv pretrained/latest_weights.pyt pretrained/wave_800K.pyt +``` +6. Run provided script for conversion WaveRNN to onnx format +```sh +python3 wavernn_to_onnx.py --mel /mel/LJ008-0254.npy --voc_weights pretrained/wave_800K.pyt --hp_file hparams.py --batched +``` +Note: by the reason of autoregressive nature of the network, the model is divided into two parts: `wavernn_upsampler.onnx, wavernn_rnn.onnx`. The first part expands feature map by the time dimension, and the second one iteratively processes every column in expanded feature map. + +## Composite model specification + +| Metric | Value | +|---------------------------------|-------------------------------------------| +| Source framework | PyTorch* | + +### Accuracy + +Subjective + +## wavernn-upsampler model specification + +The wavernn-upsampler model accepts mel-spectrogram and produces two feature map: the first one expands mel-spectrogram in one step using Upsample layer and sequence of convolutions, and the second one expands mel-spectrogram in three steps using sequence of Upsample layers and of convolutions. + +| Metric | Value | +|---------------------------------|-------------------------------------------| +| GOPs | 0.37 | +| MParams | 0.4 | + +### Input + +Mel-spectrogram, name: `mels`, shape: [1x200x80], format: [BxTxC] +where: + + - B - batch size + - T - time in mel-spectrogram + - C - number of mels in mel-spectrogram + +### Output + +1. Processed mel-spectrogram, name: `aux`, shape: [1x53888x128], format: [BxTxC] +where: + - B - batch size + - T - time in audio (equal to `time in mel spectrogram` * `hop_length`) + - C - number of features in processed mel-spectrogram. + +2. Upsampled and processed (by time) mel-spectrogram, name: `upsample_mels`, shape: [1x55008x80], format: [BxT'xC] +where: + - B - batch size + - T' - time in audio padded with number of samples for crossfading between batches + - C - number of mels in mel-spectrogram + + +## wavernn-rnn model specification +The wavernn-rnn model accepts two feature maps from wavernn-upsampler and produces parameters for mixture of logistics distribution that is used for audio regression by B samples per forward step, where B is batch size. + +| Metric | Value | +|---------------------------------|-------------------------------------------| +| GOps | 0.06 | +| MParams | 3.83 | + +### Input +1. Time slice in `upsampled_mels`, name: `m_t`. Shape: [Bx80] +2. Time/space slices in `aux`, name: `a1_t`, `a2_t`, `a3_t`,`a4_t`. Shape: [Bx32]. Second dimension is 32 = aux.shape[1] / 4 +3. Hidden states for GRU layers in autoregression, name `h1.1`, `h2.1`. Shape: [Bx512]. +4. Previous prediction for autoregression (initially equal to zero), name: `x`. Shape: [Bx1] + +Note: B - batch size. + +### Output +1. Hidden states for GRU layers in autoregression, name `h1`, `h2`. Shape: [Bx512]. +2. Parameters for mixture of logistics distribution, name: `logits`. Shape: [Bx30]. Can be divided to parameters of mixture of logistic distributions: probabilities = logits[:, :10], means = logits[:, 10:20], scales = logits[:, 20:30]. + +Note: B - batch size. + +### Legal Information + +The original model is distributed under the following +[license](https://github.com/fatchord/WaveRNN/blob/master/LICENSE.txt) + +``` +MIT License + +Copyright (c) 2019 fatchord (https://github.com/fatchord) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +``` diff --git a/models/public/wavernn/wavernn-rnn/accuracy-check.yml b/models/public/wavernn/wavernn-rnn/accuracy-check.yml new file mode 100644 index 00000000000..f0843c8c9a1 --- /dev/null +++ b/models/public/wavernn/wavernn-rnn/accuracy-check.yml @@ -0,0 +1,41 @@ +models: + - name: wavernn-rnn + launchers: + - framework: dlsdk + adapter: + type: multi_output_regression + outputs: + - h1 + - h2 + - logits + inputs: + - name: a1_t + type: INPUT + value: .*a1_t + - name: a2_t + type: INPUT + value: .*a2_t + - name: a3_t + type: INPUT + value: .*a3_t + - name: a4_t + type: INPUT + value: .*a4_t + - name: h1.1 + type: INPUT + value: .*h1* + - name: h2.1 + type: INPUT + value: .*h2* + - name: m_t + type: INPUT + value: .*m_t + - name: x + type: INPUT + value: .*x + allow_reshape_input: True + datasets: + - name: wavernn-io + metrics: + - type: mae + presenter: print_vector diff --git a/models/public/wavernn/wavernn-rnn/model.yml b/models/public/wavernn/wavernn-rnn/model.yml new file mode 100644 index 00000000000..7ccac4fbff9 --- /dev/null +++ b/models/public/wavernn/wavernn-rnn/model.yml @@ -0,0 +1,33 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + WaveRNN model for text to speech task. Part for waveform autoregression. +task_type: text_to_speech +files: + - name: wavernn-rnn.zip + size: 14297518 + sha256: bcde8bb9cda28092e2356d38856c35a2ca33531294b65fcb7ea9f432f041960c + source: https://download.01.org/opencv/public_models/102020/wavernn/wavernn-rnn.zip +postprocessing: + - $type: unpack_archive + format: zip + file: wavernn-rnn.zip +model_optimizer_args: + - --input=m_t,a1_t,a2_t,a3_t,a4_t,h1.1,h2.1,x + - --output=logits,h1,h2 + - --input_model=$dl_dir/wavernn-rnn/wavernn_rnn.onnx +framework: onnx + +license: https://github.com/fatchord/WaveRNN/blob/master/LICENSE.txt diff --git a/models/public/wavernn/wavernn-upsampler/accuracy-check.yml b/models/public/wavernn/wavernn-upsampler/accuracy-check.yml new file mode 100644 index 00000000000..e6df2e4828d --- /dev/null +++ b/models/public/wavernn/wavernn-upsampler/accuracy-check.yml @@ -0,0 +1,26 @@ +models: + - name: wavernn-upsampler + launchers: + - framework: dlsdk + adapter: + type: multi_output_regression + outputs: + - aux + - upsample_mels + inputs: + - name: mels + type: INPUT + layout: NHWC + allow_reshape_input: True + datasets: + - name: wavernn-io-upsampler + data_source: wavernn_io/upsampler + reader: numpy_dict_reader + annotation_conversion: + converter: multi_feature_regression + data_dir: wavernn_io/upsampler + input_suffix: in + reference_suffix: out + metrics: + - type: mae + presenter: print_vector diff --git a/models/public/wavernn/wavernn-upsampler/model.yml b/models/public/wavernn/wavernn-upsampler/model.yml new file mode 100644 index 00000000000..21dde0564d4 --- /dev/null +++ b/models/public/wavernn/wavernn-upsampler/model.yml @@ -0,0 +1,34 @@ +# Copyright (c) 2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: >- + WaveRNN model for text to speech task. Part for mel-spectrogram upsampling by time axis. +task_type: text_to_speech +files: + - name: wavernn-upsampler.zip + size: 1496559 + sha256: f6f3982f785ab2d78a30d8c08fef952c2bfaa89a835c15cd7c27798ff0b6d2c9 + source: https://download.01.org/opencv/public_models/102020/wavernn/wavernn-upsampler.zip +postprocessing: + - $type: unpack_archive + format: zip + file: wavernn-upsampler.zip +model_optimizer_args: + - --input_shape=[1, 200, 80] + - --input=mels + - --output=upsample_mels,aux + - --input_model=$dl_dir/wavernn-upsampler/wavernn_upsampler.onnx +framework: onnx + +license: https://github.com/fatchord/WaveRNN/blob/master/LICENSE.txt diff --git a/models/public/wavernn/wavernn_to_onnx.py b/models/public/wavernn/wavernn_to_onnx.py new file mode 100755 index 00000000000..fe405064455 --- /dev/null +++ b/models/public/wavernn/wavernn_to_onnx.py @@ -0,0 +1,192 @@ +#!/usr/bin/env python3 +import os +import argparse + +import numpy as np +import torch +import torch.nn as nn +from torch.nn import functional as F + +from models.fatchord_version import WaveRNN +from utils import hparams as hp + +################################################################################################## + +class WaveRNNUpsamplerONNX(nn.Module): + def __init__(self, model, batched, target, overlap): + super().__init__() + model.upsample.fuse() + self.model = model + self.batched = batched + self.target = target + self.overlap = overlap + + def pad_tensor(self, mels): + mels = self.model.pad_tensor(mels.transpose(1, 2), pad=self.model.pad, side='both') + return mels + + def fold(self, mels, aux): + if self.batched: + mels = self.model.fold_with_overlap(mels, self.target, self.overlap) + aux = self.model.fold_with_overlap(aux, self.target, self.overlap) + return mels, aux + + def forward(self, mels): + mels = mels.transpose(1, 2) + aux = self.model.upsample.resnet(mels) + aux = aux.unsqueeze(1) + aux = self.model.upsample.resnet_stretch(aux) + aux = aux.squeeze(1) + upsample_mels = mels.unsqueeze(1) + for f in self.model.upsample.up_layers: + upsample_mels = f(upsample_mels) + + return upsample_mels.squeeze(1).transpose(1, 2), aux.transpose(1, 2) + + +class WaveRNNONNX(nn.Module): + def __init__(self, model): + super().__init__() + self.model = model + self.rnn1 = self.model.get_gru_cell(self.model.rnn1) + self.rnn2 = self.model.get_gru_cell(self.model.rnn2) + + def get_initial_parameters(self, mels): + device = next(self.model.parameters()).device + b_size, seq_len, _ = mels.size() + + h1 = torch.zeros(b_size, self.model.rnn_dims, device=device) + h2 = torch.zeros(b_size, self.model.rnn_dims, device=device) + x = torch.zeros(b_size, 1, device=device) + + return h1, h2, x + + def split_aux(self, aux): + d = self.model.aux_dims + aux_split = [aux[:, :, d * i:d * (i + 1)] for i in range(4)] + return aux_split + + def forward(self, m_t, a1_t, a2_t, a3_t, a4_t, h1, h2, x): + return self.infer(m_t, a1_t, a2_t, a3_t, a4_t, h1, h2, x) + + def infer(self, m_t, a1_t, a2_t, a3_t, a4_t, h1, h2, x): + """ + implement one step forward pass from WaveRNN fatchord version + :return: + """ + x = torch.cat([x, m_t, a1_t], dim=1) + x = self.model.I(x) + h1 = self.rnn1(x, h1) + + x = x + h1 + inp = torch.cat([x, a2_t], dim=1) + h2 = self.rnn2(inp, h2) + + x = x + h2 + x = torch.cat([x, a3_t], dim=1) + x = F.relu(self.model.fc1(x)) + + x = torch.cat([x, a4_t], dim=1) + x = F.relu(self.model.fc2(x)) + + logits = self.model.fc3(x) + + return logits, h1, h2 + +################################################################################################## + +def main(): + # Parse Arguments + parser = argparse.ArgumentParser(description='TTS Generator') + + parser.add_argument('--mel', type=str, help='[string/path] path to test mel file') + + parser.add_argument('--hp_file', metavar='FILE', default='hparams.py', + help='The file to use for the hyperparameters') + + parser.add_argument('--batched', '-b', dest='batched', action='store_true', help='Fast Batched Generation') + + parser.add_argument('--voc_weights', type=str, help='[string/path] Load in different FastSpeech weights', default="pretrained/wave_800K.pyt") + + args = parser.parse_args() + + if not os.path.exists('onnx'): + os.mkdir('onnx') + + hp.configure(args.hp_file) + + device = torch.device('cpu') + print('Using device:', device) + + ##### + print('\nInitialising WaveRNN Model...\n') + # Instantiate WaveRNN Model + voc_model = WaveRNN(rnn_dims=hp.voc_rnn_dims, + fc_dims=hp.voc_fc_dims, + bits=hp.bits, + pad=hp.voc_pad, + upsample_factors=hp.voc_upsample_factors, + feat_dims=hp.num_mels, + compute_dims=hp.voc_compute_dims, + res_out_dims=hp.voc_res_out_dims, + res_blocks=hp.voc_res_blocks, + hop_length=hp.hop_length, + sample_rate=hp.sample_rate, + mode=hp.voc_mode).to(device) + + voc_load_path = args.voc_weights + voc_model.load(voc_load_path) + + voc_upsampler = WaveRNNUpsamplerONNX(voc_model, args.batched, hp.voc_target, hp.voc_overlap) + voc_infer = WaveRNNONNX(voc_model) + + voc_model.eval() + voc_upsampler.eval() + voc_infer.eval() + + + opset_version = 11 + + with torch.no_grad(): + mels = np.load(args.mel) + mels = torch.from_numpy(mels) + mels = mels.unsqueeze(0) + mels = voc_upsampler.pad_tensor(mels) + + mels_onnx = mels.clone() + + torch.onnx.export(voc_upsampler, mels_onnx, "./onnx/wavernn_upsampler.onnx", + opset_version=opset_version, + do_constant_folding=True, + input_names=["mels"], + output_names=["upsample_mels", "aux"]) + + + mels, aux = voc_upsampler(mels) + mels = mels[:, 550:-550, :] + + mels, aux = voc_upsampler.fold(mels, aux) + + h1, h2, x = voc_infer.get_initial_parameters(mels) + + aux_split = voc_infer.split_aux(aux) + + b_size, seq_len, _ = mels.size() + + if seq_len: + m_t = mels[:, 0, :] + + a1_t, a2_t, a3_t, a4_t = \ + (a[:, 0, :] for a in aux_split) + + rnn_input = (m_t, a1_t, a2_t, a3_t, a4_t, h1, h2, x) + torch.onnx.export(voc_infer, rnn_input, "./onnx/wavernn_rnn.onnx", + opset_version=opset_version, + do_constant_folding=True, + input_names=["m_t", "a1_t", "a2_t", "a3_t", "a4_t", "h1", "h2", "x"], + output_names=["logits", "h1", "h2"]) + + print('Done!') + +if __name__ == '__main__': + main() diff --git a/models/public/yolact-resnet50-fpn-pytorch/model.yml b/models/public/yolact-resnet50-fpn-pytorch/model.yml index 62f719d5aaf..b5acee67895 100644 --- a/models/public/yolact-resnet50-fpn-pytorch/model.yml +++ b/models/public/yolact-resnet50-fpn-pytorch/model.yml @@ -97,8 +97,8 @@ conversion_to_onnx_args: - --output-names=conf,mask,proto,boxes model_optimizer_args: - --input=input.1 - - --mean_values=input.1[123.675,116.28,103.53] - - --scale_values=input.1[51.525,50.4,50.625] + - --mean_values=input.1[123.675,116.78,103.94] + - --scale_values=input.1[58.395,57.12,57.375] - --reverse_input_channels - --output=conf,mask,proto,boxes - --input_model=$conv_dir/yolact-resnet50-fpn.onnx diff --git a/models/public/yolact-resnet50-fpn-pytorch/yolact-resnet50-fpn-pytorch.md b/models/public/yolact-resnet50-fpn-pytorch/yolact-resnet50-fpn-pytorch.md index 830557a5743..b2acf8c11d1 100644 --- a/models/public/yolact-resnet50-fpn-pytorch/yolact-resnet50-fpn-pytorch.md +++ b/models/public/yolact-resnet50-fpn-pytorch/yolact-resnet50-fpn-pytorch.md @@ -5,8 +5,6 @@ YOLACT ResNet 50 is a simple, fully convolutional model for real-time instance segmentation described in "YOLACT: Real-time Instance Segmentation" [paper](https://arxiv.org/abs/1904.02689). Model pretrained in Pytorch\* on COCO dataset. For details, see the [repository](https://github.com/dbolya/yolact). -## Example - ## Specification | Metric | Value | @@ -23,8 +21,6 @@ For details, see the [repository](https://github.com/dbolya/yolact). | AP@masks | 28.00% | | AP@boxes | 30.69% | -## Performance - ## Input ### Original Model @@ -38,7 +34,7 @@ Image, name: `input.1`, shape: [1x3x550x550], format: [BxCxHxW], - C - number of channels Expected color order: `RGB`. - Mean values - [123.675,116.28,103.53], scale values - [58.395,57.12,57.375]. + Mean values - [123.675,116.78,103.94], scale values - [58.395,57.12,57.375]. ### Converted Model diff --git a/models/public/yolo-v1-tiny-tf/accuracy-check.yml b/models/public/yolo-v1-tiny-tf/accuracy-check.yml index 99ba552a55b..7c32399c79a 100644 --- a/models/public/yolo-v1-tiny-tf/accuracy-check.yml +++ b/models/public/yolo-v1-tiny-tf/accuracy-check.yml @@ -3,8 +3,6 @@ models: launchers: - framework: tf - tags: - - FP32 model: yolo-v1-tiny.pb inputs: - name: 'input_1' diff --git a/models/public/yolo-v2-tf/yolo-v2-tf.md b/models/public/yolo-v2-tf/yolo-v2-tf.md index 89808c648ed..4727a85ed03 100644 --- a/models/public/yolo-v2-tf/yolo-v2-tf.md +++ b/models/public/yolo-v2-tf/yolo-v2-tf.md @@ -42,8 +42,6 @@ Accuracy metrics obtained on COCO\* validation dataset for converted model. | mAP | 53.15% | | [COCO\* mAP](https://cocodataset.org/#detection-eval) | 56.5% | -## Performance - ## Input ### Original model diff --git a/models/public/yolo-v2-tiny-tf/accuracy-check.yml b/models/public/yolo-v2-tiny-tf/accuracy-check.yml index 4611af7a00e..a4f8ca2fba8 100644 --- a/models/public/yolo-v2-tiny-tf/accuracy-check.yml +++ b/models/public/yolo-v2-tiny-tf/accuracy-check.yml @@ -3,8 +3,6 @@ models: launchers: - framework: tf - tags: - - FP32 model: yolo-v2-tiny.pb adapter: type: yolo_v2 diff --git a/models/public/yolo-v2-tiny-tf/pre-convert.py b/models/public/yolo-v2-tiny-tf/pre-convert.py index 680980c36f9..7f12b5d3cf0 100755 --- a/models/public/yolo-v2-tiny-tf/pre-convert.py +++ b/models/public/yolo-v2-tiny-tf/pre-convert.py @@ -38,7 +38,7 @@ def main(): str(args.input_dir / 'keras-YOLOv3-model-set/tools/model_converter/keras_to_tensorflow.py'), '--input_model={}'.format(args.output_dir / 'yolo-v2-tiny.h5'), '--output_model={}'.format(args.output_dir / 'yolo-v2-tiny.pb'), - ], check=True); + ], check=True) if __name__ == '__main__': main() diff --git a/models/public/yolo-v3-tiny-tf/accuracy-check.yml b/models/public/yolo-v3-tiny-tf/accuracy-check.yml index 918dafd6346..c264e30a05d 100644 --- a/models/public/yolo-v3-tiny-tf/accuracy-check.yml +++ b/models/public/yolo-v3-tiny-tf/accuracy-check.yml @@ -1,5 +1,5 @@ models: - - name: yolo_v3_tiny_tf + - name: yolo-v3-tiny-tf launchers: - framework: tf model: yolo-v3-tiny.pb @@ -54,7 +54,7 @@ models: max_detections: 100 threshold: 0.5 - - name: yolo_v3_tiny + - name: yolo-v3-tiny-tf launchers: - framework: dlsdk diff --git a/models/public/yolo-v3-tiny-tf/yolo-v3-tiny-tf.md b/models/public/yolo-v3-tiny-tf/yolo-v3-tiny-tf.md index 04912f4deb2..a44763296ea 100644 --- a/models/public/yolo-v3-tiny-tf/yolo-v3-tiny-tf.md +++ b/models/public/yolo-v3-tiny-tf/yolo-v3-tiny-tf.md @@ -6,8 +6,6 @@ YOLO v3 Tiny is a real-time object detection model implemented with Keras\* from ## Conversion -## Conversion - 1. Download or clone the original [repository](https://github.com/david8862/keras-YOLOv3-model-set) (tested on `d38c3d8` commit). 2. Use the following commands to get original model (named `yolov3_tiny` in repository) and convert it to Keras\* format (see details in the [README.md](https://github.com/david8862/keras-YOLOv3-model-set/blob/d38c3d865f7190ee9b19a30e91f2b750a31320c1/README.md) file in the official repository): diff --git a/models/public/yolo-v4-tf/accuracy-check.yml b/models/public/yolo-v4-tf/accuracy-check.yml index 22ca9ce7a6b..a7fcabcebda 100644 --- a/models/public/yolo-v4-tf/accuracy-check.yml +++ b/models/public/yolo-v4-tf/accuracy-check.yml @@ -1,5 +1,5 @@ models: - - name: yolo_v4_tf + - name: yolo-v4-tf launchers: - framework: tf model: yolo-v4.pb @@ -59,7 +59,7 @@ models: max_detections: 100 threshold: '0.5:0.05:0.95' - - name: yolo_v4 + - name: yolo-v4-tf launchers: - framework: dlsdk adapter: diff --git a/tools/accuracy_checker/.yamllint b/tools/accuracy_checker/.yamllint deleted file mode 120000 index 4a4652c1f5b..00000000000 --- a/tools/accuracy_checker/.yamllint +++ /dev/null @@ -1 +0,0 @@ -../../.yamllint \ No newline at end of file diff --git a/tools/accuracy_checker/README.md b/tools/accuracy_checker/README.md index 468d765e56e..fee6c3d8635 100644 --- a/tools/accuracy_checker/README.md +++ b/tools/accuracy_checker/README.md @@ -167,11 +167,12 @@ Each launcher configuration starts with setting `framework` name. Currently *caf Please view: - [How to configure Caffe launcher](accuracy_checker/launcher/caffe_launcher_readme.md) -- [How to configure DLSDK launcher](accuracy_checker/launcher/dlsdk_launcher_readme.md) +- [How to configure OpenVINO launcher](accuracy_checker/launcher/dlsdk_launcher_readme.md) - [How to configure OpenCV launcher](accuracy_checker/launcher/opencv_launcher_readme.md) - [How to configure MXNet Launcher](accuracy_checker/launcher/mxnet_launcher_readme.md) - [How to configure TensorFlow Launcher](accuracy_checker/launcher/tf_launcher_readme.md) - [How to configure TensorFlow Lite Launcher](accuracy_checker/launcher/tf_lite_launcher_readme.md) +- [How to configure TensorFlow 2.0 Launcher](accuracy_checker/launcher/tf2_launcher_readme.md) - [How to configure ONNX Runtime Launcher](accuracy_checker/launcher/onnx_runtime_launcher_readme.md) - [How to configure PyTorch Launcher](accuracy_checker/launcher/pytorch_launcher_readme.md) @@ -182,7 +183,7 @@ all required preprocessing and postprocessing/filtering steps, and metrics that will be used for evaluation. If your dataset data is a well-known competition problem (COCO, Pascal VOC, and others) and/or can be potentially reused for other models -it is reasonable to declare it in some global configuration file (*definition* file). This way in your local configuration file you can provide only +it is reasonable to declare it in some global configuration file ([definition file](dataset_definitions.yml)). This way in your local configuration file you can provide only `name` and all required steps will be picked from global one. To pass path to this global configuration use `--definition` argument of CLI. If you want to evaluate models using prepared config files and well-known datasets, you need to organize folders with validation datasets in a certain way. More detailed information about dataset preparation you can find in Dataset Preparation Guide. diff --git a/tools/accuracy_checker/accuracy_checker/__init__.py b/tools/accuracy_checker/accuracy_checker/__init__.py index 3f317e12d38..33e1d292eca 100644 --- a/tools/accuracy_checker/accuracy_checker/__init__.py +++ b/tools/accuracy_checker/accuracy_checker/__init__.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,4 +14,4 @@ limitations under the License. """ -__version__ = "0.8.1" +__version__ = "0.8.4" diff --git a/tools/accuracy_checker/accuracy_checker/adapters/README.md b/tools/accuracy_checker/accuracy_checker/adapters/README.md index 0a74adaaf37..1016c9d035e 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/README.md +++ b/tools/accuracy_checker/accuracy_checker/adapters/README.md @@ -28,6 +28,7 @@ AccuracyChecker supports following set of adapters: * `tiny_yolo_v1` - converting output of Tiny YOLO v1 model to `DetectionPrediction` representation. * `reid` - converting output of reidentification model to `ReIdentificationPrediction` representation. * `grn_workaround` - enabling processing output with adding Global Region Normalization layer. + * `joining_method` - method used to join embeddings (optional, supported methods are `sum` and `concatenation`, default - `sum`). * `yolo_v2` - converting output of YOLO v2 family models to `DetectionPrediction` representation. * `classes` - number of detection classes (default 20). * `anchors` - anchor values provided as comma-separated list or one of precomputed: @@ -96,6 +97,19 @@ AccuracyChecker supports following set of adapters: * `post_nms_top_k` - final number of detections after NMS applied (Optional, default 100). * `nms_threshold` - threshold for NMS (Optional, default 0.5). * `min_conf` - minimal confidence threshold for detections (Optional, default 0.05). +* `retinanet_tf2` - converting output of RetinaNet-based model from TensorFlow 2 official implementation. + * `boxes_outputs` - list of outputs with boxes. + * `class_outputs` - list of outputs with class probabilities. + **Important note: the number of boxes outputs and class outputs should be equal.** + * `aspect_ratios` - the list of aspect ratios for anchor generation (Optional, default [1.0, 2.0, 0.5]). + * `min_level` - minimal pyramid level (Optional, default 3). + * `max_level` - maximal pyramid level (Optional, default 7). + * `num_scales` - number of anchor scales (Optional, default 3). + * `anchor_size` - size of anchor box (Optional, default 4). + * `pre_nms_top_k` - keep top k boxes before NMS applied (Optional, default 5000). + * `total_size` - final number of detections after NMS applied (Optional, default 100). + * `nms_threshold` - threshold for NMS (Optional, default 0.5). + * `score_threshold` - minimal confidence threshold for detections (Optional, default 0.05). * `rfcn_class_agnostic` - convert output of Caffe RFCN model with agnostic bounding box regression approach. * `cls_out` - the name of output layer with detected probabilities for each class. The layer shape is [num_boxes, num_classes], where `num_boxes` is number of predicted boxes, `num_classes` - number of classes in the dataset including background. * `bbox_out` - the name of output layer with detected boxes deltas. The layer shape is [num_boxes, 8] where `num_boxes` is number of predicted boxes, 8 (4 for background + 4 for foreground) bounding boxes coordinates. @@ -187,10 +201,23 @@ AccuracyChecker supports following set of adapters: * `score_map_threshold` - threshold for score map (Optional, default 0.8). * `nms_threshold` - threshold for text boxes NMS (Optional, default 0.2). * `box_threshold` - minimal confidence threshold for text boxes (Optional, default 0.1). +* `craft_text_detection` - converting output of CRAFT like model for text detection to `TextDetectionPrediction`. + * `score_out` - the name of output layer which contains score map. + * `text_threshold` - text confidence threshold (Optional, default 0.7). + * `link_threshold` - link confidence threshold (Optional, default 0.4). + * `low_text` - text low-bound score (Optional, default 0.4). * `human_pose_estimation` - converting output of model for human pose estimation to `PoseEstimationPrediction`. * `part_affinity_fields_out` - name of output layer with keypoints pairwise relations (part affinity fields). * `keypoints_heatmap_out` - name of output layer with keypoints heatmaps. The output layers can be omitted if model has only one output layer - concatenation of this 2. +* `human_pose_estimation_openpose` - converting output of OpenPose-like model for human pose estimation to `PoseEstimationPrediction`. + * `part_affinity_fields_out` - name of output layer with keypoints pairwise relations (part affinity fields). + * `keypoints_heatmap_out` - name of output layer with keypoints heatmaps. + * `upscale_factor` - upscaling factor for heatmaps and part affinity fields before post-processing. +* `human_pose_estimation_ae` - converting output of Associative Embedding-like model for human pose estimation to `PoseEstimationPrediction`. + * `heatmaps_out` - name of output layer with keypoints heatmaps. + * `nms_heatmaps_out` - name of output layer with keypoints heatmaps after non-maximum suppression. + * `embeddings_out` - name of output layer with embedding (tag) maps. * `beam_search_decoder` - realization CTC Beam Search decoder for symbol sequence recognition, converting model output to `CharacterRecognitionPrediction`. * `beam_size` - size of the beam to use during decoding (default 10). * `blank_label` - index of the CTC blank label. @@ -211,7 +238,7 @@ AccuracyChecker supports following set of adapters: * `lm_oov_score` - Replace LM score for out-of-vocabulary words with this value (default -1000, ignored without LM) * `lm_vocabulary_offset` - Start of vocabulary strings section in the LM file. Default is to not filter candidate words using vocabulary (ignored without LM) * `lm_vocabulary_length` - Size in bytes of vocabulary strings section in the LM file (ignored without LM) -* `fast_ctc_beam_search_decoder_with_lm` - CTC beam search decoder with n-gram language model in kenlm binary format for speech recognition, depends on [`ctcdecode_numpy` Python module](../../../../demos/python_demos/speech_recognition_demo/ctcdecode-numpy/README.md). +* `fast_ctc_beam_search_decoder_with_lm` - CTC beam search decoder with n-gram language model in kenlm binary format for speech recognition, depends on [`ctcdecode_numpy` Python module](../../../../demos/speech_recognition_demo/python/ctcdecode-numpy/README.md). * `beam_size` - Size of the beam to use during decoding (default 10). * `logarithmic_prob` - Set to "True" to indicate that network gives natural-logarithmic probabilities. Default is False for plain probabilities (after softmax). * `probability_out` - Name of the network's output with character probabilities (required) @@ -234,17 +261,19 @@ AccuracyChecker supports following set of adapters: * `vocabulary_file` - file which contains vocabulary for encoding model predicted indexes to words (e. g. vocab.json). Path can be prefixed with `--models` arguments. * `merges_file` - file which contains merges for encoding model predicted indexes to words (e. g. merges.txt). Path can be prefixed with `--models` arguments. * `output_name` - name of model's output layer if need (optional). - * `sos_symbol` - string representation of start_of_sentence symbol (default=''). - * `eos_symbol` - string representation of end_of_sentence symbol (default=''). - * `pad_symbol` - string representation of pad symbol (default=''). + * `sos_symbol` - string representation of start_of_sentence symbol (default=``). + * `eos_symbol` - string representation of end_of_sentence symbol (default=``). + * `pad_symbol` - string representation of pad symbol (default=``). * `remove_extra_symbols` - remove sos/eos/pad symbols from predicted string (default=True) * `bert_question_answering` - converting output of BERT model trained to solve question answering task to `QuestionAnsweringPrediction`. * `bidaf_question_answering` - converting output of BiDAF model trained to solve question answering task to `QuestionAnsweringPrediction`. * `start_pos_output` - name of output layer with answer start position. * `end_pos_output` - name of output layer with answer end position. -* `bert_classification` - converting output of BERT model trained for classification task to `ClassificationPrediction`. +* `bert_classification` - converting output of BERT model trained for text classification task to `ClassificationPrediction`. * `num_classes` - number of predicted classes. * `classification_out` - name of output layer with classification probabilities. (Optional, if not provided default first output blob will be used). +* `bert_ner` - converting output of BERT model trained for named entity recognition task to `SequenceClassificationPrediction`. + * `classification_out` - name of output layer with classification probabilities. (Optional, if not provided default first output blob will be used). * `human_pose_estimation_3d` - converting output of model for 3D human pose estimation to `PoseEstimation3dPrediction`. * `features_3d_out` - name of output layer with 3D coordinates maps. * `keypoints_heatmap_out` - name of output layer with keypoints heatmaps. @@ -278,7 +307,7 @@ AccuracyChecker supports following set of adapters: * `max_detections` - maximum detection used for metrics calculation (Optional, default 100). * `class_agnostic_detection` - converting 'boxes' [n, 5] output of detection model to `DetectionPrediction` representation. * `output_blob` - name of output layer with bboxes. - * `scale` - scalar value to normalize bbox coordinates. + * `scale` - scalar value or list with 2 values to normalize bbox coordinates. * `mono_depth` - converting output of monocular depth estimation model to `DepthEstimationPrediction`. * `inpainting` - converting output of Image Inpainting model to `ImageInpaintingPrediction` representation. * `style_transfer` - converting output of Style Transfer model to `StyleTransferPrediction` representation. @@ -287,6 +316,9 @@ AccuracyChecker supports following set of adapters: * `bboxes_outputs` - the list of names for output layers with face detection boxes in order belonging to 32-, 16-, 8-strides. * `landmarks_outputs` - the list of names for output layers with predicted facial landmarks in order belonging to 32-, 16-, 8-strides (optional, if not provided, only `DetectionPrediction` will be generated). * `type_scores_outputs` - the list of names for output layers with attributes detection score in order belonging to 32-, 16-, 8-strides (optional, if not provided, only `DetectionPrediction` will be generated). + * `nms_threshold` - overlap threshold for NMS (optional, default 0.5). + * `keep_top_k ` - maximal number of boxes which should be kept (optional). + * `include_boundaries` - allows include boundaries for NMS (optional, default False). * `faceboxes` - converting output of FaceBoxes model to `DetectionPrediction` representation. * `scores_out` - name of output layer with bounding boxes scores. * `boxes_out` - name of output layer with bounding boxes coordinates. @@ -302,10 +334,12 @@ AccuracyChecker supports following set of adapters: * `window_lengths` - Window lengths for each base output layer. * `face_detection_refinement` - converts output of face detection refinement model to `DetectionPrediction` representation. Adapter refines candidates generated in previous stage model. * `threshold` - Score threshold to determine as valid face candidate. -* `attribute_classification` - converts output of attributes classifcation model to `ContainerPrediction` which contains multiple `ClassificationPrediction` for attributes with their scores. +* `attribute_classification` - converts output of attributes classification model to `ContainerPrediction` which contains multiple `ClassificationPrediction` for attributes with their scores. * `output_layer_map` - dictionary where keys are output layer names of attribute classification model and values are the names of attributes. * `regression` - converting output of regression model to `RegressionPrediction` representation. * `keep_shape` - allow keeping shape of predicted multi dimension array (Optional, default False). +* `multi_output_regression` - converting raw output features to `RegressionPrediction` for regression with gt data. + * `output` - list of target output names. * `mixed` - converts outputs of any model to `ContainerPrediction` which contains multiple types of predictions. * `adapters` - Dict where key is output name and value is adapter config map including `output_blob` key to associate the output of model and this adapter. * `person_vehilce_detection_refinement` - converts output of person vehicle detection refinement model to `DetectionPrediction` representation. Adapter refines proposals generated in previous stage model. @@ -320,7 +354,14 @@ AccuracyChecker supports following set of adapters: * `cell_width` - Specifies cell width to extract predictions. * `label_num` - Specifies number of output label classes. * `stacked_hourglass` - converts output of Stacked Hourglass Networks for single human pose estimation to `PoseEstimationPrediction`. - * `score_map_out`- the name of output layers for getting score map (Optional, default output blob will be used if not provided). + * `score_map_output`- the name of output layers for getting score map (Optional, default output blob will be used if not provided). * `dna_seq_beam_search` - converts output of DNA sequencing model to `DNASequencePrediction` using beam search decoding. * `beam_size` - beam size for CTC Beam Search (Optional, default 5). * `threshold` - beam cut threshold (Optional, default 1e-3). +* `pwcnet` - converts output of PWCNet network to `OpticalFlowPrediction`. + * `flow_out` - target output layer name. +* `salient_object_detection` - converts output of salient object detection model to `SalientRegionPrediction` + * `salient_map_output` - target output layer for getting salience map (Optional, if not provided default output blob will be used). +* `two_stage_detection` - converts output of 2-stage detector to `DetectionPrediction`. + * `boxes_out` - output with bounding boxes in format BxNx[x_min, y_min, width, height], where B - network batch size, N - number of detected boxes. + * `cls_out` - output with classification probabilities in format [BxNxC], where B - network batch size, N - number of detected boxes, C - number of classed. diff --git a/tools/accuracy_checker/accuracy_checker/adapters/__init__.py b/tools/accuracy_checker/accuracy_checker/adapters/__init__.py index 69e6c2d06fb..26b2816892a 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/__init__.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/__init__.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,7 +20,8 @@ from .text_detection import ( TextDetectionAdapter, TextProposalsDetectionAdapter, - EASTTextDetectionAdapter + EASTTextDetectionAdapter, + CRAFTTextDetectionAdapter ) from .text_recognition import ( @@ -50,7 +51,8 @@ FaceBoxesAdapter, FaceDetectionAdapter, FaceDetectionRefinementAdapter, - FasterRCNNONNX + FasterRCNNONNX, + TwoStageDetector ) from .detection_person_vehicle import ( PersonVehicleDetectionAdapter, @@ -59,11 +61,14 @@ from .detection_head import HeadDetectionAdapter from .ssd import SSDAdapter, PyTorchSSDDecoder, FacePersonAdapter, SSDAdapterMxNet, SSDONNXAdapter from .retinaface import RetinaFaceAdapter -from .retinanet import RetinaNetAdapter, MultiOutRetinaNet +from .retinanet import RetinaNetAdapter, MultiOutRetinaNet, RetinaNetTF2 from .yolo import TinyYOLOv1Adapter, YoloV2Adapter, YoloV3Adapter, YoloV3ONNX from .classification import ClassificationAdapter from .segmentation import SegmentationAdapter, BrainTumorSegmentationAdapter, DUCSegmentationAdapter from .pose_estimation import HumanPoseAdapter, SingleHumanPoseAdapter, StackedHourGlassNetworkAdapter +from .pose_estimation_openpose import OpenPoseAdapter +from .pose_estimation_associative_embedding import AssociativeEmbeddingAdapter + from .pose_estimation_3d import HumanPose3dAdapter from .hit_ratio import HitRatioAdapter @@ -72,7 +77,10 @@ from .mask_rcnn_with_text import MaskRCNNWithTextAdapter from .yolact import YolactAdapter -from .nlp import MachineTranslationAdapter, QuestionAnsweringAdapter, QuestionAnsweringBiDAFAdapter +from .nlp import ( + MachineTranslationAdapter, QuestionAnsweringAdapter, QuestionAnsweringBiDAFAdapter, + BertTextClassification, BERTNamedEntityRecognition +) from .centernet import CTDETAdapter @@ -89,10 +97,12 @@ FastCTCBeamSearchDecoderWithLm ) -from .regression import RegressionAdapter +from .regression import RegressionAdapter, MultiOutputRegression from .mixed_adapter import MixedAdapter from .face_recognition_quality_assessment import QualityAssessmentAdapter from .dna_seq_recognition import DNASeqRecognition +from .optical_flow import PWCNetAdapter +from .salient_objects_detection import SalientObjectDetection from .dummy_adapters import GVADetectionAdapter, XML2DetectionAdapter, GVAClassificationAdapter __all__ = [ @@ -108,6 +118,7 @@ 'MTCNNPAdapter', 'CTDETAdapter', 'RetinaNetAdapter', + 'RetinaNetTF2', 'ClassAgnosticDetectionAdapter', 'RetinaFaceAdapter', 'FaceBoxesAdapter', @@ -117,6 +128,7 @@ 'PersonVehicleDetectionRefinementAdapter', 'HeadDetectionAdapter', 'FasterRCNNONNX', + 'TwoStageDetector', 'TinyYOLOv1Adapter', 'YoloV2Adapter', @@ -135,6 +147,7 @@ 'SegmentationAdapter', 'BrainTumorSegmentationAdapter', 'DUCSegmentationAdapter', + 'SalientObjectDetection', 'ReidAdapter', @@ -154,13 +167,16 @@ 'TextDetectionAdapter', 'TextProposalsDetectionAdapter', 'EASTTextDetectionAdapter', + 'CRAFTTextDetectionAdapter', 'BeamSearchDecoder', 'LPRAdapter', 'CTCGreedySearchDecoder', + 'AssociativeEmbeddingAdapter', 'HumanPoseAdapter', 'HumanPose3dAdapter', + 'OpenPoseAdapter', 'SingleHumanPoseAdapter', 'StackedHourGlassNetworkAdapter', @@ -175,6 +191,8 @@ 'MachineTranslationAdapter', 'QuestionAnsweringAdapter', 'QuestionAnsweringBiDAFAdapter', + 'BERTNamedEntityRecognition', + 'BertTextClassification', 'MonoDepthAdapter', @@ -184,6 +202,7 @@ 'AttributeClassificationAdapter', 'RegressionAdapter', + 'MultiOutputRegression', 'MixedAdapter', 'CTCBeamSearchDecoder', @@ -195,6 +214,8 @@ 'DNASeqRecognition', + 'PWCNetAdapter', + 'GVADetectionAdapter', 'GVAClassificationAdapter', diff --git a/tools/accuracy_checker/accuracy_checker/adapters/action_recognition.py b/tools/accuracy_checker/accuracy_checker/adapters/action_recognition.py index a7c06b82c0d..dadbbd90396 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/action_recognition.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/action_recognition.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -90,8 +90,11 @@ def parameters(cls): return parameters - def validate_config(self): - super().validate_config(on_extra_argument=ConfigValidator.WARN_ON_EXTRA_ARGUMENT) + @classmethod + def validate_config(cls, config, fetch_only=False, **kwargs): + return super().validate_config( + config, fetch_only=fetch_only, on_extra_argument=ConfigValidator.WARN_ON_EXTRA_ARGUMENT + ) def configure(self): self.multihead = self.get_value_from_config('multihead_net') diff --git a/tools/accuracy_checker/accuracy_checker/adapters/adapter.py b/tools/accuracy_checker/accuracy_checker/adapters/adapter.py index 4efd998f17b..366039d7cdc 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/adapter.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/adapter.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,9 +14,8 @@ limitations under the License. """ -from ..topology_types import GenericTopology from ..config import BaseField, ConfigValidator, StringField, ConfigError -from ..dependency import ClassProvider +from ..dependency import ClassProvider, UnregisteredProviderException from ..utils import get_parameter_value_from_config @@ -27,14 +26,12 @@ class Adapter(ClassProvider): __provider_type__ = 'adapter' - topology_types = (GenericTopology, ) - def __init__(self, launcher_config, label_map=None, output_blob=None): self.launcher_config = launcher_config self.output_blob = output_blob self.label_map = label_map - self.validate_config() + self.validate_config(launcher_config) self.configure() def get_value_from_config(self, key): @@ -54,10 +51,29 @@ def process(self, raw, identifiers, frame_meta): def configure(self): pass - def validate_config(self, **kwargs): + @classmethod + def validate_config(cls, config, fetch_only=False, uri_prefix='', **kwargs): + if cls.__name__ == Adapter.__name__: + errors = [] + adapter_type = config if isinstance(config, str) else config.get('type') + if not adapter_type: + error = ConfigError('type is not provided', config, uri_prefix or 'adapter') + if not fetch_only: + raise error + errors.append(error) + return errors + try: + adapter_cls = cls.resolve(adapter_type) + adapter_config = config if isinstance(config, dict) else {'type': adapter_type} + return adapter_cls.validate_config(adapter_config, fetch_only=fetch_only, uri_prefix=uri_prefix) + except UnregisteredProviderException as exception: + if not fetch_only: + raise exception + return errors if 'on_extra_argument' not in kwargs: kwargs['on_extra_argument'] = ConfigValidator.IGNORE_ON_EXTRA_ARGUMENT - ConfigValidator(self.__class__.__name__, fields=self.parameters(), **kwargs).validate(self.launcher_config) + uri = '{}.{}'.format(uri_prefix, cls.__provider__) if uri_prefix else 'adapter.{}'.format(cls.__provider__) + return ConfigValidator(uri, fields=cls.parameters(), **kwargs).validate(config, fetch_only=fetch_only) @staticmethod def _extract_predictions(outputs_list, meta): @@ -65,26 +81,36 @@ def _extract_predictions(outputs_list, meta): return outputs_list return outputs_list[0] + def select_output_blob(self, outputs): + if self.output_blob is None: + self.output_blob = next(iter(outputs)) + class AdapterField(BaseField): - def validate(self, entry, field_uri_=None): - super().validate(entry, field_uri_) + def validate(self, entry, field_uri_=None, fetch_only=False): + errors_stack = super().validate(entry, field_uri_, fetch_only) if entry is None: - return + return errors_stack field_uri_ = field_uri_ or self.field_uri if isinstance(entry, str): - StringField(choices=Adapter.providers).validate(entry, 'adapter') + errors_stack.extend(StringField( + choices=Adapter.providers).validate(entry, field_uri_ or 'adapter', fetch_only=fetch_only)) elif isinstance(entry, dict): class DictAdapterValidator(ConfigValidator): type = StringField(choices=Adapter.providers) dict_adapter_validator = DictAdapterValidator( - 'adapter', on_extra_argument=DictAdapterValidator.IGNORE_ON_EXTRA_ARGUMENT + field_uri_ or 'adapter', on_extra_argument=DictAdapterValidator.IGNORE_ON_EXTRA_ARGUMENT ) - dict_adapter_validator.validate(entry) + errors_stack.extend(dict_adapter_validator.validate(entry, field_uri_ or 'adapter', fetch_only=fetch_only)) else: - self.raise_error(entry, field_uri_, 'adapter must be either string or dictionary') + if not fetch_only: + errors_stack.append( + self.build_error(entry, field_uri_ or 'adapter', 'adapter must be either string or dictionary')) + else: + self.raise_error(entry, field_uri_ or 'adapter', 'adapter must be either string or dictionary') + return errors_stack def create_adapter(adapter_config, launcher=None, dataset=None): diff --git a/tools/accuracy_checker/accuracy_checker/adapters/attribute_classification.py b/tools/accuracy_checker/accuracy_checker/adapters/attribute_classification.py index c99ccae480f..ee161737c84 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/attribute_classification.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/attribute_classification.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -43,8 +43,11 @@ def configure(self): super().configure() self.output_layers = self.get_value_from_config('output_layer_map') - def validate_config(self): - super().validate_config(on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT) + @classmethod + def validate_config(cls, config, fetch_only=False, **kwargs): + return super().validate_config( + config, fetch_only=fetch_only, on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT + ) def process(self, raw, identifiers, frame_meta): """ diff --git a/tools/accuracy_checker/accuracy_checker/adapters/attributes_recognition.py b/tools/accuracy_checker/accuracy_checker/adapters/attributes_recognition.py index 9a7303dc314..e49de8feff6 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/attributes_recognition.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/attributes_recognition.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -46,8 +46,11 @@ def parameters(cls): }) return parameters - def validate_config(self): - super().validate_config(on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT) + @classmethod + def validate_config(cls, config, fetch_only=False, **kwargs): + return super().validate_config( + config, fetch_only=fetch_only, on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT + ) def configure(self): """ @@ -97,8 +100,11 @@ def parameters(cls): }) return parameters - def validate_config(self): - super().validate_config(on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT) + @classmethod + def validate_config(cls, config, fetch_only=False, **kwargs): + return super().validate_config( + config, fetch_only=fetch_only, on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT + ) def configure(self): """ @@ -136,8 +142,11 @@ def configure(self): self.age_out = self.get_value_from_config('age_out') self.gender_out = self.get_value_from_config('gender_out') - def validate_config(self): - super().validate_config(on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT) + @classmethod + def validate_config(cls, config, fetch_only=False, **kwargs): + return super().validate_config( + config, fetch_only=fetch_only, on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT + ) @staticmethod def get_age_scores(age): @@ -177,6 +186,7 @@ class LandmarksRegressionAdapter(Adapter): def process(self, raw, identifiers=None, frame_meta=None): res = [] raw_output = self._extract_predictions(raw, frame_meta) + self.select_output_blob(raw_output) for identifier, values in zip(identifiers, raw_output[self.output_blob]): x_values, y_values = values[::2], values[1::2] res.append(FacialLandmarksPrediction(identifier, x_values.reshape(-1), y_values.reshape(-1))) @@ -198,8 +208,11 @@ def parameters(cls): }) return parameters - def validate_config(self): - super().validate_config(on_extra_argument=ConfigValidator.IGNORE_ON_EXTRA_ARGUMENT) + @classmethod + def validate_config(cls, config, fetch_only=False, **kwargs): + return super().validate_config( + config, fetch_only=fetch_only, on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT + ) def configure(self): self.attributes_recognition_out = self.launcher_config.get('attributes_recognition_out', self.output_blob) @@ -207,6 +220,7 @@ def configure(self): def process(self, raw, identifiers=None, frame_meta=None): result = [] raw_output = self._extract_predictions(raw, frame_meta) + self.select_output_blob(raw_output) self.attributes_recognition_out = self.attributes_recognition_out or self.output_blob for identifier, multi_label in zip(identifiers, raw_output[self.attributes_recognition_out]): multi_label[multi_label > 0.5] = 1. @@ -224,6 +238,7 @@ class GazeEstimationAdapter(Adapter): def process(self, raw, identifiers=None, frame_meta=None): result = [] raw_output = self._extract_predictions(raw, frame_meta) + self.select_output_blob(raw_output) for identifier, output in zip(identifiers, raw_output[self.output_blob]): result.append(GazeVectorPrediction(identifier, output)) @@ -259,6 +274,7 @@ def configure(self): def process(self, raw, identifiers=None, frame_meta=None): result = [] raw_output = self._extract_predictions(raw, frame_meta) + self.select_output_blob(raw_output) for identifier, pos, meta in zip(identifiers, raw_output[self.output_blob], frame_meta): input_shape = next(iter(meta['input_shape'].values())) if input_shape[1] == 3: diff --git a/tools/accuracy_checker/accuracy_checker/adapters/audio_recognition.py b/tools/accuracy_checker/accuracy_checker/adapters/audio_recognition.py index 33cd390c469..d378ee7a956 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/audio_recognition.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/audio_recognition.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -96,6 +96,7 @@ def process(self, raw, identifiers=None, frame_meta=None): multi_infer = frame_meta[-1].get('multi_infer', False) if frame_meta else False raw_output = self._extract_predictions(raw, frame_meta) + self.select_output_blob(raw_output) output = raw_output[self.output_blob] if multi_infer: steps, _, _, _ = output.shape @@ -234,6 +235,7 @@ def process(self, raw, identifiers, frame_meta): multi_infer = frame_meta[-1].get('multi_infer', False) if frame_meta else False raw_output = self._extract_predictions(raw, frame_meta) + self.select_output_blob(raw_output) output = raw_output[self.output_blob] if multi_infer: steps, _, _, _ = output.shape @@ -375,7 +377,7 @@ def init_lm(self, lm_file, lm_vocabulary_offset, lm_vocabulary_length): raise ValueError("Need lm_alpha and lm_beta to use lm_file") def process(self, raw, identifiers=None, frame_meta=None): - log_prob = self._extract_predictions(raw, frame_meta, self.probability_out) + log_prob = self._extract_predictions(raw, frame_meta) log_prob = np.concatenate(list(log_prob)) if not self.logarithmic_prob: log_prob = np.log(log_prob.clip(min=np.finfo(log_prob.dtype).tiny)) @@ -391,8 +393,7 @@ def process(self, raw, identifiers=None, frame_meta=None): decoded = decoded.upper() # this should be responsibility of metric return [CharacterRecognitionPrediction(identifiers[0], decoded)] - @staticmethod - def _extract_predictions(outputs_list, meta, layer_out_name): + def _extract_predictions(self, outputs_list, meta): """ Extract the value of network's output identified by the provided name. The result is returned as list(numpy.ndarray), arrays are to be @@ -402,8 +403,8 @@ def _extract_predictions(outputs_list, meta, layer_out_name): if isinstance(outputs_list, dict): outputs_list = [outputs_list] if not is_multi_infer: - return [outputs_list[0][layer_out_name]] - return [output[layer_out_name] for output in outputs_list] + return [outputs_list[0][self.probability_out]] + return [output[self.probability_out] for output in outputs_list] def decode(self, logp_audio): cand_set = CtcBeamSearchWithLmCandidateSet( diff --git a/tools/accuracy_checker/accuracy_checker/adapters/centernet.py b/tools/accuracy_checker/accuracy_checker/adapters/centernet.py index b421afebd42..531dc8bc02a 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/centernet.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/centernet.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/adapters/classification.py b/tools/accuracy_checker/accuracy_checker/adapters/classification.py index f8c3b96ea4a..454fae6fe12 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/classification.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/classification.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import numpy as np -from ..topology_types import ImageClassification from ..adapters import Adapter from ..config import BoolField, StringField from ..representation import ClassificationPrediction, ArgMaxClassificationPrediction @@ -27,7 +26,6 @@ class ClassificationAdapter(Adapter): Class for converting output of classification model to ClassificationPrediction representation """ __provider__ = 'classification' - topology_types = (ImageClassification, ) prediction_types = (ClassificationPrediction, ) @classmethod @@ -62,7 +60,9 @@ def process(self, raw, identifiers, frame_meta): if self.classification_out is not None: self.output_blob = self.classification_out multi_infer = frame_meta[-1].get('multi_infer', False) if frame_meta else False - prediction = self._extract_predictions(raw, frame_meta)[self.output_blob] + raw_prediction = self._extract_predictions(raw, frame_meta) + self.select_output_blob(raw_prediction) + prediction = raw_prediction[self.output_blob] if multi_infer: prediction = np.mean(prediction, axis=0) if len(np.shape(prediction)) == 1: diff --git a/tools/accuracy_checker/accuracy_checker/adapters/detection.py b/tools/accuracy_checker/accuracy_checker/adapters/detection.py index 0bbeeb16245..1b6924fb304 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/detection.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/detection.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,9 +21,10 @@ import numpy as np from ..adapters import Adapter -from ..config import ConfigValidator, NumberField, StringField, ListField, ConfigError +from ..config import ConfigValidator, BaseField, NumberField, StringField, ListField, ConfigError from ..postprocessor.nms import NMS from ..representation import DetectionPrediction +from ..utils import get_or_parse_value FaceDetectionLayerOutput = namedtuple('FaceDetectionLayerOutput', [ 'prob_name', @@ -36,14 +37,18 @@ 'win_trans_y' ]) + class TFObjectDetectionAPIAdapter(Adapter): """ Class for converting output of SSD model to DetectionPrediction representation """ __provider__ = 'tf_object_detection' - def validate_config(self): - super().validate_config(on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT) + @classmethod + def validate_config(cls, config, fetch_only=False, **kwargs): + return super().validate_config( + config, fetch_only=fetch_only, on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT + ) @classmethod def parameters(cls): @@ -171,7 +176,6 @@ def process(self, raw, identifiers=None, frame_meta=None): DetectionPrediction(identifier, np.full_like(scores, 1), scores, x_mins, y_mins, x_maxs, y_maxs) ) - return results @staticmethod @@ -230,24 +234,29 @@ class ClassAgnosticDetectionAdapter(Adapter): DetectionPrediction representation """ __provider__ = 'class_agnostic_detection' - prediction_types = (DetectionPrediction, ) + prediction_types = (DetectionPrediction,) - def validate_config(self): - super().validate_config(on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT) + @classmethod + def validate_config(cls, config, fetch_only=False, **kwargs): + return super().validate_config( + config, fetch_only=fetch_only, on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT + ) @classmethod def parameters(cls): parameters = super().parameters() parameters.update({ 'output_blob': StringField(optional=True, default=None, description="Output blob name."), - 'scale': NumberField(optional=True, default=1.0, description="Scale factor for bboxes."), + 'scale': BaseField(optional=True, default=1.0, description="Scale factor for bboxes."), }) return parameters def configure(self): self.out_blob_name = self.get_value_from_config('output_blob') - self.scale = self.get_value_from_config('scale') + self.scale = get_or_parse_value(self.get_value_from_config('scale')) + if isinstance(self.scale, list): + self.scale = self.scale * 2 def process(self, raw, identifiers, frame_meta): """ @@ -360,11 +369,11 @@ def process(self, raw, identifiers, frame_meta): assert len(predicted_classes.shape) == 2 assert predicted_deltas.shape[-1] == 8 predicted_boxes = self.bbox_transform_inv(predicted_proposals, predicted_deltas) - num_classes = predicted_classes.shape[-1] - 1 # skip background + num_classes = predicted_classes.shape[-1] - 1 # skip background x_mins, y_mins, x_maxs, y_maxs = predicted_boxes[:, 4:].T detections = {'labels': [], 'scores': [], 'x_mins': [], 'y_mins': [], 'x_maxs': [], 'y_maxs': []} for cls_id in range(num_classes): - cls_scores = predicted_classes[:, cls_id+1] + cls_scores = predicted_classes[:, cls_id + 1] keep = NMS.nms(x_mins, y_mins, x_maxs, y_maxs, cls_scores, 0.3, include_boundaries=False) filtered_score = cls_scores[keep] x_cls_mins = x_mins[keep] @@ -372,7 +381,7 @@ def process(self, raw, identifiers, frame_meta): x_cls_maxs = x_maxs[keep] y_cls_maxs = y_maxs[keep] # Save detections - labels = np.full_like(filtered_score, cls_id+1) + labels = np.full_like(filtered_score, cls_id + 1) detections['labels'].extend(labels) detections['scores'].extend(filtered_score) detections['x_mins'].extend(x_cls_mins) @@ -383,6 +392,7 @@ def process(self, raw, identifiers, frame_meta): identifiers[0], detections['labels'], detections['scores'], detections['x_mins'], detections['y_mins'], detections['x_maxs'], detections['y_maxs'] )] + @staticmethod def bbox_transform_inv(boxes, deltas): if boxes.shape[0] == 0: @@ -415,8 +425,11 @@ class FaceBoxesAdapter(Adapter): """ __provider__ = 'faceboxes' - def validate_config(self): - super().validate_config(on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT) + @classmethod + def validate_config(cls, config, fetch_only=False, **kwargs): + return super().validate_config( + config, fetch_only=fetch_only, on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT + ) @classmethod def parameters(cls): @@ -431,6 +444,7 @@ def parameters(cls): def configure(self): self.scores_out = self.get_value_from_config('scores_out') self.boxes_out = self.get_value_from_config('boxes_out') + self._anchors_cache = {} # Set default values self.min_sizes = [[32, 64, 128], [256], [512]] @@ -501,11 +515,15 @@ def process(self, raw, identifiers, frame_meta): image_info = meta.get("image_info")[0:2] # Prior boxes - feature_maps = [[math.ceil(image_info[0] / step), math.ceil(image_info[1] / step)] for step in - self.steps] - prior_data = self.prior_boxes(feature_maps, image_info) + if (image_info[0], image_info[1]) not in self._anchors_cache: + feature_maps = [[math.ceil(image_info[0] / step), math.ceil(image_info[1] / step)] for step in + self.steps] + prior_data = self.prior_boxes(feature_maps, image_info) + self._anchors_cache[(image_info[0], image_info[1])] = prior_data + else: + prior_data = self._anchors_cache[(image_info[0], image_info[1])] - # Boxes + # Boxes boxes[:, :2] = self.variance[0] * boxes[:, :2] boxes[:, 2:] = self.variance[1] * boxes[:, 2:] boxes[:, :2] = boxes[:, :2] * prior_data[:, 2:] + prior_data[:, :2] @@ -566,12 +584,13 @@ def process(self, raw, identifiers, frame_meta): return result + class FaceDetectionAdapter(Adapter): """ Class for converting output of Face Detection model to DetectionPrediction representation """ __provider__ = 'face_detection' - predcition_types = (DetectionPrediction, ) + predcition_types = (DetectionPrediction,) @classmethod def parameters(cls): @@ -667,10 +686,10 @@ def process(self, raw, identifiers, frame_meta): candidate_width = layer.win_length candidate_height = layer.win_length - reg_x = reg_arr[0][layer.anchor_index*4+0][row][col] * layer.win_length - reg_y = reg_arr[0][layer.anchor_index*4+1][row][col] * layer.win_length - reg_width = reg_arr[0][layer.anchor_index*4+2][row][col] * layer.win_length - reg_height = reg_arr[0][layer.anchor_index*4+3][row][col] * layer.win_length + reg_x = reg_arr[0][layer.anchor_index * 4 + 0][row][col] * layer.win_length + reg_y = reg_arr[0][layer.anchor_index * 4 + 1][row][col] * layer.win_length + reg_width = reg_arr[0][layer.anchor_index * 4 + 2][row][col] * layer.win_length + reg_height = reg_arr[0][layer.anchor_index * 4 + 3][row][col] * layer.win_length candidate_x += reg_x candidate_y += reg_y @@ -701,10 +720,10 @@ def process(self, raw, identifiers, frame_meta): return result -class FaceDetectionRefinementAdapter(Adapter): +class FaceDetectionRefinementAdapter(Adapter): __provider__ = 'face_detection_refinement' - prediction_types = (DetectionPrediction, ) + prediction_types = (DetectionPrediction,) @classmethod def parameters(cls): @@ -766,8 +785,8 @@ def refine_candidates(identifier, raw, candidates, threshold): detections['scores'].append(score) detections['x_mins'].append(x) detections['y_mins'].append(y) - detections['x_maxs'].append(x+width) - detections['y_maxs'].append(y+height) + detections['x_maxs'].append(x + width) + detections['y_maxs'].append(y + height) return [ DetectionPrediction( @@ -816,3 +835,36 @@ def process(self, raw, identifiers=None, frame_meta=None): boxes[:, 1::2] /= im_scale_y x_mins, y_mins, x_maxs, y_maxs = boxes.T return [DetectionPrediction(identifier, labels, scores, x_mins, y_mins, x_maxs, y_maxs)] + + +class TwoStageDetector(Adapter): + __provider__ = 'two_stage_detection' + + @classmethod + def parameters(cls): + params = super().parameters() + params.update({ + 'boxes_out': StringField(description='boxes output'), + 'cls_out': StringField(description='classes confidence output') + }) + return params + + def configure(self): + self.boxes_out = self.get_value_from_config('boxes_out') + self.cls_out = self.get_value_from_config('cls_out') + + def process(self, raw, identifiers, frame_meta): + raw_output = self._extract_predictions(raw, frame_meta) + boxes_outputs = raw_output[self.boxes_out] + if len(boxes_outputs.shape) == 2: + boxes_outputs = np.expand_dims(boxes_outputs, 0) + conf_outputs = raw_output[self.cls_out] + if len(conf_outputs.shape) == 2: + conf_outputs = np.expand_dims(conf_outputs, 0) + result = [] + for identifier, boxes, conf in zip(identifiers, boxes_outputs, conf_outputs): + x_mins, y_mins, w, h = boxes.T + labels = np.argmax(conf, axis=1) + scores = np.max(conf, axis=1) + result.append(DetectionPrediction(identifier, labels, scores, x_mins, y_mins, x_mins + w, y_mins + h)) + return result diff --git a/tools/accuracy_checker/accuracy_checker/adapters/detection_head.py b/tools/accuracy_checker/accuracy_checker/adapters/detection_head.py index 531e9107cf5..8df40d822ad 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/detection_head.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/detection_head.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/adapters/detection_person_vehicle.py b/tools/accuracy_checker/accuracy_checker/adapters/detection_person_vehicle.py index a72909f0bf8..d600e2db59c 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/detection_person_vehicle.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/detection_person_vehicle.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/adapters/dna_seq_recognition.py b/tools/accuracy_checker/accuracy_checker/adapters/dna_seq_recognition.py index 732d9dac77e..8474e9d5c31 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/dna_seq_recognition.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/dna_seq_recognition.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -50,6 +50,7 @@ def process(self, raw, identifiers, frame_meta): raise ConfigError('Beam Search Decoder requires dataset label map for correct decoding.') alphabet = list(self.label_map.values()) raw_outputs = self._extract_predictions(raw, frame_meta) + self.select_output_blob(raw_outputs) result = [] for identifier, out in zip(identifiers, np.exp(raw_outputs[self.output_blob])): if self.beam_size == 1: diff --git a/tools/accuracy_checker/accuracy_checker/adapters/dummy_adapters.py b/tools/accuracy_checker/accuracy_checker/adapters/dummy_adapters.py index 3efba1dd676..b893af9e83b 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/dummy_adapters.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/dummy_adapters.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -103,6 +103,7 @@ def process(self, raw, identifiers, frame_meta): class GVAClassificationAdapter(Adapter): __provider__ = 'gva_classification' + def process(self, raw, identifiers, frame_meta): results = [] for identifier, image_data in zip(identifiers, raw): diff --git a/tools/accuracy_checker/accuracy_checker/adapters/face_recognition_quality_assessment.py b/tools/accuracy_checker/accuracy_checker/adapters/face_recognition_quality_assessment.py index 767630dadb4..052e8a89a24 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/face_recognition_quality_assessment.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/face_recognition_quality_assessment.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,13 +20,16 @@ from .adapter import Adapter from ..representation import QualityAssessmentPrediction + class QualityAssessmentAdapter(Adapter): __provider__ = 'face_recognition_quality_assessment' - predcition_types = (QualityAssessmentPrediction, ) + prediction_types = (QualityAssessmentPrediction, ) score_weight = [0.25, 0.50, 0.50, 0.75] def process(self, raw, identifiers=None, frame_meta=None): - prediction = self._extract_predictions(raw, frame_meta)[self.output_blob] + prediction = self._extract_predictions(raw, frame_meta) + self.select_output_blob(prediction) + prediction = prediction[self.output_blob] return [QualityAssessmentPrediction(identifier, quality_assessment=self.calculate_quality(embedding)) for identifier, embedding in zip(identifiers, prediction)] @@ -41,7 +44,6 @@ def calculate_quality(self, qa_feature): top_score2 = qa_feature[top_id2] # Calculate quality score - qs_val = 0.0 if top_score1 > (top_score2 * 2): if top_id1 <= 1: qs_val = self.score_weight[top_id1] - 0.25 * top_score1 @@ -52,8 +54,6 @@ def calculate_quality(self, qa_feature): # Get top1 val top1_w = top_score1 / score_sum - max_val1 = 0.0 - qs_val1 = 0.0 if top_id1 <= 1: max_val1 = self.score_weight[top_id1] @@ -64,9 +64,6 @@ def calculate_quality(self, qa_feature): # Get top2 val top2_w = top_score2 / score_sum - max_val2 = 0.0 - qs_val2 = 0.0 - if top_id2 <= 1: max_val2 = self.score_weight[top_id2] qs_val2 = max_val2 - 0.25 * top2_w diff --git a/tools/accuracy_checker/accuracy_checker/adapters/hit_ratio.py b/tools/accuracy_checker/accuracy_checker/adapters/hit_ratio.py index d096c3bd3aa..576e4da79e8 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/hit_ratio.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/hit_ratio.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -38,7 +38,9 @@ def process(self, raw, identifiers, frame_meta): list of HitRatioPrediction objects. """ - prediction = self._extract_predictions(raw, frame_meta)[self.output_blob] + raw_prediction = self._extract_predictions(raw, frame_meta) + self.select_output_blob(raw_prediction) + prediction = raw_prediction[self.output_blob] prediction = np.reshape(prediction, -1) result = [] diff --git a/tools/accuracy_checker/accuracy_checker/adapters/image_inpainting.py b/tools/accuracy_checker/accuracy_checker/adapters/image_inpainting.py index c34a7861812..e6482e96004 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/image_inpainting.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/image_inpainting.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -26,8 +26,9 @@ class ImageInpaintingAdapter(Adapter): def process(self, raw, identifiers, frame_meta): result = [] - raw_outputs = self._extract_predictions(raw, frame_meta)[self.output_blob] - for identifier, img in zip(identifiers, raw_outputs): + raw_outputs = self._extract_predictions(raw, frame_meta) + self.select_output_blob(raw_outputs) + for identifier, img in zip(identifiers, raw_outputs[self.output_blob]): if img.shape[0] == 3: img = np.transpose(img, (1, 2, 0)) result.append(ImageInpaintingPrediction(identifier, img.astype(np.uint8))) diff --git a/tools/accuracy_checker/accuracy_checker/adapters/image_processing.py b/tools/accuracy_checker/accuracy_checker/adapters/image_processing.py index 19647eb8739..c6d52b853f9 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/image_processing.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/image_processing.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ def parameters(cls): description='The value which should be added to prediction pixels for scaling to range [0, 255]' '(usually it is the same mean value which subtracted in preprocessing step))' ), - 'std': BaseField( + 'std': BaseField( optional=True, default=255, description='The value on which prediction pixels should be multiplied for scaling to range ' '[0, 255] (usually it is the same scale (std) used in preprocessing step))' @@ -55,8 +55,11 @@ def parameters(cls): }) return parameters - def validate_config(self): - super().validate_config(on_extra_argument=ConfigValidator.IGNORE_ON_EXTRA_ARGUMENT) + @classmethod + def validate_config(cls, config, fetch_only=False, **kwargs): + return super().validate_config( + config, fetch_only=fetch_only, on_extra_argument=ConfigValidator.IGNORE_ON_EXTRA_ARGUMENT + ) def configure(self): self.reverse_channels = self.get_value_from_config('reverse_channels') @@ -76,18 +79,19 @@ def process(self, raw, identifiers, frame_meta): result = [] raw_outputs = self._extract_predictions(raw, frame_meta) if not self.target_out: + self.select_output_blob(raw_outputs) self.target_out = self.output_blob for identifier, out_img in zip(identifiers, raw_outputs[self.target_out]): out_img = self._basic_postprocess(out_img) - result.append(SuperResolutionPrediction(identifier, out_img)) + result.append(ImageProcessingPrediction(identifier, out_img)) return result def _basic_postprocess(self, img): + img = img.transpose((1, 2, 0)) if img.shape[-1] > 4 else img img *= self.std img += self.mean - img = img.transpose((1, 2, 0)) if img.shape[-1] not in [3, 4, 1] else img if self.cast_to_uint8: img = np.clip(img, 0., 255.) img = img.astype(np.uint8) @@ -107,6 +111,7 @@ def process(self, raw, identifiers=None, frame_meta=None): result = [] raw_outputs = self._extract_predictions(raw, frame_meta) if not self.target_out: + self.select_output_blob(raw_outputs) self.target_out = self.output_blob for identifier, img_sr in zip(identifiers, raw_outputs[self.target_out]): @@ -132,7 +137,7 @@ def parameters(cls): description='The value which should be added to prediction pixels for scaling to range [0, 255]' '(usually it is the same mean value which subtracted in preprocessing step))' ), - 'std': BaseField( + 'std': BaseField( optional=True, default=255, description='The value on which prediction pixels should be multiplied for scaling to range ' '[0, 255] (usually it is the same scale (std) used in preprocessing step))' @@ -144,8 +149,11 @@ def parameters(cls): }) return parameters - def validate_config(self): - super().validate_config(on_extra_argument=ConfigValidator.IGNORE_ON_EXTRA_ARGUMENT) + @classmethod + def validate_config(cls, config, fetch_only=False, **kwargs): + return super().validate_config( + config, fetch_only=fetch_only, on_extra_argument=ConfigValidator.IGNORE_ON_EXTRA_ARGUMENT + ) def configure(self): self.target_mapping = self.get_value_from_config('target_mapping') diff --git a/tools/accuracy_checker/accuracy_checker/adapters/mask_rcnn.py b/tools/accuracy_checker/accuracy_checker/adapters/mask_rcnn.py index d2803dbdcf9..7520d40af33 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/mask_rcnn.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/mask_rcnn.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/adapters/mask_rcnn_with_text.py b/tools/accuracy_checker/accuracy_checker/adapters/mask_rcnn_with_text.py index 28098f9083d..3600563ee05 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/mask_rcnn_with_text.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/mask_rcnn_with_text.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ def parameters(cls): ), 'scores_out': StringField( description="Name of output layer with bbox scores.", - optional=False + optional=True ), 'boxes_out': StringField( description="Name of output layer with bboxes.", @@ -70,10 +70,15 @@ def process(self, raw, identifiers, frame_meta): raw_outputs = self._extract_predictions(raw, frame_meta) classes = raw_outputs[self.classes_out] - valid_detections_mask = classes > 0 - classes = classes[valid_detections_mask] - boxes = raw_outputs[self.boxes_out][valid_detections_mask] - scores = raw_outputs[self.scores_out][valid_detections_mask] + if self.scores_out: + valid_detections_mask = classes > 0 + scores = raw_outputs[self.scores_out][valid_detections_mask] + else: + scores = raw_outputs[self.boxes_out][:, 4] + valid_detections_mask = scores > 0 + scores = scores[valid_detections_mask] + classes = classes[valid_detections_mask].astype(np.uint32) + boxes = raw_outputs[self.boxes_out][valid_detections_mask, :4] raw_masks = raw_outputs[self.raw_masks_out][valid_detections_mask] texts = raw_outputs[self.texts_out][valid_detections_mask] @@ -83,13 +88,18 @@ def process(self, raw, identifiers, frame_meta): texts = texts[confidence_filter] raw_masks = raw_masks[confidence_filter] + text_filter = texts != '' + classes = classes[text_filter] + boxes = boxes[text_filter] + texts = texts[text_filter] + raw_masks = raw_masks[text_filter] + results = [] for identifier, image_meta in zip(identifiers, frame_meta): original_image_size = image_meta['image_size'][:2] if 'scale_x' in image_meta and 'scale_y' in image_meta: - im_scale_x = image_meta['scale_x'] - im_scale_y = image_meta['scale_y'] + im_scale_x, im_scale_y = image_meta['scale_x'], image_meta['scale_y'] else: image_input = [shape for shape in image_meta['input_shape'].values() if len(shape) == 4] assert image_input, "image input not found" @@ -99,19 +109,21 @@ def process(self, raw, identifiers, frame_meta): im_scale_x = processed_image_size[1] / original_image_size[1] boxes[:, 0::2] /= im_scale_x boxes[:, 1::2] /= im_scale_y - classes = classes.astype(np.uint32) masks = [] - raw_mask_for_all_classes = np.shape(raw_masks)[1] != len(identifiers) - if raw_mask_for_all_classes: - per_obj_raw_masks = [] - for cls, raw_mask in zip(classes, raw_masks): - per_obj_raw_masks.append(raw_mask[cls, ...]) + + if self.scores_out: + raw_mask_for_all_classes = np.shape(raw_masks)[1] != len(identifiers) + if raw_mask_for_all_classes: + per_obj_raw_masks = [] + for cls, raw_mask in zip(classes, raw_masks): + per_obj_raw_masks.append(raw_mask[cls, ...]) + else: + per_obj_raw_masks = np.squeeze(raw_masks, axis=1) else: - per_obj_raw_masks = np.squeeze(raw_masks, axis=1) + per_obj_raw_masks = raw_masks for box, raw_cls_mask in zip(boxes, per_obj_raw_masks): - mask = self.segm_postprocess(box, raw_cls_mask, *original_image_size, True, False) - masks.append(mask) + masks.append(self.segm_postprocess(box, raw_cls_mask, *original_image_size, True, False)) rectangles = self.masks_to_rects(masks) diff --git a/tools/accuracy_checker/accuracy_checker/adapters/mixed_adapter.py b/tools/accuracy_checker/accuracy_checker/adapters/mixed_adapter.py index afac137a27c..c1d735926eb 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/mixed_adapter.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/mixed_adapter.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/adapters/mono_depth.py b/tools/accuracy_checker/accuracy_checker/adapters/mono_depth.py index c7dc76b60ac..4ec85fbdc3c 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/mono_depth.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/mono_depth.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,7 +22,9 @@ class MonoDepthAdapter(Adapter): __provider__ = 'mono_depth' def process(self, raw, identifiers, frame_meta): - batch_prediction = self._extract_predictions(raw, frame_meta)[self.output_blob] + raw_prediction = self._extract_predictions(raw, frame_meta) + self.select_output_blob(raw_prediction) + batch_prediction = raw_prediction[self.output_blob] result = [] for identifier, prediction in zip(identifiers, batch_prediction): result.append(DepthEstimationPrediction(identifier, prediction)) diff --git a/tools/accuracy_checker/accuracy_checker/adapters/nlp.py b/tools/accuracy_checker/accuracy_checker/adapters/nlp.py index 12b5d5f0b28..afc1fd72039 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/nlp.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/nlp.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ QuestionAnsweringPrediction, QuestionAnsweringEmbeddingPrediction, ClassificationPrediction, + SequenceClassificationPrediction, LanguageModelingPrediction) from ..config import PathField, NumberField, StringField, BoolField from ..utils import read_txt, UnsupportedPackage @@ -79,6 +80,9 @@ def configure(self): def process(self, raw, identifiers, frame_meta): raw_outputs = self._extract_predictions(raw, frame_meta) + if self.output_name is None: + self.select_output_blob(raw_outputs) + self.output_name = self.output_blob translation = raw_outputs[self.output_name] results = [] for identifier, tokens in zip(identifiers, translation): @@ -119,6 +123,7 @@ def configure(self): def process(self, raw, identifiers, frame_meta): raw_outputs = self._extract_predictions(raw, frame_meta) + self.select_output_blob(raw_outputs) translation = raw_outputs[self.output_blob] translation = np.transpose(translation, (1, 2, 0)) results = [] @@ -126,8 +131,9 @@ def process(self, raw, identifiers, frame_meta): best_sequence = best_beam[0] if self.eos_index is not None: if self.eos_index: - end_of_string = np.argwhere(best_sequence == self.eos_index)[0] - best_sequence = best_sequence[:end_of_string[0]] + end_of_string_args = np.argwhere(best_sequence == self.eos_index) + if np.size(end_of_string_args) != 0: + best_sequence = best_sequence[:end_of_string_args[0][0]] encoded_words = [] for seq_id, idx in enumerate(best_sequence): word = self.encoding_vocab.get(int(idx)) @@ -171,6 +177,7 @@ def process(self, raw, identifiers, frame_meta): return result + class QuestionAnsweringEmbeddingAdapter(Adapter): __provider__ = 'bert_question_answering_embedding' prediction_types = (QuestionAnsweringEmbeddingPrediction, ) @@ -196,6 +203,7 @@ def process(self, raw, identifiers=None, frame_meta=None): return result + class QuestionAnsweringBiDAFAdapter(Adapter): __provider__ = 'bidaf_question_answering' prediction_types = (QuestionAnsweringPrediction, ) @@ -225,6 +233,7 @@ def process(self, raw, identifiers, frame_meta): return result + class LanguageModelingAdapter(Adapter): __provider__ = 'common_language_modeling' prediction_types = (LanguageModelingPrediction, ) @@ -244,6 +253,8 @@ def process(self, raw, identifiers=None, frame_meta=None): raw_output = self._extract_predictions(raw, frame_meta) result = [] for identifier, token_output in zip(identifiers, raw_output[self.logits_out]): + if len(token_output.shape) == 3: + token_output = np.squeeze(token_output, axis=0) result.append(LanguageModelingPrediction(identifier, token_output)) return result @@ -270,9 +281,11 @@ def configure(self): self.classification_out = self.get_value_from_config('classification_out') def process(self, raw, identifiers=None, frame_meta=None): + outputs = self._extract_predictions(raw, frame_meta) if self.classification_out is None: + self.select_output_blob(outputs) self.classification_out = self.output_blob - outputs = self._extract_predictions(raw, frame_meta)[self.classification_out] + outputs = outputs[self.classification_out] if outputs.shape[1] != self.num_classes: _, hidden_size = outputs.shape output_weights = np.random.normal(scale=0.02, size=(self.num_classes, hidden_size)) @@ -286,3 +299,33 @@ def process(self, raw, identifiers=None, frame_meta=None): result.append(ClassificationPrediction(identifier, output)) return result + + +class BERTNamedEntityRecognition(Adapter): + __provider__ = 'bert_ner' + + @classmethod + def parameters(cls): + params = super().parameters() + params.update({ + 'classification_out': StringField( + optional=True, + description='Classification output layer name. If not provided, first output will be used.' + ) + }) + + return params + + def configure(self): + self.classification_out = self.get_value_from_config('classification_out') + + def process(self, raw, identifiers=None, frame_meta=None): + outputs = self._extract_predictions(raw, frame_meta) + if self.classification_out is None: + self.select_output_blob(outputs) + self.classification_out = self.output_blob + outputs = outputs[self.classification_out] + results = [] + for identifier, out in zip(identifiers, outputs): + results.append(SequenceClassificationPrediction(identifier, out)) + return results diff --git a/tools/accuracy_checker/accuracy_checker/adapters/optical_flow.py b/tools/accuracy_checker/accuracy_checker/adapters/optical_flow.py new file mode 100644 index 00000000000..6a044e4bd1c --- /dev/null +++ b/tools/accuracy_checker/accuracy_checker/adapters/optical_flow.py @@ -0,0 +1,48 @@ +""" +Copyright (c) 2018-2021 Intel Corporation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +import numpy as np +from .adapter import Adapter +from ..config import StringField +from ..representation import OpticalFlowPrediction + + +class PWCNetAdapter(Adapter): + __provider__ = 'pwcnet' + + @classmethod + def parameters(cls): + params = super().parameters() + params.update({ + 'flow_out': StringField(optional=True, description='target output layer') + }) + return params + + def configure(self): + self.flow_out = self.get_value_from_config('flow_out') + + def process(self, raw, identifiers, frame_meta): + raw_outputs = self._extract_predictions(raw, frame_meta) + if self.flow_out is None: + self.select_output_blob(raw_outputs) + self.flow_out = self.output_blob + result = [] + for identifier, flow in zip(identifiers, raw_outputs[self.flow_out]): + if flow.shape[0] == 2: + flow = np.transpose(flow, (1, 2, 0)) + result.append(OpticalFlowPrediction(identifier, flow)) + + return result diff --git a/tools/accuracy_checker/accuracy_checker/adapters/pose_estimation.py b/tools/accuracy_checker/accuracy_checker/adapters/pose_estimation.py index aa40c884a4b..e8e6c40cf77 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/pose_estimation.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/pose_estimation.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -55,8 +55,11 @@ def parameters(cls): return parameters - def validate_config(self): - super().validate_config(on_extra_argument=ConfigValidator.WARN_ON_EXTRA_ARGUMENT) + @classmethod + def validate_config(cls, config, fetch_only=False, **kwargs): + return super().validate_config( + config, fetch_only=fetch_only, on_extra_argument=ConfigValidator.WARN_ON_EXTRA_ARGUMENT + ) def configure(self): self.part_affinity_fields = self.get_value_from_config('part_affinity_fields_out') @@ -89,6 +92,7 @@ def process(self, raw, identifiers, frame_meta): ] raw_output = zip(identifiers, keypoints_heatmap, pafs, frame_meta) else: + self.select_output_blob(raw_outputs) concat_out = raw_outputs[self.output_blob] keypoints_num = concat_out.shape[1] // 3 keypoints_heat_map = concat_out[:, :keypoints_num, :] @@ -374,13 +378,16 @@ class SingleHumanPoseAdapter(Adapter): __provider__ = 'single_human_pose_estimation' prediction_types = (PoseEstimationPrediction, ) - def validate_config(self): - super().validate_config(on_extra_argument=ConfigValidator.WARN_ON_EXTRA_ARGUMENT) + @classmethod + def validate_config(cls, config, fetch_only=False, **kwargs): + return super().validate_config( + config, fetch_only=fetch_only, on_extra_argument=ConfigValidator.WARN_ON_EXTRA_ARGUMENT + ) def process(self, raw, identifiers=None, frame_meta=None): result = [] raw_outputs = self._extract_predictions(raw, frame_meta) - + self.select_output_blob(raw_outputs) outputs_batch = raw_outputs[self.output_blob] for i, heatmaps in enumerate(outputs_batch): heatmaps = np.transpose(heatmaps, (1, 2, 0)) @@ -436,12 +443,13 @@ def parameters(cls): return params def configure(self): - self.score_map_out = self.get_value_from_config('score_map_out') + self.score_map_out = self.get_value_from_config('score_map_output') def process(self, raw, identifiers, frame_meta): + raw_outputs = self._extract_predictions(raw, frame_meta) if self.score_map_out is None: + self.select_output_blob(raw_outputs) self.score_map_out = self.output_blob - raw_outputs = self._extract_predictions(raw, frame_meta) score_map_batch = raw_outputs[self.score_map_out] result = [] for identifier, score_map, meta in zip(identifiers, score_map_batch, frame_meta): @@ -484,7 +492,7 @@ def get_preds(scores): hm = output[p] px = int(math.floor(coords[p][0])) py = int(math.floor(coords[p][1])) - if 1 < px < res[0] and 1 < py < res[1]: + if 1 < px < res[0] and 1 < py < res[1]: diff = np.array([hm[py - 1][px] - hm[py - 1][px - 2], hm[py][px - 1] - hm[py - 2][px - 1]]) coords[p] += np.sign(diff).astype(float) * .25 coords += 0.5 diff --git a/tools/accuracy_checker/accuracy_checker/adapters/pose_estimation_3d.py b/tools/accuracy_checker/accuracy_checker/adapters/pose_estimation_3d.py index ba34e1bd4bd..a20b36d0202 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/pose_estimation_3d.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/pose_estimation_3d.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -62,8 +62,11 @@ def parameters(cls): return parameters - def validate_config(self): - super().validate_config(on_extra_argument=ConfigValidator.WARN_ON_EXTRA_ARGUMENT) + @classmethod + def validate_config(cls, config, fetch_only=False, **kwargs): + return super().validate_config( + config, fetch_only=fetch_only, on_extra_argument=ConfigValidator.WARN_ON_EXTRA_ARGUMENT + ) def configure(self): self.features_3d = self.get_value_from_config('features_3d_out') diff --git a/tools/accuracy_checker/accuracy_checker/adapters/pose_estimation_associative_embedding.py b/tools/accuracy_checker/accuracy_checker/adapters/pose_estimation_associative_embedding.py new file mode 100644 index 00000000000..ed37ef863a4 --- /dev/null +++ b/tools/accuracy_checker/accuracy_checker/adapters/pose_estimation_associative_embedding.py @@ -0,0 +1,307 @@ +""" +Copyright (c) 2020 Intel Corporation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +import numpy as np + +from ..adapters import Adapter +from ..config import ConfigValidator, StringField, ConfigError +from ..representation import PoseEstimationPrediction +from ..utils import contains_all, UnsupportedPackage + +try: + from scipy.optimize import linear_sum_assignment +except ImportError as error: + linear_sum_assignment = UnsupportedPackage('scipy.optimize', error.msg) + + +class AssociativeEmbeddingAdapter(Adapter): + __provider__ = 'human_pose_estimation_ae' + prediction_types = (PoseEstimationPrediction, ) + + @classmethod + def parameters(cls): + parameters = super().parameters() + parameters.update({ + 'heatmaps_out': StringField( + description="Name of output layer with keypoints heatmaps.", + optional=True + ), + 'nms_heatmaps_out': StringField( + description="Name of output layer with keypoints heatmaps after NMS.", + optional=True + ), + 'embeddings_out': StringField( + description="Name of output layer with associative embeddings.", + optional=True + ), + }) + return parameters + + @classmethod + def validate_config(cls, config, fetch_only=False, **kwargs): + return super().validate_config( + config, fetch_only=fetch_only, on_extra_argument=ConfigValidator.WARN_ON_EXTRA_ARGUMENT + ) + + def configure(self): + self.heatmaps = self.get_value_from_config('heatmaps_out') + self.nms_heatmaps = self.get_value_from_config('nms_heatmaps_out') + self.embeddings = self.get_value_from_config('embeddings_out') + if isinstance(linear_sum_assignment, UnsupportedPackage): + linear_sum_assignment.raise_error(self.__provider__) + self.decoder = AssociativeEmbeddingDecoder( + num_joints=17, + adjust=True, + refine=True, + delta=0.0, + max_num_people=30, + detection_threshold=0.1, + tag_threshold=1, + use_detection_val=True, + ignore_too_much=False) + + def process(self, raw, identifiers, frame_meta): + result = [] + raw_outputs = self._extract_predictions(raw, frame_meta) + if not contains_all(raw_outputs, (self.heatmaps, self.nms_heatmaps, self.embeddings)): + raise ConfigError('Some of the outputs are not found') + raw_output = zip(identifiers, raw_outputs[self.heatmaps][None], + raw_outputs[self.nms_heatmaps][None], + raw_outputs[self.embeddings][None], frame_meta) + + for identifier, heatmap, nms_heatmap, embedding, meta in raw_output: + poses, scores = self.decoder(heatmap, embedding, nms_heatmaps=nms_heatmap) + if len(scores) == 0: + result.append(PoseEstimationPrediction( + identifier, + np.empty((0, 17), dtype=float), + np.empty((0, 17), dtype=float), + np.empty((0, 17), dtype=float), + np.empty((0, ), dtype=float) + )) + continue + poses = poses.astype(float) + scores = np.asarray(scores).astype(float) + scale_x = meta['scale_x'] + scale_y = meta['scale_y'] + poses[:, :, 0] /= scale_x / 2 + poses[:, :, 1] /= scale_y / 2 + point_scores = poses[:, :, 2] + result.append(PoseEstimationPrediction( + identifier, + poses[:, :, 0], + poses[:, :, 1], + point_scores, + scores)) + return result + + +class Pose: + def __init__(self, num_joints, tag_size=1): + self.num_joints = num_joints + self.tag_size = tag_size + self.pose = np.zeros((num_joints, 2 + 1 + tag_size), dtype=np.float32) + self.pose_tag = np.zeros(tag_size, dtype=np.float32) + self.valid_points_num = 0 + + def add(self, idx, joint, tag): + self.pose[idx] = joint + self.pose_tag = (self.pose_tag * self.valid_points_num) + tag + self.valid_points_num += 1 + self.pose_tag /= self.valid_points_num + + @property + def tag(self): + if self.valid_points_num > 0: + return self.pose_tag + return None + + +class AssociativeEmbeddingDecoder: + def __init__(self, num_joints, max_num_people, detection_threshold, use_detection_val, + ignore_too_much, tag_threshold, + adjust=True, refine=True, delta=0.0, joints_order=None): + self.num_joints = num_joints + self.max_num_people = max_num_people + self.detection_threshold = detection_threshold + self.tag_threshold = tag_threshold + self.use_detection_val = use_detection_val + self.ignore_too_much = ignore_too_much + + if self.num_joints == 17 and joints_order is None: + self.joint_order = (0, 1, 2, 3, 4, 5, 6, 11, 12, 7, 8, 9, 10, 13, 14, 15, 16) + else: + self.joint_order = list(np.arange(self.num_joints)) + + self.do_adjust = adjust + self.do_refine = refine + self.delta = delta + + def match(self, tag_k, loc_k, val_k): + return list(map(self._match_by_tag, zip(tag_k, loc_k, val_k))) + + @staticmethod + def _max_match(scores): + r, c = linear_sum_assignment(scores) + tmp = np.stack((r, c), axis=1) + return tmp + + def _match_by_tag(self, inp): + tag_k, loc_k, val_k = inp + embd_size = tag_k.shape[2] + all_joints = np.concatenate((loc_k, val_k[..., None], tag_k), -1) + + poses = [] + for idx in self.joint_order: + tags = tag_k[idx] + joints = all_joints[idx] + mask = joints[:, 2] > self.detection_threshold + tags = tags[mask] + joints = joints[mask] + + if len(poses) == 0: + for tag, joint in zip(tags, joints): + pose = Pose(self.num_joints, embd_size) + pose.add(idx, joint, tag) + poses.append(pose) + continue + + if joints.shape[0] == 0 or (self.ignore_too_much and len(poses) == self.max_num_people): + continue + + poses_tags = np.stack([p.tag for p in poses], axis=0) + diff = tags[:, None] - poses_tags[None, :] + diff_normed = np.linalg.norm(diff, ord=2, axis=2) + diff_saved = np.copy(diff_normed) + if self.use_detection_val: + diff_normed = np.round(diff_normed) * 100 - joints[:, 2:3] + num_added = diff.shape[0] + num_grouped = diff.shape[1] + if num_added > num_grouped: + diff_normed = np.pad(diff_normed, ((0, 0), (0, num_added - num_grouped)), + mode='constant', constant_values=1e10) + + pairs = self._max_match(diff_normed) + for row, col in pairs: + if row < num_added and col < num_grouped and diff_saved[row][col] < self.tag_threshold: + poses[col].add(idx, joints[row], tags[row]) + else: + pose = Pose(self.num_joints, embd_size) + pose.add(idx, joints[row], tags[row]) + poses.append(pose) + + ans = np.asarray([p.pose for p in poses], dtype=np.float32).reshape(-1, self.num_joints, 2 + 1 + embd_size) + tags = np.asarray([p.tag for p in poses], dtype=np.float32).reshape(-1, embd_size) + return ans, tags + + def top_k(self, heatmaps, tags): + N, K, H, W = heatmaps.shape + heatmaps = heatmaps.reshape(N, K, -1) + ind = heatmaps.argpartition(-self.max_num_people, axis=2)[:, :, -self.max_num_people:] + val_k = np.take_along_axis(heatmaps, ind, axis=2) + subind = np.argsort(-val_k, axis=2) + ind = np.take_along_axis(ind, subind, axis=2) + val_k = np.take_along_axis(val_k, subind, axis=2) + + tags = tags.reshape(N, K, W * H, -1) + tag_k = [np.take_along_axis(tags[..., i], ind, axis=2) for i in range(tags.shape[3])] + tag_k = np.stack(tag_k, axis=3) + + x = ind % W + y = ind // W + ind_k = np.stack((x, y), axis=3) + + ans = {'tag_k': tag_k, 'loc_k': ind_k, 'val_k': val_k} + return ans + + @staticmethod + def adjust(ans, heatmaps): + H, W = heatmaps.shape[-2:] + for n, people in enumerate(ans): + for person in people: + for k, joint in enumerate(person): + heatmap = heatmaps[n, k] + px = int(joint[0]) + py = int(joint[1]) + if 1 < px < W - 1 and 1 < py < H - 1: + diff = np.array([ + heatmap[py, px + 1] - heatmap[py, px - 1], + heatmap[py + 1, px] - heatmap[py - 1, px] + ]) + joint[:2] += np.sign(diff) * .25 + return ans + + @staticmethod + def refine(heatmap, tag, keypoints, pose_tag=None): + K, H, W = heatmap.shape + if len(tag.shape) == 3: + tag = tag[..., None] + + if pose_tag is not None: + prev_tag = pose_tag + else: + tags = [] + for i in range(K): + if keypoints[i, 2] > 0: + x, y = keypoints[i][:2].astype(int) + tags.append(tag[i, y, x]) + prev_tag = np.mean(tags, axis=0) + + for i, (_heatmap, _tag) in enumerate(zip(heatmap, tag)): + if keypoints[i, 2] > 0: + continue + # Get position with the closest tag value to the pose tag. + diff = np.abs(_tag[..., 0] - prev_tag) + 0.5 + diff = diff.astype(np.int32).astype(_heatmap.dtype) + diff -= _heatmap + idx = diff.argmin() + y, x = np.divmod(idx, _heatmap.shape[-1]) + # Corresponding keypoint detection score. + val = _heatmap[y, x] + if val > 0: + keypoints[i, :3] = x, y, val + if 1 < x < W - 1 and 1 < y < H - 1: + diff = np.array([ + _heatmap[y, x + 1] - _heatmap[y, x - 1], + _heatmap[y + 1, x] - _heatmap[y - 1, x] + ]) + keypoints[i, :2] += np.sign(diff) * .25 + + return keypoints + + def __call__(self, heatmaps, tags, nms_heatmaps=None): + ans = self.match(**self.top_k(nms_heatmaps, tags)) + ans, ans_tags = map(list, zip(*ans)) + + if self.do_adjust: + ans = self.adjust(ans, heatmaps) + + if self.delta != 0.0: + for people in ans: + for person in people: + for joint in person: + joint[:2] += self.delta + + ans = ans[0] + scores = np.asarray([i[:, 2].mean() for i in ans]) + + if self.do_refine: + heatmap_numpy = heatmaps[0] + tag_numpy = tags[0] + for i, pose in enumerate(ans): + ans[i] = self.refine(heatmap_numpy, tag_numpy, pose, ans_tags[0][i]) + + return ans, scores diff --git a/tools/accuracy_checker/accuracy_checker/adapters/pose_estimation_openpose.py b/tools/accuracy_checker/accuracy_checker/adapters/pose_estimation_openpose.py new file mode 100644 index 00000000000..29058edac00 --- /dev/null +++ b/tools/accuracy_checker/accuracy_checker/adapters/pose_estimation_openpose.py @@ -0,0 +1,432 @@ +""" +Copyright (c) 2020 Intel Corporation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +import cv2 +import numpy as np + +try: + from numpy.core.umath import clip +except ImportError: + from numpy import clip + +from ..adapters import Adapter +from ..config import ConfigValidator, StringField, ConfigError, NumberField +from ..representation import PoseEstimationPrediction +from ..utils import contains_any, UnsupportedPackage + +try: + from skimage.measure import block_reduce +except ImportError as import_error: + block_reduce = UnsupportedPackage('skimage.measure', import_error.msg) + + +class OpenPoseAdapter(Adapter): + __provider__ = 'human_pose_estimation_openpose' + prediction_types = (PoseEstimationPrediction, ) + + @classmethod + def parameters(cls): + parameters = super().parameters() + parameters.update({ + 'part_affinity_fields_out': StringField( + description="Name of output layer with keypoints pairwise relations (part affinity fields).", + optional=True + ), + 'keypoints_heatmap_out': StringField( + description="Name of output layer with keypoints heatmaps.", optional=True + ), + 'upscale_factor': NumberField( + description="Upscaling factor for output feature maps before postprocessing.", + value_type=float, min_value=1, default=1, optional=True + ), + }) + return parameters + + @classmethod + def validate_config(cls, config, fetch_only=False, **kwargs): + return super().validate_config( + config, fetch_only=fetch_only, on_extra_argument=ConfigValidator.WARN_ON_EXTRA_ARGUMENT + ) + + def configure(self): + self.upscale_factor = self.get_value_from_config('upscale_factor') + self.part_affinity_fields = self.get_value_from_config('part_affinity_fields_out') + self.keypoints_heatmap = self.get_value_from_config('keypoints_heatmap_out') + self.concat_out = self.part_affinity_fields is None and self.keypoints_heatmap is None + if not self.concat_out: + contains_both = self.part_affinity_fields is not None and self.keypoints_heatmap is not None + if not contains_both: + raise ConfigError( + 'human_pose_estimation adapter should contains both: keypoints_heatmap_out ' + 'and part_affinity_fields_out or not contain them at all (in single output model case)' + ) + self._keypoints_heatmap_bias = self.keypoints_heatmap + '/add_' + self._part_affinity_fields_bias = self.part_affinity_fields + '/add_' + + self.decoder = OpenPoseDecoder(num_joints=18, delta=0.5 if self.upscale_factor == 1 else 0.0) + if isinstance(block_reduce, UnsupportedPackage): + block_reduce.raise_error(self.__provider__) + self.nms = HeatmapNMS(kernel=2 * int(np.round(6 / 7 * self.upscale_factor)) + 1) + + def process(self, raw, identifiers, frame_meta): + result = [] + raw_outputs = self._extract_predictions(raw, frame_meta) + if not self.concat_out: + if not contains_any(raw_outputs, [self.part_affinity_fields, self._part_affinity_fields_bias]): + raise ConfigError('part affinity fields output not found') + if not contains_any(raw_outputs, [self.keypoints_heatmap, self._keypoints_heatmap_bias]): + raise ConfigError('keypoints heatmap output not found') + keypoints_heatmap = raw_outputs[ + self.keypoints_heatmap if self.keypoints_heatmap in raw_outputs else self._keypoints_heatmap_bias + ] + pafs = raw_outputs[ + self.part_affinity_fields if self.part_affinity_fields in raw_outputs + else self._part_affinity_fields_bias + ] + raw_output = zip(identifiers, keypoints_heatmap, pafs, frame_meta) + else: + concat_out = raw_outputs[self.output_blob] + keypoints_num = concat_out.shape[1] // 3 + keypoints_heat_map = concat_out[:, :keypoints_num, :] + pafs = concat_out[:, keypoints_num:, :] + raw_output = zip(identifiers, keypoints_heat_map, pafs, frame_meta) + for identifier, heatmap, paf, meta in raw_output: + output_h, output_w = heatmap.shape[-2:] + if self.upscale_factor > 1: + self.decoder.delta = 0 + heatmap = np.transpose(heatmap, (1, 2, 0)) + heatmap = cv2.resize(heatmap, (0, 0), fx=self.upscale_factor, fy=self.upscale_factor, + interpolation=cv2.INTER_CUBIC) + heatmap = np.transpose(heatmap, (2, 0, 1)) + paf = np.transpose(np.squeeze(paf), (1, 2, 0)) + paf = cv2.resize(paf, (0, 0), fx=self.upscale_factor, fy=self.upscale_factor, + interpolation=cv2.INTER_CUBIC) + paf = np.transpose(paf, (2, 0, 1)) + hmap = heatmap[None] + nms_hmap = self.nms(hmap) + poses, scores = self.decoder(hmap, nms_hmap, paf[None]) + if len(scores) == 0: + result.append(PoseEstimationPrediction( + identifier, + np.empty((0, 17), dtype=float), + np.empty((0, 17), dtype=float), + np.empty((0, 17), dtype=float), + np.empty((0, ), dtype=float) + )) + continue + poses = poses.astype(float) + scores = np.asarray(scores).astype(float) + scale_x = meta['scale_x'] + scale_y = meta['scale_y'] + input_h, input_w = next(iter(meta['input_shape'].values()))[-2:] + output_scale_x = input_w / output_w + output_scale_y = input_h / output_h + poses[:, :, 0] *= output_scale_x / self.upscale_factor / scale_x + poses[:, :, 1] *= output_scale_y / self.upscale_factor / scale_y + point_scores = poses[:, :, 2] + + result.append(PoseEstimationPrediction( + identifier, + poses[:, :, 0], + poses[:, :, 1], + point_scores, + scores)) + return result + + +class HeatmapNMS: + def __init__(self, kernel): + self.kernel = kernel + self.pad = (kernel - 1) // 2 + + def max_pool(self, x): + # Max pooling kernel x kernel with stride 1 x 1. + k = self.kernel + p = self.pad + pooled = np.zeros_like(x) + hmap = np.pad(x, ((0, 0), (0, 0), (p, p), (p, p))) + h, w = hmap.shape[-2:] + for i in range(k): + n = (h - i) // k * k + for j in range(k): + m = (w - j) // k * k + hmap_slice = hmap[..., i:i + n, j:j + m] + pooled[..., i::k, j::k] = block_reduce(hmap_slice, (1, 1, k, k), np.max) + return pooled + + def __call__(self, heatmaps): + pooled = self.max_pool(heatmaps) + return heatmaps * (pooled == heatmaps).astype(heatmaps.dtype) + + +class OpenPoseDecoder: + + BODY_PARTS_KPT_IDS = ((1, 2), (1, 5), (2, 3), (3, 4), (5, 6), (6, 7), (1, 8), (8, 9), (9, 10), (1, 11), + (11, 12), (12, 13), (1, 0), (0, 14), (14, 16), (0, 15), (15, 17), (2, 16), (5, 17)) + BODY_PARTS_PAF_IDS = (12, 20, 14, 16, 22, 24, 0, 2, 4, 6, 8, 10, 28, 30, 34, 32, 36, 18, 26) + + def __init__(self, num_joints=18, skeleton=BODY_PARTS_KPT_IDS, paf_indices=BODY_PARTS_PAF_IDS, + max_points=100, score_threshold=0.1, min_paf_alignment_score=0.05, delta=0.5): + self.num_joints = num_joints + self.skeleton = skeleton + self.paf_indices = paf_indices + self.max_points = max_points + self.score_threshold = score_threshold + self.min_paf_alignment_score = min_paf_alignment_score + self.delta = delta + + self.points_per_limb = 10 + self.grid = np.arange(self.points_per_limb, dtype=np.float32).reshape(1, -1, 1) + + def __call__(self, heatmaps, nms_heatmaps, pafs): + batch_size, _, h, w = heatmaps.shape + assert batch_size == 1, 'Batch size of 1 only supported' + + keypoints = self.extract_points(heatmaps, nms_heatmaps) + pafs = np.transpose(pafs, (0, 2, 3, 1)) + + if self.delta > 0: + for kpts in keypoints: + kpts[:, :2] += self.delta + clip(kpts[:, 0], 0, w - 1, out=kpts[:, 0]) + clip(kpts[:, 1], 0, h - 1, out=kpts[:, 1]) + + pose_entries, keypoints = self.group_keypoints(keypoints, pafs, pose_entry_size=self.num_joints + 2) + poses, scores = self.convert_to_coco_format(pose_entries, keypoints) + if len(poses) > 0: + poses = np.asarray(poses, dtype=np.float32) + poses = poses.reshape((poses.shape[0], -1, 3)) + else: + poses = np.empty((0, 17, 3), dtype=np.float32) + scores = np.empty(0, dtype=np.float32) + + return poses, scores + + def extract_points(self, heatmaps, nms_heatmaps): + batch_size, channels_num, h, w = heatmaps.shape + assert batch_size == 1, 'Batch size of 1 only supported' + assert channels_num >= self.num_joints + + xs, ys, scores = self.top_k(nms_heatmaps) + masks = scores > self.score_threshold + all_keypoints = [] + keypoint_id = 0 + for k in range(self.num_joints): + # Filter low-score points. + mask = masks[0, k] + x = xs[0, k][mask].ravel() + y = ys[0, k][mask].ravel() + score = scores[0, k][mask].ravel() + n = len(x) + if n == 0: + all_keypoints.append(np.empty((0, 4), dtype=np.float32)) + continue + # Apply quarter offset to improve localization accuracy. + x, y = self.refine(heatmaps[0, k], x, y) + clip(x, 0, w - 1, out=x) + clip(y, 0, h - 1, out=y) + # Pack resulting points. + keypoints = np.empty((n, 4), dtype=np.float32) + keypoints[:, 0] = x + keypoints[:, 1] = y + keypoints[:, 2] = score + keypoints[:, 3] = np.arange(keypoint_id, keypoint_id + n) + keypoint_id += n + all_keypoints.append(keypoints) + return all_keypoints + + def top_k(self, heatmaps): + N, K, _, W = heatmaps.shape + heatmaps = heatmaps.reshape(N, K, -1) + # Get positions with top scores. + ind = heatmaps.argpartition(-self.max_points, axis=2)[:, :, -self.max_points:] + scores = np.take_along_axis(heatmaps, ind, axis=2) + # Keep top scores sorted. + subind = np.argsort(-scores, axis=2) + ind = np.take_along_axis(ind, subind, axis=2) + scores = np.take_along_axis(scores, subind, axis=2) + y, x = np.divmod(ind, W) + return x, y, scores + + @staticmethod + def refine(heatmap, x, y): + h, w = heatmap.shape[-2:] + valid = np.logical_and(np.logical_and(x > 0, x < w - 1), np.logical_and(y > 0, y < h - 1)) + xx = x[valid] + yy = y[valid] + dx = np.sign(heatmap[yy, xx + 1] - heatmap[yy, xx - 1], dtype=np.float32) * 0.25 + dy = np.sign(heatmap[yy + 1, xx] - heatmap[yy - 1, xx], dtype=np.float32) * 0.25 + x = x.astype(np.float32) + y = y.astype(np.float32) + x[valid] += dx + y[valid] += dy + return x, y + + @staticmethod + def is_disjoint(pose_a, pose_b): + pose_a = pose_a[:-2] + pose_b = pose_b[:-2] + return np.all(np.logical_or.reduce((pose_a == pose_b, pose_a < 0, pose_b < 0))) + + def update_poses(self, kpt_a_id, kpt_b_id, all_keypoints, connections, pose_entries, pose_entry_size): + for connection in connections: + pose_a_idx = -1 + pose_b_idx = -1 + for j, pose in enumerate(pose_entries): + if pose[kpt_a_id] == connection[0]: + pose_a_idx = j + if pose[kpt_b_id] == connection[1]: + pose_b_idx = j + if pose_a_idx < 0 and pose_b_idx < 0: + # Create new pose entry. + pose_entry = np.full(pose_entry_size, -1, dtype=np.float32) + pose_entry[kpt_a_id] = connection[0] + pose_entry[kpt_b_id] = connection[1] + pose_entry[-1] = 2 + pose_entry[-2] = np.sum(all_keypoints[connection[0:2], 2]) + connection[2] + pose_entries.append(pose_entry) + elif pose_a_idx >= 0 and pose_b_idx >= 0 and pose_a_idx != pose_b_idx: + # Merge two poses are disjoint merge them, otherwise ignore connection. + pose_a = pose_entries[pose_a_idx] + pose_b = pose_entries[pose_b_idx] + if self.is_disjoint(pose_a, pose_b): + pose_a += pose_b + pose_a[:-2] += 1 + pose_a[-2] += connection[2] + del pose_entries[pose_b_idx] + elif pose_a_idx >= 0 and pose_b_idx >= 0: + # Adjust score of a pose. + pose_entries[pose_a_idx][-2] += connection[2] + elif pose_a_idx >= 0: + # Add a new limb into pose. + pose = pose_entries[pose_a_idx] + if pose[kpt_b_id] < 0: + pose[-2] += all_keypoints[connection[1], 2] + pose[kpt_b_id] = connection[1] + pose[-2] += connection[2] + pose[-1] += 1 + elif pose_b_idx >= 0: + # Add a new limb into pose. + pose = pose_entries[pose_b_idx] + if pose[kpt_a_id] < 0: + pose[-2] += all_keypoints[connection[0], 2] + pose[kpt_a_id] = connection[0] + pose[-2] += connection[2] + pose[-1] += 1 + return pose_entries + + @staticmethod + def connections_nms(a_idx, b_idx, affinity_scores): + # From all retrieved connections that share starting/ending keypoints leave only the top-scoring ones. + order = affinity_scores.argsort()[::-1] + affinity_scores = affinity_scores[order] + a_idx = a_idx[order] + b_idx = b_idx[order] + idx = [] + has_kpt_a = set() + has_kpt_b = set() + for t, (i, j) in enumerate(zip(a_idx, b_idx)): + if i not in has_kpt_a and j not in has_kpt_b: + idx.append(t) + has_kpt_a.add(i) + has_kpt_b.add(j) + idx = np.asarray(idx, dtype=np.int32) + return a_idx[idx], b_idx[idx], affinity_scores[idx] + + def group_keypoints(self, all_keypoints_by_type, pafs, pose_entry_size=20): + all_keypoints = np.concatenate(all_keypoints_by_type, axis=0) + pose_entries = [] + # For every limb. + for part_id, paf_channel in enumerate(self.paf_indices): + kpt_a_id, kpt_b_id = self.skeleton[part_id] + kpts_a = all_keypoints_by_type[kpt_a_id] + kpts_b = all_keypoints_by_type[kpt_b_id] + n = len(kpts_a) + m = len(kpts_b) + if n == 0 or m == 0: + continue + + # Get vectors between all pairs of keypoints, i.e. candidate limb vectors. + a = kpts_a[:, :2] + a = np.broadcast_to(a[None], (m, n, 2)) + b = kpts_b[:, :2] + vec_raw = (b[:, None, :] - a).reshape(-1, 1, 2) + + # Sample points along every candidate limb vector. + steps = (1 / (self.points_per_limb - 1) * vec_raw) + points = steps * self.grid + a.reshape(-1, 1, 2) + points = points.round().astype(dtype=np.int32) + x = points[..., 0].ravel() + y = points[..., 1].ravel() + + # Compute affinity score between candidate limb vectors and part affinity field. + part_pafs = pafs[0, :, :, paf_channel:paf_channel + 2] + field = part_pafs[y, x].reshape(-1, self.points_per_limb, 2) + vec_norm = np.linalg.norm(vec_raw, ord=2, axis=-1, keepdims=True) + vec = vec_raw / (vec_norm + 1e-6) + affinity_scores = (field * vec).sum(-1).reshape(-1, self.points_per_limb) + valid_affinity_scores = affinity_scores > self.min_paf_alignment_score + valid_num = valid_affinity_scores.sum(1) + affinity_scores = (affinity_scores * valid_affinity_scores).sum(1) / (valid_num + 1e-6) + success_ratio = valid_num / self.points_per_limb + + # Get a list of limbs according to the obtained affinity score. + valid_limbs = np.where(np.logical_and(affinity_scores > 0, success_ratio > 0.8))[0] + if len(valid_limbs) == 0: + continue + b_idx, a_idx = np.divmod(valid_limbs, n) + affinity_scores = affinity_scores[valid_limbs] + + # Suppress incompatible connections. + a_idx, b_idx, affinity_scores = self.connections_nms(a_idx, b_idx, affinity_scores) + connections = list(zip(kpts_a[a_idx, 3].astype(np.int32), + kpts_b[b_idx, 3].astype(np.int32), + affinity_scores)) + if len(connections) == 0: + continue + + # Update poses with new connections. + pose_entries = self.update_poses(kpt_a_id, kpt_b_id, all_keypoints, + connections, pose_entries, pose_entry_size) + + # Remove poses with not enough points. + pose_entries = np.asarray(pose_entries, dtype=np.float32).reshape(-1, pose_entry_size) + pose_entries = pose_entries[pose_entries[:, -1] >= 3] + return pose_entries, all_keypoints + + @staticmethod + def convert_to_coco_format(pose_entries, all_keypoints): + num_joints = 17 + coco_keypoints = [] + scores = [] + for pose in pose_entries: + if len(pose) == 0: + continue + keypoints = np.zeros(num_joints * 3) + reorder_map = [0, -1, 6, 8, 10, 5, 7, 9, 12, 14, 16, 11, 13, 15, 2, 1, 4, 3] + person_score = pose[-2] + for keypoint_id, target_id in zip(pose[:-2], reorder_map): + if target_id < 0: + continue + cx, cy, score = 0, 0, 0 # keypoint not found + if keypoint_id != -1: + cx, cy, score = all_keypoints[int(keypoint_id), 0:3] + keypoints[target_id * 3 + 0] = cx + keypoints[target_id * 3 + 1] = cy + keypoints[target_id * 3 + 2] = score + coco_keypoints.append(keypoints) + scores.append(person_score * max(0, (pose[-1] - 1))) # -1 for 'neck' + return np.asarray(coco_keypoints), np.asarray(scores) diff --git a/tools/accuracy_checker/accuracy_checker/adapters/regression.py b/tools/accuracy_checker/accuracy_checker/adapters/regression.py index e0cc0331ae2..81415e3c95d 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/regression.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/regression.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ import numpy as np from .adapter import Adapter -from ..config import BoolField +from ..config import BoolField, ListField from ..representation import RegressionPrediction @@ -47,7 +47,9 @@ def process(self, raw, identifiers, frame_meta): Returns: list of RegressionPrediction objects """ - predictions = self._extract_predictions(raw, frame_meta)[self.output_blob] + predictions = self._extract_predictions(raw, frame_meta) + self.select_output_blob(predictions) + predictions = predictions[self.output_blob] if len(np.shape(predictions)) == 1 or (self.keep_shape and np.shape(predictions)[0] != len(identifiers)): predictions = np.expand_dims(predictions, axis=0) if not self.keep_shape: @@ -59,3 +61,29 @@ def process(self, raw, identifiers, frame_meta): result.append(prediction) return result + + +class MultiOutputRegression(Adapter): + __provider__ = 'multi_output_regression' + prediction_types = (RegressionPrediction,) + + @classmethod + def parameters(cls): + params = super().parameters() + params.update({ + 'outputs': ListField(value_type=str, allow_empty=False, description='list of target output names') + }) + return params + + def configure(self): + self.output_list = self.get_value_from_config('outputs') + + def process(self, raw, identifiers, frame_meta): + raw_outputs = self._extract_predictions(raw, frame_meta) + result = [] + for batch_id, identfier in enumerate(identifiers): + res_dict = {} + for output_name in self.output_list: + res_dict.update({output_name: raw_outputs[output_name][batch_id]}) + result.append(RegressionPrediction(identfier, res_dict)) + return result diff --git a/tools/accuracy_checker/accuracy_checker/adapters/reidentification.py b/tools/accuracy_checker/accuracy_checker/adapters/reidentification.py index e4b776e2d20..419e9f4f17a 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/reidentification.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/reidentification.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ from ..adapters import Adapter from ..representation import ReIdentificationPrediction +from ..config import BoolField, StringField class ReidAdapter(Adapter): @@ -27,11 +28,28 @@ class ReidAdapter(Adapter): __provider__ = 'reid' prediction_types = (ReIdentificationPrediction, ) + @classmethod + def parameters(cls): + parameters = super().parameters() + parameters.update({ + 'grn_workaround': BoolField( + optional=True, default=True, + description='allows processing output with adding Global Region Normalization layer' + ), + 'joining_method': StringField( + optional=True, default='sum', description='method used to join embeddings', + choices=['sum', 'concatenation'] + ) + }) + + return parameters + def configure(self): """ Specifies parameters of config entry """ - self.grn_workaround = self.launcher_config.get("grn_workaround", True) + self.grn_workaround = self.get_value_from_config('grn_workaround') + self.joining_method = self.get_value_from_config('joining_method') def process(self, raw, identifiers, frame_meta): """ @@ -41,7 +59,9 @@ def process(self, raw, identifiers, frame_meta): Returns: list of ReIdentificationPrediction objects """ - prediction = self._extract_predictions(raw, frame_meta)[self.output_blob] + raw_prediction = self._extract_predictions(raw, frame_meta) + self.select_output_blob(raw_prediction) + prediction = raw_prediction[self.output_blob] if self.grn_workaround: # workaround: GRN layer @@ -57,3 +77,15 @@ def _grn_layer(prediction): prediction = prediction / np.sqrt(sum_[:, np.newaxis] + GRN_BIAS) return prediction + + def _extract_predictions(self, outputs_list, meta): + if not (meta[-1] or {}).get('multi_infer', False): + return outputs_list[0] if not isinstance(outputs_list, dict) else outputs_list + + if len(outputs_list) == 2 and not isinstance(outputs_list, dict): + self.select_output_blob(outputs_list[0]) + emb1, emb2 = outputs_list[0][self.output_blob], outputs_list[1][self.output_blob] + emb = emb1 + emb2 if self.joining_method == 'sum' else np.concatenate((emb1, emb2), axis=1) + return {self.output_blob: emb} + + return outputs_list[0] if not isinstance(outputs_list, dict) else outputs_list diff --git a/tools/accuracy_checker/accuracy_checker/adapters/retinaface.py b/tools/accuracy_checker/accuracy_checker/adapters/retinaface.py index 43939eed29e..d4718998557 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/retinaface.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/retinaface.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ import numpy as np from ..adapters import Adapter -from ..config import ListField +from ..config import ListField, BoolField, NumberField from ..postprocessor import NMS from ..representation import ( DetectionPrediction, @@ -34,10 +34,24 @@ def parameters(cls): params = super().parameters() params.update( { - 'bboxes_outputs': ListField(), - 'scores_outputs': ListField(), - 'landmarks_outputs': ListField(optional=True), - 'type_scores_outputs': ListField(optional=True) + 'bboxes_outputs': ListField(description="Names for output layers with face detection boxes"), + 'scores_outputs': ListField(description="Names for output layers with face detection score"), + 'landmarks_outputs': ListField( + optional=True, description="Names for output layers with predicted facial landmarks" + ), + 'type_scores_outputs': ListField( + optional=True, description="Names for output layers with attributes detection score" + ), + 'include_boundaries': BoolField( + optional=True, default=False, description="Allows include boundaries for NMS" + ), + 'keep_top_k': NumberField( + min_value=1, optional=True, description="Maximal number of boxes which should be kept", + value_type=int + ), + 'nms_threshold': NumberField( + min_value=0, optional=True, default=0.5, description="Overlap threshold for NMS" + ) } ) return params @@ -47,6 +61,9 @@ def configure(self): self.scores_output = self.get_value_from_config('scores_outputs') self.landmarks_output = self.get_value_from_config('landmarks_outputs') or [] self.type_scores_output = self.get_value_from_config('type_scores_outputs') or [] + self.include_boundaries = self.get_value_from_config('include_boundaries') + self.keep_top_k = self.get_value_from_config('keep_top_k') + self.nms_threshold = self.get_value_from_config('nms_threshold') _ratio = (1.,) self.anchor_cfg = { 32: {'SCALES': (32, 16), 'BASE_SIZE': 16, 'RATIOS': _ratio}, @@ -62,6 +79,7 @@ def configure(self): self.landmark_std = 0.2 else: self.landmark_std = 1.0 + self._anchor_plane_cache = {} def process(self, raw, identifiers, frame_meta): raw_predictions = self._extract_predictions(raw, frame_meta) @@ -78,11 +96,18 @@ def process(self, raw, identifiers, frame_meta): bbox_deltas = raw_predictions[self.bboxes_output[_idx]][batch_id] height, width = bbox_deltas.shape[1], bbox_deltas.shape[2] anchors_fpn = self._anchors_fpn[s] - anchors = self.anchors_plane(height, width, int(s), anchors_fpn) - anchors = anchors.reshape((height * width * anchor_num, 4)) + if (height, width) in self._anchor_plane_cache and s in self._anchor_plane_cache[(height, width)]: + anchors = self._anchor_plane_cache[(height, width)][s] + else: + anchors = self.anchors_plane(height, width, int(s), anchors_fpn) + anchors = anchors.reshape((height * width * anchor_num, 4)) + if (height, width) not in self._anchor_plane_cache: + self._anchor_plane_cache[(height, width)] = {} + self._anchor_plane_cache[(height, width)][s] = anchors proposals = self._get_proposals(bbox_deltas, anchor_num, anchors) x_mins, y_mins, x_maxs, y_maxs = proposals.T - keep = NMS.nms(x_mins, y_mins, x_maxs, y_maxs, scores, 0.5, False) + keep = NMS.nms(x_mins, y_mins, x_maxs, y_maxs, scores, self.nms_threshold, + self.include_boundaries, self.keep_top_k) proposals_list.extend(proposals[keep]) scores_list.extend(scores[keep]) if self.type_scores_output: diff --git a/tools/accuracy_checker/accuracy_checker/adapters/retinanet.py b/tools/accuracy_checker/accuracy_checker/adapters/retinanet.py index 728cd112fcc..42a4d2b1ceb 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/retinanet.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/retinanet.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -11,11 +11,13 @@ limitations under the License. """ +from collections import OrderedDict import numpy as np from .adapter import Adapter from ..config import ListField, StringField, NumberField from ..representation import DetectionPrediction +from ..postprocessor import NMS class MultiOutRetinaNet(Adapter): @@ -33,7 +35,7 @@ def parameters(cls): 'pre_nms_top_k': NumberField( description='pre nms keep top k boxes', value_type=int, optional=True, default=1000 ), - 'post_nms_top_k': NumberField( + 'post_nms_top_k': NumberField( description='post nms keep top k boxes', value_type=int, optional=True, default=100 ), 'min_conf': NumberField( @@ -100,13 +102,13 @@ def delta2box(deltas, anchors, size, stride): pred_ctr = deltas[:, :2] * anchors_wh + ctr pred_wh = np.exp(deltas[:, 2:]) * anchors_wh - m = np.zeros([2]) - M = np.array([size]) * stride - 1 - clamp = lambda t: np.maximum(m, np.minimum(t, M)) - return np.concatenate([ - clamp(pred_ctr - 0.5 * pred_wh), - clamp(pred_ctr + 0.5 * pred_wh - 1) - ], 1) + boxes = np.concatenate([ + pred_ctr - 0.5 * pred_wh, + pred_ctr + 0.5 * pred_wh - 1, + ], axis=1) + + M = np.array([*size, *size]) * stride - 1 + return np.clip(boxes, 0, M) num_boxes = 4 num_anchors = anchors.shape[0] if anchors is not None else 1 @@ -228,7 +230,7 @@ def parameters(cls): params = super().parameters() params.update({ 'loc_out': StringField(description='boxes localization output'), - 'class_out': StringField(description="output with classes probabilities") + 'class_out': StringField(description="output with classes probabilities") }) return params @@ -333,3 +335,254 @@ def regress_boxes(self, boxes, deltas): pred_boxes = np.stack([pred_boxes_x1, pred_boxes_y1, pred_boxes_x2, pred_boxes_y2], axis=1) return pred_boxes + + +class RetinaNetTF2(Adapter): + __provider__ = 'retinanet_tf2' + + @classmethod + def parameters(cls): + params = super().parameters() + params.update({ + 'boxes_outputs': ListField(description='boxes localization output', value_type=str), + 'class_outputs': ListField(description="output with classes probabilities"), + 'min_level': NumberField(optional=True, value_type=int, default=3, description='min pyramid level'), + 'max_level': NumberField(optional=True, value_type=int, default=7, description='max pyramid level'), + 'aspect_ratios': ListField( + value_type=float, optional=True, default=[1, 2, 0.5], description='aspect ratio levels' + ), + 'num_scales': NumberField( + optional=True, default=3, value_type=int, min_value=1, description='number anchor scales'), + 'anchor_size': NumberField(optional=True, default=4, description='anchor box size'), + 'total_size': NumberField( + optional=True, default=100, value_type=int, min_value=1, description='final number of boxes' + ), + 'pre_nms_top_k': NumberField( + optional=True, value_type=int, min_value=1, default=5000, + description='number of keep top by score boxes before nms'), + 'score_threshold': NumberField( + value_type=float, min_value=0, max_value=1, default=0.05, description='scores threshold' + ), + 'nms_threshold': NumberField( + value_type=float, min_value=0, max_value=1, default=0.5, description='nms threshold' + ) + + }) + return params + + def configure(self): + self.loc_out = self.get_value_from_config('boxes_outputs') + self.cls_out = self.get_value_from_config('class_outputs') + self.min_level = self.get_value_from_config('min_level') + self.max_level = self.get_value_from_config('max_level') + self.aspect_ratios = self.get_value_from_config('aspect_ratios') + self.anchor_size = self.get_value_from_config('anchor_size') + self.num_scales = self.get_value_from_config('num_scales') + self.max_total_size = self.get_value_from_config('total_size') + self.nms_iou_threshold = self.get_value_from_config('nms_threshold') + self.score_threshold = self.get_value_from_config('score_threshold') + self.pre_nms_num_boxes = self.get_value_from_config('pre_nms_top_k') + + def _generate_anchor_boxes(self, image_size): + boxes_all = [] + for level in range(self.min_level, self.max_level + 1): + boxes_l = [] + for scale in range(self.num_scales): + for aspect_ratio in self.aspect_ratios: + stride = 2 ** level + intermediate_scale = 2 ** (scale / float(self.num_scales)) + base_anchor_size = self.anchor_size * stride * intermediate_scale + aspect_x = aspect_ratio ** 0.5 + aspect_y = aspect_ratio ** -0.5 + half_anchor_size_x = base_anchor_size * aspect_x / 2.0 + half_anchor_size_y = base_anchor_size * aspect_y / 2.0 + x = np.arange(stride / 2, image_size[1], stride) + y = np.arange(stride / 2, image_size[0], stride) + xv, yv = np.meshgrid(x, y) + xv = np.reshape(xv, -1) + yv = np.reshape(yv, -1) + boxes = np.stack([ + yv - half_anchor_size_y, xv - half_anchor_size_x, + yv + half_anchor_size_y, xv + half_anchor_size_x + ], axis=1) + boxes_l.append(boxes) + boxes_l = np.stack(boxes_l, axis=1) + boxes_l = np.reshape(boxes_l, [-1, 4]) + boxes_all.append(boxes_l) + + def unpack_labels(labels): + unpacked_labels = OrderedDict() + count = 0 + for level in range(self.min_level, self.max_level + 1): + feat_size_y = int(image_size[0] / 2 ** level) + feat_size_x = int(image_size[1] / 2 ** level) + steps = feat_size_y * feat_size_x * self.num_scales * len(self.aspect_ratios) + unpacked_labels[level] = np.reshape(labels[count:count + steps], + [feat_size_y, feat_size_x, -1]) + count += steps + return unpacked_labels + + return unpack_labels(np.concatenate(boxes_all, axis=0)) + + def prepare_boxes_and_classes(self, raw, batch_id): + boxes_outs, classes_outs = [], [] + for boxes_out, cls_out in zip(self.loc_out, self.cls_out): + boxes_outs.append(np.transpose(raw[boxes_out][batch_id], (1, 2, 0))) + classes_outs.append(np.transpose(raw[cls_out][batch_id], (1, 2, 0))) + return boxes_outs, classes_outs + + def process(self, raw, identifiers, frame_meta): + raw_outputs = self._extract_predictions(raw, frame_meta) + result = [] + for batch_id, (identifier, meta) in enumerate(zip(identifiers, frame_meta)): + boxes_out, classes_out = self.prepare_boxes_and_classes(raw_outputs, batch_id) + input_shape = [shape for shape in meta['input_shape'].values() if len(shape) == 4] + input_shape = input_shape[0] + image_size = input_shape[2:] if input_shape[1] == 3 else input_shape[1:3] + boxes, scores, labels = self.process_single(boxes_out, classes_out, image_size) + if np.size(boxes): + x_mins, y_mins, x_maxs, y_maxs = boxes.T + x_mins /= image_size[1] + y_mins /= image_size[0] + x_maxs /= image_size[1] + y_maxs /= image_size[0] + else: + x_mins, y_mins, x_maxs, y_maxs = [], [], [], [] + result.append( + DetectionPrediction( + identifier, labels, scores, + x_mins, y_mins, x_maxs, y_maxs + )) + return result + + def process_single(self, box_outputs, class_outputs, image_size): + def sigmoid(x): + return 1 / (1 + np.exp(-x)) + + boxes = [] + scores = [] + anchor_boxes = self._generate_anchor_boxes(image_size) + for i in range(self.min_level, self.max_level + 1): + box_outputs_i_shape = np.shape(box_outputs[i - self.min_level]) + num_anchors_per_locations = box_outputs_i_shape[-1] // 4 + num_classes = np.shape(class_outputs[i - self.min_level])[-1] // num_anchors_per_locations + + scores_i = sigmoid(np.reshape(class_outputs[i - self.min_level], [-1, num_classes])) + scores_i = scores_i[:, 1:] + + anchor_boxes_i = np.reshape(anchor_boxes[i], [-1, 4]) + box_outputs_i = np.reshape(box_outputs[i - self.min_level], [-1, 4]) + boxes_i = self.decode_boxes(box_outputs_i, anchor_boxes_i) + boxes_i[:, ::2] = np.clip(boxes_i[:, ::2], a_min=0, a_max=image_size[1] - 1) + boxes_i[:, 1::2] = np.clip(boxes_i[:, 1::2], a_min=0, a_max=image_size[0] - 1) + + boxes.append(boxes_i) + scores.append(scores_i) + boxes = np.concatenate(boxes, axis=0) + scores = np.concatenate(scores, axis=0) + + nmsed_boxes, nmsed_scores, nmsed_classes = self._generate_detections( + np.expand_dims(boxes, axis=1), scores, + self.max_total_size, self.nms_iou_threshold, self.score_threshold, self.pre_nms_num_boxes + ) + + return nmsed_boxes, nmsed_scores, nmsed_classes + + @staticmethod + def decode_boxes(encoded_boxes, anchors): + BBOX_XFORM_CLIP = np.log(1000. / 16.) + dy = encoded_boxes[..., 0:1] + dx = encoded_boxes[..., 1:2] + dh = encoded_boxes[..., 2:3] + dw = encoded_boxes[..., 3:4] + dh = np.minimum(dh, BBOX_XFORM_CLIP) + dw = np.minimum(dw, BBOX_XFORM_CLIP) + + anchor_ymin = anchors[..., 0:1] + anchor_xmin = anchors[..., 1:2] + anchor_ymax = anchors[..., 2:3] + anchor_xmax = anchors[..., 3:4] + anchor_h = anchor_ymax - anchor_ymin + 1.0 + anchor_w = anchor_xmax - anchor_xmin + 1.0 + anchor_yc = anchor_ymin + 0.5 * anchor_h + anchor_xc = anchor_xmin + 0.5 * anchor_w + + decoded_boxes_yc = dy * anchor_h + anchor_yc + decoded_boxes_xc = dx * anchor_w + anchor_xc + decoded_boxes_h = np.exp(dh) * anchor_h + decoded_boxes_w = np.exp(dw) * anchor_w + + decoded_boxes_ymin = decoded_boxes_yc - 0.5 * decoded_boxes_h + decoded_boxes_xmin = decoded_boxes_xc - 0.5 * decoded_boxes_w + decoded_boxes_ymax = decoded_boxes_ymin + decoded_boxes_h - 1.0 + decoded_boxes_xmax = decoded_boxes_xmin + decoded_boxes_w - 1.0 + + decoded_boxes = np.concatenate([ + decoded_boxes_xmin, decoded_boxes_ymin, decoded_boxes_xmax, + decoded_boxes_ymax + ], axis=-1) + return decoded_boxes + + @staticmethod + def _generate_detections(boxes, + scores, + max_total_size=100, + nms_iou_threshold=0.5, + score_threshold=0.05, + pre_nms_num_boxes=5000): + + def _select_top_k_scores(scores_in, pre_nms_num_detections): + num_anchors, num_class = scores_in.shape + scores_trans = np.transpose(scores_in, [1, 0]) + scores_trans = np.reshape(scores_trans, [-1, num_anchors]) + + indices_ = np.argsort(-scores_trans) + top_k_scores = -1 * np.sort(-scores_trans)[:, :pre_nms_num_detections] + top_k_indices = indices_[:, :pre_nms_num_detections] + + top_k_scores = np.reshape(top_k_scores, + [num_class, pre_nms_num_detections]) + top_k_indices = np.reshape(top_k_indices, + [num_class, pre_nms_num_detections]) + + return np.transpose(top_k_scores, + [1, 0]), np.transpose(top_k_indices, [1, 0]) + + nmsed_boxes = [] + nmsed_classes = [] + nmsed_scores = [] + _, num_classes_for_box, _ = boxes.shape + total_anchors, num_classes = scores.shape + scores, indices = _select_top_k_scores( + scores, min(total_anchors, pre_nms_num_boxes)) + for i in range(num_classes): + boxes_i = boxes[:, min(num_classes_for_box - 1, i), :] + scores_i = scores[:, i] + boxes_i = boxes_i[indices[:, i], :] + + filtered_scores = scores_i > score_threshold + boxes_i = boxes_i[filtered_scores] + scores_i = scores_i[filtered_scores] + if not np.size(scores_i): + continue + + keep = NMS.nms(*boxes_i.T, scores_i, nms_iou_threshold) + if len(keep) > max_total_size: + keep = keep[:max_total_size] + nms_boxes = boxes_i[keep] + nms_scores = scores_i[keep] + nmsed_classes_i = np.full(len(nms_scores), i+1) + nmsed_boxes.append(nms_boxes) + nmsed_scores.append(nms_scores) + nmsed_classes.append(nmsed_classes_i) + if np.size(nmsed_scores): + nmsed_boxes = np.concatenate(nmsed_boxes, axis=0) + nmsed_scores = np.concatenate(nmsed_scores, axis=0) + nmsed_classes = np.concatenate(nmsed_classes, axis=0) + sorted_order = np.argsort(nmsed_scores)[::-1] + if sorted_order.size > max_total_size: + sorted_order = sorted_order[:max_total_size] + nmsed_scores = nmsed_scores[sorted_order] + nmsed_boxes = nmsed_boxes[sorted_order, :] + nmsed_classes = nmsed_classes[sorted_order] + return nmsed_boxes, nmsed_scores, nmsed_classes diff --git a/tools/accuracy_checker/accuracy_checker/adapters/salient_objects_detection.py b/tools/accuracy_checker/accuracy_checker/adapters/salient_objects_detection.py new file mode 100644 index 00000000000..a289a308dd2 --- /dev/null +++ b/tools/accuracy_checker/accuracy_checker/adapters/salient_objects_detection.py @@ -0,0 +1,46 @@ +""" +Copyright (c) 2018-2021 Intel Corporation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" +import numpy as np +from .adapter import Adapter +from ..representation import SalientRegionPrediction +from ..config import StringField + + +class SalientObjectDetection(Adapter): + __provider__ = 'salient_object_detection' + + @classmethod + def parameters(cls): + params = super().parameters() + params.update({ + 'salient_map_output': StringField(optional=True, description='target output layer for getting salience map') + }) + return params + + def configure(self): + self.salient_map_output = self.get_value_from_config('salient_map_output') + + def process(self, raw, identifiers, frame_meta): + raw_output = self._extract_predictions(raw, frame_meta) + if self.salient_map_output is None: + self.select_output_blob(raw_output) + self.salient_map_output = self.output_blob + result = [] + for identifier, mask in zip(identifiers, raw_output[self.salient_map_output]): + mask = 1/(1 + np.exp(-mask)) + result.append(SalientRegionPrediction(identifier, np.round(np.squeeze(mask)).astype(np.uint8))) + + return result diff --git a/tools/accuracy_checker/accuracy_checker/adapters/segmentation.py b/tools/accuracy_checker/accuracy_checker/adapters/segmentation.py index 2b71dc11809..527a28661ee 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/segmentation.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/segmentation.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -37,8 +37,11 @@ def parameters(cls): }) return parameters - def validate_config(self): - super().validate_config(on_extra_argument=ConfigValidator.IGNORE_ON_EXTRA_ARGUMENT) + @classmethod + def validate_config(cls, config, fetch_only=False, **kwargs): + return super().validate_config( + config, fetch_only=fetch_only, on_extra_argument=ConfigValidator.IGNORE_ON_EXTRA_ARGUMENT + ) def configure(self): self.make_argmax = self.launcher_config.get('make_argmax', False) @@ -47,17 +50,29 @@ def process(self, raw, identifiers, frame_meta): result = [] frame_meta = frame_meta or [] * len(identifiers) raw_outputs = self._extract_predictions(raw, frame_meta) - for identifier, output in zip(identifiers, raw_outputs[self.output_blob]): + self.select_output_blob(raw_outputs) + for identifier, output, meta in zip(identifiers, raw_outputs[self.output_blob], frame_meta): + input_shape = next(iter(meta['input_shape'].values())) + is_chw = input_shape[1] <= 4 + if len(output.shape) == 2 and len(input_shape) == 4: + (in_h, in_w) = input_shape[2:] if is_chw else input_shape[1:3] + if output.shape[0] == in_h * in_w: + output = np.resize(output, (in_h, in_w, output.shape[-1])) + is_chw = False if self.make_argmax: - output = np.argmax(output, axis=0) + argmax_axis = 0 if is_chw else -1 + output = np.argmax(output, axis=argmax_axis) + if not is_chw and not self.make_argmax and len(output.shape) == 3: + output = np.transpose(output, (2, 0, 1)) result.append(SegmentationPrediction(identifier, output)) return result def _extract_predictions(self, outputs_list, meta): - if not 'tiles_shape' in (meta[-1] or {}): + if 'tiles_shape' not in (meta[-1] or {}): return outputs_list[0] if not isinstance(outputs_list, dict) else outputs_list + self.select_output_blob(outputs_list[0]) tiles_shapes = [meta['tiles_shape'] for meta in meta] restore_output = [] offset = 0 @@ -96,6 +111,7 @@ def process(self, raw, identifiers, frame_meta): result = [] frame_meta = frame_meta or [] * len(identifiers) raw_outputs = self._extract_predictions(raw, frame_meta) + self.select_output_blob(raw_outputs) for identifier, output in zip(identifiers, raw_outputs[self.output_blob]): output = output > self.threshold result.append(SegmentationPrediction(identifier, output.astype(np.uint8))) @@ -142,6 +158,7 @@ def process(self, raw, identifiers=None, frame_meta=None): raise ConfigError('segmentation output not found') segm_out = self.segmentation_out if self.segmentation_out in raw_outputs else self.segmentation_out_bias else: + self.select_output_blob(raw_outputs) segm_out = self.output_blob for identifier, output in zip(identifiers, raw_outputs[segm_out]): if self.argmax: @@ -193,6 +210,7 @@ def configure(self): def process(self, raw, identifiers, frame_meta): result = [] raw_outputs = self._extract_predictions(raw, frame_meta) + self.select_output_blob(raw_outputs) for identifier, output, meta in zip(identifiers, raw_outputs[self.output_blob], frame_meta): _, _, h, w = next(iter(meta.get('input_shape', {'data': (1, 3, 800, 800)}).values())) feat_height = math.floor(h / self.ds_rate) diff --git a/tools/accuracy_checker/accuracy_checker/adapters/ssd.py b/tools/accuracy_checker/accuracy_checker/adapters/ssd.py index 50033f8f5db..533d155962d 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/ssd.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/ssd.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,7 +24,6 @@ from ..config import ConfigValidator, StringField, NumberField, ListField, BoolField from ..postprocessor import NMS from ..representation import DetectionPrediction, ContainerPrediction -from ..topology_types import SSD, FasterRCNN class SSDAdapter(Adapter): @@ -33,7 +32,6 @@ class SSDAdapter(Adapter): """ __provider__ = 'ssd' prediction_types = (DetectionPrediction, ) - topology_types = (SSD, FasterRCNN, ) def process(self, raw, identifiers, frame_meta): """ @@ -43,7 +41,9 @@ def process(self, raw, identifiers, frame_meta): Returns: list of DetectionPrediction objects """ - prediction_batch = self._extract_predictions(raw, frame_meta)[self.output_blob] + prediction_batch = self._extract_predictions(raw, frame_meta) + self.select_output_blob(prediction_batch) + prediction_batch = prediction_batch[self.output_blob] prediction_count = prediction_batch.shape[2] if len(prediction_batch.shape) > 2 else prediction_batch.shape[0] prediction_batch = prediction_batch.reshape(prediction_count, -1) prediction_batch = self.remove_empty_detections(prediction_batch) @@ -72,8 +72,11 @@ class PyTorchSSDDecoder(Adapter): """ __provider__ = 'pytorch_ssd_decoder' - def validate_config(self): - super().validate_config(on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT) + @classmethod + def validate_config(cls, config, fetch_only=False, **kwargs): + return super().validate_config( + config, fetch_only=fetch_only, on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT + ) @classmethod def parameters(cls): @@ -247,8 +250,11 @@ def parameters(cls): return parameters - def validate_config(self): - super().validate_config(on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT) + @classmethod + def validate_config(cls, config, fetch_only=False, **kwargs): + return super().validate_config( + config, fetch_only=fetch_only, on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT + ) def configure(self): self.face_detection_out = self.launcher_config['face_out'] @@ -281,6 +287,7 @@ def process(self, raw, identifiers, frame_meta): list of DetectionPrediction objects """ raw_outputs = self._extract_predictions(raw, frame_meta) + self.select_output_blob(raw_outputs) result = [] for identifier, prediction_batch in zip(identifiers, raw_outputs[self.output_blob]): # Filter detections (get only detections with class_id >= 0) @@ -331,7 +338,18 @@ def process(self, raw, identifiers, frame_meta): x_mins, y_mins, x_maxs, y_maxs = bboxes.T else: x_mins, y_mins, x_maxs, y_maxs, scores = bboxes.T - results.append(DetectionPrediction(identifier, labels, scores, x_mins, y_mins, x_maxs, y_maxs)) + if labels.ndim > 1: + labels = np.squeeze(labels) + if scores.ndim > 1: + scores = np.squeeze(scores) + if x_mins.ndim > 1: + x_mins = np.squeeze(x_mins) + y_mins = np.squeeze(y_mins) + x_maxs = np.squeeze(x_maxs) + y_maxs = np.squeeze(y_maxs) + results.append( + DetectionPrediction( + identifier, labels, scores, x_mins, y_mins, x_maxs, y_maxs)) return results diff --git a/tools/accuracy_checker/accuracy_checker/adapters/style_transfer.py b/tools/accuracy_checker/accuracy_checker/adapters/style_transfer.py index 9dd3c3fa0c8..679e7bb065b 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/style_transfer.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/style_transfer.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -25,7 +25,9 @@ class StyleTransferAdapter(Adapter): def process(self, raw, identifiers, frame_meta): result = [] - raw_outputs = self._extract_predictions(raw, frame_meta)[self.output_blob] + raw_outputs = self._extract_predictions(raw, frame_meta) + self.select_output_blob(raw_outputs) + raw_outputs = raw_outputs[self.output_blob] for identifier, img in zip(identifiers, raw_outputs): img = self._basic_postprocess(img) result.append(StyleTransferPrediction(identifier, img)) diff --git a/tools/accuracy_checker/accuracy_checker/adapters/text_detection.py b/tools/accuracy_checker/accuracy_checker/adapters/text_detection.py index 12d2e9f2131..8c55e493673 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/text_detection.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/text_detection.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -64,8 +64,11 @@ def parameters(cls): return parameters - def validate_config(self): - super().validate_config(on_extra_argument=ConfigValidator.WARN_ON_EXTRA_ARGUMENT) + @classmethod + def validate_config(cls, config, fetch_only=False, **kwargs): + return super().validate_config( + config, fetch_only=fetch_only, on_extra_argument=ConfigValidator.WARN_ON_EXTRA_ARGUMENT + ) def configure(self): self.pixel_link_out = self.get_value_from_config('pixel_link_out') @@ -333,7 +336,7 @@ def process(self, raw, identifiers, frame_meta): if len(resize_op) >= 2: scale_x, scale_y = resize_op[0].parameters['scale_y'], resize_op[0].parameters['scale_x'] boxes[:, 0::2] /= scale_x - boxes [:, 1::2] /= scale_y + boxes[:, 1::2] /= scale_y rects = [box.reshape(4, 2) for box in boxes] result.append(TextDetectionPrediction(identifier, np.array(rects))) @@ -855,3 +858,116 @@ def restore_rectangle(origin, geometry): new_p_1 = np.zeros((0, 4, 2)) return np.concatenate([new_p_0, new_p_1]) + + +class CRAFTTextDetectionAdapter(Adapter): + __provider__ = 'craft_text_detection' + + @classmethod + def parameters(cls): + parameters = super().parameters() + parameters.update({ + 'score_out': StringField(description='name of layer with score map', optional=True), + 'text_threshold': NumberField( + value_type=float, optional=True, default=0.7, min_value=0, description='text confidence threshold' + ), + 'link_threshold': NumberField( + value_type=float, optional=True, default=0.4, min_value=0, description='link confidence threshold' + ), + 'low_text': NumberField( + value_type=float, optional=True, default=0.4, min_value=0, description='text low-bound score' + ) + }) + return parameters + + def configure(self): + self.score_out = self.get_value_from_config('score_out') + self.text_threshold = self.get_value_from_config('text_threshold') + self.link_threshold = self.get_value_from_config('link_threshold') + self.low_text = self.get_value_from_config('low_text') + + def process(self, raw, identifiers, frame_meta): + raw_outputs = self._extract_predictions(raw, frame_meta) + self.select_output_blob(raw_outputs) + score_out = raw_outputs[self.score_out] if self.score_out else raw_outputs[self.output_blob] + results = [] + for identifier, score, meta in zip(identifiers, score_out, frame_meta): + score_text = score[:, :, 0] + score_link = score[:, :, 1] + + boxes = self.get_detection_boxes(score_text, score_link, + self.text_threshold, self.link_threshold, self.low_text) + boxes = self.adjust_result_coordinates(boxes, meta.get('scale', 1.0)) + results.append(TextDetectionPrediction(identifier, boxes)) + + return results + + @staticmethod + def get_detection_boxes(text, link, text_threshold, link_threshold, low_text): + img_h, img_w = text.shape + + _, score_text = cv2.threshold(text.copy(), low_text, 1, 0) + _, score_link = cv2.threshold(link.copy(), link_threshold, 1, 0) + + text_score_comb = np.clip(score_text + score_link, 0, 1) + count, labels, stats, _ = cv2.connectedComponentsWithStats(text_score_comb.astype(np.uint8), connectivity=4) + + det = [] + for k in range(1, count): + # size filtering + size = stats[k, cv2.CC_STAT_AREA] + if size < 10: + continue + + # thresholding + if np.max(text[labels == k]) < text_threshold: + continue + + # make segmentation map + segmap = np.zeros(text.shape, dtype=np.uint8) + segmap[labels == k] = 255 + segmap[np.logical_and(score_link == 1, score_text == 0)] = 0 # remove link area + x, y = stats[k, cv2.CC_STAT_LEFT], stats[k, cv2.CC_STAT_TOP] + w, h = stats[k, cv2.CC_STAT_WIDTH], stats[k, cv2.CC_STAT_HEIGHT] + niter = int(np.sqrt(size * min(w, h) / (w * h)) * 2) + sx, ex, sy, ey = x - niter, x + w + niter + 1, y - niter, y + h + niter + 1 + # boundary check + if sx < 0: + sx = 0 + if sy < 0: + sy = 0 + if ex > img_w: + ex = img_w + if ey > img_h: + ey = img_h + kernel = cv2.getStructuringElement(cv2.MORPH_RECT, (1 + niter, 1 + niter)) + segmap[sy:ey, sx:ex] = cv2.dilate(segmap[sy:ey, sx:ex], kernel) + + # make box + np_contours = np.roll(np.array(np.where(segmap != 0)), 1, axis=0).transpose().reshape(-1, 2) + rectangle = cv2.minAreaRect(np_contours) + box = cv2.boxPoints(rectangle) + + # align diamond-shape + w, h = np.linalg.norm(box[0] - box[1]), np.linalg.norm(box[1] - box[2]) + box_ratio = max(w, h) / (min(w, h) + 1e-5) + if abs(1 - box_ratio) <= 0.1: + l, r = min(np_contours[:, 0]), max(np_contours[:, 0]) + t, b = min(np_contours[:, 1]), max(np_contours[:, 1]) + box = np.array([[l, t], [r, t], [r, b], [l, b]], dtype=np.float32) + + # make clock-wise order + startidx = box.sum(axis=1).argmin() + box = np.roll(box, 4 - startidx, 0) + box = np.array(box) + + det.append(box) + + return det + + @staticmethod + def adjust_result_coordinates(polys, scale, ratio_net=2): + polys = np.array(polys) + for k, _ in enumerate(polys): + polys[k] *= (scale * ratio_net, scale * ratio_net) + return polys diff --git a/tools/accuracy_checker/accuracy_checker/adapters/text_recognition.py b/tools/accuracy_checker/accuracy_checker/adapters/text_recognition.py index 409cd69550b..5796691f861 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/text_recognition.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/text_recognition.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -44,8 +44,13 @@ def parameters(cls): }) return parameters - def validate_config(self): - super().validate_config(on_extra_argument=ConfigValidator.IGNORE_ON_EXTRA_ARGUMENT) + @classmethod + def validate_config(cls, config, fetch_only=False, **kwargs): + return super().validate_config( + config, fetch_only=fetch_only, on_extra_argument=ConfigValidator.IGNORE_ON_EXTRA_ARGUMENT + ) + + def configure(self): self.beam_size = self.get_value_from_config('beam_size') self.blank_label = self.launcher_config.get('blank_label') self.softmaxed_probabilities = self.get_value_from_config('softmaxed_probabilities') @@ -56,6 +61,7 @@ def process(self, raw, identifiers, frame_meta): if self.blank_label is None: self.blank_label = len(self.label_map) raw_output = self._extract_predictions(raw, frame_meta) + self.select_output_blob(raw_output) output = raw_output[self.output_blob] output = np.swapaxes(output, 0, 1) @@ -152,9 +158,14 @@ def parameters(cls): }) return parameters - def validate_config(self): - super().validate_config(on_extra_argument=ConfigValidator.IGNORE_ON_EXTRA_ARGUMENT) - self.blank_label = self.launcher_config.get('blank_label') + @classmethod + def validate_config(cls, config, fetch_only=False, **kwargs): + return super().validate_config( + config, fetch_only=fetch_only, on_extra_argument=ConfigValidator.IGNORE_ON_EXTRA_ARGUMENT + ) + + def configure(self): + self.blank_label = self.get_value_from_config('blank_label') def process(self, raw, identifiers=None, frame_meta=None): if not self.label_map: @@ -162,6 +173,7 @@ def process(self, raw, identifiers=None, frame_meta=None): if self.blank_label is None: self.blank_label = 0 raw_output = self._extract_predictions(raw, frame_meta) + self.select_output_blob(raw_output) output = raw_output[self.output_blob] preds_index = np.argmax(output, 2) preds_index = preds_index.transpose(1, 0) @@ -200,6 +212,7 @@ def process(self, raw, identifiers=None, frame_meta=None): if not self.label_map: raise ConfigError('LPR adapter requires dataset label map for correct decoding.') raw_output = self._extract_predictions(raw, frame_meta) + self.select_output_blob(raw_output) predictions = raw_output[self.output_blob] result = [] for identifier, output in zip(identifiers, predictions): diff --git a/tools/accuracy_checker/accuracy_checker/adapters/yolact.py b/tools/accuracy_checker/accuracy_checker/adapters/yolact.py index 47378bbc41d..45c96a15b46 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/yolact.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/yolact.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ def parameters(cls): 'prior_out': StringField(description='name of output with prior boxes', optional=True), 'mask_out': StringField(description='name of output with masks'), 'proto_out': StringField(description='name of output with proto for masks calculation'), - 'confidence_threshold': NumberField( + 'confidence_threshold': NumberField( value_type=float, optional=True, default=0.05, description='confidence threshold' ), 'max_detections': NumberField( diff --git a/tools/accuracy_checker/accuracy_checker/adapters/yolo.py b/tools/accuracy_checker/accuracy_checker/adapters/yolo.py index 928974b92fe..212d76c31af 100644 --- a/tools/accuracy_checker/accuracy_checker/adapters/yolo.py +++ b/tools/accuracy_checker/accuracy_checker/adapters/yolo.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ from ..adapters import Adapter from ..config import BoolField, NumberField, StringField, ConfigValidator, ListField, ConfigError from ..representation import DetectionPrediction -from ..topology_types import YoloV1Tiny, YoloV2, YoloV2Tiny, YoloV3, YoloV3Tiny from ..utils import get_or_parse_value DetectionBox = namedtuple('DetectionBox', ["x", "y", "w", "h", "confidence", "probabilities"]) @@ -59,17 +58,19 @@ class TinyYOLOv1Adapter(Adapter): """ __provider__ = 'tiny_yolo_v1' prediction_types = (DetectionPrediction, ) - topology_types = (YoloV1Tiny, ) def process(self, raw, identifiers, frame_meta): """ Args: identifiers: list of input data identifiers raw: output of model + frame_meta: meta info about prediction Returns: list of DetectionPrediction objects """ - prediction = self._extract_predictions(raw, frame_meta)[self.output_blob] + prediction = self._extract_predictions(raw, frame_meta) + self.select_output_blob(prediction) + prediction = prediction[self.output_blob] PROBABILITY_SIZE = 980 CONFIDENCE_SIZE = 98 @@ -156,7 +157,6 @@ class YoloV2Adapter(Adapter): """ __provider__ = 'yolo_v2' prediction_types = (DetectionPrediction, ) - topology_types = (YoloV2, YoloV2Tiny, ) PRECOMPUTED_ANCHORS = { 'yolo_v2': [1.3221, 1.73145, 3.19275, 4.00944, 5.05587, 8.09892, 9.47112, 4.84053, 11.2364, 10.0071], @@ -198,8 +198,11 @@ def parameters(cls): }) return parameters - def validate_config(self): - super().validate_config(on_extra_argument=ConfigValidator.WARN_ON_EXTRA_ARGUMENT) + @classmethod + def validate_config(cls, config, fetch_only=False, **kwargs): + return super().validate_config( + config, fetch_only=fetch_only, on_extra_argument=ConfigValidator.WARN_ON_EXTRA_ARGUMENT + ) def configure(self): self.classes = self.get_value_from_config('classes') @@ -224,10 +227,13 @@ def process(self, raw, identifiers, frame_meta): Args: identifiers: list of input data identifiers raw: output of model + frame_meta: meta info about data processing Returns: list of DetectionPrediction objects """ - predictions = self._extract_predictions(raw, frame_meta)[self.output_blob] + predictions = self._extract_predictions(raw, frame_meta) + self.select_output_blob(predictions) + predictions = predictions[self.output_blob] result = [] box_size = self.classes + self.coords + 1 @@ -253,7 +259,6 @@ class YoloV3Adapter(Adapter): """ __provider__ = 'yolo_v3' prediction_types = (DetectionPrediction, ) - topology_types = (YoloV3, YoloV3Tiny, ) PRECOMPUTED_ANCHORS = { 'yolo_v3': [ @@ -321,8 +326,11 @@ def parameters(cls): return parameters - def validate_config(self): - super().validate_config(on_extra_argument=ConfigValidator.WARN_ON_EXTRA_ARGUMENT) + @classmethod + def validate_config(cls, config, fetch_only=False, **kwargs): + return super().validate_config( + config, fetch_only=fetch_only, on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT + ) def configure(self): self.classes = self.get_value_from_config('classes') @@ -459,6 +467,8 @@ def process(self, raw, identifiers, frame_meta): ): out_boxes, out_scores, out_classes = [], [], [] for idx_ in indices: + if idx_[0] == -1: + break out_classes.append(idx_[1]) out_scores.append(scores[tuple(idx_[1:])]) out_boxes.append(boxes[idx_[2]]) diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/README.md b/tools/accuracy_checker/accuracy_checker/annotation_converters/README.md index 11e84358bab..5f28d7212b2 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/README.md +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/README.md @@ -11,8 +11,8 @@ Process of conversion can be implemented in two ways: ## Describing Annotation Conversion in Configuration File -Annotation conversion can be provided in `dataset` section your configuration file to convert annotation in-place before every evaluation. -Each conversion configuration should contain `converter` field filled selected converter name and provide converter specific parameters (more details in supported converters section). All paths can be prefixed via command line with `-s, --source` argument. +Annotation conversion can be provided in `dataset` section of your configuration file to convert annotation in-place before every evaluation. +Each conversion configuration should contain `converter` field filled with a selected converter name and provide converter specific parameters (more details in supported converters section). All paths can be prefixed via command line with `-s, --source` argument. You can additionally use optional parameters like: * `subsample_size` - Dataset subsample size. You can specify the number of ground truth objects or dataset ratio in percentage. Please, be careful to use this option, some datasets does not support subsampling. You can also specify `subsample_seed` if you want to generate subsample with specific random seed. @@ -137,6 +137,14 @@ Accuracy Checker supports following list of annotation converters and specific f * `data_dir` - path to dataset root folder. Relative paths to images and masks directory determine as `imgs` and `masks` respectively. In way when images and masks are located in non default directories, you can use parameters described below. * `images_dir` - path to images folder. * `mask_dir` - path to ground truth mask folder. + * `images_subfolder` - sub-directory for images(Optional, default `imgs`) + * `mask_subfolder` - sub-directory for ground truth mask(Optional, default `masks`) +* `mapillary_vistas` - converts Mapillary Vistas dataset contained 20 classes to `SegmentationAnnotation`. + * `data_dir` - path to dataset root folder. Relative paths to images and masks directory determine as `images` and `labels` respectively. In way when images and masks are located in non default directories, you can use parameters described below. + * `images_dir` - path to images folder. + * `mask_dir` - path to ground truth mask folder. + * `images_subfolder` - sub-directory for images(Optional, default `images`) + * `mask_subfolder` - sub-directory for ground truth mask(Optional, default `labels`) * `vgg_face` - converts VGG Face 2 dataset for facial landmarks regression task to `FacialLandmarksAnnotation`. * `landmarks_csv_file` - path to csv file with coordinates of landmarks points. * `bbox_csv_file` - path to cvs file which contains bounding box coordinates for faces (optional parameter). @@ -144,6 +152,11 @@ Accuracy Checker supports following list of annotation converters and specific f * `pairs_file` - path to file with annotation positive and negative pairs. * `train_file` - path to file with annotation positive and negative pairs used for network train (optional parameter). * `landmarks_file` - path to file with facial landmarks coordinates for annotation images (optional parameter). + * `extension` - images extension(optional, default - `jpg`). +* `face_recognition_bin` - converts preprocessed face recognition dataset stored in binary format to `ReidentificationClassificationAnnotation`. + * `bin_file` - file with dataset. Example of datasets can be found [here](https://github.com/deepinsight/insightface/wiki/Dataset-Zoo). + * `images_dir` - directory for saving converted images (Optional, used only if `convert_images` enabled, if not provided `/converted_images` will be used) + * `convert_images` - allows decode and save images. * `mars` - converts MARS person reidentification dataset to `ReidentificationAnnotation`. * `data_dir` - path to data directory, where gallery (`bbox_test`) and `query` subdirectories are located. * `market1501_reid` - converts Market1501 person reidentification dataset to `ReidentificationAnnotation`. @@ -225,9 +238,14 @@ The main difference between this converter and `super_resolution` in data organi * `mask_loader` - the way how GT mask should be loaded. Supported methods: `pillow`, `opencv`, `nifti`, `numpy`, `scipy`. * `dataset_meta_file` - path to json file with prepared dataset meta info. It should contains `label_map` key with dictionary in format class_id: class_name and optionally `segmentation_colors` (if your dataset uses color encoding). Segmentation colors is a list of channel-wise values for each class. (e.g. if your dataset has 3 classes in BGR colors, segmentation colors for it will looks like: `[[255, 0, 0], [0, 255, 0], [0, 0, 255]]`). (Optional, you can provide self-created file as `dataset_meta` in your config). **Note: since OpenVINO 2020.4 converter behaviour changed. `data_source` parameter of dataset should contains directory for images only, if you have segmentation mask in separated location, please use `segmentation_masks_source` for specifying gt masks location.** -* `camvid` - converts CamVid dataset format to `SegmentationAnnotation`. +* `camvid` - converts CamVid dataset with 12 classes to `SegmentationAnnotation`. Dataset can be found in the following [repository](https://github.com/alexgkendall/SegNet-Tutorial/tree/master/CamVid) * `annotation_file` - file in txt format which contains list of validation pairs (`` `` separated by space) * `dataset_meta_file` - path path to json file with dataset meta (e.g. label_map, color_encoding).Optional, more details in [Customizing dataset meta](#customizing-dataset-meta) section. +* `camvid_32` - converts CamVid dataset with 32 classes to `SegmentationAnnotation`. Dataset can be found [here](http://mi.eng.cam.ac.uk/research/projects/VideoRec/CamVid/). + * `labels_dir` - directory with labeled ground truth images. + * `images_dir` - directory with input data. + * `val_subset_ratio` - ratio of subset, which should be used for validation. It is the float value in (0, 1] range for definition subset size as * . Optional, default 1 (it means full dataset used for validation). + * `dataset_meta_file` - path path to json file with dataset meta (e.g. label_map, color_encoding).Optional, more details in [Customizing dataset meta](#customizing-dataset-meta) section. * `image_retrieval` - converts dataset for image retrieval task to `ReidentificationAnnotation`. Dataset should have following structure: 1. the dataset root directory contains 2 subdirectory named `gallery` and `queries` for gallery images and query images respectively. 2. Every of these subdirectories should contains text file with list of pairs: `` `` (image_path and image_ID should be separated by space), where `` is path to the image related dataset root, `` is the number which represent image id in the gallery. @@ -360,12 +378,21 @@ The main difference between this converter and `super_resolution` in data organi * `validation` - if provided, only second half of dataset converted to annotations, according to dataset definition * `preprocessed_dir` - path to store preprocessed batch files (e.g. `criteo/terabyte/preprocessed`). * `separator` - symbol used to separate feature identifiers from batch data filename. + * `save_preprocessed_features` - allow to save preprocessed input features into `preprocessed_dir` (Optional, default True). * `features_regression` - converts dataset stored in format of directories with preprocessed input numeric data (features) in text files and reference data in the same format to `FeatureRegressionAnnotation`. This approach allows comparing output of model from different frameworks (e.g. OpenVINO converted model and source framework realisation). * `input_dir` - directory with input data files. * `reference_dir` - directory with reference data. **Note: inside converted annotation, path to directory is not stored, only file name, please use `additional_data_source` for providing prefix.** * `input_suffix` - suffix for input files (usually file extension). Optional, default `.txt`. * `reference_suffix` - suffix for reference files (usually file extension). Optional, default `.txt`. + * `use_bin_data` - this flag specifies that input data in binary format, optional, default `False` + * `bin_data_dtype` - data type for reading binary data. +* `multi_feature_regression` - converts dataset stored in format of directories with preprocessed input numeric data (features) in dictionary format, where keys are layer names and values - features and reference data in the same format to `FeatureRegressionAnnotation`. + This approach allows comparing output of model from different frameworks (e.g. OpenVINO converted model and source framework realisation). Please note, that input and reference should be stored as dict-like objects in npy files. + * `data_dir` - directory with input and reference files. + * `input_suffix` - suffix for input files (usually file extension). Optional, default `in.npy`. + * `reference_suffix` - suffix for reference files (usually file extension). Optional, default `out.npy`. + * `prefix` - prefix for input files selection (Optional, ignored if not provided). * `librispeech` - converts [librispeech](http://www.openslr.org/12) dataset to `CharachterRecognitionAnnotation`. * `data_dir` - path to dataset directory, which contains converted wav files. * `annotation_file` - path to file which describe the data which should be used in evaluation (`audio_filepath`, `text`, `duration`). Optional, used only for data filtering and sorting audio samples by duration. @@ -380,7 +407,7 @@ The main difference between this converter and `super_resolution` in data organi * `separator` - Separator between input identifier and file identifier * `preprocessed_dir` - Preprocessed dataset location * `dense_features` - Name of model dense features input - * `sparse_features` - Name of model sparse features input. For multiple inputs use comma-separated list in form : + * `sparse_features` - Name of model sparse features input. For multiple inputs use comma-separated list in form `:` * `lso_features` - Name of lS_o-like features input * `im2latex` - converts im2latex-like datasets to `CharacterRecognitionAnnotation`. [Example of the dataset](http://lstm.seas.harvard.edu/latex/data/) * `images_dir` - path to input images (rendered or scanned formulas) @@ -396,17 +423,58 @@ The main difference between this converter and `super_resolution` in data organi * `subset_file` - matlab file contains info about subset used in validation. * `mpii` - converts MPII Human Pose Estimation dataset to `PoseEstimationAnnotation`. * `annotation_file` - json-file with annotation. - * `headboxes_file` - file with boxes contained head coordinates for each image. + * `headboxes_file` - numpy file with boxes contained head coordinates for each image. + * `gt_pos_file` - numpy file with ground truth keypoints, optional, if not provided, default keypoints from annotation will be used. + * `joints_visibility_file` - numpy file with ground truth keypoints visibility level, optional, if not provided, default visibility level from annotation will be used. * `cluttered_mnist` - converts MNIST dataset from spatial transformer network [example](https://github.com/oarriaga/STN.keras/tree/master/datasets) to `ClassificationAnnotation`. * `data_file` - npz file with dataset. * `split` - dataset split: `train` - for training subset, `valid` - for train-validation subset, `test` - for testing subset (Optional, default test). * `convert_images` - allows convert images from raw data stored in npz and save them into provided directory (Optional, default True). * `images_dir` - directory for saving converted images (Optional, if not provided, the images will be saved into converted_images directory in the same location, where data_file is stored) +* `antispoofing` - converts dataset for antispoofing classification task to `ClassificationAnnotation` + * `data_dir` - path to root folder of the dataset + * `annotation_file` - path to json file containing annotations to the dataset ({index: {path:"...", labels:[...], bbox:[...] (optional), ...}) + * `label_id` - number of label in the annotation file representing spoof/real labels + * `dataset_meta_file` - path to json file with dataset meta (e.g. label_map) +* `sound_classification` - converts dataset for sound classification to `ClassificationAnnotation`. The dataset should be represented by directory with input wav files and annotation in 2 column csv format, where first column is audio file name and second is label id from dataset. + * `annotation_file` - csv file with selected subset for evaluation, file structure described above. + * `audio_dir` - directory with input data, (optional, required only if you want check file existence during annotation conversion). +* `ade20k_image_translation` - converts ADE20K dataset to `ImageProcessingAnnotation` according to `reference_file`. + * `annotations_dir` - path to directory with annotations (e.g. `ADEChallengeData2016/annotations`). + * `reference_file` - path to file with pairs key (validation): value (train). +* `salient_object_detection` - converts dataset for salient object detection to `SalientRegionAnnotation`. The dataset should have following structure: + 1. images have numeric ids like names and `jpg` extension (e.g. image/0.jpg, image/1.jpg, image/2.jpg, ...). + 2. salience map located in separated directory, have the same ids like images and `png` extension (e.g. mask/0.png, mask/1.png, mask/2.png). + * `images_dir` - directory with input images. + * `masks_dir` - directory with reference salience maps. + * `annotation_file` - txt file with selected image ids. +* `wflw` - converts WFLW dataset for facial landmarks regression task to `FacialLandmarksAnnotation`. + * `annotation_file` - path to txt file with ground truth data in WFLW dataset format. + * `images_dir` - path to dataset images, used only for content existence check (optional parameter). +* `common_object_detection` - converts object detection dataset to `DetectionAnnotation`. Dataset should be stored in following format: + 1. labels_map defined as text file, where defined labels line by line. + 2. annotations for each image stored in separated text file. Box is represented by space separated info: . + 3. name of annotation file the same like image name (or additional file with file mapping should be defined). + * `annotation_dir` - path to directory with annotation files. + * `images_dir` - path to directory with images (Optional, used only for content check step). + * `labels_file` - path to file with labels. + * `pairs_file` - path to file where described image and annotation file pairs (Optional, if not provided list will be created according to annotation_dir content). + * `has_background` - flag that background label should be added to label_map (Optional, default False). + * `add_background_to_label_id` - flag that label_ids defined in annotation should be shifted if `has_background` enabled. +* `see_in_the_dark` - converts See-in-the-Dark dataset described in the [paper](https://cchen156.github.io/paper/18CVPR_SID.pdf) to `ImageProcessingAnnotation`. + * `annotation_file` - path to image pairs file in txt format. +* `conll_ner` - converts CONLL 2003 dataset for Named Entity Recognition to `BERTNamedEntityRecognitionAnnotation`. + * `annotation_file` - annotation file in txt forma + * `vocab_file` - vocab file for word piece tokenization. + * `lower_case` - converts all tokens to lower case during tokenization (Optional, default `False`). + * `max_length` - maximal input sequence length (Optional, default 128). + * `pad_input` - allow padding for input sequence if input less that `max_length` (Optional, default `True`). + * `include_special_token_lables` - allow extension original dataset labels with special token labels (`[CLS'`, `[SEP]`]) (Optional, default `False`). ## Customizing Dataset Meta -There are situations when we need customize some default dataset parameters (e.g. replace original dataset label map with own.) +There are situations when we need to customize some default dataset parameters (e.g. replace original dataset label map with own.) You are able to overload parameters such as `label_map`, `segmentation_colors`, `background_label` using `dataset_meta_file` argument. -dataset meta file is JSON file, which can contains following parameters: +Dataset meta file is JSON file, which can contain the following parameters: * `label_map` is dictionary where `` is key and `` - value. * `labels` is the list of strings, which represent class names (order is matter, the index of class name used as class id). Can be used instead `label_map`. * `background_label` - id of background label in the dataset. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/__init__.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/__init__.py index 3ff0d11e63a..dbe54719304 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/__init__.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/__init__.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ """ from .format_converter import BaseFormatConverter -from .convert import make_subset, save_annotation, analyze_dataset +from .convert import make_subset, save_annotation, analyze_dataset, DatasetConversionInfo from .market1501 import Market1501Converter from .veri776 import VeRi776Converter from .mars import MARSConverter @@ -23,7 +23,7 @@ from .sample_converter import SampleConverter from .wider import WiderFormatConverter from .detection_opencv_storage import DetectionOpenCVStorageFormatConverter -from .lfw import LFWConverter +from .lfw import LFWConverter, FaceRecognitionBinary from .vgg_face_regression import VGGFaceRegressionConverter from .super_resolution_converter import ( SRConverter, SRMultiFrameConverter, MultiTargetSuperResolutionConverter, SRDirectoryBased @@ -43,7 +43,7 @@ from .mnist import MNISTCSVFormatConverter from .wmt import WMTConverter from .common_semantic_segmentation import CommonSegmentationConverter -from .camvid import CamVidConverter +from .camvid import CamVidConverter, CamVid32DatasetConverter from .lpr import LPRConverter from .image_retrieval import ImageRetrievalConverter from .cvat_object_detection import CVATObjectDetectionConverter @@ -83,16 +83,25 @@ from .librispeech import LibrispeechConverter from .criteo_kaggle_dac import CriteoKaggleDACConverter -from .features_regression import FeaturesRegressionConverter +from .features_regression import FeaturesRegressionConverter, MultiOutputFeaturesRegression from .nyu_depth import NYUDepthV2Converter from .dna_seq import DNASequenceDatasetConverter from .place_recognition import PlaceRecognitionDatasetConverter from .cluttered_mnist import ClutteredMNISTConverter from .mpii import MPIIDatasetConverter -from .mapillary_20 import Mapillary20Converter +from .mapillary_20 import Mapillary20Converter, MapillaryVistasConverter +from .antispoofing import AntispoofingDatasetConverter +from .sound_classification_converter import SoundClassificationFormatConverter +from .ade20k_image_translation import ADE20kImageTranslationConverter +from .salient_object_detection import SalientObjectDetectionConverter +from .common_object_detection import CommonDetectionConverter +from .wflw import WFLWConverter +from .see_in_the_dark import SeeInTheDarkDatasetConverter +from .conll_ner import CONLLDatasetConverter __all__ = [ 'BaseFormatConverter', + 'DatasetConversionInfo', 'make_subset', 'save_annotation', 'analyze_dataset', @@ -106,6 +115,7 @@ 'MARSConverter', 'DetectionOpenCVStorageFormatConverter', 'LFWConverter', + 'FaceRecognitionBinary', 'VGGFaceRegressionConverter', 'SRConverter', 'SRMultiFrameConverter', @@ -114,11 +124,13 @@ 'ICDAR13RecognitionDatasetConverter', 'ICDAR15DetectionDatasetConverter', 'UnicodeCharacterRecognitionDatasetConverter', + 'KondateNakayosiRecognitionDatasetConverter', 'MSCocoKeypointsConverter', 'MSCocoSingleKeypointsConverter', 'MSCocoDetectionConverter', 'CityscapesConverter', 'Mapillary20Converter', + 'MapillaryVistasConverter', 'MovieLensConverter', 'BratsConverter', 'BratsNumpyConverter', @@ -128,6 +140,7 @@ 'WMTConverter', 'CommonSegmentationConverter', 'CamVidConverter', + 'CamVid32DatasetConverter', 'LPRConverter', 'ImageRetrievalConverter', 'CVATObjectDetectionConverter', @@ -162,9 +175,18 @@ 'LibrispeechConverter', 'CriteoKaggleDACConverter', 'FeaturesRegressionConverter', + 'MultiOutputFeaturesRegression', 'Im2latexDatasetConverter', 'DNASequenceDatasetConverter', 'PlaceRecognitionDatasetConverter', 'ClutteredMNISTConverter', - 'MPIIDatasetConverter' + 'MPIIDatasetConverter', + 'AntispoofingDatasetConverter', + 'SoundClassificationFormatConverter', + 'ADE20kImageTranslationConverter', + 'SalientObjectDetectionConverter', + 'CommonDetectionConverter', + 'WFLWConverter', + 'SeeInTheDarkDatasetConverter', + 'CONLLDatasetConverter' ] diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/_nlp_common.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/_nlp_common.py index cb224215b15..67d60f02103 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/_nlp_common.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/_nlp_common.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -323,7 +323,7 @@ def get_input_ids(text): return text raise ValueError( "Input is not valid. Should be a string, a list/tuple of strings or a list/tuple of integers." - ) + ) first_ids = get_input_ids(text) second_ids = get_input_ids(text_pair) if text_pair is not None else None diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/_reid_common.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/_reid_common.py index 5fc85aa4a6c..448d9a40bff 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/_reid_common.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/_reid_common.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/action_recognition.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/action_recognition.py index 2bccb08ae7a..26e31951d83 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/action_recognition.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/action_recognition.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/ade20k_dataset_converter.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/ade20k_dataset_converter.py index 978e00da204..358512d2742 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/ade20k_dataset_converter.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/ade20k_dataset_converter.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/ade20k_image_translation.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/ade20k_image_translation.py new file mode 100644 index 00000000000..15743fb372a --- /dev/null +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/ade20k_image_translation.py @@ -0,0 +1,61 @@ +""" +Copyright (c) 2018-2021 Intel Corporation +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +from ..config import PathField +from ..representation import ImageProcessingAnnotation +from .format_converter import BaseFormatConverter, ConverterReturn + + +class ADE20kImageTranslationConverter(BaseFormatConverter): + __provider__ = 'ade20k_image_translation' + annotation_types = (ImageProcessingAnnotation,) + + @classmethod + def parameters(cls): + parameters = super().parameters() + parameters.update({ + 'annotations_dir': PathField( + optional=False, is_directory=True, + description="Path to directory with masks." + ), + 'reference_file': PathField( + optional=False, description="Path to .txt file with pairs (validation:train)." + ) + }) + return parameters + + def configure(self): + self.annotation_dir = self.get_value_from_config('annotations_dir') + self.reference_dict = self.get_value_from_config('reference_file') + + def convert(self, check_content=False, progress_callback=None, progress_interval=100, **kwargs): + annotations = [] + ref_dict = self.get_ref() + for key, value in ref_dict.items(): + input_mask_filename = "annotations/validation/" + key.replace('.jpg', '.png') + reference_image_filename = "images/training/" + value + reference_mask_filename = "annotations/training/" + value.replace('.jpg', '.png') + identifier = [str(input_mask_filename), str(reference_image_filename), str(reference_mask_filename)] + annotation = ImageProcessingAnnotation(identifier, "validation/{}".format(key)) + annotations.append(annotation) + + return ConverterReturn(annotations, None, None) + + def get_ref(self): + with open(self.reference_dict, 'r', encoding="utf-8-sig") as fd: + lines = fd.readlines() + ref_dict = {} + for line in lines: + key, value = line.strip().split(',')[:2] + ref_dict[key] = value + return ref_dict diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/aflw2000_3d.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/aflw2000_3d.py index 069d4da77b6..bc3f473e6a0 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/aflw2000_3d.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/aflw2000_3d.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/antispoofing.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/antispoofing.py new file mode 100644 index 00000000000..52a445a90fa --- /dev/null +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/antispoofing.py @@ -0,0 +1,107 @@ +""" +Copyright (c) 2018-2021 Intel Corporation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +from .format_converter import ConverterReturn, FileBasedAnnotationConverter +from ..representation import ClassificationAnnotation +from ..utils import read_json, check_file_existence +from ..config import PathField, NumberField + +class AntispoofingDatasetConverter(FileBasedAnnotationConverter): + __provider__ = 'antispoofing' + annotation_types = (ClassificationAnnotation, ) + + @classmethod + def parameters(cls): + configuration_parameters = super().parameters() + configuration_parameters.update( + { + 'data_dir': PathField( + is_directory=True, optional=False, + description='path to input images' + ), + 'dataset_meta_file': PathField( + description='path to json file with dataset meta (e.g. label_map)', optional=True + ), + 'label_id': NumberField( + description='number of label in the annotation file representing spoof/real labels', + optional=True, default=43, value_type=int + ), + 'annotation_file': PathField( + description='path to json file with dataset annotations' + '({index : {path: ..., labels: ..., boxes: ... (optional)}})', optional=False + ) + } + ) + return configuration_parameters + + def configure(self): + super().configure() + self.data_dir = self.get_value_from_config('data_dir') + self.annotations = self.get_value_from_config('annotation_file') + self.label_id = self.get_value_from_config('label_id') + self.meta = self.get_value_from_config('dataset_meta_file') + + def convert(self, check_content=False, progress_callback=None, progress_interval=100, **kwargs): + """Reads data from disk and returns dataset in converted for AC format + + Args: + check_content (bool, optional): Check if content is valid. Defaults to False. + progress_callback (bool, optional): Display progress. Defaults to None. + progress_interval (int, optional): Units to display progress. Defaults to 100 (percent). + + Returns: + [type]: Converted dataset + """ + annotation_tuple = self.generate_annotations() + annotations = [] + content_errors = None if not check_content else [] + meta = self.generate_meta() + num_iterations = len(annotations) + + for i, (img_name, label, bbox) in enumerate(annotation_tuple): + image_annotation = ClassificationAnnotation(img_name, label) + if bbox: + image_annotation.metadata['rect'] = bbox + annotations.append(image_annotation) + + if check_content: + if not check_file_existence(self.data_dir /img_name): + content_errors.append('{}: does not exist'.format(img_name)) + if progress_callback is not None and i % progress_interval == 0: + progress_callback(i / num_iterations * 100) + + return ConverterReturn(annotations, meta, content_errors) + + def generate_meta(self): + if not self.meta: + return {'label_map': {'real': 0, 'spoof': 1}} + dataset_meta = read_json(self.meta) + label_map = dataset_meta.get('label_map') + dataset_meta['label_map'] = label_map or {'real': 0, 'spoof': 1} + return dataset_meta + + def generate_annotations(self): + ''' read json file with images paths and return + list of the items''' + annotation_store = [] + dataset_annotations = read_json(self.annotations) + for index in dataset_annotations: + path = dataset_annotations[index]['path'] + target_label = dataset_annotations[index]['labels'][self.label_id] + bbox = dataset_annotations[index].get('bbox') + annotation_store.append((path, target_label, bbox)) + + return annotation_store diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/brats.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/brats.py index 639efd6f93c..06a0276db4b 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/brats.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/brats.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/camvid.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/camvid.py index 38039d53642..7688e3272c4 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/camvid.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/camvid.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,10 +14,10 @@ limitations under the License. """ -from .format_converter import FileBasedAnnotationConverter, ConverterReturn, verify_label_map +from .format_converter import FileBasedAnnotationConverter, BaseFormatConverter, ConverterReturn, verify_label_map from ..utils import read_txt, check_file_existence from ..representation import SegmentationAnnotation -from ..config import PathField +from ..config import PathField, NumberField from ..utils import read_json @@ -85,3 +85,96 @@ def convert(self, check_content=False, progress_callback=None, progress_interval meta['label_map'] = dict(enumerate(meta['labels'])) return ConverterReturn(annotations, meta, content_errors) + + +class CamVid32DatasetConverter(BaseFormatConverter): + __provider__ = 'camvid_32' + meta = { + 'label_map': { + 0: 'Animal', + 1: 'Archway', + 2: 'Bicyclist', + 3: 'Bridge', + 4: 'Building', + 5: 'Car', + 6: 'CartLuggagePram', + 7: 'Child', + 8: 'Column_Pole', + 9: 'Fence', + 10: 'LaneMkgsDriv', + 11: 'LaneMkgsNonDriv', + 12: 'Misc_Text', + 13: 'MotorcycleScooter', + 14: 'OtherMoving', + 15: 'ParkingBlock', + 16: 'Pedestrian', + 17: 'Road', + 18: 'RoadShoulder', + 19: 'Sidewalk', + 20: 'SignSymbol', + 21: 'Sky', + 22: 'SUVPickupTruck', + 23: 'TrafficCone', + 24: 'TrafficLight', + 25: 'Train', + 26: 'Tree', + 27: 'Truck_Bus', + 28: 'Tunnel', + 29: 'VegetationMisc', + 30: 'Void', + 31: 'Wall' + }, + 'background_label': 30, + 'segmentation_colors': ( + (64, 128, 64), (192, 0, 128), (0, 128, 192), (0, 128, 64), (128, 0, 0), (64, 0, 128), (64, 0, 192), + (192, 128, 64), (192, 192, 128), (64, 64, 128), (128, 0, 192), (192, 0, 64), (128, 128, 64), (192, 0, 192), + (128, 64, 64), (64, 192, 128), (64, 64, 0), (128, 64, 128), (128, 128, 192), (0, 0, 192), (192, 128, 128), + (128, 128, 128), (64, 128, 192), (0, 0, 64), (0, 64, 64), (192, 64, 128), (128, 128, 0), (192, 128, 192), + (64, 0, 64), (192, 192, 0), (0, 0, 0), (64, 192, 0) + ) + } + + @classmethod + def parameters(cls): + params = super().parameters() + params.update({ + "labels_dir": PathField(is_directory=True, description='path to directory with labeled images'), + 'images_dir': PathField(is_directory=True, description='path to directory with input images'), + 'val_subset_ratio': NumberField( + value_type=float, min_value=0, max_value=1, default=1, description='subset ration for validation' + ), + 'dataset_meta_file': PathField( + optional=True, description='path to json file with dataset meta (e.g. label_map, color_encoding') + }) + return params + + def configure(self): + self.labels_dir = self.get_value_from_config('labels_dir') + self.images_dir = self.get_value_from_config('images_dir') + self.val_subset_ratio = self.get_value_from_config('val_subset_ratio') + self.dataset_meta = self.get_value_from_config('dataset_meta_file') + + def convert(self, check_content=False, progress_callback=None, progress_interval=100, **kwargs): + label_files = list(self.labels_dir.glob('*.png')) + annotations = [] + val_subset_size = int(len(label_files) * self.val_subset_ratio) + val_labels = label_files[len(label_files)-val_subset_size:] + content_errors = None if not check_content else [] + for idx, label in enumerate(val_labels): + identifier = label.name.replace('_L', '') + if check_content: + if not check_file_existence(self.images_dir / identifier): + content_errors.append('{}: does not exist'.format(self.images_dir / identifier)) + annotations.append(SegmentationAnnotation(identifier, label.name)) + if progress_callback and idx % progress_interval == 0: + progress_callback(idx * 100 / val_subset_size) + + meta = self.meta + if self.dataset_meta: + meta = read_json(self.dataset_meta) + if 'label_map' in meta: + meta['label_map'] = verify_label_map(meta['label_map']) + if 'labels' in meta and 'label_map' not in meta: + meta['label_map'] = dict(enumerate(meta['labels'])) + + return ConverterReturn(annotations, meta, content_errors) diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/cifar.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/cifar.py index 817f46f979d..dcc59fa8dd6 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/cifar.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/cifar.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/cityscapes.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/cityscapes.py index 8595e02c7d4..2444696f872 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/cityscapes.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/cityscapes.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ } full_dataset_meta = { - 'segmentation_colors' : ( + 'segmentation_colors': ( (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (111, 74, 0), (81, 0, 81), (128, 64, 128), (244, 35, 232), (250, 170, 160), (230, 150, 140), (70, 70, 70), (102, 102, 156), (190, 153, 153), (180, 165, 180), (150, 100, 100), (150, 120, 90), (153, 153, 153), (153, 153, 153), (250, 170, 30), @@ -45,7 +45,7 @@ (0, 0, 70), (0, 60, 100), (0, 0, 90), (0, 0, 110), (0, 80, 100), (0, 0, 230), (119, 11, 32) ), 'label_map': { - 0: 'unlabeled', 1: 'ego vehicle', 2: 'rectification border', 3: 'out of roi', 4: 'static', 5: 'dynamic', + 0: 'unlabeled', 1: 'ego vehicle', 2: 'rectification border', 3: 'out of roi', 4: 'static', 5: 'dynamic', 6: 'ground', 7: 'road', 8: 'sidewalk', 9: 'parking', 10: 'rail track', 11: 'building', 12: 'wall', 13: 'fence', 14: 'guard rail', 15: 'bridge', 16: 'tunnel', 17: 'pole', 18: 'polegroup', 19: 'traffic light', 20: 'traffic sign', 21: 'vegetation', 22: 'terrain', 23: 'sky', 24: 'person', 25: 'rider', 26: 'car', diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/cluttered_mnist.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/cluttered_mnist.py index f70ccd30d2b..2b47d453d5c 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/cluttered_mnist.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/cluttered_mnist.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/cmu_panoptic.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/cmu_panoptic.py index 5f00c1c6951..57cf1263dd9 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/cmu_panoptic.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/cmu_panoptic.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/common_object_detection.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/common_object_detection.py new file mode 100644 index 00000000000..1fdba666dbe --- /dev/null +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/common_object_detection.py @@ -0,0 +1,101 @@ +""" +Copyright (c) 2018-2021 Intel Corporation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +import numpy as np +from .format_converter import BaseFormatConverter, ConverterReturn +from ..utils import read_txt, check_file_existence +from ..config import PathField, BoolField +from ..representation import DetectionAnnotation + + +class CommonDetectionConverter(BaseFormatConverter): + __provider__ = 'common_object_detection' + + @classmethod + def parameters(cls): + params = super().parameters() + params.update({ + 'images_dir': PathField(optional=True, is_directory=True, description='Images directory'), + 'annotation_dir': PathField(optional=False, is_directory=True, description='Annotation directory'), + 'labels_file': PathField(description='Labels file'), + 'pairs_file': PathField( + optional=True, description='matching between images and annotations' + ), + 'has_background': BoolField(optional=True, default=False, description='Indicator of background'), + 'add_background_to_label_id': BoolField( + optional=True, default=False, description='Indicator that need shift labels' + ) + }) + return params + + def configure(self): + self.images_dir = self.get_value_from_config('images_dir') + self.annotation_dir = self.get_value_from_config('annotation_dir') + self.labels_file = self.get_value_from_config('labels_file') + self.has_background = self.get_value_from_config('has_background') + self.shift_labels = self.get_value_from_config('add_background_to_label_id') + self.pairs_file = self.get_value_from_config('pairs_file') + + def convert(self, check_content=False, progress_callback=None, progress_interval=100, **kwargs): + content_errors = None if not check_content else [] + image_ann_pairs = [] + if self.pairs_file: + pairs_list = read_txt(self.pairs_file) + for line in pairs_list: + image_path, annotation_path = line.split(' ') + image_path = image_path.split('@')[-1] + annotation_path = annotation_path.split('@')[-1] + image_ann_pairs.append((image_path, annotation_path)) + else: + annotation_files = self.annotation_dir.glob('*.txt') + for ann_file in annotation_files: + image_ann_pairs.append((ann_file.name.replace('txt', 'jpg'), ann_file.name)) + num_iterations = len(image_ann_pairs) + annotations = [] + for idx, (identifier, annotation_file) in enumerate(image_ann_pairs): + labels, x_mins, y_mins, x_maxs, y_maxs = self.parse_annotation(annotation_file) + annotations.append(DetectionAnnotation(identifier, labels, x_mins, y_mins, x_maxs, y_maxs)) + if check_content: + if self.images_dir is None: + self.images_dir = self.annotation_dir.parent / 'images' + check_file_existence(self.images_dir / identifier) + content_errors.append('{}: does not exist'.format(self.images_dir / identifier)) + if progress_callback and idx % progress_interval == 0: + progress_callback(idx * 100 / num_iterations) + + return ConverterReturn(annotations, self.generate_meta(), content_errors) + + def parse_annotation(self, annotation_file): + labels, x_mins, y_mins, x_maxs, y_maxs = [], [], [], [], [] + for line in read_txt(self.annotation_dir / annotation_file): + label, x_min, y_min, x_max, y_max = line.split() + labels.append(int(label) + self.shift_labels) + x_mins.append(float(x_min)) + y_mins.append(float(y_min)) + x_maxs.append(float(x_max)) + y_maxs.append(float(y_max)) + return np.array(labels), np.array(x_mins), np.array(y_mins), np.array(x_maxs), np.array(y_maxs) + + def generate_meta(self): + labels = read_txt(self.labels_file) + label_map = {} + for idx, label_name in enumerate(labels): + label_map[idx + self.has_background] = label_name + meta = {'label_map': label_map} + if self.has_background: + meta['label_map'][0] = 'background' + meta['background_label'] = 0 + return meta diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/common_semantic_segmentation.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/common_semantic_segmentation.py index b5f1d981ac9..f073fdc0caa 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/common_semantic_segmentation.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/common_semantic_segmentation.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/conll_ner.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/conll_ner.py new file mode 100644 index 00000000000..c52ac4336f8 --- /dev/null +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/conll_ner.py @@ -0,0 +1,158 @@ +"""" +Copyright (c) 2018-2021 Intel Corporation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +from .format_converter import FileBasedAnnotationConverter, ConverterReturn +from ._nlp_common import WordPieceTokenizer +from ..config import BoolField, PathField, NumberField +from ..representation import BERTNamedEntityRecognitionAnnotation + + +class CONLLDatasetConverter(FileBasedAnnotationConverter): + __provider__ = 'conll_ner' + label_list = ["O", "B-MISC", "I-MISC", "B-PER", "I-PER", "B-ORG", "I-ORG", "B-LOC", "I-LOC"] + + @classmethod + def parameters(cls): + params = super().parameters() + params.update({ + 'lower_case': BoolField(optional=True, default=False), + 'vocab_file': PathField(description='Path to vocabulary file for word piece tokenizer'), + 'max_len': NumberField(optional=True, default=128, value_type=int, description='max_sequence_length'), + 'pad_input': BoolField( + optional=True, default=True, description='Should input be padded to max length or not' + ), + 'include_special_token_labels': BoolField( + optional=True, default=False, description='Should special tokens be included to labels or not' + ) + }) + return params + + def configure(self): + super().configure() + self.include_spec = self.get_value_from_config('include_special_token_labels') + self.tokenizer = WordPieceTokenizer( + self.get_value_from_config('vocab_file'), + lower_case=self.get_value_from_config('lower_case'), max_len=self.get_value_from_config('max_len') + ) + if self.include_spec: + self.label_list.extend(['[CLS]', '[SEP]']) + self.pad = self.get_value_from_config('pad_input') + + def convert(self, check_content=False, **kwargs): + sents, labels = self.read_annotation() + annotations = self.convert_examples_to_features(sents, labels) + label_map = dict(enumerate(self.label_list, int(self.include_spec))) + return ConverterReturn(annotations, {'label_map': label_map}, None) + + def read_annotation(self): + with self.annotation_file.open(mode='r') as lines: + sentence, label, sentences, labels = [], [], [], [] + for line in lines: + if not line or line.startswith('-DOCSTART') or line[0] == "\n": + if len(sentence) > 0: + sentences.append(' '.join(sentence)) + labels.append(label) + sentence = [] + label = [] + continue + splits = line.split(' ') + sentence.append(splits[0]) + label.append(splits[-1][:-1]) + + if len(sentence) > 0: + sentences.append(' '.join(sentence)) + labels.append(label) + + return sentences, labels + + def convert_examples_to_features(self, sentences, labels): + label_map = {label: i for i, label in enumerate(self.label_list, int(self.include_spec))} + + features = [] + max_seq_length = self.tokenizer.max_len + + for ex_index, (text, label) in enumerate(zip(sentences, labels)): + tokens = [] + labels = [] + valid = [] + label_mask = [] + for i, word in enumerate(text.split(' ')): + token = self.tokenizer.tokenize(word) + tokens.extend(token) + label_1 = label[i] + for m in range(len(token)): + if m == 0: + labels.append(label_1) + valid.append(1) + label_mask.append(1) + else: + valid.append(0) + if len(tokens) >= max_seq_length - 1: + tokens = tokens[0:(max_seq_length - 2)] + labels = labels[0:(max_seq_length - 2)] + valid = valid[0:(max_seq_length - 2)] + label_mask = label_mask[0:(max_seq_length - 2)] + ntokens = [] + segment_ids = [] + label_ids = [] + ntokens.append("[CLS]") + segment_ids.append(0) + valid.insert(0, int(self.include_spec)) + label_mask.insert(0, int(self.include_spec)) + label_ids.append(label_map.get('[CLS]', -1)) + for i, token in enumerate(tokens): + ntokens.append(token) + segment_ids.append(0) + if len(labels) > i: + label_ids.append(label_map[labels[i]]) + ntokens.append("[SEP]") + segment_ids.append(0) + valid.append(int(self.include_spec)) + label_mask.append(int(self.include_spec)) + label_ids.append(label_map.get('[SEP]', -1)) + input_ids = self.tokenizer.convert_tokens_to_ids(ntokens) + input_mask = [1] * len(input_ids) + if self.pad: + input_ids, input_mask, segment_ids, label_ids, valid, label_mask = pad_inputs( + input_ids, input_mask, segment_ids, label_ids, valid, label_mask, max_seq_length + ) + + identifier = [ + 'input_ids_{}'.format(ex_index), + 'input_mask_{}'.format(ex_index), + 'segment_ids_{}'.format(ex_index), + ] + features.append( + BERTNamedEntityRecognitionAnnotation( + identifier, input_ids, input_mask, segment_ids, label_ids, valid, label_mask + )) + + return features + + +def pad_inputs(input_ids, input_mask, segment_ids, label_ids, valid, label_mask, max_seq_length): + while len(input_ids) < max_seq_length: + input_ids.append(0) + input_mask.append(0) + segment_ids.append(0) + label_ids.append(0) + valid.append(0) + label_mask.append(0) + while len(label_ids) < max_seq_length: + label_ids.append(0) + label_mask.append(0) + + return input_ids, input_mask, segment_ids, label_ids, valid, label_mask diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/convert.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/convert.py index f4e2cb44eda..c232030004f 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/convert.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/convert.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -19,18 +19,30 @@ import copy import json from pathlib import Path +import pickle from argparse import ArgumentParser +from collections import namedtuple from functools import partial import numpy as np +from .. import __version__ from ..representation import ( ReIdentificationClassificationAnnotation, ReIdentificationAnnotation, PlaceRecognitionAnnotation ) from ..utils import get_path, OrderedSet from ..data_analyzer import BaseDataAnalyzer from .format_converter import BaseFormatConverter -from ..utils import cast_to_bool +from ..utils import cast_to_bool, is_relative_to + +DatasetConversionInfo = namedtuple('DatasetConversionInfo', + [ + 'dataset_name', + 'conversion_parameters', + 'subset_parameters', + 'dataset_size', + 'ac_version' + ]) def build_argparser(): @@ -188,7 +200,7 @@ def main(): main_argparser = ArgumentParser(parents=[main_argparser, converter_argparser]) args = main_argparser.parse_args() - converter = configure_converter(converter_args, args, converter) + converter, converter_config = configure_converter(converter_args, args, converter) out_dir = args.output_dir or Path.cwd() results = converter.convert() @@ -208,7 +220,6 @@ def main(): subsample_size = int(args.subsample) converted_annotation = make_subset(converted_annotation, subsample_size, args.subsample_seed, args.shuffle) - if args.analyze_dataset: analyze_dataset(converted_annotation, meta) @@ -218,18 +229,29 @@ def main(): annotation_file = out_dir / annotation_name meta_file = out_dir / meta_name + dataset_config = { + 'name': annotation_name, + 'annotation_conversion': converter_config, + 'subsample_size': subsample, + 'subsample_seed': args.subsample_seed, + 'shuffle': args.shuffle + } - save_annotation(converted_annotation, meta, annotation_file, meta_file) + save_annotation(converted_annotation, meta, annotation_file, meta_file, dataset_config) -def save_annotation(annotation, meta, annotation_file, meta_file): +def save_annotation(annotation, meta, annotation_file, meta_file, dataset_config=None): if annotation_file: + conversion_meta = get_conversion_attributes(dataset_config, len(annotation)) if dataset_config else None annotation_dir = annotation_file.parent if not annotation_dir.exists(): annotation_dir.mkdir(parents=True) with annotation_file.open('wb') as file: + if conversion_meta: + pickle.dump(conversion_meta, file) for representation in annotation: representation.dump(file) + if meta_file and meta: meta_dir = meta_file.parent if not meta_dir.exists(): @@ -238,6 +260,34 @@ def save_annotation(annotation, meta, annotation_file, meta_file): json.dump(meta, file) +def get_conversion_attributes(config, dataset_size): + dataset_name = config.get('name', '') + conversion_parameters = copy.deepcopy(config.get('annotation_conversion', {})) + for key, value in config.get('annotation_conversion', {}).items(): + if key in config.get('_command_line_mapping', {}): + m_path = config['_command_line_mapping'][key] + if not m_path: + conversion_parameters[key] = str(value) + continue + + if isinstance(m_path, list): + for m_path in config['_command_line_mapping'][key]: + if is_relative_to(value, m_path): + break + conversion_parameters[key] = str(value.relative_to(m_path)) + + subset_size = config.get('subsample_size') + subset_parameters = {} + if subset_size is not None: + shuffle = config.get('shuffle', True) + subset_parameters = { + 'subsample_size': subset_size, + 'subsample_seed': config.get('subsample_seed'), + 'shuffle': shuffle + } + return DatasetConversionInfo(dataset_name, conversion_parameters, subset_parameters, dataset_size, __version__) + + def configure_converter(converter_options, args, converter): args_dict, converter_options_dict = vars(args), vars(converter_options) converter_config = { @@ -249,7 +299,7 @@ def configure_converter(converter_options, args, converter): converter.validate_config() converter.configure() - return converter + return converter, converter_config def get_converter_arguments(arguments): diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/criteo_kaggle_dac.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/criteo_kaggle_dac.py index 156c6b8b3d1..eb4326d6a19 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/criteo_kaggle_dac.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/criteo_kaggle_dac.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -49,6 +49,9 @@ def parameters(cls): description="Name of model sparse features input. " + "For multiple inputs use comma-separated list in form :"), "lso_features": StringField(optional=True, default='lS_o', description="Name of lS_o-like features input."), + "save_preprocessed_features": BoolField( + optional=True, default=True, description='Save preprocessed features or not' + ) }) return parameters @@ -64,6 +67,7 @@ def configure(self): self.dense_features = self.get_value_from_config('dense_features') self.sparse_features = self.get_value_from_config('sparse_features') self.lso_features = self.get_value_from_config('lso_features') + self.save_preprocessed_features = self.get_value_from_config('save_preprocessed_features') self.parse_sparse_features() def parse_sparse_features(self): @@ -79,13 +83,11 @@ def parse_sparse_features(self): else: ConfigError('Invalid configuration option {}'.format(feat)) - def convert(self, check_content=False, **kwargs): - preprocessed_folder = Path(self.preprocessed_dir) input_folder = preprocessed_folder / "bs{}".format(self.batch) / 'input' - if not input_folder.exists(): + if not input_folder.exists() and self.save_preprocessed_features: input_folder.mkdir(parents=True) annotations = [] @@ -109,22 +111,22 @@ def convert(self, check_content=False, **kwargs): for i in range(start, samples - self.batch + 1, self.batch): c_input = input_folder / "{:02d}".format(subfolder) - - if not c_input.exists(): - c_input.mkdir(parents=True) - c_input = c_input / "{:06d}.npz".format(i) - sample = { - self.dense_features: np.log1p(x_int[i:i+self.batch, ...]), - self.lso_features: np.dot(np.expand_dims(np.linspace(0, self.batch - 1, num=self.batch), -1), - np.ones((1, cat_feat))).T - } + if self.save_preprocessed_features: + if not c_input.parent.exists(): + c_input.parent.mkdir(parents=True) + + sample = { + self.dense_features: np.log1p(x_int[i:i+self.batch, ...]), + self.lso_features: np.dot(np.expand_dims(np.linspace(0, self.batch - 1, num=self.batch), -1), + np.ones((1, cat_feat))).T + } - for name in self.sparse_features.keys(): - sample[name] = x_cat[i:i+self.batch, self.sparse_features[name]].T + for name in self.sparse_features.keys(): + sample[name] = x_cat[i:i+self.batch, self.sparse_features[name]].T - np.savez_compressed(str(c_input), **sample) + np.savez_compressed(str(c_input), **sample) filecnt += 1 filecnt %= 0x100 diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_age_gender_recognition.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_age_gender_recognition.py index b1ebbe7400f..2a0f4656cfb 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_age_gender_recognition.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_age_gender_recognition.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_attributes_recognition.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_attributes_recognition.py index f1750569378..663a6dd1386 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_attributes_recognition.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_attributes_recognition.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ from .format_converter import FileBasedAnnotationConverter, ConverterReturn from ..representation import ClassificationAnnotation, ContainerAnnotation -from ..topology_types import ImageClassification from ..utils import read_xml, check_file_existence from ..config import StringField, PathField, ConfigError @@ -24,7 +23,6 @@ class CVATAttributesRecognitionConverter(FileBasedAnnotationConverter): __provider__ = 'cvat_attributes_recognition' annotation_types = (ClassificationAnnotation, ) - topology_types = (ImageClassification, ) @classmethod def parameters(cls): diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_facial_landmarks.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_facial_landmarks.py index 05dec594a5c..9d9650a2089 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_facial_landmarks.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_facial_landmarks.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_human_pose.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_human_pose.py index 73672e25b0f..9a19468bed6 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_human_pose.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_human_pose.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_multilabel_recognition.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_multilabel_recognition.py index 23555824109..f701581069c 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_multilabel_recognition.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_multilabel_recognition.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_object_detection.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_object_detection.py index eb3d974ffc8..abfacbf0bcf 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_object_detection.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_object_detection.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ from .format_converter import FileBasedAnnotationConverter, ConverterReturn from ..representation import DetectionAnnotation -from ..topology_types import ObjectDetection from ..utils import read_xml, check_file_existence, read_json from ..config import PathField, ConfigError, BoolField @@ -24,7 +23,6 @@ class CVATObjectDetectionConverter(FileBasedAnnotationConverter): __provider__ = 'cvat_object_detection' annotation_types = (DetectionAnnotation, ) - topology_types = (ObjectDetection, ) @classmethod def parameters(cls): diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_person_detection_action_recognition.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_person_detection_action_recognition.py index d8f6d7dca28..63823380cdb 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_person_detection_action_recognition.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_person_detection_action_recognition.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ from .format_converter import FileBasedAnnotationConverter, ConverterReturn from ..representation import DetectionAnnotation, ActionDetectionAnnotation, ContainerAnnotation -from ..topology_types import ObjectDetection from ..utils import read_xml, check_file_existence from ..config import PathField, ConfigError, StringField @@ -71,7 +70,7 @@ 2: 'raising_hand' }, - 'common_6_actions':{ + 'common_6_actions': { 0: 'sitting', 1: 'writing', 2: 'raising_hand', @@ -96,7 +95,6 @@ class CVATPersonDetectionActionRecognitionConverter(FileBasedAnnotationConverter): __provider__ = 'cvat_person_detection_action_recognition' annotation_types = (DetectionAnnotation, ActionDetectionAnnotation) - topology_types = (ObjectDetection, ) @classmethod def parameters(cls): diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_text_recognition.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_text_recognition.py index 5c03fe1a98e..acfab8dbcec 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_text_recognition.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_text_recognition.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/detection_opencv_storage.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/detection_opencv_storage.py index f26abd0654e..bc23dbbbc11 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/detection_opencv_storage.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/detection_opencv_storage.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/dna_seq.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/dna_seq.py index b279a260395..69d9c0ee9aa 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/dna_seq.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/dna_seq.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/fashion_mnist.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/fashion_mnist.py index dafd101cca2..7fbdeee89c5 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/fashion_mnist.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/fashion_mnist.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/features_regression.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/features_regression.py index 93887ec32c5..7156a9a92b9 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/features_regression.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/features_regression.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,9 +14,10 @@ limitations under the License. """ -from ..config import PathField +from ..config import PathField, StringField, BoolField from ..representation import FeaturesRegressionAnnotation -from .format_converter import ConverterReturn, BaseFormatConverter, StringField +from ..utils import check_file_existence +from .format_converter import ConverterReturn, BaseFormatConverter class FeaturesRegressionConverter(BaseFormatConverter): @@ -26,10 +27,12 @@ class FeaturesRegressionConverter(BaseFormatConverter): def parameters(cls): params = super().parameters() params.update({ - 'input_dir': PathField(is_directory=True), - 'reference_dir': PathField(is_directory=True), - 'input_suffix': StringField(optional=True, default='.txt'), - 'reference_suffix': StringField(optional=True, default='.txt') + 'input_dir': PathField(is_directory=True, description='directory with input data'), + 'reference_dir': PathField(is_directory=True, description='directory for reference files storing'), + 'input_suffix': StringField(optional=True, default='.txt', description='suffix for input file'), + 'reference_suffix': StringField(optional=True, default='.txt', description='suffix for reference file'), + 'use_bin_data': BoolField(optional=True, default=False, description='use binary data formats'), + 'bin_data_dtype': StringField(optional=True, default='float32', description='binary data type for reading') }) return params @@ -38,6 +41,8 @@ def configure(self): self.ref_directory = self.get_value_from_config('reference_dir') self.in_suffix = self.get_value_from_config('input_suffix') self.ref_suffix = self.get_value_from_config('reference_suffix') + self.bin_data = self.get_value_from_config('use_bin_data') + self.bin_dtype = self.get_value_from_config('bin_data_dtype') def convert(self, check_content=False, progress_callback=None, progress_interval=100, **kwargs): annotations = [] @@ -47,5 +52,42 @@ def convert(self, check_content=False, progress_callback=None, progress_interval input_file = self.in_directory / identifier if not input_file.exists(): continue - annotations.append(FeaturesRegressionAnnotation(identifier, ref_file.name)) + annotations.append( + FeaturesRegressionAnnotation(identifier, ref_file.name, is_bin=self.bin_data, bin_dtype=self.bin_dtype) + ) + return ConverterReturn(annotations, None, None) + + +class MultiOutputFeaturesRegression(BaseFormatConverter): + __provider__ = 'multi_feature_regression' + + @classmethod + def parameters(cls): + params = super().parameters() + params.update({ + 'data_dir': PathField(is_directory=True, description='directory with data'), + 'input_suffix': StringField(optional=True, default='in.npy', description='suffix for input files search'), + 'reference_suffix': StringField(optional=True, default='out.npy', description='suffix for ref files'), + 'prefix': StringField(optional=True, default='', description='prefix for files search') + }) + return params + + def configure(self): + self.data_dir = self.get_value_from_config('data_dir') + self.input_suffix = self.get_value_from_config('input_suffix') + self.output_suffix = self.get_value_from_config('reference_suffix') + self.prefix = self.get_value_from_config('prefix') + + def convert(self, check_content=False, progress_callback=None, progress_interval=100, **kwargs): + annotations = [] + input_data = list(self.data_dir.glob('{}*{}*'.format(self.prefix, self.input_suffix))) + content_errors = None if not check_content else [] + num_iterations = len(input_data) + for idx, input_file in enumerate(input_data): + ref_file = input_file.parent / input_file.name.replace(self.input_suffix, self.output_suffix) + if check_content and not check_file_existence(ref_file): + content_errors.append('{}: does not exist'.format(ref_file)) + annotations.append(FeaturesRegressionAnnotation(input_file.name, ref_file.name, dict_features=True)) + if progress_callback and idx % progress_interval == 0: + progress_callback(idx * 100 / num_iterations) return ConverterReturn(annotations, None, None) diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/format_converter.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/format_converter.py index 1a537341176..f9236292e83 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/format_converter.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/format_converter.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ from argparse import ArgumentParser from collections import namedtuple -from ..topology_types import GenericTopology from ..config import ConfigValidator, StringField, PathField, ConfigError from ..dependency import ClassProvider from ..utils import format_key, get_parameter_value_from_config @@ -27,7 +26,6 @@ class BaseFormatConverter(ClassProvider): __provider_type__ = 'converter' - topology_types = (GenericTopology, ) @classmethod def parameters(cls): @@ -35,17 +33,18 @@ def parameters(cls): 'converter': StringField(description="Converter name.") } - @property - def config_validator(self): + @classmethod + def config_validator(cls, uri_prefix=''): + converter_uri = uri_prefix or 'annotation_conversion.{}'.format(cls.get_name()) return ConfigValidator( - '{}_converter_config'.format(self.get_name()), fields=self.parameters(), + converter_uri, fields=cls.parameters(), on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT ) def __init__(self, config=None): self.config = config if config: - self.validate_config() + self.validate_config(config) self.configure() def get_value_from_config(self, key): @@ -72,7 +71,7 @@ def get_name(cls): def get_argparser(self): parser = ArgumentParser(add_help=False) - config_validator = self.config_validator + config_validator = self.config_validator() fields = config_validator.fields for field_name, field in fields.items(): if field_name == 'converter': @@ -89,8 +88,9 @@ def get_argparser(self): return parser - def validate_config(self): - self.config_validator.validate(self.config) + @classmethod + def validate_config(cls, config, fetch_only=False, uri_prefix=''): + return cls.config_validator(uri_prefix=uri_prefix).validate(config, fetch_only=fetch_only) def configure(self): pass diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/icdar.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/icdar.py index 691d7bf495a..cab7981a4ed 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/icdar.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/icdar.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/im2latex.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/im2latex.py index 1b0442d1932..7e3dc997e41 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/im2latex.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/im2latex.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -77,6 +77,7 @@ def parameters(cls): } ) return configuration_parameters + def configure(self): super().configure() self.images_dir = self.get_value_from_config('images_dir') diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/image_processing.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/image_processing.py index 0e808acb034..4f9e95cb6b7 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/image_processing.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/image_processing.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/image_retrieval.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/image_retrieval.py index 796a08a2e2f..31b8ca388c8 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/image_retrieval.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/image_retrieval.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/imagenet.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/imagenet.py index 9bfd2ae7690..1c3d6aa05c5 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/imagenet.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/imagenet.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,20 +14,19 @@ limitations under the License. """ +from pathlib import Path import numpy as np from ..config import PathField, BoolField from ..representation import ClassificationAnnotation from ..utils import read_txt, get_path, check_file_existence, read_json -from ..topology_types import ImageClassification from .format_converter import BaseFormatConverter, ConverterReturn, verify_label_map class ImageNetFormatConverter(BaseFormatConverter): __provider__ = 'imagenet' annotation_types = (ClassificationAnnotation, ) - topology_types = (ImageClassification, ) @classmethod def parameters(cls): @@ -67,6 +66,7 @@ def convert(self, check_content=False, progress_callback=None, progress_interval num_iterations = len(original_annotation) for image_id, image in enumerate(original_annotation): image_name, label = image.split() + image_name = Path(image_name).name.split('@')[-1] if check_content: if not check_file_existence(self.images_dir / image_name): content_errors.append('{}: does not exist'.format(self.images_dir / image_name)) diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/inpainting.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/inpainting.py index 11bc9a95d84..5feef73d84c 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/inpainting.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/inpainting.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -51,7 +51,7 @@ def convert(self, check_content=False, progress_callback=None, progress_interval images = [ im for im in self.image_dir.iterdir() if im.name.lower().endswith(('.png', '.jpg', '.jpeg', '.tiff', '.bmp', '.gif')) - ] + ] if self.masks_dir is not None: masks = [ mask for mask in self.masks_dir.iterdir() diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/lfw.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/lfw.py index bab128c110f..2afed7e08dc 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/lfw.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/lfw.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,10 +14,14 @@ limitations under the License. """ +import pickle from collections import defaultdict from pathlib import Path -from ..config import PathField +import cv2 +import numpy as np + +from ..config import PathField, BoolField, StringField from ..representation import ReIdentificationClassificationAnnotation from ..utils import read_txt, check_file_existence, OrderedSet @@ -39,6 +43,9 @@ def parameters(cls): 'images_dir': PathField( is_directory=True, optional=True, description='path to dataset images, used only for content existence check' + ), + 'extension': StringField( + optional=True, default='jpg', description='images extension', choices=['jpg', 'png'] ) }) @@ -48,6 +55,7 @@ def configure(self): self.pairs_file = self.get_value_from_config('pairs_file') self.landmarks_file = self.get_value_from_config('landmarks_file') self.images_dir = self.get_value_from_config('images_dir') or self.pairs_file.parent + self.extension = self.get_value_from_config('extension') def convert(self, check_content=False, progress_callback=None, progress_interval=100, **kwargs): landmarks_map = {} @@ -62,10 +70,9 @@ def convert(self, check_content=False, progress_callback=None, progress_interval return test_annotations - @staticmethod - def get_image_name(person, image_id): - image_path_pattern = '{}/{}_{}{}.jpg' - return image_path_pattern.format(person, person, '0' * (4 - len(image_id)), image_id) + def get_image_name(self, person, image_id): + image_path_pattern = '{}/{}_{}{}.{}' + return image_path_pattern.format(person, person, '0' * (4 - len(image_id)), image_id, self.extension) def convert_positive(self, pairs, all_images): positives = defaultdict(OrderedSet) @@ -130,3 +137,62 @@ def prepare_annotation( progress_callback(image_id / num_iterations * 100) return ConverterReturn(annotations, None, content_errors) + + +class FaceRecognitionBinary(BaseFormatConverter): + __provider__ = 'face_recognition_bin' + + @classmethod + def parameters(cls): + params = super().parameters() + params.update({ + 'bin_file': PathField(description='binary data file'), + 'images_dir': PathField( + is_directory=True, optional=True, check_exists=False, + description='directory for saving converted images'), + 'convert_images': BoolField( + optional=True, default=True, + description='flag that image conversion required or not' + ) + }) + return params + + def configure(self): + self.bin_file = self.get_value_from_config('bin_file') + self.images_dir = self.get_value_from_config('images_dir') or self.bin_file.parent / 'converted_images' + self.convert_images = self.get_value_from_config('convert_images') + if self.convert_images and not self.images_dir.exists(): + self.images_dir.mkdir(parents=True) + + def convert(self, check_content=False, progress_callback=None, progress_interval=100, **kwargs): + with self.bin_file.open('rb') as f: + bins, issame_list = pickle.load(f, encoding='bytes') + annotations = [] + content_errors = None if not check_content else [] + num_iterations = len(issame_list) * 2 + for idx in range(0, num_iterations, 2): + first_img = '{}.png'.format(idx) + second_img = '{}.png'.format(idx + 1) + if self.convert_images: + self.save_image(bins[idx], first_img) + self.save_image(bins[idx + 1], second_img) + if check_content: + if not check_file_existence(self.images_dir / first_img): + content_errors.append('{}: does not exist'.format(self.images_dir / first_img)) + if not check_file_existence(self.images_dir / second_img): + content_errors.append('{}: does not exist'.format(self.images_dir / second_img)) + is_same = issame_list[int(idx // 2)] + positive = [second_img] if is_same else [] + negative = [second_img] if not is_same else [] + annotations.append( + ReIdentificationClassificationAnnotation(first_img, positive, negative) + ) + annotations.append(ReIdentificationClassificationAnnotation(second_img, [], [])) + if progress_callback and idx % progress_interval == 0: + progress_callback(idx * 100 / num_iterations) + return ConverterReturn(annotations, None, content_errors) + + def save_image(self, data, image_name): + image = cv2.imdecode(np.frombuffer(data, dtype=np.uint8), cv2.IMREAD_COLOR) + path_to_save = self.images_dir / image_name + cv2.imwrite(str(path_to_save), image) diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/librispeech.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/librispeech.py index a9122b3c296..e7ed1f07f37 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/librispeech.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/librispeech.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/lpr.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/lpr.py index 9f543aa4985..e881f1f5bc9 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/lpr.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/lpr.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/mapillary_20.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/mapillary_20.py index 594a7ac97a5..aecaac08548 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/mapillary_20.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/mapillary_20.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,14 +14,62 @@ limitations under the License. """ -from ..config import PathField +from ..config import PathField, StringField, ConfigError from ..representation import SegmentationAnnotation from ..representation.segmentation_representation import GTMaskLoader from ..utils import get_path from .format_converter import BaseFormatConverter, ConverterReturn -class Mapillary20Converter(BaseFormatConverter): +class MapillaryBaseConverter(BaseFormatConverter): + @classmethod + def parameters(cls): + parameters = super().parameters() + parameters.update({ + 'data_dir': PathField( + optional=True, is_directory=True, + description="Path to dataset root folder. Relative paths to images and masks directory " + "determine as imgs and masks respectively. " + "In way when images and masks are located in non default directories, " + "you can use parameters described below." + ), + 'images_dir': PathField( + optional=True, is_directory=True, description="Path to images folder." + ), + 'mask_dir': PathField( + optional=True, is_directory=True, description="Path to ground truth mask folder." + ), + 'images_subfolder': StringField( + optional=True, default='imgs', description="Sub-directory for images." + ), + 'mask_subfolder': StringField( + optional=True, default='masks', description="Sub-directory for ground truth mask." + ) + }) + + return parameters + + def configure(self): + data_dir = self.get_value_from_config('data_dir') + images_dir = self.get_value_from_config('images_dir') + mask_dir = self.get_value_from_config('mask_dir') + images_folder = self.get_value_from_config('images_subfolder') + mask_folder = self.get_value_from_config('mask_subfolder') + + if not data_dir and (not images_dir or not mask_dir): + raise ConfigError('data_dir or images_dir and mask_dir should be provided for conversion') + + images_path = images_dir if images_dir else data_dir / images_folder + mask_path = mask_dir if mask_dir else data_dir / mask_folder + + self.images_dir = get_path(images_path, is_directory=True) + self.mask_dir = get_path(mask_path, is_directory=True) + + def convert(self, *args, **kwargs): + pass + + +class Mapillary20Converter(MapillaryBaseConverter): __provider__ = 'mapillary_20' annotation_types = (SegmentationAnnotation, ) @@ -48,43 +96,69 @@ class Mapillary20Converter(BaseFormatConverter): 19: 'Ego-Vehicle' } + def convert(self, *args, **kwargs): + annotations = [] + for file_in_dir in self.images_dir.glob('*.png'): + annotation = SegmentationAnnotation(file_in_dir.name, file_in_dir.name, mask_loader=GTMaskLoader.PILLOW) + annotations.append(annotation) + + return ConverterReturn(annotations, {'label_map': self.label_map}, None) + + +class MapillaryVistasConverter(MapillaryBaseConverter): + __provider__ = 'mapillary_vistas' + annotation_types = (SegmentationAnnotation, ) + + meta = { + 'label_map': { + 0: 'Unlabeled', + 1: 'Road', + 2: 'Sidewalk', + 3: 'Building', + 4: 'Wall', + 5: 'Fence', + 6: 'Pole', + 7: 'Traffic Light', + 8: 'Traffic Sign', + 9: 'Vegetation', + 10: 'Terrain', + 11: 'Sky', + 12: 'Person', + 13: 'Rider', + 14: 'Car', + 15: 'Truck', + 16: 'Bus', + 17: 'Train', + 18: 'Motorcycle', + 19: 'Bicycle' + }, + 'background_label': 0, + 'segmentation_colors': ( + (0, 0, 0), (128, 64, 128), (244, 35, 232), (70, 70, 70), (102, 102, 156), (190, 153, 153), (153, 153, 153), + (250, 170, 30), (220, 220, 0), (107, 142, 35), (152, 251, 152), (70, 130, 180), (220, 20, 60), (255, 0, 0), + (0, 0, 142), (0, 0, 70), (0, 60, 100), (0, 80, 100), (0, 0, 230), (119, 11, 32) + ) + } + @classmethod def parameters(cls): parameters = super().parameters() parameters.update({ - 'data_dir': PathField( - is_directory=True, - description="Path to dataset root folder. Relative paths to images and masks directory " - "determine as imgs and masks respectively. " - "In way when images and masks are located in non default directories, " - "you can use parameters described below." - ), - 'images_dir': PathField( - optional=True, is_directory=True, check_exists=False, - default='imgs', description="Path to images folder." + 'images_subfolder': StringField( + optional=True, default='images', description="Sub-directory for images." ), - 'mask_dir': PathField( - optional=True, is_directory=True, check_exists=False, - default='masks', description="Path to ground truth mask folder." + 'mask_subfolder': StringField( + optional=True, default='labels', description="Sub-directory for ground truth mask." ) }) return parameters - def configure(self): - data_dir = self.get_value_from_config('data_dir') - image_folder = self.get_value_from_config('images_dir') - mask_folder = self.get_value_from_config('mask_dir') - if data_dir: - image_folder = data_dir / image_folder - mask_folder = data_dir / mask_folder - self.images_dir = get_path(image_folder, is_directory=True) - self.mask_dir = get_path(mask_folder, is_directory=True) - def convert(self, *args, **kwargs): annotations = [] - for file_in_dir in self.images_dir.iterdir(): - annotation = SegmentationAnnotation(file_in_dir.name, file_in_dir.name, mask_loader=GTMaskLoader.PILLOW) + for file_in_dir in self.mask_dir.glob('*.png'): + identifier = file_in_dir.name.replace('.png', '.jpg') + annotation = SegmentationAnnotation(identifier, file_in_dir.name, GTMaskLoader.PILLOW_CONVERT_TO_RGB) annotations.append(annotation) - return ConverterReturn(annotations, {'label_map': self.label_map}, None) + return ConverterReturn(annotations, self.meta, None) diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/market1501.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/market1501.py index 2a50d4feb4e..f4ec3b78ad1 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/market1501.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/market1501.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/mars.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/mars.py index d6b0dcb978c..4146a7cfae5 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/mars.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/mars.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/mnist.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/mnist.py index 91bbd070f78..4bb5dc78d64 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/mnist.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/mnist.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/monocular_depth_perception.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/monocular_depth_perception.py index aae2906838d..ac137005f25 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/monocular_depth_perception.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/monocular_depth_perception.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/mpii.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/mpii.py index 4c6d03cf360..3897b18637b 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/mpii.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/mpii.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -44,27 +44,39 @@ class MPIIDatasetConverter(FileBasedAnnotationConverter): def parameters(cls): params = super().parameters() params.update({ - 'headboxes_file': PathField(), + 'headboxes_file': PathField(description='path to file with head box for each image'), + 'gt_pos_file': PathField(optional=True, description='ground truth keypoints file'), + 'joints_visibility_file': PathField(optional=True, description='joints visibility file') }) return params def configure(self): super().configure() self.headboxes_file = self.get_value_from_config('headboxes_file') + self.joints_vis = self.get_value_from_config('joints_visibility_file') + self.gt_pos_file = self.get_value_from_config('gt_pos_file') def convert(self, check_content=False, progress_callback=None, progress_interval=100, **kwargs): annotations = [] headboxes = np.load(str(self.headboxes_file)) + visibility = np.load(str(self.joints_vis)).T if self.joints_vis else [] + gt_pose = np.transpose(np.load(str(self.gt_pos_file)), (2, 0, 1)) if self.gt_pos_file else [] valid_annotations = [ann for ann in read_json(self.annotation_file) if ann['isValidation']] num_iterations = len(valid_annotations) content_errors = [] if check_content else None for idx, ann in enumerate(valid_annotations): identifier = ann['img_paths'] - points = np.array(ann['joint_self']) center = ann['objpos'] scale = float(ann['scale_provided']) - x_values, y_values, vis = points.T # pylint: disable=E0633 + points = np.array(ann['joint_self']) if not self.gt_pos_file else gt_pose[idx] + if points.shape[-1] == 3: + x_values, y_values, vis = points.T # pylint: disable=E0633 + if np.size(visibility): + vis = visibility[idx] + else: + x_values, y_values = points.T # pylint: disable=E0633 + vis = visibility[idx] if np.size(visibility) else np.ones_like(x_values) annotation = PoseEstimationAnnotation(identifier, x_values, y_values, visibility=vis) annotation.metadata['center'] = center annotation.metadata['scale'] = scale diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/mrlEyes_2018_01.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/mrlEyes_2018_01.py index cfd44b5694d..91e22c1b7e7 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/mrlEyes_2018_01.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/mrlEyes_2018_01.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -65,7 +65,7 @@ def convert(self, check_content=False, progress_callback=None, progress_interval annotations.append(ClassificationAnnotation(file, int(eye_state))) # convert label list to label map - label_map = {0:'closed', 1: 'open'} + label_map = {0: 'closed', 1: 'open'} metadata = {'label_map': label_map} return ConverterReturn(annotations, metadata, None) diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/ms_asl_continuous.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/ms_asl_continuous.py index 133c87d1d9f..d071eb89424 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/ms_asl_continuous.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/ms_asl_continuous.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/ms_coco.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/ms_coco.py index 709a0707b5e..9eb88dc00b0 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/ms_coco.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/ms_coco.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -193,6 +193,7 @@ def _read_image_annotation(image, annotations, label_id_to_label): class MSCocoKeypointsConverter(FileBasedAnnotationConverter): __provider__ = 'mscoco_keypoints' annotation_types = (PoseEstimationAnnotation, ) + @classmethod def parameters(cls): parameters = super().parameters() diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/ncf_converter.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/ncf_converter.py index e7f63176bba..6c518226b0e 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/ncf_converter.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/ncf_converter.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/nyu_depth.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/nyu_depth.py index 94ecaa8388a..41a68b2481b 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/nyu_depth.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/nyu_depth.py @@ -22,7 +22,7 @@ def parameters(cls): 'images_dir': PathField( optional=True, is_directory=True, description='path to directory with images', check_exists=False ), - 'depth_map_dir': PathField( + 'depth_map_dir': PathField( optional=True, is_directory=True, description='path to directory with depth maps', check_exists=False ), 'data_dir': PathField( diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/oar3d.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/oar3d.py index a79a43db659..47ebae684fa 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/oar3d.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/oar3d.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/pascal_voc.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/pascal_voc.py index 55c53171e28..3702772337d 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/pascal_voc.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/pascal_voc.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,6 @@ limitations under the License. """ -from ..topology_types import ObjectDetection from ..config import PathField, BoolField from ..representation import DetectionAnnotation, SegmentationAnnotation from ..representation.segmentation_representation import GTMaskLoader @@ -136,7 +135,6 @@ def convert(self, check_content=False, progress_callback=None, progress_interval class PascalVOCDetectionConverter(BaseFormatConverter): __provider__ = 'voc_detection' annotation_types = (DetectionAnnotation, ) - topology_types = (ObjectDetection, ) @classmethod def parameters(cls): diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/place_recognition.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/place_recognition.py index 3ca1807d8f5..60a8885f7a0 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/place_recognition.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/place_recognition.py @@ -1,5 +1,5 @@ """" -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/salient_object_detection.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/salient_object_detection.py new file mode 100644 index 00000000000..a4c5adea18f --- /dev/null +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/salient_object_detection.py @@ -0,0 +1,60 @@ +""" +Copyright (c) 2018-2021 Intel Corporation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +from .format_converter import BaseFormatConverter, ConverterReturn +from ..config import PathField +from ..representation import SalientRegionAnnotation +from ..utils import check_file_existence, read_txt + + +class SalientObjectDetectionConverter(BaseFormatConverter): + __provider__ = 'salient_object_detection' + + @classmethod + def parameters(cls): + params = super().parameters() + params.update({ + 'images_dir': PathField(is_directory=True, description='directory with images'), + 'masks_dir': PathField(is_directory=True, description='directory with salient region mask'), + 'annotation_file': PathField(optional=True, description='target image id list') + }) + return params + + def configure(self): + self.images_dir = self.get_value_from_config('images_dir') + self.masks_dir = self.get_value_from_config('masks_dir') + self.annotation_file = self.get_value_from_config('annotation_file') + + def convert(self, check_content=False, progress_callback=None, progress_interval=100, **kwargs): + content_errors = [] if check_content else None + annotations = [] + if self.annotation_file: + image_ids = ['{}.jpg'.format(im_id) for im_id in read_txt(self.annotation_file)] + else: + image_ids = [image.name for image in self.images_dir.glob('*.jpg')] + num_iterations = len(image_ids) + for idx, identifier in enumerate(image_ids): + map_identifier = identifier.replace('jpg', 'png') + if check_content: + if not check_file_existence(self.images_dir / identifier): + content_errors.append('{}: does not exist'.format(self.images_dir / identifier)) + if not check_file_existence(self.masks_dir / map_identifier): + content_errors.append('{}: does not exist'.format(self.masks_dir / map_identifier)) + if progress_callback is not None and idx % progress_interval == 0: + progress_callback(idx * 100 / num_iterations) + annotations.append(SalientRegionAnnotation(identifier, map_identifier)) + + return ConverterReturn(annotations, None, content_errors) diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/sample_converter.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/sample_converter.py index c0934eb0eee..cf19e42be04 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/sample_converter.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/sample_converter.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/see_in_the_dark.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/see_in_the_dark.py new file mode 100644 index 00000000000..30e5af4f2e4 --- /dev/null +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/see_in_the_dark.py @@ -0,0 +1,49 @@ +""" +Copyright (c) 2018-2021 Intel Corporation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" +from pathlib import Path +from .format_converter import FileBasedAnnotationConverter, ConverterReturn +from ..representation import ImageProcessingAnnotation +from ..representation.image_processing import GTLoader +from ..utils import read_txt, check_file_existence + + +class SeeInTheDarkDatasetConverter(FileBasedAnnotationConverter): + __provider__ = 'see_in_the_dark' + + def convert(self, check_content=False, progress_callback=None, progress_interval=100, **kwargs): + images_list = read_txt(self.annotation_file) + annotations = [] + content_errors = None if not check_content else [] + num_images = len(images_list) + for idx, line in enumerate(images_list): + input_image, gt_image = line.split(' ')[:2] + identifier = Path(input_image).name + gt_identifier = Path(gt_image).name + in_exposure = float(identifier[9:-5]) + gt_exposure = float(identifier[9:-5]) + ratio = min(gt_exposure / in_exposure, 300) + if check_content: + if not check_file_existence(self.annotation_file.parent / input_image): + content_errors.append('{}: does not exist'.format(self.annotation_file.parent / input_image)) + if not check_file_existence(self.annotation_file.parent / gt_image): + content_errors.append('{}: does not exist'.format(self.annotation_file.parent / gt_image)) + annotation = ImageProcessingAnnotation(identifier, gt_identifier, gt_loader=GTLoader.RAWPY) + annotation.metadata['ratio'] = ratio + annotations.append(annotation) + if progress_callback and idx % progress_interval: + progress_callback(idx * 100 / num_images) + + return ConverterReturn(annotations, None, content_errors) diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/sound_classification_converter.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/sound_classification_converter.py new file mode 100644 index 00000000000..618c3a07ee2 --- /dev/null +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/sound_classification_converter.py @@ -0,0 +1,59 @@ +""" +Copyright (c) 2018-2021 Intel Corporation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +from .format_converter import ConverterReturn, BaseFormatConverter +from ..config import PathField +from ..representation import ClassificationAnnotation +from ..utils import read_csv, get_path, check_file_existence + + +class SoundClassificationFormatConverter(BaseFormatConverter): + __provider__ = 'sound_classification' + + @classmethod + def parameters(cls): + parameters = super().parameters() + parameters.update({ + 'annotation_file': PathField(description="Path to annotation in cvs format."), + 'audio_dir': PathField( + is_directory=True, optional=True, + description='Path to dataset audio files, used only for content existence check' + ) + }) + + return parameters + + def configure(self): + self.annotation_file = self.get_value_from_config('annotation_file') + self.audio_dir = self.get_value_from_config('audio_dir') or self.annotation_file.parent + + def convert(self, check_content=False, progress_callback=None, progress_interval=100, **kwargs): + annotation = [] + content_errors = [] if check_content else None + original_annotation = read_csv(get_path(self.annotation_file), fieldnames=['identifier', 'label']) + num_iterations = len(original_annotation) + for audio_id, audio in enumerate(original_annotation): + identifier = audio['identifier'] + label = int(audio['label']) + if check_content: + if not check_file_existence(self.audio_dir / identifier): + content_errors.append('{}: does not exist'.format(self.audio_dir / identifier)) + + annotation.append(ClassificationAnnotation(identifier, label)) + if progress_callback is not None and audio_id % progress_interval == 0: + progress_callback(audio_id / num_iterations * 100) + + return ConverterReturn(annotation, None, content_errors) diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/squad.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/squad.py index 84758e2fecc..2c18c0634a9 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/squad.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/squad.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/squad_bidaf.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/squad_bidaf.py index 3756702e870..785e7300a02 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/squad_bidaf.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/squad_bidaf.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/squad_emb.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/squad_emb.py index 34e552797d8..963ef350794 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/squad_emb.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/squad_emb.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/style_transfer.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/style_transfer.py index de19c9d79f7..cbcd965cab3 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/style_transfer.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/style_transfer.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/super_resolution_converter.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/super_resolution_converter.py index 436b6791e3d..cce8aa8af00 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/super_resolution_converter.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/super_resolution_converter.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -110,7 +110,7 @@ def configure(self): try: self.lr_dir.relative_to(self.data_dir) self.upsampled_dir.relative_to(self.data_dir) - except: + except ValueError: raise ConfigError('data_dir parameter should be provided for conversion as common part of paths ' 'lr_dir and upsampled_dir, if 2 streams used') self.relative_dir = self.data_dir or os.path.commonpath([self.lr_dir, self.upsampled_dir]) @@ -418,12 +418,12 @@ def set_default_path(add_dir, param_name): if self.images_dir: try: self.lr_dir.relative_to(self.images_dir) - except: + except ValueError: raise ConfigError('lr_dir should be relative to images_dir') if self.two_streams: try: self.upsample_dir.relative_to(self.images_dir) - except: + except ValueError: raise ConfigError('upsample_dir should be relative to images_dir') else: self.images_dir = ( diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/text_classification.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/text_classification.py index 3de702011a2..618bf0fe8a6 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/text_classification.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/text_classification.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -171,7 +171,7 @@ def parameters(cls): description='comma-separated list of languages for selection only appropriate annotations.' 'If not provided full dataset used', optional=True - ) + ) }) return params @@ -277,7 +277,7 @@ class BertXNLITFRecordConverter(BertTextClassificationTFRecordConverter): def convert(self, check_content=False, progress_callback=None, progress_interval=100, **kwargs): annotations, _, errors = super().convert(check_content, progress_callback, progress_interval, **kwargs) - return ConverterReturn(annotations, {'label_map': dict(enumerate(labels['xnli']))}, errors) + return ConverterReturn(annotations, {'label_map': dict(enumerate(labels['xnli']))}, errors) class MRPCConverter(BaseGLUETextClassificationConverter): diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/unicode_character_recognition.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/unicode_character_recognition.py index ad5708a8e65..9667ec642a1 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/unicode_character_recognition.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/unicode_character_recognition.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/veri776.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/veri776.py index fc942fab220..cc195aacd85 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/veri776.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/veri776.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/vgg_face_regression.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/vgg_face_regression.py index f1f94a49419..3e0565dbb73 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/vgg_face_regression.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/vgg_face_regression.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/wflw.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/wflw.py new file mode 100644 index 00000000000..7c0fbd0e982 --- /dev/null +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/wflw.py @@ -0,0 +1,77 @@ +""" +Copyright (c) 2018-2021 Intel Corporation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +import numpy as np + +from ..config import PathField +from ..representation import FacialLandmarksAnnotation +from ..utils import read_txt, check_file_existence + +from .format_converter import BaseFormatConverter, ConverterReturn + + +class WFLWConverter(BaseFormatConverter): + __provider__ = 'wflw' + annotation_types = (FacialLandmarksAnnotation, ) + + @classmethod + def parameters(cls): + configuration_parameters = super().parameters() + configuration_parameters.update({ + 'annotation_file': PathField( + description="Path to txt file, which contains ground truth data in WFLW dataset format." + ), + 'images_dir': PathField( + is_directory=True, optional=True, + description="Path to dataset images, used only for content existence check." + ) + }) + + return configuration_parameters + + def configure(self): + self.annotation_file = self.get_value_from_config('annotation_file') + self.images_dir = self.get_value_from_config('images_dir') + self.landmarks_count = 98 + self.coordinates_count = 2 + + def convert(self, check_content=False, progress_callback=None, progress_interval=100, **kwargs): + image_annotations = read_txt(self.annotation_file) + content_errors = None if not check_content else [] + annotations = [] + num_iterations = len(image_annotations) + + for index, line in enumerate(image_annotations): + line = line.strip().split() + identifier = line[-1] + + landmarks = [float(val) for val in line[:self.landmarks_count * self.coordinates_count]] + x_values = np.array(landmarks[::2]) + y_values = np.array(landmarks[1::2]) + + annotation = FacialLandmarksAnnotation(identifier, x_values, y_values) + annotation.metadata['left_eye'] = [68, 72] + annotation.metadata['right_eye'] = [60, 64] + + annotations.append(annotation) + if check_content and self.images_dir: + if not check_file_existence(self.images_dir / identifier): + content_errors.append('{}: does not exist'.format(self.images_dir / identifier)) + + if progress_callback and index % progress_interval == 0: + progress_callback(index * 100 / num_iterations) + + return ConverterReturn(annotations, None, content_errors) diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/wider.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/wider.py index 941d29dd9f4..1e890c58ec6 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/wider.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/wider.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/wikitext2raw.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/wikitext2raw.py index 5bc18c99c27..de88b9bdc74 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/wikitext2raw.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/wikitext2raw.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/wmt.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/wmt.py index ff3afc45b98..1164b0783e1 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/wmt.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/wmt.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/config/__init__.py b/tools/accuracy_checker/accuracy_checker/config/__init__.py index e150d218cde..7e22978aff5 100644 --- a/tools/accuracy_checker/accuracy_checker/config/__init__.py +++ b/tools/accuracy_checker/accuracy_checker/config/__init__.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/config/config_reader.py b/tools/accuracy_checker/accuracy_checker/config/config_reader.py index 0b6053483ab..a59fc993f4a 100644 --- a/tools/accuracy_checker/accuracy_checker/config/config_reader.py +++ b/tools/accuracy_checker/accuracy_checker/config/config_reader.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ import warnings -from ..utils import read_yaml, to_lower_register, contains_any +from ..utils import read_yaml, to_lower_register, contains_any, is_iterable from .config_validator import ConfigError ENTRIES_PATHS = { @@ -68,6 +68,7 @@ 'mxnet_weights': 'models', 'onnx_model': 'models', 'kaldi_model': 'models', + 'saved_model_dir': 'models' } COMMAND_LINE_ARGS_AS_ENV_VARS = { @@ -86,7 +87,8 @@ 'mxnet_weights', 'onnx_model', 'kaldi_model', - 'model' + 'model', + 'saved_model_dir' ] @@ -681,13 +683,14 @@ def process_dataset(datasets_configs): if annotation_conversion_config: command_line_conversion = (create_command_line_mapping(annotation_conversion_config, 'source', ANNOTATION_CONVERSION_PATHS)) + datasets_config['_command_line_mapping'] = prepare_commandline_conversion_mapping( + command_line_conversion, args + ) merge_entry_paths(command_line_conversion, annotation_conversion_config, args) if 'preprocessing' in datasets_config: for preprocessor in datasets_config['preprocessing']: - command_line_preprocessing = ( - create_command_line_mapping(preprocessor, 'models', PREPROCESSING_PATHS) - ) - merge_entry_paths(command_line_preprocessing, preprocessor, args) + merge_entry_paths(create_command_line_mapping(preprocessor, 'models', PREPROCESSING_PATHS), + preprocessor, args) def process_launchers(launchers_configs): if not isinstance(launchers_configs, list): @@ -751,7 +754,7 @@ def process_launchers(launchers_configs): def merge_entry_paths(keys, value, args, value_id=0): for field, argument in keys.items(): - if field not in value: + if not is_iterable(value) or field not in value: continue config_path = Path(value[field]) @@ -859,3 +862,19 @@ def _add_subset_specific_arg(dataset_entry, arguments): if 'subsample_size' in arguments and arguments.subsample_size is not None: dataset_entry['subsample_size'] = arguments.subsample_size + + +def prepare_commandline_conversion_mapping(commandline_conversion, args): + mapping = {} + for key, value in commandline_conversion.items(): + if not isinstance(value, list): + mapping[key] = args.get(value) + else: + possible_paths = [] + for v in value: + if args.get(v) is None: + continue + possible_paths.append(args[v]) + mapping[key] = possible_paths + + return mapping diff --git a/tools/accuracy_checker/accuracy_checker/config/config_validator.py b/tools/accuracy_checker/accuracy_checker/config/config_validator.py index ca42f72d1c7..b81176f712d 100644 --- a/tools/accuracy_checker/accuracy_checker/config/config_validator.py +++ b/tools/accuracy_checker/accuracy_checker/config/config_validator.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -27,7 +27,11 @@ class ConfigError(ValueError): - pass + def __init__(self, message="", entry='', field_uri=''): + self.entry = entry + self.field_uri = field_uri + self.message = message + super().__init__(self.message) class BaseValidator: @@ -37,20 +41,32 @@ def __init__(self, on_error=None, additional_validator=None): self.field_uri = None - def validate(self, entry, field_uri=None): + def validate(self, entry, field_uri=None, fetch_only=False): field_uri = field_uri or self.field_uri + errors = [] if self.additional_validator and not self.additional_validator(entry, field_uri): - self.raise_error(entry, field_uri) + if not fetch_only: + self.raise_error(entry, field_uri) + else: + errors.append(self.build_error(entry, field_uri)) + return errors - def raise_error(self, value, field_uri, reason=None): + def raise_error(self, value, field_uri, reason=None, override_message=False): if self.on_error: self.on_error(value, field_uri, reason) + error = self.build_error(value, field_uri, reason, override_message) + raise error + @staticmethod + def build_error(value, field_uri, reason=None, override_message=False): error_message = 'Invalid value "{value}" for {field_uri}'.format(value=value, field_uri=field_uri) if reason: - error_message = '{error_message}: {reason}'.format(error_message=error_message, reason=reason) + if not override_message: + error_message = '{error_message}: {reason}'.format(error_message=error_message, reason=reason) + else: + error_message = reason - raise ConfigError(error_message.format(value, field_uri)) + return ConfigError(error_message, value, field_uri) class _ExtraArgumentBehaviour(enum.Enum): @@ -67,7 +83,7 @@ class ConfigValidator(BaseValidator): WARN_ON_EXTRA_ARGUMENT = _ExtraArgumentBehaviour.WARN ERROR_ON_EXTRA_ARGUMENT = _ExtraArgumentBehaviour.ERROR IGNORE_ON_EXTRA_ARGUMENT = _ExtraArgumentBehaviour.IGNORE - acceptable_unknown_options = ['connector'] + acceptable_unknown_options = ['connector', '_command_line_mapping'] def __init__(self, config_uri, on_extra_argument=WARN_ON_EXTRA_ARGUMENT, fields=None, **kwargs): super().__init__(**kwargs) @@ -91,51 +107,60 @@ def __init__(self, config_uri, on_extra_argument=WARN_ON_EXTRA_ARGUMENT, fields= field_copy.field_uri = "{}.{}".format(config_uri, name) self.fields[name] = field_copy - def validate(self, entry, field_uri=None): - super().validate(entry, field_uri) + def validate(self, entry, field_uri=None, fetch_only=False): + error_stack = super().validate(entry, field_uri, fetch_only=fetch_only) field_uri = field_uri or self.field_uri if not _is_dict_like(entry): - raise ConfigError("{} is expected to be dict-like".format(field_uri)) + error = ConfigError("{} is expected to be dict-like".format(field_uri)) + if not fetch_only: + raise error + error_stack.append(error) extra_arguments = [] for key in entry: - if key not in self.fields and key not in self.acceptable_unknown_options: - extra_arguments.append(key) - continue - if key in self.acceptable_unknown_options: continue + if key not in self.fields: + extra_arguments.append(key) + continue - self.fields[key].validate(entry[key]) + error_stack.extend(self.fields[key].validate(entry[key], fetch_only=fetch_only)) required_fields = set(name for name, value in self.fields.items() if value.required()) missing_arguments = required_fields.difference(entry) if missing_arguments: arguments = ', '.join(map(str, missing_arguments)) - self.raise_error( - entry, field_uri, "Invalid config for {}: missing required fields: {}".format(field_uri, arguments) - ) + missing_error = "Invalid config for {}: missing required fields: {}".format(field_uri, arguments) + if not fetch_only: + self.raise_error( + entry, field_uri, missing_error, override_message=True + ) + else: + error_stack.append(self.build_error(entry, field_uri, missing_error, override_message=True)) if extra_arguments: - unknown_options_error = "specifies unknown options: {}".format(extra_arguments) - message = "{} {}".format(field_uri, unknown_options_error) + error_stack.extend(self._extra_args_error_handle(entry, field_uri, extra_arguments, fetch_only)) + + return error_stack - if self.on_extra_argument == _ExtraArgumentBehaviour.WARN: - warnings.warn(message) - if self.on_extra_argument == _ExtraArgumentBehaviour.ERROR: + def _extra_args_error_handle(self, entry, field_uri, extra_arguments, fetch_only=False): + unknown_options_error = "specifies unknown options: {}".format(extra_arguments) + message = "{} {}".format(field_uri, unknown_options_error) + + if self.on_extra_argument == _ExtraArgumentBehaviour.WARN: + warnings.warn(message) + if self.on_extra_argument == _ExtraArgumentBehaviour.ERROR: + if not fetch_only: self.raise_error(entry, field_uri, message) + else: + return [self.build_error(entry, field_uri, message, override_message=True)] + return [] @property def known_fields(self): return set(self.fields) - def raise_error(self, value, field_uri, reason=None): - if self.on_error: - self.on_error(value, field_uri, reason) - else: - raise ConfigError(reason) - class BaseField(BaseValidator): def __init__(self, optional=False, description=None, default=None, **kwargs): @@ -144,11 +169,16 @@ def __init__(self, optional=False, description=None, default=None, **kwargs): self.description = description self.default = default - def validate(self, entry, field_uri=None): - super().validate(entry, field_uri) + def validate(self, entry, field_uri=None, fetch_only=False): + error_stack = super().validate(entry, field_uri, fetch_only) field_uri = field_uri or self.field_uri + empty_error = "{} is not allowed to be None" if self.required() and entry is None: - raise ConfigError("{} is not allowed to be None".format(field_uri)) + if not fetch_only: + self.raise_error(entry, field_uri, empty_error.format(field_uri)) + else: + error_stack.append(self.build_error(entry, field_uri, empty_error.format(field_uri))) + return error_stack @property def type(self): @@ -183,26 +213,40 @@ def set_regex(self, regex): self._regex = regex self._regex = re.compile(regex, flags=re.IGNORECASE if not self.case_sensitive else 0) if regex else None - def validate(self, entry, field_uri=None): - super().validate(entry, field_uri) + def validate(self, entry, field_uri=None, fetch_only=False): + error_stack = super().validate(entry, field_uri) if entry is None: - return + return error_stack field_uri = field_uri or self.field_uri source_entry = entry if not isinstance(entry, str): - raise ConfigError("{} is expected to be str".format(source_entry)) + type_error = "{} is expected to be str" + if not fetch_only: + self.raise_error(entry, field_uri, type_error.format(source_entry)) + else: + error_stack.append(self.build_error(entry, field_uri, type_error.format(source_entry))) + return error_stack if not self.case_sensitive: entry = entry.lower() if self.choices and entry not in self.choices and not self.allow_own_choice: reason = "unsupported option, expected one of: {}".format(', '.join(map(str, self.choices))) - self.raise_error(source_entry, field_uri, reason) + if not fetch_only: + self.raise_error(source_entry, field_uri, reason) + else: + error_stack.append(self.build_error(source_entry, field_uri, reason)) if self._regex and not self._regex.match(entry): - self.raise_error(source_entry, field_uri, reason=None) + regex_reason = 'value does not matched by regex' + if not fetch_only: + self.raise_error(source_entry, field_uri, reason=regex_reason) + else: + error_stack.append(self.build_error(source_entry, field_uri, regex_reason)) + + return error_stack @property def type(self): @@ -220,27 +264,38 @@ def __init__(self, key_type=None, value_type=None, validate_keys=True, validate_ self.allow_empty = allow_empty - def validate(self, entry, field_uri=None): - super().validate(entry, field_uri) + def validate(self, entry, field_uri=None, fetch_only=False): + error_stack = super().validate(entry, field_uri, fetch_only) if entry is None: - return + return error_stack field_uri = field_uri or self.field_uri if not isinstance(entry, dict): - raise ConfigError("{} is expected to be dict".format(field_uri)) + msg = "{} is expected to be dict".format(field_uri) + if not fetch_only: + self.raise_error(entry, field_uri, msg) + else: + error_stack.append(self.build_error(entry, field_uri, msg)) + return error_stack if not entry and not self.allow_empty: - self.raise_error(entry, field_uri, "value is empty") + empty_msg = "value is empty" + if not fetch_only: + self.raise_error(entry, field_uri, empty_msg) + else: + error_stack.append(self.build_error(entry, field_uri, empty_msg)) + return error_stack for k, v in entry.items(): if self.validate_keys: uri = "{}.keys.{}".format(field_uri, k) - self.key_type.validate(k, uri) + error_stack.extend(self.key_type.validate(k, uri, fetch_only)) if self.validate_values: uri = "{}.{}".format(field_uri, k) - self.value_type.validate(v, uri) + error_stack.extend(self.value_type.validate(v, uri, fetch_only)) + return error_stack @property def type(self): @@ -254,20 +309,30 @@ def __init__(self, value_type=None, validate_values=True, allow_empty=True, **kw self.value_type = _get_field_type(value_type) self.allow_empty = allow_empty - def validate(self, entry, field_uri=None): - super().validate(entry, field_uri) + def validate(self, entry, field_uri=None, fetch_only=False): + error_stack = super().validate(entry, field_uri, fetch_only) if entry is None: - return + return error_stack if not isinstance(entry, list): - raise ConfigError("{} is expected to be list".format(field_uri)) + msg = "{} is expected to be list".format(field_uri) + if not fetch_only: + self.raise_error(entry, field_uri, msg) + else: + error_stack.append(self.build_error(entry, field_uri, msg)) + return error_stack if not entry and not self.allow_empty: - self.raise_error(entry, field_uri, "value is empty") + if not fetch_only: + self.raise_error(entry, field_uri, "value is empty") + else: + error_stack.append(self.build_error(entry, field_uri, "value is empty")) + return error_stack if self.validate_values: for i, val in enumerate(entry): - self.value_type.validate(val, "{}[{}]".format(val, i)) + error_stack.extend(self.value_type.validate(val, "{}[{}]".format(val, i), fetch_only)) + return error_stack @property def type(self): @@ -275,7 +340,7 @@ def type(self): class InputField(BaseField): - INPUTS_TYPES = ('CONST_INPUT', 'INPUT', 'IMAGE_INFO', 'ORIG_IMAGE_INFO', 'LSTM_INPUT') + INPUTS_TYPES = ('CONST_INPUT', 'INPUT', 'IMAGE_INFO', 'ORIG_IMAGE_INFO', 'LSTM_INPUT', 'IGNORE_INPUT') LAYOUT_TYPES = ('NCHW', 'NHWC', 'NCWH', 'NWHC') PRECISIONS = ('FP32', 'FP16', 'U8', 'U16', 'I8', 'I16', 'I32', 'I64') @@ -289,24 +354,28 @@ def __init__(self, **kwargs): self.shape = BaseField(optional=True, description="Input shape.") self.precision = StringField(optional=True, description='Input precision', choices=InputField.PRECISIONS) - def validate(self, entry, field_uri=None): + def validate(self, entry, field_uri=None, fetch_only=False): entry['optional'] = entry['type'] not in ['CONST_INPUT', 'LSTM_INPUT'] - super().validate(entry, field_uri) + return super().validate(entry, field_uri) class ListInputsField(ListField): def __init__(self, **kwargs): super().__init__(allow_empty=False, value_type=InputField(description="Input type."), **kwargs) - def validate(self, entry, field_uri=None): - super().validate(entry, field_uri) + def validate(self, entry, field_uri=None, fetch_only=False): + error_stack = super().validate(entry, field_uri, fetch_only) names_set = set() for input_layer in entry: input_name = input_layer['name'] if input_name not in names_set: names_set.add(input_name) else: - self.raise_error(entry, field_uri, '{} repeated name'.format(input_name)) + if not fetch_only: + self.raise_error(entry, field_uri, '{} repeated name'.format(input_name)) + else: + error_stack.append(self.build_error(entry, field_uri, '{} repeated name'.format(input_name))) + return error_stack class NumberField(BaseField): @@ -318,28 +387,60 @@ def __init__(self, value_type=float, min_value=None, max_value=None, allow_inf=F self._allow_inf = allow_inf self._allow_nan = allow_nan - def validate(self, entry, field_uri=None): - super().validate(entry, field_uri) + def validate(self, entry, field_uri=None, fetch_only=False): + error_stack = super().validate(entry, field_uri) if entry is None: - return + return error_stack field_uri = field_uri or self.field_uri if self.type != float and isinstance(entry, float): - raise ConfigError("{} is expected to be int".format(field_uri)) + if fetch_only: + error_stack.append(self.build_error(entry, field_uri, "{} is expected to be int".format(field_uri))) + return error_stack + self.raise_error(entry, field_uri, "{} is expected to be int".format(field_uri)) + if not isinstance(entry, int) and not isinstance(entry, float): - raise ConfigError("{} is expected to be number".format(field_uri)) + if fetch_only: + error_stack.append(self.build_error(entry, field_uri, "{} is expected to be number".format(field_uri))) + return error_stack + self.raise_error(entry, field_uri, "{} is expected to be number".format(field_uri)) + error_stack.extend(self.range_check(entry, field_uri, fetch_only)) + error_stack.extend(self.finite_check(entry, field_uri, fetch_only)) + + return error_stack + + def range_check(self, entry, field_uri, fetch_only): + error_stack = [] if self.min is not None and entry < self.min: reason = "value is less than minimal allowed - {}".format(self.min) - self.raise_error(entry, field_uri, reason) + if not fetch_only: + self.raise_error(entry, field_uri, reason) + else: + error_stack.append(self.build_error(entry, field_uri, reason)) if self.max is not None and entry > self.max: reason = "value is greater than maximal allowed - {}".format(self.max) - self.raise_error(entry, field_uri, reason) + if not fetch_only: + self.raise_error(entry, field_uri, reason) + else: + error_stack.append(self.build_error(entry, fetch_only, reason)) + return error_stack + def finite_check(self, entry, field_uri, fetch_only): + error_stack = [] if math.isinf(entry) and not self._allow_inf: - self.raise_error(entry, field_uri, "value is infinity") + reason = "value is infinity" + if not fetch_only: + self.raise_error(entry, field_uri, reason) + else: + error_stack.append(self.build_error(entry, field_uri, reason)) if math.isnan(entry) and not self._allow_nan: - self.raise_error(entry, field_uri, "value is NaN") + reason = "value is NaN" + if not fetch_only: + self.raise_error(entry, field_uri, reason) + else: + error_stack.append(self.build_error(entry, field_uri, reason)) + return error_stack @property def type(self): @@ -353,22 +454,36 @@ def __init__(self, is_directory=False, check_exists=True, file_or_directory=Fals self.check_exists = check_exists self.file_or_directory = file_or_directory - def validate(self, entry, field_uri=None): - super().validate(entry, field_uri) + def validate(self, entry, field_uri=None, fetch_only=False): + error_stack = super().validate(entry, field_uri, fetch_only) if entry is None: - return + return error_stack field_uri = field_uri or self.field_uri try: get_path(entry, self.is_directory, self.check_exists, self.file_or_directory) except TypeError: - self.raise_error(entry, field_uri, "values is expected to be path-like") + reason = "values is expected to be path-like" + if not fetch_only: + self.raise_error(entry, field_uri, reason) + error_stack.append(self.build_error(entry, field_uri, reason)) except FileNotFoundError: - self.raise_error(entry, field_uri, "path does not exist") + reason = "path does not exist" + if not fetch_only: + self.raise_error(entry, field_uri, reason) + error_stack.append(self.build_error(entry, field_uri, reason)) except NotADirectoryError: - self.raise_error(entry, field_uri, "path is not a directory") + reason = "path is not a directory" + if not fetch_only: + self.raise_error(entry, field_uri, reason) + error_stack.append(self.build_error(entry, field_uri, reason)) except IsADirectoryError: - self.raise_error(entry, field_uri, "path is a directory, regular file expected") + reason = "path is a directory, regular file expected" + if not fetch_only: + self.raise_error(entry, field_uri, reason) + error_stack.append(self.build_error(entry, field_uri, reason)) + + return error_stack @property def type(self): @@ -379,14 +494,19 @@ class BoolField(BaseField): def __init__(self, **kwargs): super().__init__(**kwargs) - def validate(self, entry, field_uri=None): - super().validate(entry, field_uri) + def validate(self, entry, field_uri=None, fetch_only=False): + error_stack = super().validate(entry, field_uri, fetch_only) if entry is None: - return + return error_stack field_uri = field_uri or self.field_uri if not isinstance(entry, bool): - raise ConfigError("{} is expected to be bool".format(field_uri)) + reason = "{} is expected to be bool".format(field_uri) + if not fetch_only: + self.raise_error(entry, field_uri, reason) + else: + error_stack.append(self.build_error(entry, field_uri, reason)) + return error_stack @property def type(self): diff --git a/tools/accuracy_checker/accuracy_checker/data_analyzer/__init__.py b/tools/accuracy_checker/accuracy_checker/data_analyzer/__init__.py index f5061b15b19..4df57de71cd 100644 --- a/tools/accuracy_checker/accuracy_checker/data_analyzer/__init__.py +++ b/tools/accuracy_checker/accuracy_checker/data_analyzer/__init__.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -35,4 +35,4 @@ 'SegmentationDataAnalyzer', 'ReIdentificationDataAnalyzer', 'ReIdentificationClassificationDataAnalyzer' - ] +] diff --git a/tools/accuracy_checker/accuracy_checker/data_analyzer/base_data_analyzer.py b/tools/accuracy_checker/accuracy_checker/data_analyzer/base_data_analyzer.py index 71c4d4c75f2..a4cccac6465 100644 --- a/tools/accuracy_checker/accuracy_checker/data_analyzer/base_data_analyzer.py +++ b/tools/accuracy_checker/accuracy_checker/data_analyzer/base_data_analyzer.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/data_analyzer/classification_analyzer.py b/tools/accuracy_checker/accuracy_checker/data_analyzer/classification_analyzer.py index 3dd07f13c33..e95439f989e 100644 --- a/tools/accuracy_checker/accuracy_checker/data_analyzer/classification_analyzer.py +++ b/tools/accuracy_checker/accuracy_checker/data_analyzer/classification_analyzer.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/data_analyzer/coco_instance_segmentation_analyzer.py b/tools/accuracy_checker/accuracy_checker/data_analyzer/coco_instance_segmentation_analyzer.py index d18184b54b7..c85cbeb0879 100644 --- a/tools/accuracy_checker/accuracy_checker/data_analyzer/coco_instance_segmentation_analyzer.py +++ b/tools/accuracy_checker/accuracy_checker/data_analyzer/coco_instance_segmentation_analyzer.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/data_analyzer/container_analyzer.py b/tools/accuracy_checker/accuracy_checker/data_analyzer/container_analyzer.py index 2217888733d..3ff44720e90 100644 --- a/tools/accuracy_checker/accuracy_checker/data_analyzer/container_analyzer.py +++ b/tools/accuracy_checker/accuracy_checker/data_analyzer/container_analyzer.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/data_analyzer/detection_analyzer.py b/tools/accuracy_checker/accuracy_checker/data_analyzer/detection_analyzer.py index 088e9f8ed0d..f12f9498ef2 100644 --- a/tools/accuracy_checker/accuracy_checker/data_analyzer/detection_analyzer.py +++ b/tools/accuracy_checker/accuracy_checker/data_analyzer/detection_analyzer.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/data_analyzer/multi_label_recognition_analyzer.py b/tools/accuracy_checker/accuracy_checker/data_analyzer/multi_label_recognition_analyzer.py index 8a57ce1a9e3..cf4b22208ae 100644 --- a/tools/accuracy_checker/accuracy_checker/data_analyzer/multi_label_recognition_analyzer.py +++ b/tools/accuracy_checker/accuracy_checker/data_analyzer/multi_label_recognition_analyzer.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/data_analyzer/regression_analyzer.py b/tools/accuracy_checker/accuracy_checker/data_analyzer/regression_analyzer.py index 31321db092d..76c1087de19 100644 --- a/tools/accuracy_checker/accuracy_checker/data_analyzer/regression_analyzer.py +++ b/tools/accuracy_checker/accuracy_checker/data_analyzer/regression_analyzer.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/data_analyzer/reidentification_analyzer.py b/tools/accuracy_checker/accuracy_checker/data_analyzer/reidentification_analyzer.py index a0047d0338f..1ae79c7fc83 100644 --- a/tools/accuracy_checker/accuracy_checker/data_analyzer/reidentification_analyzer.py +++ b/tools/accuracy_checker/accuracy_checker/data_analyzer/reidentification_analyzer.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/data_analyzer/segmentation_analyzer.py b/tools/accuracy_checker/accuracy_checker/data_analyzer/segmentation_analyzer.py index 77b480fba02..6eeeb41e360 100644 --- a/tools/accuracy_checker/accuracy_checker/data_analyzer/segmentation_analyzer.py +++ b/tools/accuracy_checker/accuracy_checker/data_analyzer/segmentation_analyzer.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/data_readers/README.md b/tools/accuracy_checker/accuracy_checker/data_readers/README.md index b177659262f..a10db5f5b63 100644 --- a/tools/accuracy_checker/accuracy_checker/data_readers/README.md +++ b/tools/accuracy_checker/accuracy_checker/data_readers/README.md @@ -35,6 +35,7 @@ AccuracyChecker supports following list of data readers: ``` Note: since 1.3.0 version the image processing module is not a part of scipy library. This reader does not use scipy anymore. ``` +* `skimage_imread` - read images using scikit-mage library. Default color space is RGB. * `tf_imread`- read images using TensorFlow. Default color space is RGB. Requires TensorFlow installation. * `opencv_capture` - read frames from video using OpenCV. * `json_reader` - read value from json file. @@ -55,3 +56,5 @@ Note: since 1.3.0 version the image processing module is not a part of scipy lib * `pickle_reader` - read data stored in pickle file. Supported formats of pickle content: 1. numeric data array 2. numeric data array + metadata stored in dictionary +* `rawpy` - read raw image formats using rawpy library. + * `postprocess` - allow image postprocessing and normalization (Optional, default `True`). diff --git a/tools/accuracy_checker/accuracy_checker/data_readers/__init__.py b/tools/accuracy_checker/accuracy_checker/data_readers/__init__.py index 6401a37e5ac..441dfd22f42 100644 --- a/tools/accuracy_checker/accuracy_checker/data_readers/__init__.py +++ b/tools/accuracy_checker/accuracy_checker/data_readers/__init__.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ BaseReader, DataReaderField, ReaderCombiner, - JSONReaderConfig, OpenCVFrameReader, OpenCVImageReader, PillowImageReader, @@ -27,15 +26,20 @@ NumPyReader, NumpyTXTReader, NumpyDictReader, + NumpyBinReader, TensorflowImageReader, AnnotationFeaturesReader, WavReader, DicomReader, PickleReader, + SkimageReader, + RawpyReader, DataRepresentation, ClipIdentifier, MultiFramesInputIdentifier, + ImagePairIdentifier, + create_reader, REQUIRES_ANNOTATIONS ) @@ -45,7 +49,6 @@ 'DataReaderField', 'DataRepresentation', 'ReaderCombiner', - 'JSONReaderConfig', 'OpenCVFrameReader', 'OpenCVImageReader', 'PillowImageReader', @@ -59,10 +62,14 @@ 'NumPyReader', 'NumpyTXTReader', 'NumpyDictReader', + 'NumpyBinReader', + 'SkimageReader', + 'RawpyReader', 'DataRepresentation', 'ClipIdentifier', 'MultiFramesInputIdentifier', + 'ImagePairIdentifier', 'create_reader', - 'REQUIRES_ANNOTATIONS' + 'REQUIRES_ANNOTATIONS', ] diff --git a/tools/accuracy_checker/accuracy_checker/data_readers/data_reader.py b/tools/accuracy_checker/accuracy_checker/data_readers/data_reader.py index ca4f5d9f9d2..1d885df5d8b 100644 --- a/tools/accuracy_checker/accuracy_checker/data_readers/data_reader.py +++ b/tools/accuracy_checker/accuracy_checker/data_readers/data_reader.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -25,9 +25,11 @@ import numpy as np from numpy.lib.npyio import NpzFile -from ..utils import get_path, read_json, read_pickle, contains_all, UnsupportedPackage -from ..dependency import ClassProvider -from ..config import BaseField, StringField, ConfigValidator, ConfigError, DictField, ListField, BoolField, NumberField +from ..utils import get_path, read_json, read_pickle, contains_all, UnsupportedPackage, get_parameter_value_from_config +from ..dependency import ClassProvider, UnregisteredProviderException +from ..config import ( + BaseField, StringField, ConfigValidator, ConfigError, DictField, ListField, BoolField, NumberField, PathField +) try: import nibabel as nib @@ -39,7 +41,19 @@ except ImportError as import_error: pydicom = UnsupportedPackage("pydicom", import_error.msg) +try: + import skimage.io as sk +except ImportError as import_error: + sk = UnsupportedPackage('skimage.io', import_error.msg) + +try: + import rawpy +except ImportError as import_error: + rawpy = UnsupportedPackage('rawpy', import_error.msg) + REQUIRES_ANNOTATIONS = ['annotation_features_extractor', ] +DOES_NOT_REQUIRED_DATA_SOURCE = REQUIRES_ANNOTATIONS + ['ncf_reader'] +DATA_SOURCE_IS_FILE = ['opencv_capture'] class DataRepresentation: @@ -59,6 +73,7 @@ def __init__(self, data, meta=None, identifier=''): ClipIdentifier = namedtuple('ClipIdentifier', ['video', 'clip_id', 'frames']) MultiFramesInputIdentifier = namedtuple('MultiFramesInputIdentifier', ['input_id', 'frames']) +ImagePairIdentifier = namedtuple('ImagePairIdentifier', ['first', 'second']) def create_reader(config): @@ -66,15 +81,15 @@ def create_reader(config): class DataReaderField(BaseField): - def validate(self, entry_, field_uri=None): - super().validate(entry_, field_uri) + def validate(self, entry_, field_uri=None, fetch_only=False): + errors = super().validate(entry_, field_uri) if entry_ is None: - return + return errors field_uri = field_uri or self.field_uri if isinstance(entry_, str): - StringField(choices=BaseReader.providers).validate(entry_, 'reader') + errors.extend(StringField(choices=BaseReader.providers).validate(entry_, field_uri, fetch_only=fetch_only)) elif isinstance(entry_, dict): class DictReaderValidator(ConfigValidator): type = StringField(choices=BaseReader.providers) @@ -82,9 +97,14 @@ class DictReaderValidator(ConfigValidator): dict_reader_validator = DictReaderValidator( 'reader', on_extra_argument=DictReaderValidator.IGNORE_ON_EXTRA_ARGUMENT ) - dict_reader_validator.validate(entry_) + errors.extend(dict_reader_validator.validate(entry_, field_uri, fetch_only=fetch_only)) else: - self.raise_error(entry_, field_uri, 'reader must be either string or dictionary') + msg = 'reader must be either string or dictionary' + if not fetch_only: + self.raise_error(entry_, field_uri, msg) + errors.append(self.build_error(entry_, field_uri, msg)) + + return errors class BaseReader(ClassProvider): @@ -97,23 +117,70 @@ def __init__(self, data_source, config=None, **kwargs): self.read_dispatcher.register(list, self._read_list) self.read_dispatcher.register(ClipIdentifier, self._read_clip) self.read_dispatcher.register(MultiFramesInputIdentifier, self._read_frames_multi_input) + self.read_dispatcher.register(ImagePairIdentifier, self._read_pair) self.multi_infer = False - self.validate_config() + self.validate_config(config, data_source) self.configure() def __call__(self, identifier): return self.read_item(identifier) + @classmethod + def parameters(cls): + return { + 'type': StringField( + default=cls.__provider__ if hasattr(cls, '__provider__') else None, description='Reader type.' + ), + 'multi_infer': BoolField( + default=False, optional=True, description='Allows multi infer.' + ), + } + + def get_value_from_config(self, key): + return get_parameter_value_from_config(self.config, self.parameters(), key) + def configure(self): if not self.data_source: raise ConfigError('data_source parameter is required to create "{}" ' 'data reader and read data'.format(self.__provider__)) self.data_source = get_path(self.data_source, is_directory=True) - self.multi_infer = self.config.get('multi_infer', False) - - def validate_config(self): - pass + self.multi_infer = self.get_value_from_config('multi_infer') + + @classmethod + def validate_config(cls, config, data_source=None, fetch_only=False, **kwargs): + uri_prefix = kwargs.pop('uri_prefix', '') + reader_uri = uri_prefix or 'reader' + if cls.__name__ == BaseReader.__name__: + errors = [] + reader_type = config if isinstance(config, str) else config.get('type') + if not reader_type: + error = ConfigError('type is not provided', config, reader_uri) + if not fetch_only: + raise error + errors.append(error) + return errors + try: + reader_cls = cls.resolve(reader_type) + reader_config = config if isinstance(config, dict) else {'type': reader_type} + if reader_type not in DOES_NOT_REQUIRED_DATA_SOURCE: + data_source_field = PathField(is_directory=reader_type not in DATA_SOURCE_IS_FILE) + errors.extend( + data_source_field.validate( + data_source, '{}.data_source'.format(reader_uri), fetch_only=fetch_only) + ) + errors.extend( + reader_cls.validate_config(reader_config, fetch_only=fetch_only, **kwargs, uri_prefix=uri_prefix)) + return errors + except UnregisteredProviderException as exception: + if not fetch_only: + raise exception + return errors + if 'on_extra_argument' not in kwargs: + kwargs['on_extra_argument'] = ConfigValidator.IGNORE_ON_EXTRA_ARGUMENT + return ConfigValidator(reader_uri, fields=cls.parameters(), **kwargs).validate( + config or {}, fetch_only=fetch_only + ) def read(self, data_id): raise NotImplementedError @@ -135,6 +202,10 @@ def read_item(self, data_id): data_rep.metadata['multi_infer'] = True return data_rep + def _read_pair(self, data_id): + data = self.read_dispatcher([data_id.first, data_id.second]) + return data + @property def name(self): return self.__provider__ @@ -143,22 +214,20 @@ def reset(self): pass -class ReaderCombinerConfig(ConfigValidator): - type = StringField() - scheme = DictField( - value_type=DataReaderField(), key_type=StringField(), allow_empty=False - ) - - class ReaderCombiner(BaseReader): __provider__ = 'combine_reader' - def validate_config(self): - config_validator = ReaderCombinerConfig('reader_combiner_config') - config_validator.validate(self.config) + @classmethod + def parameters(cls): + parameters = super().parameters() + parameters.update({ + 'scheme': DictField(value_type=DataReaderField(), key_type=StringField(), allow_empty=False, + description='Dictionary for describing reading scheme which depends on file names.') + }) + return parameters def configure(self): - scheme = self.config['scheme'] + scheme = self.get_value_from_config('scheme') reading_scheme = OrderedDict() for pattern, reader_config in scheme.items(): reader_type = reader_config['type'] if isinstance(reader_config, dict) else reader_config @@ -168,7 +237,7 @@ def configure(self): reading_scheme[pattern] = reader self.reading_scheme = reading_scheme - self.multi_infer = self.config.get('multi_infer', False) + self.multi_infer = self.get_value_from_config('multi_infer') def read(self, data_id): for pattern, reader in self.reading_scheme.items(): @@ -185,24 +254,21 @@ def read(self, data_id): } -class OpenCVImageReaderConfig(ConfigValidator): - type = StringField(optional=True) - reading_flag = StringField(optional=True, choices=OPENCV_IMREAD_FLAGS, default='color') - - class OpenCVImageReader(BaseReader): __provider__ = 'opencv_imread' - def validate_config(self): - if self.config: - config_validator = OpenCVImageReaderConfig( - 'opencv_imread_config', on_extra_argument=ConfigValidator.IGNORE_ON_EXTRA_ARGUMENT - ) - config_validator.validate(self.config) + @classmethod + def parameters(cls): + parameters = super().parameters() + parameters.update({ + 'reading_flag': StringField(optional=True, choices=OPENCV_IMREAD_FLAGS, default='color', + description='Flag which specifies the way image should be read.') + }) + return parameters def configure(self): super().configure() - self.flag = OPENCV_IMREAD_FLAGS[self.config.get('reading_flag', 'color') if self.config else 'color'] + self.flag = OPENCV_IMREAD_FLAGS[self.get_value_from_config('reading_flag')] def read(self, data_id): return cv2.imread(str(get_path(self.data_source / data_id)), self.flag) @@ -266,28 +332,28 @@ def configure(self): 'data reader and read data'.format(self.__provider__)) self.data_source = get_path(self.data_source) self.videocap = cv2.VideoCapture(str(self.data_source)) - self.multi_infer = self.config.get('multi_infer', False) + self.multi_infer = self.get_value_from_config('multi_infer') def reset(self): self.current = -1 self.videocap.set(cv2.CAP_PROP_POS_FRAMES, 0) -class JSONReaderConfig(ConfigValidator): - type = StringField() - key = StringField(optional=True, case_sensitive=True) - - class JSONReader(BaseReader): __provider__ = 'json_reader' - def validate_config(self): - config_validator = JSONReaderConfig('json_reader_config') - config_validator.validate(self.config) + @classmethod + def parameters(cls): + parameters = super().parameters() + parameters.update({ + 'key': StringField(optional=True, case_sensitive=True, + description='Key for reading from json dictionary.') + }) + return parameters def configure(self): - self.key = self.config.get('key') - self.multi_infer = self.config.get('multi_infer', False) + self.key = self.get_value_from_config('key') + self.multi_infer = self.get_value_from_config('multi_infer') if not self.data_source: raise ConfigError('data_source parameter is required to create "{}" ' 'data reader and read data'.format(self.__provider__)) @@ -316,24 +382,23 @@ def read(self, data_id): return float(data_id.split(":")[1]) -class NiftyReaderConfig(ConfigValidator): - type = StringField(optional=True) - channels_first = BoolField(optional=True, default=False) - - class NiftiImageReader(BaseReader): __provider__ = 'nifti_reader' - def validate_config(self): - if self.config: - config_validator = NiftyReaderConfig('nifti_reader_config') - config_validator.validate(self.config) + @classmethod + def parameters(cls): + parameters = super().parameters() + parameters.update({ + 'channels_first': BoolField(optional=True, default=False, + description='Allows read files and transpose in order where channels first.') + }) + return parameters def configure(self): if isinstance(nib, UnsupportedPackage): nib.raise_error(self.__provider__) - self.channels_first = self.config.get('channels_first', False) if self.config else False - self.multi_infer = self.config.get('multi_infer', False) + self.channels_first = self.get_value_from_config('channels_first') + self.multi_infer = self.get_value_from_config('multi_infer') if not self.data_source: raise ConfigError('data_source parameter is required to create "{}" ' 'data reader and read data'.format(self.__provider__)) @@ -348,36 +413,37 @@ def read(self, data_id): return image -class NumpyReaderConfig(ConfigValidator): - type = StringField(optional=True) - keys = StringField(optional=True, default="") - separator = StringField(optional=True, default="@") - id_sep = StringField(optional=True, default="_") - block = BoolField(optional=True, default=False) - batch = NumberField(optional=True, default=1) - - class NumPyReader(BaseReader): __provider__ = 'numpy_reader' - def validate_config(self): - if self.config: - config_validator = NumpyReaderConfig('numpy_reader_config') - config_validator.validate(self.config) + @classmethod + def parameters(cls): + parameters = super().parameters() + parameters.update({ + 'keys': StringField(optional=True, default="", description='Comma-separated model input names.'), + 'separator': StringField(optional=True, + description='Separator symbol between input identifier and file identifier.'), + 'id_sep': StringField( + optional=True, default="_", + description='Separator symbol between input name and record number in input identifier.' + ), + 'block': BoolField(optional=True, default=False, description='Allows block mode.'), + 'batch': NumberField(optional=True, default=1, description='Batch size') + }) + return parameters def configure(self): self.is_text = self.config.get('text_file', False) - self.multi_infer = self.config.get('multi_infer', False) - self.keys = self.config.get('keys', "") if self.config else "" + self.multi_infer = self.get_value_from_config('multi_infer') + self.keys = self.get_value_from_config('keys') self.keys = [t.strip() for t in self.keys.split(',')] if len(self.keys) > 0 else [] - self.separator = self.config.get('separator') - self.id_sep = self.config.get('id_sep', '_') - self.block = self.config.get('block', False) - self.batch = int(self.config.get('batch', 1)) + self.separator = self.get_value_from_config('separator') + self.id_sep = self.get_value_from_config('id_sep') + self.block = self.get_value_from_config('block') + self.batch = int(self.get_value_from_config('batch')) if self.separator and self.is_text: raise ConfigError('text file reading with numpy does') - self.multi_infer = self.config.get('multi_infer', False) if not self.data_source: raise ConfigError('data_source parameter is required to create "{}" ' 'data reader and read data'.format(self.__provider__)) @@ -387,7 +453,7 @@ def configure(self): def read(self, data_id): field_id = None if self.separator: - field_id, data_id = data_id.split(self.separator) + field_id, data_id = str(data_id).split(self.separator) data = np.load(str(self.data_source / data_id)) @@ -432,8 +498,26 @@ def read_item(self, data_id): identifier.append('{}.{}'.format(data_id, key)) data.append(value) if len(data) == 1: - return DataRepresentation(data[0], data_id) - return DataRepresentation(data, identifier) + return DataRepresentation(data[0], identifier=data_id) + return DataRepresentation(data, identifier=identifier) + + +class NumpyBinReader(BaseReader): + __provider__ = 'numpy_bin_reader' + + @classmethod + def parameters(cls): + params = super().parameters() + params.update({ + "dtype": StringField(optional=True, default='float32', description='data type for reading') + }) + return params + + def configure(self): + self.dtype = self.get_value_from_config('dtype') + + def read(self, data_id): + return np.fromfile(self.data_source / data_id, dtype=self.dtype) class TensorflowImageReader(BaseReader): @@ -448,10 +532,11 @@ def __init__(self, data_source, config=None, **kwargs): 'tf backend for image reading requires TensorFlow. ' 'Please install it before usage. {}'.format(import_error.msg) ) - tf.enable_eager_execution() + if tf.__version__ < '2.0.0': + tf.enable_eager_execution() def read_func(path): - img_raw = tf.read_file(str(path)) + img_raw = tf.read_file(str(path)) if tf.__version__ < '2.0.0' else tf.io.read_file(str(path)) img_tensor = tf.image.decode_image(img_raw, channels=3) return img_tensor.numpy() @@ -461,16 +546,19 @@ def read(self, data_id): return self.read_realisation(self.data_source / data_id) -class AnnotationFeaturesConfig(ConfigValidator): - type = StringField() - features = ListField(allow_empty=False, value_type=StringField) - - class AnnotationFeaturesReader(BaseReader): __provider__ = 'annotation_features_extractor' + @classmethod + def parameters(cls): + parameters = super().parameters() + parameters.update({ + 'features': ListField(allow_empty=False, value_type=str, description='List of features.') + }) + return parameters + def configure(self): - self.feature_list = self.config['features'] + self.feature_list = self.get_value_from_config('features') if not contains_all(self.data_source[0].__dict__, self.feature_list): raise ConfigError( 'annotation_class prototype does not contain provided features {}'.format(', '.join(self.feature_list)) @@ -478,7 +566,7 @@ def configure(self): self.single = len(self.feature_list) == 1 self.counter = 0 self.subset = range(len(self.data_source)) - self.multi_infer = self.config.get('multi_infer', False) + self.multi_infer = self.get_value_from_config('multi_infer') def read(self, data_id): relevant_annotation = self.data_source[self.subset[self.counter]] @@ -550,3 +638,39 @@ def read(self, data_id): def read_item(self, data_id): return DataRepresentation(*self.read_dispatcher(data_id), identifier=data_id) + + +class SkimageReader(BaseReader): + __provider__ = 'skimage_imread' + + def __init__(self, data_source, config=None, **kwargs): + super().__init__(data_source, config) + if isinstance(sk, UnsupportedPackage): + sk.raise_error(self.__provider__) + + def read(self, data_id): + return sk.imread(str(self.data_source / data_id)) + + +class RawpyReader(BaseReader): + __provider__ = 'rawpy' + + @classmethod + def parameters(cls): + params = super().parameters() + params.update({ + 'postprocess': BoolField(optional=True, default=True) + }) + return params + + def configure(self): + if isinstance(rawpy, UnsupportedPackage): + rawpy.raise_error(self.__provider__) + self.postprocess = self.get_value_from_config('postprocess') + + def read(self, data_id): + raw = rawpy.imread(str(self.data_source / data_id)) + if not self.postprocess: + return raw.raw_image_visible.astype(np.float32) + postprocessed = raw.postprocess(use_camera_wb=True, half_size=False, no_auto_bright=True, output_bps=16) + return np.float32(postprocessed / 65535.0) diff --git a/tools/accuracy_checker/accuracy_checker/dataset.py b/tools/accuracy_checker/accuracy_checker/dataset.py index 0a535de37a0..aff6798b233 100644 --- a/tools/accuracy_checker/accuracy_checker/dataset.py +++ b/tools/accuracy_checker/accuracy_checker/dataset.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -17,9 +17,12 @@ from copy import deepcopy from pathlib import Path import warnings +import pickle import numpy as np -from .annotation_converters import BaseFormatConverter, save_annotation, make_subset, analyze_dataset +from .annotation_converters import ( + BaseFormatConverter, DatasetConversionInfo, save_annotation, make_subset, analyze_dataset +) from .config import ( ConfigValidator, StringField, @@ -31,7 +34,11 @@ ConfigError, BoolField ) -from .utils import JSONDecoderWithAutoConversion, read_json, get_path, contains_all, set_image_metadata, OrderedSet +from .dependency import UnregisteredProviderException +from .utils import ( + JSONDecoderWithAutoConversion, read_json, get_path, contains_all, set_image_metadata, OrderedSet, contains_any +) + from .representation import ( BaseRepresentation, ReIdentificationClassificationAnnotation, ReIdentificationAnnotation, PlaceRecognitionAnnotation ) @@ -69,7 +76,7 @@ def __init__(self, config_entry, delayed_annotation_loading=False): self._config = config_entry self.batch = self.config.get('batch') self.iteration = 0 - dataset_config = DatasetConfig('Dataset') + dataset_config = DatasetConfig('dataset') dataset_config.validate(self._config) if not delayed_annotation_loading: self._load_annotation() @@ -122,7 +129,7 @@ def _load_annotation(self): dataset_name=self._config['name'], file=meta_name)) print_info('Converted annotation for {dataset_name} dataset will be saved to {file}'.format( dataset_name=self._config['name'], file=Path(annotation_name))) - save_annotation(annotation, meta, Path(annotation_name), meta_name) + save_annotation(annotation, meta, Path(annotation_name), meta_name, self._config) self._annotation = annotation self._meta = meta or {} @@ -248,7 +255,7 @@ def ibl_subset(pairs_set, subsample_set, ids): (PlaceRecognitionAnnotation, ibl_subset), (ReIdentificationClassificationAnnotation, reid_pairwise_subset), (ReIdentificationAnnotation, reid_subset), - ] + ] subsample_set = OrderedSet() pairs_set = OrderedSet() for (dtype, func) in realisation: @@ -313,18 +320,62 @@ def set_annotation(self, annotation): self.name = self._config.get('name') self.subset = None - def provide_data_info(self, reader, annotations): - for ann in annotations: + def provide_data_info(self, reader, annotations, progress_reporter=None): + if progress_reporter: + progress_reporter.reset(len(annotations)) + for idx, ann in enumerate(annotations): input_data = reader(ann.identifier) self.set_annotation_metadata(ann, input_data, reader.data_source) + if progress_reporter: + progress_reporter.update(idx, 1) return annotations + @classmethod + def validate_config(cls, config, fetch_only=False, uri_prefix=''): + dataset_config = DatasetConfig(uri_prefix or 'dataset') + errors = dataset_config.validate(config, fetch_only=fetch_only) + if 'annotation_conversion' in config: + conversion_uri = '{}.annotation_conversion'.format(uri_prefix) if uri_prefix else 'annotation_conversion' + conversion_params = config['annotation_conversion'] + converter = conversion_params.get('converter') + if not converter: + error = ConfigError('converter is not found', conversion_params, conversion_uri) + if not fetch_only: + raise error + errors.append(error) + return errors + try: + converter_cls = BaseFormatConverter.resolve(converter) + except UnregisteredProviderException as exception: + if not fetch_only: + raise exception + errors.append( + ConfigError( + 'converter {} unregistered'.format(converter), conversion_params, conversion_uri) + ) + return errors + errors.extend(converter_cls.validate_config(conversion_params, fetch_only=fetch_only)) + if not contains_any(config, ['annotation_conversion', 'annotation']): + errors.append( + ConfigError( + 'annotation_conversion or annotation field should be provided', config, uri_prefix or 'dataset') + ) + return errors + def read_annotation(annotation_file: Path): annotation_file = get_path(annotation_file) result = [] with annotation_file.open('rb') as file: + try: + first_obj = pickle.load(file) + if isinstance(first_obj, DatasetConversionInfo): + describe_cached_dataset(first_obj) + else: + result.append(first_obj) + except EOFError: + return result while True: try: result.append(BaseRepresentation.load(file)) @@ -354,6 +405,21 @@ def create_subset(annotation, subsample_size, subsample_seed, shuffle=True): return make_subset(annotation, subsample_size, subsample_seed, shuffle) +def describe_cached_dataset(dataset_info): + print_info('Loaded dataset info:') + if dataset_info.dataset_name: + print_info('\tDataset name: {}'.format(dataset_info.dataset_name)) + print_info('\tAccuracy Checker version {}'.format(dataset_info.ac_version)) + print_info('\tDataset size {}'.format(dataset_info.dataset_size)) + print_info('\tConversion parameters:') + for key, value in dataset_info.conversion_parameters.items(): + print_info('\t\t{key}: {value}'.format(key=key, value=value)) + if dataset_info.subset_parameters: + print_info('\nSubset selection parameters:') + for key, value in dataset_info.subset_parameters.items(): + print_info('\t\t{key}: {value}'.format(key=key, value=value)) + + class DatasetWrapper: def __init__(self, data_reader, annotation_reader=None, tag='', dataset_config=None): self.tag = tag diff --git a/tools/accuracy_checker/accuracy_checker/dependency.py b/tools/accuracy_checker/accuracy_checker/dependency.py index f7ddd6c8112..c628fb25d44 100644 --- a/tools/accuracy_checker/accuracy_checker/dependency.py +++ b/tools/accuracy_checker/accuracy_checker/dependency.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/evaluators/__init__.py b/tools/accuracy_checker/accuracy_checker/evaluators/__init__.py index 5ba9fa2d3b2..2b5c99fb18e 100644 --- a/tools/accuracy_checker/accuracy_checker/evaluators/__init__.py +++ b/tools/accuracy_checker/accuracy_checker/evaluators/__init__.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/evaluators/base_evaluator.py b/tools/accuracy_checker/accuracy_checker/evaluators/base_evaluator.py index 285e8b6bca2..6a4ba041ea6 100644 --- a/tools/accuracy_checker/accuracy_checker/evaluators/base_evaluator.py +++ b/tools/accuracy_checker/accuracy_checker/evaluators/base_evaluator.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/README.md b/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/README.md index 1cd8358a901..b37e79b7305 100644 --- a/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/README.md +++ b/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/README.md @@ -30,9 +30,9 @@ Optionally you can provide `module_config` section which contains config for cus Evaluator code. Configuration file example: mtcnn. -* **Text Spotting Evaluator** demonstrates how to evaluate the `text-spotting-0002` model via Accuracy Checker. +* **Text Spotting Evaluator** demonstrates how to evaluate the `text-spotting-0003` model via Accuracy Checker. Evaluator code. - Configuration file example: text-spotting-0002. + Configuration file example: text-spotting-0003. * **Automatic Speech Recognition Evaluator** shows how to evaluate speech recognition pipeline (encoder + decoder). Evaluator code. @@ -43,3 +43,9 @@ Optionally you can provide `module_config` section which contains config for cus * **I3D Evaluator** demonstrates how to evaluate two-stream I3D model (RGB + Flow). Evaluator code. + +* **Text to speech Evaluator** demonstrates how to evaluate text to speech pipeline for Forward Tacotron and MelGAN upsampler. + Evaluator code. + +* **LPCNet Evaluator** demonstrates how to evaluate LPCNet vocoder pipeline. + Evaluator code. diff --git a/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/__init__.py b/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/__init__.py index 7375355084f..fefb21dec89 100644 --- a/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/__init__.py +++ b/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/__init__.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/asr_encoder_decoder_evaluator.py b/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/asr_encoder_decoder_evaluator.py index 0fdfbc69e14..5608e5f75c5 100644 --- a/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/asr_encoder_decoder_evaluator.py +++ b/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/asr_encoder_decoder_evaluator.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -96,7 +96,7 @@ def process_dataset( batch_identifiers, batch_inputs_extr, encoder_callback=encoder_callback ) metrics_result = None - if self.metric_executor and calculate_metrcis: + if self.metric_executor and calculate_metrics: metrics_result, _ = self.metric_executor.update_metrics_on_batch( batch_input_ids, batch_annotation, batch_prediction ) diff --git a/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/cocosnet_evaluator.py b/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/cocosnet_evaluator.py new file mode 100644 index 00000000000..314e8783334 --- /dev/null +++ b/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/cocosnet_evaluator.py @@ -0,0 +1,492 @@ +""" +Copyright (c) 2018-2021 Intel Corporation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +from collections import OrderedDict +from pathlib import Path +import numpy as np +import cv2 + +from ..base_evaluator import BaseEvaluator +from ..quantization_model_evaluator import create_dataset_attributes +from ...adapters import create_adapter +from ...config import ConfigError +from ...data_readers import DataRepresentation +from ...launcher import create_launcher +from ...logging import print_info +from ...preprocessor import PreprocessingExecutor +from ...progress_reporters import ProgressReporter +from ...representation import RawTensorPrediction, RawTensorAnnotation +from ...utils import extract_image_representations, contains_all, get_path + + +class CocosnetEvaluator(BaseEvaluator): + def __init__( + self, dataset_config, launcher, preprocessor_mask, preprocessor_image, + gan_model, check_model + ): + self.launcher = launcher + self.dataset_config = dataset_config + self.preprocessor_mask = preprocessor_mask + self.preprocessor_image = preprocessor_image + self.postprocessor = None + self.dataset = None + self.metric_executor = None + self.test_model = gan_model + self.check_model = check_model + self._metrics_results = [] + self._part_by_name = { + 'gan_network': self.test_model, + } + if self.check_model: + self._part_by_name.update({'verification_network': self.check_model}) + + @classmethod + def from_configs(cls, config, delayed_model_loading=False): + launcher_config = config['launchers'][0] + dataset_config = config['datasets'] + + preprocessor_mask = PreprocessingExecutor( + dataset_config[0].get('preprocessing_mask') + ) + preprocessor_image = PreprocessingExecutor( + dataset_config[0].get('preprocessing_image') + ) + launcher = create_launcher(launcher_config, delayed_model_loading=True) + + network_info = config.get('network_info', {}) + cocosnet_network = network_info.get('cocosnet_network', {}) + verification_network = network_info.get('verification_network', {}) + if not delayed_model_loading: + model_args = config.get('_models', []) + models_is_blob = config.get('_model_is_blob') + + if 'model' not in cocosnet_network and model_args: + cocosnet_network['model'] = model_args[0] + cocosnet_network['_model_is_blob'] = models_is_blob + if verification_network and 'model' not in verification_network and model_args: + verification_network['model'] = model_args[1 if len(model_args) > 1 else 0] + verification_network['_model_is_blob'] = models_is_blob + network_info.update({ + 'cocosnet_network': cocosnet_network, + 'verification_network': verification_network + }) + if not contains_all(network_info, ['cocosnet_network']): + raise ConfigError('configuration for cocosnet_network does not exist') + + gan_model = CocosnetModel(network_info.get('cocosnet_network', {}), launcher, delayed_model_loading) + if verification_network: + check_model = GanCheckModel(network_info.get('verification_network', {}), launcher, delayed_model_loading) + else: + check_model = None + + return cls( + dataset_config, launcher, preprocessor_mask, preprocessor_image, gan_model, check_model + ) + + @staticmethod + def get_processing_info(config): + module_specific_params = config.get('module_config') + model_name = config['name'] + launcher_config = module_specific_params['launchers'][0] + dataset_config = module_specific_params['datasets'][0] + + return ( + model_name, launcher_config['framework'], launcher_config['device'], launcher_config.get('tags'), + dataset_config['name'] + ) + + def _preprocessing_for_batch_input(self, batch_annotation, batch_inputs): + for i, _ in enumerate(batch_inputs): + for index_of_input, _ in enumerate(batch_inputs[i].data): + preprocessor = self.preprocessor_mask + if index_of_input % 2: + preprocessor = self.preprocessor_image + batch_inputs[i].data[index_of_input] = preprocessor.process( + images=[DataRepresentation(batch_inputs[i].data[index_of_input])], + batch_annotation=batch_annotation)[0].data + + return batch_inputs + + def process_dataset( + self, subset=None, + num_images=None, + check_progress=False, + dataset_tag='', + output_callback=None, + allow_pairwise_subset=False, + dump_prediction_to_annotgiation=False, + **kwargs): + if self.dataset is None or (dataset_tag and self.dataset.tag != dataset_tag): + self.select_dataset(dataset_tag) + + self._annotations, self._predictions = [], [] + + self._create_subset(subset, num_images, allow_pairwise_subset) + + if 'progress_reporter' in kwargs: + _progress_reporter = kwargs['progress_reporter'] + _progress_reporter.reset(self.dataset.size) + else: + _progress_reporter = None if not check_progress else self._create_progress_reporter( + check_progress, self.dataset.size + ) + + metric_config = self.configure_intermediate_metrics_results(kwargs) + compute_intermediate_metric_res, metric_interval, ignore_results_formatting = metric_config + + for batch_id, (batch_input_ids, batch_annotation, batch_inputs, batch_identifiers) in enumerate(self.dataset): + batch_inputs = self._preprocessing_for_batch_input(batch_annotation, batch_inputs) + extr_batch_inputs, _ = extract_image_representations(batch_inputs) + batch_predictions = self.test_model.predict(batch_identifiers, extr_batch_inputs) + annotations, predictions = self.postprocessor.process_batch(batch_annotation, batch_predictions) + + if self.metric_executor: + metrics_result, _ = self.metric_executor.update_metrics_on_batch( + batch_input_ids, annotations, predictions + ) + check_model_annotations = [] + check_model_predictions = [] + if self.check_model: + for index_of_metric in range(self.check_model.number_of_metrics): + check_model_annotations.extend( + self.check_model.predict(batch_identifiers, annotations, index_of_metric) + ) + check_model_predictions.extend( + self.check_model.predict(batch_identifiers, predictions, index_of_metric) + ) + batch_identifiers.extend(batch_identifiers) + check_model_annotations = [ + RawTensorAnnotation(batch_identifier, item) + for batch_identifier, item in zip(batch_identifiers, check_model_annotations)] + check_model_predictions = [ + RawTensorPrediction(batch_identifier, item) + for batch_identifier, item in zip(batch_identifiers, check_model_predictions)] + + if self.metric_executor.need_store_predictions: + self._annotations.extend(check_model_annotations) + self._predictions.extend(check_model_predictions) + + if output_callback: + output_callback( + predictions, + metrics_result=metrics_result, + element_identifiers=batch_identifiers, + dataset_indices=batch_input_ids + ) + + if _progress_reporter: + _progress_reporter.update(batch_id, len(batch_predictions)) + if compute_intermediate_metric_res and _progress_reporter.current % metric_interval == 0: + self.compute_metrics( + print_results=True, ignore_results_formatting=ignore_results_formatting + ) + + if _progress_reporter: + _progress_reporter.finish() + + return self._annotations, self._predictions + + def compute_metrics(self, print_results=True, ignore_results_formatting=False): + if self._metrics_results: + del self._metrics_results + self._metrics_results = [] + + for result_presenter, evaluated_metric in self.metric_executor.iterate_metrics( + self._annotations, self._predictions): + self._metrics_results.append(evaluated_metric) + if print_results: + result_presenter.write_result(evaluated_metric, ignore_results_formatting) + return self._metrics_results + + def extract_metrics_results(self, print_results=True, ignore_results_formatting=False): + if not self._metrics_results: + self.compute_metrics(False, ignore_results_formatting) + + result_presenters = self.metric_executor.get_metric_presenters() + extracted_results, extracted_meta = [], [] + for presenter, metric_result in zip(result_presenters, self._metrics_results): + result, metadata = presenter.extract_result(metric_result) + if isinstance(result, list): + extracted_results.extend(result) + extracted_meta.extend(metadata) + else: + extracted_results.append(result) + extracted_meta.append(metadata) + if print_results: + presenter.write_result(metric_result, ignore_results_formatting) + + return extracted_results, extracted_meta + + def print_metrics_results(self, ignore_results_formatting=False): + if not self._metrics_results: + self.compute_metrics(True, ignore_results_formatting) + return + result_presenters = self.metric_executor.get_metric_presenters() + for presenter, metric_result in zip(result_presenters, self._metrics_results): + presenter.write_result(metric_result, ignore_results_formatting) + + def reset_progress(self, progress_reporter): + progress_reporter.reset(self.dataset.size) + + def release(self): + self.test_model.release() + if self.check_model: + self.check_model.release() + self.launcher.release() + + def reset(self): + if self.metric_executor: + self.metric_executor.reset() + if hasattr(self, '_annotations'): + del self._annotations + del self._predictions + del self._input_ids + del self._metrics_results + self._annotations = [] + self._predictions = [] + self._input_ids = [] + self._metrics_results = [] + if self.dataset: + self.dataset.reset(self.postprocessor.has_processors) + + def load_model(self, network_list, launcher): + for network_dict in network_list: + self._part_by_name[network_dict['name']].load_network(network_dict, launcher) + + def load_network(self, network_list, launcher): + for network_dict in network_list: + self._part_by_name[network_dict['name']].load_network(network_dict['model'], launcher) + + def get_network(self): + return [{'name': key, 'model': model.network} for key, model in self._part_by_name.items()] + + def get_metrics_attributes(self): + if not self.metric_executor: + return {} + return self.metric_executor.get_metrics_attributes() + + def register_metric(self, metric_config): + if isinstance(metric_config, str): + self.metric_executor.register_metric({'type': metric_config}) + elif isinstance(metric_config, dict): + self.metric_executor.register_metric(metric_config) + else: + raise ValueError('Unsupported metric configuration type {}'.format(type(metric_config))) + + def register_postprocessor(self, postprocessing_config): + pass + + def register_dumped_annotations(self): + pass + + def select_dataset(self, dataset_tag): + if self.dataset is not None and isinstance(self.dataset_config, list): + return + dataset_attributes = create_dataset_attributes(self.dataset_config, dataset_tag) + self.dataset, self.metric_executor, self.preprocessor, self.postprocessor = dataset_attributes + + def set_profiling_dir(self, profiler_dir): + self.metric_executor.set_profiling_dir(profiler_dir) + + def _create_subset(self, subset=None, num_images=None, allow_pairwise=False): + if self.dataset.batch is None: + self.dataset.batch = 1 + if subset is not None: + self.dataset.make_subset(ids=subset, accept_pairs=allow_pairwise) + elif num_images is not None: + self.dataset.make_subset(end=num_images, accept_pairs=allow_pairwise) + + @staticmethod + def _create_progress_reporter(check_progress, dataset_size): + pr_kwargs = {} + if isinstance(check_progress, int) and not isinstance(check_progress, bool): + pr_kwargs = {"print_interval": check_progress} + + return ProgressReporter.provide('print', dataset_size, **pr_kwargs) + + @staticmethod + def configure_intermediate_metrics_results(config): + compute_intermediate_metric_res = config.get('intermediate_metrics_results', False) + metric_interval, ignore_results_formatting = None, None + if compute_intermediate_metric_res: + metric_interval = config.get('metrics_interval', 1000) + ignore_results_formatting = config.get('ignore_results_formatting', False) + return compute_intermediate_metric_res, metric_interval, ignore_results_formatting + + +class BaseModel: + def __init__(self, network_info, launcher, delayed_model_loading=False): + self.input_blob = None + self.output_blob = None + self.with_prefix = False + if not delayed_model_loading: + self.load_model(network_info, launcher, log=True) + + @staticmethod + def auto_model_search(network_info, net_type=""): + model = Path(network_info['model']) + is_blob = network_info.get('_model_is_blob') + if model.is_dir(): + if is_blob: + model_list = list(model.glob('*.blob')) + else: + model_list = list(model.glob('*.xml')) + if not model_list and is_blob is None: + model_list = list(model.glob('*.blob')) + if not model_list: + raise ConfigError('Suitable model not found') + if len(model_list) > 1: + raise ConfigError('Several suitable models found') + model = model_list[0] + print_info('{} - Found model: {}'.format(net_type, model)) + if model.suffix == '.blob': + return model, None + weights = get_path(network_info.get('weights', model.parent / model.name.replace('xml', 'bin'))) + print_info('{} - Found weights: {}'.format(net_type, weights)) + + return model, weights + + def predict(self, idenitifiers, input_data): + raise NotImplementedError + + def release(self): + del self.network + del self.exec_network + + def load_model(self, network_info, launcher, log=False): + model, weights = self.auto_model_search(network_info, self.net_type) + if weights: + self.network = launcher.read_network(model, weights) + self.exec_network = launcher.ie_core.load_network(self.network, launcher.device) + else: + self.network = None + self.exec_network = launcher.ie_core.import_network(str(model)) + self.set_input_and_output() + if log: + self.print_input_output_info() + + def load_network(self, network, launcher): + self.network = network + self.exec_network = launcher.ie_core.load_network(self.network, launcher.device) + self.set_input_and_output() + + def set_input_and_output(self): + pass + + def print_input_output_info(self): + print_info('{} - Input info:'.format(self.net_type)) + has_info = hasattr(self.network if self.network is not None else self.exec_network, 'input_info') + if self.network: + if has_info: + network_inputs = OrderedDict( + [(name, data.input_data) for name, data in self.network.input_info.items()] + ) + else: + network_inputs = self.network.inputs + network_outputs = self.network.outputs + else: + if has_info: + network_inputs = OrderedDict([ + (name, data.input_data) for name, data in self.exec_network.input_info.items() + ]) + else: + network_inputs = self.exec_network.inputs + network_outputs = self.exec_network.outputs + for name, input_info in network_inputs.items(): + print_info('\tLayer name: {}'.format(name)) + print_info('\tprecision: {}'.format(input_info.precision)) + print_info('\tshape {}\n'.format(input_info.shape)) + print_info('{} - Output info'.format(self.net_type)) + for name, output_info in network_outputs.items(): + print_info('\tLayer name: {}'.format(name)) + print_info('\tprecision: {}'.format(output_info.precision)) + print_info('\tshape: {}\n'.format(output_info.shape)) + + +class CocosnetModel(BaseModel): + def __init__(self, network_info, launcher, delayed_model_loading=False): + self.net_type = "cocosnet_network" + self.adapter = create_adapter(network_info.get('adapter')) + super().__init__(network_info, launcher, delayed_model_loading) + self.adapter.output_blob = self.output_blob + + def set_input_and_output(self): + has_info = hasattr(self.exec_network, 'input_info') + if has_info: + inputs_data = OrderedDict([(name, data.input_data) for name, data in self.exec_network.input_info.items()]) + else: + inputs_data = self.exec_network.inputs + self.inputs_names = list(inputs_data.keys()) + self.output_blob = next(iter(self.exec_network.outputs)) + self.adapter.output_blob = self.output_blob + + def fit_to_input(self, input_data): + inputs = {} + for value, key in zip(input_data, self.inputs_names): + value = np.expand_dims(value, 0) + value = np.transpose(value, (0, 3, 1, 2)) + inputs.update({key: value}) + return inputs + + def predict(self, identifiers, inputs): + results = [] + for current_input in inputs: + prediction = self.exec_network.infer(self.fit_to_input(current_input)) + results.append(*self.adapter.process(prediction, identifiers, [{}])) + return results + + +class GanCheckModel(BaseModel): + def __init__(self, network_info, launcher, delayed_model_loading=False): + self.net_type = "verification_network" + self.additional_layers = network_info.get('additional_layers') + super().__init__(network_info, launcher) + + def load_model(self, network_info, launcher, log=False): + model, weights = self.auto_model_search(network_info, self.net_type) + if weights: + self.network = launcher.read_network(model, weights) + for layer in self.additional_layers: + self.network.add_outputs(layer) + self.exec_network = launcher.ie_core.load_network(self.network, launcher.device) + else: + self.network = None + self.exec_network = launcher.ie_core.import_network(str(model)) + self.set_input_and_output() + if log: + self.print_input_output_info() + + def set_input_and_output(self): + has_info = hasattr(self.exec_network, 'input_info') + input_info = self.exec_network.input_info if has_info else self.exec_network.inputs + self.input_blob = next(iter(input_info)) + self.input_shape = tuple(input_info[self.input_blob].input_data.shape) + self.output_blob = list(self.exec_network.outputs.keys()) + self.number_of_metrics = len(self.output_blob) + + def fit_to_input(self, input_data): + input_data = cv2.cvtColor(input_data, cv2.COLOR_RGB2BGR) + input_data = cv2.resize(input_data, dsize=self.input_shape[2:]) + input_data = np.expand_dims(input_data, 0) + input_data = np.transpose(input_data, (0, 3, 1, 2)) + return {self.input_blob: input_data} + + def predict(self, identifiers, input_data, index_of_key): + results = [] + for data in input_data: + prediction = self.exec_network.infer(self.fit_to_input(data.value)) + results.append(np.squeeze(prediction[self.output_blob[index_of_key]])) + return results diff --git a/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/colorization_evaluator.py b/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/colorization_evaluator.py index a8baf01f53f..a73e0c842cb 100644 --- a/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/colorization_evaluator.py +++ b/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/colorization_evaluator.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -175,6 +175,8 @@ def print_metrics_results(self, ignore_results_formatting=False): presenter.write_results(metric_result, ignore_results_formatting) def release(self): + self.test_model.release() + self.check_model.release() self.launcher.release() def reset(self): @@ -326,7 +328,8 @@ def predict(self, idenitifers, input_data): raise NotImplementedError def release(self): - pass + del self.network + del self.exec_network def load_model(self, network_info, launcher, log=False): model, weights = self.auto_model_search(network_info, self.net_type) @@ -411,15 +414,12 @@ def postprocessing(self, res, img_l): def predict(self, identifiers, input_data): img_l, img_l_rs = self.data_preparation(input_data) - res = self.exec_network.infer(inputs={self.input_blob: [img_l_rs]}) + self.inputs[self.input_blob] = img_l_rs + res = self.exec_network.infer(inputs=self.inputs) new_result = self.postprocessing(res[self.output_blob], img_l) return res, np.array(new_result) - def release(self): - del self.network - del self.exec_network - def fit_to_input(self, input_data): has_info = hasattr(self.exec_network, 'input_info') input_info = ( @@ -446,6 +446,10 @@ def set_input_and_output(self): self.output_blob = output_blob self.with_prefix = with_prefix + self.inputs = {} + for input_name in input_info: + self.inputs[input_name] = np.zeros(input_info[input_name].input_data.shape) + class ColorizationCheckModel(BaseModel): def __init__(self, network_info, launcher, delayed_model_loading=False): @@ -459,10 +463,6 @@ def predict(self, identifiers, input_data): result = self.adapter.process([raw_result], identifiers, [{}]) return raw_result, result - def release(self): - del self.network - del self.exec_network - def fit_to_input(self, input_data): constant_normalization = 255. input_data *= constant_normalization diff --git a/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/i3d_evaluator.py b/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/i3d_evaluator.py index d07c92cf038..46c22bf403d 100644 --- a/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/i3d_evaluator.py +++ b/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/i3d_evaluator.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -402,7 +402,7 @@ def preprocessing(image): resizer = Resize(resizer_config) image = resizer.process(image) for i, frame in enumerate(image.data): - image.data[i] = Crop.process_data(frame, 224, 224, None, False, True, {}) + image.data[i] = Crop.process_data(frame, 224, 224, None, False, False, True, {}) return image diff --git a/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/im2latex_evaluator.py b/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/im2latex_evaluator.py index d85cd78ab5d..ec02cbf839f 100644 --- a/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/im2latex_evaluator.py +++ b/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/im2latex_evaluator.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/lpcnet_evaluator.py b/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/lpcnet_evaluator.py new file mode 100644 index 00000000000..72dcec5721f --- /dev/null +++ b/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/lpcnet_evaluator.py @@ -0,0 +1,351 @@ +""" +Copyright (c) 2018-2021 Intel Corporation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +from pathlib import Path +import numpy as np +from .text_to_speech_evaluator import TextToSpeechEvaluator, TTSDLSDKModel +from ...adapters import create_adapter +from ...config import ConfigError +from ...launcher import create_launcher +from ...utils import contains_all + + +scale = 255.0/32768.0 +scale_1 = 32768.0/255.0 + + +def ulaw2lin(u): + u = u - 128 + s = np.sign(u) + u = np.abs(u) + return s*scale_1*(np.exp(u/128.*np.log(256))-1) + + +def lin2ulaw(x): + s = np.sign(x) + x = np.abs(x) + u = (s*(128*np.log(1+scale*x)/np.log(256))) + u = np.clip(128 + np.round(u), 0, 255) + return u.astype('int16') + + +def generate_name(prefix, with_prefix, layer_name): + return prefix + layer_name if with_prefix else layer_name.split(prefix)[-1] + + +class SequentialModel: + def __init__(self, network_info, launcher, models_args, is_blob=None, delayed_model_loading=False): + if not delayed_model_loading: + encoder = network_info.get('encoder', {}) + decoder = network_info.get('decoder', {}) + if 'model' not in encoder: + encoder['model'] = models_args[0] + encoder['_model_is_blob'] = is_blob + if 'model' not in decoder: + decoder['model'] = models_args[1 if len(models_args) > 1 else 0] + decoder['_model_is_blob'] = is_blob + network_info.update({ + 'encoder': encoder, + 'decoder': decoder, + }) + required_fields = ['encoder', 'decoder'] + if not contains_all(network_info, required_fields): + raise ConfigError( + 'network_info should contains: {} fields'.format(' ,'.join(required_fields)) + ) + self.encoder = create_encoder(network_info, launcher, delayed_model_loading) + self.decoder = create_decoder(network_info, launcher, delayed_model_loading) + self.adapter = create_adapter(network_info['adapter']) + self.adapter.output_blob = 'audio' + + self.with_prefix = False + self._part_by_name = { + 'encoder': self.encoder, + 'decoder': self.decoder, + } + + def predict(self, identifiers, input_data, input_meta, callback=None): + assert len(identifiers) == 1 + encoder_output, feats, chunk_size = self.encoder.predict(input_data[0]) + if callback: + callback(encoder_output) + + cfeats = encoder_output[self.encoder.output] + out_blob = self.decoder.predict(cfeats, feats, chunk_size, callback=callback) + + return {}, self.adapter.process(out_blob, identifiers, input_meta) + + def release(self): + self.encoder.release() + self.decoder.release() + + def load_model(self, network_list, launcher): + for network_dict in network_list: + self._part_by_name[network_dict['name']].load_model(network_dict, launcher) + self.update_inputs_outputs_info() + + def load_network(self, network_list, launcher): + for network_dict in network_list: + self._part_by_name[network_dict['name']].load_network(network_dict['model'], launcher) + self.update_inputs_outputs_info() + + def get_network(self): + return [ + {'name': 'encoder', 'model': self.encoder.get_network()}, + {'name': 'decoder', 'model': self.decoder.get_network()}, + ] + + def update_inputs_outputs_info(self): + current_name = next(iter(self.encoder.inputs)) + with_prefix = current_name.startswith('encoder_') + if with_prefix != self.with_prefix: + self.encoder.update_inputs_outputs_info(with_prefix) + self.decoder.update_inputs_outputs_info(with_prefix) + + self.with_prefix = with_prefix + + +class EncoderModel: + def __init__(self, network_info, launcher, suffix, nb_features, nb_used_features, delayed_model_loading=False): + self.network_info = network_info + self.nb_features = nb_features + self.nb_used_features = nb_used_features + self.feature_input = network_info.get('feature_input') + self.periods_input = network_info.get('periods_input') + self.output = network_info.get('output') + self.default_model_suffix = suffix + self.launcher = launcher + self.prepare_model(launcher, network_info, delayed_model_loading) + + def predict(self, features): + features = np.resize(features, (-1, self.nb_features)) + feature_chunk_size = features.shape[0] + nb_frames = 1 + features = np.reshape(features, (nb_frames, feature_chunk_size, self.nb_features)) + features[:, :, 18:36] = 0 + periods = (.1 + 50 * features[:, :, 36:37] + 100).astype('float32') + outs = self.infer( + { + self.feature_input: features[:, :, :self.nb_used_features], + self.periods_input: periods + }) + return outs, features, feature_chunk_size + + def infer(self, feed_dict): + raise NotImplementedError + + def prepare_model(self, launcher, network_info, delayed_model_loading): + raise NotImplementedError + + def update_inputs_outputs_info(self, with_prefix): + self.feature_input = generate_name(self.default_model_suffix+'_', with_prefix, self.feature_input) + self.periods_input = generate_name(self.default_model_suffix+'_', with_prefix, self.periods_input) + self.output = generate_name(self.default_model_suffix+'_', with_prefix, self.output) + + +class EncoderOpenVINOModel(EncoderModel, TTSDLSDKModel): + def prepare_model(self, launcher, network_info, delayed_model_loading): + if not delayed_model_loading: + self.load_model(network_info, launcher, log=True) + + def infer(self, feed_dict): + feature_layer_shape = self.inputs[self.feature_input] + if feature_layer_shape != feed_dict[self.feature_input].shape: + input_shapes = {in_name: value.shape for in_name, value in feed_dict.items()} + self._reshape_input(input_shapes) + return self.exec_network.infer(feed_dict) + + def _reshape_input(self, input_shapes): + del self.exec_network + self.network.reshape(input_shapes) + self.exec_network = self.launcher.ie_core.load_network(self.network, self.launcher.device) + + +class BaseONNXModel: + @property + def inputs(self): + inputs_info = self.inference_session.get_inputs() + return {input_layer.name: input_layer.shape for input_layer in inputs_info} + + def infer(self, feed_dict): + outs = self.inference_session.run(self.output_names, feed_dict) + return dict(zip(self.output_names, outs)) + + def release(self): + del self.inference_session + + def automatic_model_search(self, network_info): + model = Path(network_info['model']) + if model.is_dir(): + model_list = list(model.glob('*{}.onnx'.format(self.default_model_suffix))) + if not model_list: + model_list = list(model.glob('*.onnx')) + if not model_list: + raise ConfigError('Suitable model for {} not found'.format(self.default_model_suffix)) + if len(model_list) > 1: + raise ConfigError('Several suitable models for {} found'.format(self.default_model_suffix)) + model = model_list[0] + + return model + + def prepare_model(self, launcher, network_info, delayed_model_loading=False): + if not delayed_model_loading: + model = self.automatic_model_search(network_info) + self.inference_session = launcher.create_inference_session(str(model)) + outputs = self.inference_session.get_outputs() + self.output_names = [output.name for output in outputs] + +class EncoderONNXModel(BaseONNXModel, EncoderModel): + pass + + +class DecoderModel: + def __init__(self, network_info, launcher, suffix, frame_size, nb_features, delayed_model_loading=False): + self.network_info = network_info + self.default_model_suffix = suffix + self.frame_size = frame_size + self.nb_frames = 1 + self.nb_features = nb_features + self.rnn_units1 = network_info.get('rnn_units1') + self.rnn_units2 = network_info.get('rnn_units2') + self.input1 = network_info.get('input1') + self.input2 = network_info.get('input2') + self.rnn_input1 = network_info.get('rnn_input1') + self.rnn_input2 = network_info.get('rnn_input2') + self.rnn_output1 = network_info.get('rnn_output1') + self.rnn_output2 = network_info.get('rnn_output2') + self.output = network_info.get('output') + self.prepare_model(launcher, network_info, delayed_model_loading) + + def predict(self, cfeats, features, chunk_size, order=16, callback=None): + coef = 0.85 + pcm_chunk_size = self.frame_size * chunk_size + pcm = np.zeros((self.nb_frames * pcm_chunk_size + order + 2,), dtype='float32') + fexc = np.zeros((1, 1, 3), dtype='float32') + 128 + state1 = np.zeros((1, self.rnn_units1), dtype='float32') + state2 = np.zeros((1, self.rnn_units2), dtype='float32') + skip = order + 1 + mem = [] + mem_ = 0 + for fr in range(chunk_size): + f = chunk_size + fr + a = features[0, fr, self.nb_features - order:] + for i in range(skip, self.frame_size): + pcm_start_index = min(f*self.frame_size + i - 1, len(pcm) - 1) + pred = -sum(a*pcm[pcm_start_index: pcm_start_index - order:-1]) + fexc[0, 0, 1] = lin2ulaw(pred) + outputs = self.infer({ + self.input1: fexc, + self.input2: cfeats[:, fr:fr + 1, :], + self.rnn_input1: state1, + self.rnn_input2: state2 + }) + + if callback is not None: + callback(outputs) + p = outputs[self.output] + state1 = outputs[self.rnn_output1] + state2 = outputs[self.rnn_output2] + # Lower the temperature for voiced frames to reduce noisiness + p *= np.power(p, np.maximum(0, 1.5 * features[0, fr, 37] - .5)) + p = p / (1e-18 + np.sum(p)) + # Cut off the tail of the remaining distribution + p = np.maximum(p - 0.002, 0).astype('float64') + p = p / (1e-8 + np.sum(p)) + + fexc[0, 0, 2] = np.argmax(np.random.multinomial(1, p[0, 0, :], 1)) + pcm[pcm_start_index] = pred + ulaw2lin(fexc[0, 0, 2]) + fexc[0, 0, 0] = lin2ulaw(pcm[pcm_start_index]) + mem.append(coef * mem_ + pcm[pcm_start_index]) + skip = 0 + audio = np.round(mem).astype('int16') + + return {'audio': audio} + + def update_inputs_outputs_info(self, with_prefix): + prefix = self.default_model_suffix + '_' + self.input1 = generate_name(prefix, with_prefix, self.input1) + self.input2 = generate_name(prefix, with_prefix, self.input2) + self.rnn_input1 = generate_name(prefix, with_prefix, self.rnn_input1) + self.rnn_input2 = generate_name(prefix, with_prefix, self.rnn_input2) + self.output = generate_name(prefix, with_prefix, self.output) + self.rnn_output1 = generate_name(prefix, with_prefix, self.rnn_output1) + self.rnn_output2 = generate_name(prefix, with_prefix, self.rnn_output2) + + def infer(self, feed_dict): + raise NotImplementedError + + def prepare_model(self, launcher, network_info, delayed_model_loading=False): + raise NotImplementedError + + +class DecoderONNXModel(BaseONNXModel, DecoderModel): + pass + + +class DecoderOpenVINOModel(DecoderModel, TTSDLSDKModel): + def prepare_model(self, launcher, network_info, delayed_model_loading=False): + if not delayed_model_loading: + self.load_model(network_info, launcher, log=True) + + def infer(self, feed_dict): + return self.exec_network.infer(feed_dict) + + +def create_encoder(model_config, launcher, delayed_model_loading=False): + launcher_model_mapping = { + 'dlsdk': EncoderOpenVINOModel, + 'onnx_runtime': EncoderONNXModel, + } + framework = launcher.config['framework'] + model_class = launcher_model_mapping.get(framework) + if not model_class: + raise ValueError('model for framework {} is not supported'.format(framework)) + return model_class( + model_config['encoder'], launcher, 'encoder', model_config['nb_features'], model_config['nb_used_features'], + delayed_model_loading + ) + + +def create_decoder(model_config, launcher, delayed_model_loading=False): + launcher_model_mapping = { + 'dlsdk': DecoderOpenVINOModel, + 'onnx_runtime': DecoderONNXModel + } + framework = launcher.config['framework'] + model_class = launcher_model_mapping.get(framework) + if not model_class: + raise ValueError('model for framework {} is not supported'.format(framework)) + return model_class( + model_config['decoder'], launcher, 'decoder', model_config['frame_size'], + model_config['nb_features'], delayed_model_loading + ) + + +class LPCNetEvaluator(TextToSpeechEvaluator): + @classmethod + def from_configs(cls, config, delayed_model_loading=False): + dataset_config = config['datasets'] + launcher_config = config['launchers'][0] + if launcher_config['framework'] == 'dlsdk' and 'device' not in launcher_config: + launcher_config['device'] = 'CPU' + + launcher = create_launcher(launcher_config, delayed_model_loading=True) + model = SequentialModel( + config.get('network_info', {}), launcher, config.get('_models', []), config.get('_model_is_blob'), + delayed_model_loading + ) + return cls(dataset_config, launcher, model) diff --git a/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/mtcnn_evaluator.py b/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/mtcnn_evaluator.py index d6862cb5408..a838ae82283 100644 --- a/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/mtcnn_evaluator.py +++ b/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/mtcnn_evaluator.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ import cv2 from ..base_evaluator import BaseEvaluator -from ..quantization_model_evaluator import create_dataset_attributes +from ..quantization_model_evaluator import create_dataset_attributes from ...adapters import create_adapter, MTCNNPAdapter from ...launcher import create_launcher, InputFeeder from ...preprocessor import PreprocessingExecutor @@ -955,10 +955,10 @@ def pad(boxesA, h, w): def rerec(bboxA): w = bboxA[:, 2] - bboxA[:, 0] h = bboxA[:, 3] - bboxA[:, 1] - l = np.maximum(w, h).T - bboxA[:, 0] = bboxA[:, 0] + w * 0.5 - l * 0.5 - bboxA[:, 1] = bboxA[:, 1] + h * 0.5 - l * 0.5 - bboxA[:, 2:4] = bboxA[:, 0:2] + np.repeat([l], 2, axis=0).T + max_side = np.maximum(w, h).T + bboxA[:, 0] = bboxA[:, 0] + w * 0.5 - max_side * 0.5 + bboxA[:, 1] = bboxA[:, 1] + h * 0.5 - max_side * 0.5 + bboxA[:, 2:4] = bboxA[:, 0:2] + np.repeat([max_side], 2, axis=0).T return bboxA diff --git a/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/sequential_action_recognition_evaluator.py b/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/sequential_action_recognition_evaluator.py index 269b04369e7..0732200129d 100644 --- a/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/sequential_action_recognition_evaluator.py +++ b/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/sequential_action_recognition_evaluator.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/text_spotting_evaluator.py b/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/text_spotting_evaluator.py index ece0ec4acfa..c1626a9751b 100644 --- a/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/text_spotting_evaluator.py +++ b/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/text_spotting_evaluator.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -29,6 +29,11 @@ from ...logging import print_info +def softmax(x): + e_x = np.exp(x - np.max(x)) + return e_x / e_x.sum() + + class TextSpottingEvaluator(BaseEvaluator): def __init__(self, dataset_config, launcher, model): self.dataset_config = dataset_config @@ -386,6 +391,7 @@ def __init__(self, network_info, launcher, models_args, is_blob=None, delayed_mo self.alphabet = network_info['alphabet'] self.sos_index = int(network_info['sos_index']) self.eos_index = int(network_info['eos_index']) + self.confidence_threshold = float(network_info.get('recognizer_confidence_threshold', '0')) self.with_prefix = False self._part_by_name = { 'detector': self.detector, @@ -421,6 +427,7 @@ def predict(self, identifiers, input_data, frame_meta, callback): text = str() + confidence = 1.0 for _ in range(self.max_seq_len): input_to_decoder = { self.recognizer_decoder_inputs['prev_symbol']: prev_symbol_index, @@ -429,16 +436,17 @@ def predict(self, identifiers, input_data, frame_meta, callback): decoder_outputs = self.recognizer_decoder.predict(identifiers, input_to_decoder) if callback: callback(decoder_outputs) - coder_output = decoder_outputs[self.recognizer_decoder_outputs['symbols_distribution']] - prev_symbol_index = np.argmax(coder_output, axis=1) + decoder_output = decoder_outputs[self.recognizer_decoder_outputs['symbols_distribution']] + softmaxed = softmax(decoder_output[0]) + prev_symbol_index = np.argmax(decoder_output, axis=1) + confidence *= softmaxed[prev_symbol_index] if prev_symbol_index == self.eos_index: break hidden = decoder_outputs[self.recognizer_decoder_outputs['cur_hidden']] text += self.alphabet[int(prev_symbol_index)] - texts.append(text) + texts.append(text if confidence >= self.confidence_threshold else '') texts = np.array(texts) - detector_outputs['texts'] = texts output = self.adapter.process(detector_outputs, identifiers, frame_meta) return detector_outputs, output @@ -463,7 +471,7 @@ def get_network(self): {'name': 'detector', 'model': self.detector.get_network()}, {'name': 'recognizer_encoder', 'model': self.recognizer_encoder.get_network()}, {'name': 'recognizer_decoder', 'model': self.recognizer_decoder.get_network()} - ] + ] def update_inputs_outputs_info(self): def generate_name(prefix, with_prefix, layer_name): @@ -473,9 +481,9 @@ def generate_name(prefix, with_prefix, layer_name): isinstance(self.detector.im_data_name, str) and self.detector.im_data_name.startswith('detector_') ) if with_prefix != self.with_prefix: - self.detector.text_feats_out = generate_name('detector_', with_prefix, self.detector.text_feats_out) self.adapter.classes_out = generate_name('detector_', with_prefix, self.adapter.classes_out) - self.adapter.scores_out = generate_name('detector_', with_prefix, self.adapter.scores_out) + if self.adapter.scores_out is not None: + self.adapter.scores_out = generate_name('detector_', with_prefix, self.adapter.scores_out) self.adapter.boxes_out = generate_name('detector_', with_prefix, self.adapter.boxes_out) self.adapter.raw_masks_out = generate_name('detector_', with_prefix, self.adapter.raw_masks_out) self.recognizer_encoder_input = generate_name( @@ -509,19 +517,26 @@ def __init__(self, network_info, launcher, delayed_model_loading=False): OrderedDict([(name, data.input_data) for name, data in self.exec_network.input_info.items()]) if has_info else self.exec_network.inputs ) - self.im_info_name = [x for x in input_info if len(input_info[x].shape) == 2][0] + self.im_info_name = [x for x in input_info if len(input_info[x].shape) == 2] self.im_data_name = [x for x in input_info if len(input_info[x].shape) == 4][0] - self.text_feats_out = 'text_features' + if self.im_info_name: + self.im_info_name = self.im_info_name[0] + self.text_feats_out = 'detector_text_features' if self.im_data_name.startswith( + 'detector_') else 'text_features' + else: + self.text_feats_out = 'detector_text_features.0' if self.im_data_name.startswith( + 'detector_') else 'text_features.0' def predict(self, identifiers, input_data): - input_data = np.array(input_data) assert len(input_data.shape) == 4 assert input_data.shape[0] == 1 - input_data = {self.im_data_name: self.fit_to_input(input_data), - self.im_info_name: np.array( - [[input_data.shape[1], input_data.shape[2], 1.0]])} + if self.im_info_name: + input_data = {self.im_data_name: self.fit_to_input(input_data), + self.im_info_name: np.array([[input_data.shape[1], input_data.shape[2], 1.0]])} + else: + input_data = {self.im_data_name: self.fit_to_input(input_data)} output = self.exec_network.infer(input_data) @@ -554,8 +569,15 @@ def load_model(self, network_info, launcher, log=False): OrderedDict([(name, data.input_data) for name, data in self.exec_network.input_info.items()]) if has_info else self.exec_network.inputs ) - self.im_info_name = [x for x in input_info if len(input_info[x].shape) == 2][0] self.im_data_name = [x for x in input_info if len(input_info[x].shape) == 4][0] + self.im_info_name = [x for x in input_info if len(input_info[x].shape) == 2] + if self.im_info_name: + self.im_info_name = self.im_info_name[0] + self.text_feats_out = 'detector_text_features' if self.im_data_name.startswith( + 'detector_') else 'text_features' + else: + self.text_feats_out = 'detector_text_features.0' if self.im_data_name.startswith( + 'detector_') else 'text_features.0' if log: self.print_input_output_info() diff --git a/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/text_to_speech_evaluator.py b/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/text_to_speech_evaluator.py new file mode 100644 index 00000000000..768b1923c9c --- /dev/null +++ b/tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/text_to_speech_evaluator.py @@ -0,0 +1,498 @@ +""" +Copyright (c) 2018-2021 Intel Corporation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +from pathlib import Path +from functools import partial +from collections import OrderedDict +import numpy as np + +from ..base_evaluator import BaseEvaluator +from ..quantization_model_evaluator import create_dataset_attributes +from ...adapters import create_adapter +from ...config import ConfigError +from ...launcher import create_launcher +from ...utils import contains_all, extract_image_representations, get_path +from ...progress_reporters import ProgressReporter +from ...logging import print_info + + +class TextToSpeechEvaluator(BaseEvaluator): + def __init__(self, dataset_config, launcher, model): + self.dataset_config = dataset_config + self.preprocessor = None + self.dataset = None + self.postprocessor = None + self.metric_executor = None + self.launcher = launcher + self.model = model + self._metrics_results = [] + + @classmethod + def from_configs(cls, config, delayed_model_loading=False): + dataset_config = config['datasets'] + launcher_config = config['launchers'][0] + if launcher_config['framework'] == 'dlsdk' and 'device' not in launcher_config: + launcher_config['device'] = 'CPU' + + launcher = create_launcher(launcher_config, delayed_model_loading=True) + model = SequentialModel( + config.get('network_info', {}), launcher, config.get('_models', []), config.get('_model_is_blob'), + delayed_model_loading + ) + return cls(dataset_config, launcher, model) + + def process_dataset( + self, subset=None, + num_images=None, + check_progress=False, + dataset_tag='', + output_callback=None, + allow_pairwise_subset=False, + dump_prediction_to_annotation=False, + calculate_metrics=True, + **kwargs): + self._prepare_dataset(dataset_tag) + self._create_subset(subset, num_images, allow_pairwise_subset) + self._annotations, self._predictions = [], [] + if 'progress_reporter' in kwargs: + _progress_reporter = kwargs['progress_reporter'] + _progress_reporter.reset(self.dataset.size) + else: + _progress_reporter = None if not check_progress else self._create_progress_reporter( + check_progress, self.dataset.size + ) + compute_intermediate_metric_res = kwargs.get('intermediate_metrics_results', False) + if compute_intermediate_metric_res: + metric_interval = kwargs.get('metrics_interval', 1000) + ignore_results_formatting = kwargs.get('ignore_results_formatting', False) + for batch_id, (batch_input_ids, batch_annotation, batch_inputs, batch_identifiers) in enumerate(self.dataset): + batch_inputs = self.preprocessor.process(batch_inputs, batch_annotation) + batch_data, batch_meta = extract_image_representations(batch_inputs) + temporal_output_callback = None + if output_callback: + temporal_output_callback = partial(output_callback, + metrics_result=None, + element_identifiers=batch_identifiers, + dataset_indices=batch_input_ids) + + batch_raw_prediction, batch_prediction = self.model.predict( + batch_identifiers, batch_data, batch_meta, callback=temporal_output_callback + ) + batch_annotation, batch_prediction = self.postprocessor.process_batch(batch_annotation, batch_prediction) + metrics_result = None + if self.metric_executor and calculate_metrics: + metrics_result, _ = self.metric_executor.update_metrics_on_batch( + batch_input_ids, batch_annotation, batch_prediction + ) + if self.metric_executor.need_store_predictions: + self._annotations.extend(batch_annotation) + self._predictions.extend(batch_prediction) + + if output_callback: + output_callback( + batch_raw_prediction, + metrics_result=metrics_result, + element_identifiers=batch_identifiers, + dataset_indices=batch_input_ids + ) + if _progress_reporter: + _progress_reporter.update(batch_id, len(batch_prediction)) + if compute_intermediate_metric_res and _progress_reporter.current % metric_interval == 0: + self.compute_metrics( + print_results=True, ignore_results_formatting=ignore_results_formatting + ) + + if _progress_reporter: + _progress_reporter.finish() + + def compute_metrics(self, print_results=True, ignore_results_formatting=False): + if self._metrics_results: + del self._metrics_results + self._metrics_results = [] + + for result_presenter, evaluated_metric in self.metric_executor.iterate_metrics( + self._annotations, self._predictions + ): + self._metrics_results.append(evaluated_metric) + if print_results: + result_presenter.write_result(evaluated_metric, ignore_results_formatting) + + return self._metrics_results + + def extract_metrics_results(self, print_results=True, ignore_results_formatting=False): + if not self._metrics_results: + self.compute_metrics(False, ignore_results_formatting) + + result_presenters = self.metric_executor.get_metric_presenters() + extracted_results, extracted_meta = [], [] + for presenter, metric_result in zip(result_presenters, self._metrics_results): + result, metadata = presenter.extract_result(metric_result) + if isinstance(result, list): + extracted_results.extend(result) + extracted_meta.extend(metadata) + else: + extracted_results.append(result) + extracted_meta.append(metadata) + if print_results: + presenter.write_result(metric_result, ignore_results_formatting) + + return extracted_results, extracted_meta + + def print_metrics_results(self, ignore_results_formatting=False): + if not self._metrics_results: + self.compute_metrics(True, ignore_results_formatting) + return + result_presenters = self.metric_executor.get_metric_presenters() + for presenter, metric_result in zip(result_presenters, self._metrics_results): + presenter.write_result(metric_result, ignore_results_formatting) + + def set_profiling_dir(self, profiler_dir): + self.metric_executor.set_profiling_dir(profiler_dir) + + def release(self): + self.model.release() + self.launcher.release() + + def reset(self): + if self.metric_executor: + self.metric_executor.reset() + if hasattr(self, '_annotations'): + del self._annotations + del self._predictions + del self._input_ids + del self._metrics_results + self._annotations = [] + self._predictions = [] + self._input_ids = [] + self._metrics_results = [] + if self.dataset: + self.dataset.reset(self.postprocessor.has_processors) + + @staticmethod + def get_processing_info(config): + module_specific_params = config.get('module_config') + model_name = config['name'] + dataset_config = module_specific_params['datasets'][0] + launcher_config = module_specific_params['launchers'][0] + return ( + model_name, launcher_config['framework'], launcher_config['device'], + launcher_config.get('tags'), + dataset_config['name'] + ) + + def load_network(self, network=None): + self.model.load_network(network, self.launcher) + + def load_network_from_ir(self, models_dict): + self.model.load_model(models_dict, self.launcher) + + def get_network(self): + return self.model.get_network() + + def get_metrics_attributes(self): + if not self.metric_executor: + return {} + return self.metric_executor.get_metrics_attributes() + + def register_metric(self, metric_config): + if isinstance(metric_config, str): + self.metric_executor.register_metric({'type': metric_config}) + elif isinstance(metric_config, dict): + self.metric_executor.register_metric(metric_config) + else: + raise ValueError('Unsupported metric configuration type {}'.format(type(metric_config))) + + def register_postprocessor(self, postprocessing_config): + pass + + def register_dumped_annotations(self): + pass + + def select_dataset(self, dataset_tag): + if self.dataset is not None and isinstance(self.dataset_config, list): + return + dataset_attributes = create_dataset_attributes(self.dataset_config, dataset_tag) + self.dataset, self.metric_executor, self.preprocessor, self.postprocessor = dataset_attributes + + @staticmethod + def _create_progress_reporter(check_progress, dataset_size): + pr_kwargs = {} + if isinstance(check_progress, int) and not isinstance(check_progress, bool): + pr_kwargs = {"print_interval": check_progress} + + return ProgressReporter.provide('print', dataset_size, **pr_kwargs) + + def _prepare_dataset(self, dataset_tag=''): + if self.dataset is None or (dataset_tag and self.dataset.tag != dataset_tag): + self.select_dataset(dataset_tag) + + if self.dataset.batch is None: + self.dataset.batch = 1 + + def _create_subset(self, subset=None, num_images=None, allow_pairwise=False): + if subset is not None: + self.dataset.make_subset(ids=subset, accept_pairs=allow_pairwise) + elif num_images is not None: + self.dataset.make_subset(end=num_images, accept_pairs=allow_pairwise) + + +def create_network(model_config, launcher, delayed_model_loading=False): + launcher_model_mapping = { + 'dlsdk': TTSDLSDKModel + } + framework = launcher.config['framework'] + model_class = launcher_model_mapping.get(framework) + if not model_class: + raise ValueError('model for framework {} is not supported'.format(framework)) + return model_class(model_config, launcher, delayed_model_loading) + + +class SequentialModel: + def __init__(self, network_info, launcher, models_args, is_blob=None, delayed_model_loading=False): + if not delayed_model_loading: + forward_tacotron_duration = network_info.get('forward_tacotron_duration', {}) + forward_tacotron_regression = network_info.get('forward_tacotron_regression', {}) + melgan = network_info.get('melgan', {}) + if 'model' not in forward_tacotron_duration: + forward_tacotron_duration['model'] = models_args[0] + forward_tacotron_duration['_model_is_blob'] = is_blob + if 'model' not in forward_tacotron_regression: + forward_tacotron_regression['model'] = models_args[1 if len(models_args) > 1 else 0] + forward_tacotron_regression['_model_is_blob'] = is_blob + if 'model' not in melgan: + melgan['model'] = models_args[2 if len(models_args) > 2 else 0] + melgan['_model_is_blob'] = is_blob + network_info.update({ + 'forward_tacotron_duration': forward_tacotron_duration, + 'forward_tacotron_regression': forward_tacotron_regression, + 'melgan': melgan + }) + required_fields = ['forward_tacotron_duration', 'forward_tacotron_regression', 'melgan'] + if not contains_all(network_info, required_fields): + raise ConfigError( + 'network_info should contains: {} fields'.format(' ,'.join(required_fields)) + ) + self.forward_tacotron_duration = create_network( + network_info.get('forward_tacotron_duration', {}), launcher, delayed_model_loading + ) + self.forward_tacotron_regression = create_network( + network_info.get('forward_tacotron_regression', {}), launcher, delayed_model_loading + ) + self.melgan = create_network( + network_info.get('melgan', {}), launcher, delayed_model_loading + ) + self.forward_tacotron_duration_input = next(iter(self.forward_tacotron_duration.inputs)) + self.forward_tacotron_regression_input = next(iter(self.forward_tacotron_regression.inputs)) + self.melgan_input = next(iter(self.melgan.inputs)) + self.duration_output = 'duration' + self.embeddings_output = 'embeddings' + self.audio_output = 'audio' + self.max_mel_len = int(network_info['max_mel_len']) + self.adapter = create_adapter(network_info['adapter']) + self.adapter.output_blob = self.audio_output + + self.with_prefix = False + self._part_by_name = { + 'forward_tacotron_duration': self.forward_tacotron_duration, + 'forward_tacotron_regression': self.forward_tacotron_regression, + 'melgan': self.melgan + } + + def predict(self, identifiers, input_data, input_meta, callback=None): + assert len(identifiers) == 1 + + duration_output = self.forward_tacotron_duration.predict({self.forward_tacotron_duration_input: input_data[0]}) + if callback: + callback(duration_output) + + duration = duration_output[self.duration_output] + duration = (duration + 0.5).astype('int').flatten() + duration = np.expand_dims(duration, axis=0) + + preprocessed_embeddings = duration_output[self.embeddings_output] + indexes = self.build_index(duration, preprocessed_embeddings) + processed_embeddings = self.gather(preprocessed_embeddings, 1, indexes) + processed_embeddings = processed_embeddings[:, self.max_mel_len, :] + + mels = self.forward_tacotron_regression.predict({self.forward_tacotron_regression_input: processed_embeddings}) + if callback: + callback(mels) + melgan_input = mels[self.melgan_input] + if np.ndim(melgan_input) != 3: + melgan_input = np.expand_dims(melgan_input, 0) + melgan_input = melgan_input[:, :, :self.max_mel_len] + audio = self.melgan.predict({self.melgan_input: melgan_input}) + + return audio, self.adapter.process(audio, identifiers, input_meta) + + def release(self): + self.forward_tacotron_duration.release() + self.forward_tacotron_regression.release() + self.melgan.release() + + def load_model(self, network_list, launcher): + for network_dict in network_list: + self._part_by_name[network_dict['name']].load_model(network_dict, launcher) + self.update_inputs_outputs_info() + + def load_network(self, network_list, launcher): + for network_dict in network_list: + self._part_by_name[network_dict['name']].load_network(network_dict['model'], launcher) + self.update_inputs_outputs_info() + + def get_network(self): + return [ + {'name': 'forward_tacotron_duration', 'model': self.forward_tacotron_duration.get_network()}, + {'name': 'forward_tacotron_regression', 'model': self.forward_tacotron_regression.get_network()}, + {'name': 'melgan', 'model': self.melgan.get_network()} + ] + + @staticmethod + def build_index(duration, x): + duration[np.where(duration < 0)] = 0 + tot_duration = np.cumsum(duration, 1) + max_duration = int(tot_duration.max().item()) + index = np.zeros([x.shape[0], max_duration, x.shape[2]], dtype='long') + + for i in range(tot_duration.shape[0]): + pos = 0 + for j in range(tot_duration.shape[1]): + pos1 = tot_duration[i, j] + index[i, pos:pos1, :] = j + pos = pos1 + index[i, pos:, :] = tot_duration.shape[1] - 1 + return index + + @staticmethod + def gather(a, dim, index): + expanded_index = [ + index if dim == i else + np.arange(a.shape[i]).reshape([-1 if i == j else 1 for j in range(a.ndim)]) for i in range(a.ndim) + ] + return a[tuple(expanded_index)] + + def update_inputs_outputs_info(self): + def generate_name(prefix, with_prefix, layer_name): + return prefix + layer_name if with_prefix else layer_name.split(prefix)[-1] + + current_name = next(iter(self.forward_tacotron_duration.inputs)) + with_prefix = current_name.startswith('forward_tacotron_duration_') + if with_prefix != self.with_prefix: + self.duration_output = generate_name('forward_tacotron_duration_', with_prefix, self.duration_output) + self.embeddings_output = generate_name('forward_tacotron_duration', with_prefix, self.embeddings_output) + self.audio_output = generate_name('melgan', with_prefix, self.audio_output) + self.adapter.output_blob = self.audio_output + self.forward_tacotron_duration_input = next(iter(self.forward_tacotron_duration.inputs)) + self.forward_tacotron_regression_input = next(iter(self.forward_tacotron_regression.inputs)) + self.melgan_input = next(iter(self.melgan.inputs)) + + self.with_prefix = with_prefix + + +class TTSDLSDKModel: + def __init__(self, network_info, launcher, suffix, delayed_model_loading=False): + self.network_info = network_info + self.default_model_suffix = suffix + if not delayed_model_loading: + self.load_model(network_info, launcher, log=True) + + def predict(self, input_data): + return self.exec_network.infer(input_data) + + def release(self): + del self.network + del self.exec_network + + def automatic_model_search(self, network_info): + model = Path(network_info['model']) + if model.is_dir(): + is_blob = network_info.get('_model_is_blob') + if is_blob: + model_list = list(model.glob('*{}.blob'.format(self.default_model_suffix))) + if not model_list: + model_list = list(model.glob('*.blob')) + else: + model_list = list(model.glob('*{}.xml'.format(self.default_model_suffix))) + blob_list = list(model.glob('*{}.blob'.format(self.default_model_suffix))) + if not model_list and not blob_list: + model_list = list(model.glob('*.xml')) + blob_list = list(model.glob('*.blob')) + if not model_list: + model_list = blob_list + if not model_list: + raise ConfigError('Suitable model for {} not found'.format(self.default_model_suffix)) + if len(model_list) > 1: + raise ConfigError('Several suitable models for {} found'.format(self.default_model_suffix)) + model = model_list[0] + print_info('{} - Found model: {}'.format(self.default_model_suffix, model)) + if model.suffix == '.blob': + return model, None + weights = get_path(network_info.get('weights', model.parent / model.name.replace('xml', 'bin'))) + print_info('{} - Found weights: {}'.format(self.default_model_suffix, weights)) + + return model, weights + + def print_input_output_info(self): + print_info('{} - Input info:'.format(self.default_model_suffix)) + has_info = hasattr(self.network if self.network is not None else self.exec_network, 'input_info') + if self.network: + if has_info: + network_inputs = OrderedDict( + [(name, data.input_data) for name, data in self.network.input_info.items()] + ) + else: + network_inputs = self.network.inputs + network_outputs = self.network.outputs + else: + if has_info: + network_inputs = OrderedDict([ + (name, data.input_data) for name, data in self.exec_network.input_info.items() + ]) + else: + network_inputs = self.exec_network.inputs + network_outputs = self.exec_network.outputs + for name, input_info in network_inputs.items(): + print_info('\tLayer name: {}'.format(name)) + print_info('\tprecision: {}'.format(input_info.precision)) + print_info('\tshape {}\n'.format(input_info.shape)) + print_info('{} - Output info'.format(self.default_model_suffix)) + for name, output_info in network_outputs.items(): + print_info('\tLayer name: {}'.format(name)) + print_info('\tprecision: {}'.format(output_info.precision)) + print_info('\tshape: {}\n'.format(output_info.shape)) + + def load_network(self, network, launcher): + self.network = network + self.exec_network = launcher.ie_core.load_network(network, launcher.device) + + def get_network(self): + return self.network + + def load_model(self, network_info, launcher, log=False): + model, weights = self.automatic_model_search(network_info) + if weights is not None: + self.network = launcher.read_network(str(model), str(weights)) + self.exec_network = launcher.ie_core.load_network(self.network, launcher.device) + else: + self.exec_network = launcher.ie_core.import_network(str(model)) + if log: + self.print_input_output_info() + + @property + def inputs(self): + if self.network: + return self.network.input_info if hasattr(self.network, 'input_info') else self.network.inputs + return self.exec_network.input_info if hasattr(self.exec_network, 'input_info') else self.exec_network.inputs diff --git a/tools/accuracy_checker/accuracy_checker/evaluators/model_evaluator.py b/tools/accuracy_checker/accuracy_checker/evaluators/model_evaluator.py index 1425c258e4d..618086b0658 100644 --- a/tools/accuracy_checker/accuracy_checker/evaluators/model_evaluator.py +++ b/tools/accuracy_checker/accuracy_checker/evaluators/model_evaluator.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -19,13 +19,13 @@ from ..utils import get_path, extract_image_representations, is_path from ..dataset import Dataset -from ..launcher import create_launcher, DummyLauncher, InputFeeder -from ..launcher.loaders import PickleLoader +from ..launcher import create_launcher, DummyLauncher, InputFeeder, Launcher +from ..launcher.loaders import StoredPredictionBatch from ..logging import print_info, warning from ..metrics import MetricsExecutor from ..postprocessor import PostprocessingExecutor from ..preprocessor import PreprocessingExecutor -from ..adapters import create_adapter +from ..adapters import create_adapter, Adapter from ..config import ConfigError from ..data_readers import BaseReader, REQUIRES_ANNOTATIONS, DataRepresentation from .base_evaluator import BaseEvaluator @@ -58,6 +58,9 @@ def from_configs(cls, model_config): dataset_name = dataset_config['name'] data_reader_config = dataset_config.get('reader', 'opencv_imread') data_source = dataset_config.get('data_source') + postpone_model_loading = ( + not model_config.get('_store_only', False) and cls._is_stored(model_config.get('_stored_data')) + ) dataset = Dataset(dataset_config) if isinstance(data_reader_config, str): @@ -70,7 +73,7 @@ def from_configs(cls, model_config): if data_reader_type in REQUIRES_ANNOTATIONS: data_source = dataset.annotation data_reader = BaseReader.provide(data_reader_type, data_source, data_reader_config) - launcher_kwargs = {} + launcher_kwargs = {'delayed_model_loading': postpone_model_loading} enable_ie_preprocessing = ( dataset_config.get('_ie_preprocessing', False) if launcher_config['framework'] == 'dlsdk' else False @@ -90,13 +93,15 @@ def from_configs(cls, model_config): async_mode = launcher.async_mode if hasattr(launcher, 'async_mode') else False config_adapter = launcher_config.get('adapter') adapter = None if not config_adapter else create_adapter(config_adapter, launcher, dataset) + launcher_inputs = launcher.inputs if not postpone_model_loading else {} input_feeder = InputFeeder( - launcher.config.get('inputs', []), launcher.inputs, launcher.fit_to_input, launcher.default_layout, - launcher_config['framework'] == 'dummy', input_precision + launcher.config.get('inputs', []), launcher_inputs, launcher.fit_to_input, launcher.default_layout, + launcher_config['framework'] == 'dummy' or postpone_model_loading, input_precision ) - if input_precision: - launcher.update_input_configuration(input_feeder.inputs_config) - preprocessor.input_shapes = launcher.inputs_info_for_meta() + if not postpone_model_loading: + if input_precision: + launcher.update_input_configuration(input_feeder.inputs_config) + preprocessor.input_shapes = launcher.inputs_info_for_meta() postprocessor = PostprocessingExecutor(dataset_config.get('postprocessing'), dataset_name, dataset.metadata) metric_dispatcher = MetricsExecutor(dataset_config.get('metrics', []), dataset) if metric_dispatcher.profile_metrics: @@ -107,6 +112,69 @@ def from_configs(cls, model_config): preprocessor, postprocessor, dataset, metric_dispatcher, async_mode ) + @classmethod + def validate_config(cls, model_config): + uri_prefix = '' + if 'models' in model_config: + model_config = model_config['models'][0] + uri_prefix = 'models' + config_errors = [] + if 'launchers' not in model_config or not model_config['launchers']: + config_errors.append( + ConfigError( + 'launchers section is not provided', model_config.get('launchers', []), + '{}.launchers'.format(uri_prefix) if uri_prefix else 'launchers' + ) + ) + else: + for launcher_id, launcher_config in enumerate(model_config['launchers']): + adapter_config = launcher_config.get('adapter') + launcher_uri_prefix = '{}.launchers.{}'.format( + uri_prefix, launcher_id) if uri_prefix else 'launchers.{}'.format(launcher_id) + config_errors.extend( + Launcher.validate_config(launcher_config, fetch_only=True, uri_prefix=launcher_uri_prefix)) + if adapter_config: + adapter_uri = '{}.adapter'.format(launcher_uri_prefix) + config_errors.extend( + Adapter.validate_config(adapter_config, fetch_only=True, uri_prefix=adapter_uri)) + + datasets_uri = '{}.datasets'.format(uri_prefix) if uri_prefix else 'datasets' + if 'datasets' not in model_config or not model_config['datasets']: + config_errors.append( + ConfigError('datasets section is not provided', model_config.get('datasets', []), datasets_uri)) + else: + for dataset_id, dataset_config in enumerate(model_config['datasets']): + data_reader_config = dataset_config.get('reader', 'opencv_imread') + current_dataset_uri = '{}.{}'.format(datasets_uri, dataset_id) + config_errors.extend( + Dataset.validate_config(dataset_config, fetch_only=True, uri_prefix=current_dataset_uri) + ) + config_errors.extend( + BaseReader.validate_config( + data_reader_config, data_source=dataset_config.get('data_source'), fetch_only=True, + uri_prefix='{}.reader'.format(current_dataset_uri) + ) + ) + config_errors.extend( + PreprocessingExecutor.validate_config( + dataset_config.get('preprocessing'), fetch_only=True, + uri_prefix='{}.preprocessing'.format(current_dataset_uri) + ) + ) + config_errors.extend( + PostprocessingExecutor.validate_config( + dataset_config.get('postprocessing'), fetch_only=True, + uri_prefix='{}.postprocessing'.format(current_dataset_uri) + ) + ) + config_errors.extend( + MetricsExecutor.validate_config( + dataset_config.get('metrics', []), fetch_only=True, + uri_prefix='{}.metrics'.format(current_dataset_uri)) + ) + + return config_errors + @staticmethod def get_processing_info(config): launcher_config = config['launchers'][0] @@ -130,25 +198,22 @@ def _get_batch_input(self, batch_annotation): return filled_inputs, batch_meta, batch_identifiers def process_dataset_async(self, stored_predictions, progress_reporter, *args, **kwargs): - def _process_ready_predictions(batch_predictions, batch_identifiers, batch_meta, adapter): - if adapter: - batch_predictions = self.adapter.process(batch_predictions, batch_identifiers, batch_meta) - - return batch_predictions - def completion_callback(status_code, request_id): if status_code: warning('Request {} failed with status code {}'.format(request_id, status_code)) queued_irs.remove(request_id) ready_irs.append(request_id) - def prepare_dataset(): + def prepare_dataset(store_only_mode): if self.dataset.batch is None: self.dataset.batch = self.launcher.batch if progress_reporter: progress_reporter.reset(self.dataset.size) + if self._is_stored(stored_predictions) and store_only_mode: + self._reset_stored_predictions(stored_predictions) - prepare_dataset() + store_only = kwargs.get('store_only', False) + prepare_dataset(store_only) if ( self.launcher.allow_reshape_input or self.input_feeder.lstm_inputs or @@ -158,13 +223,12 @@ def prepare_dataset(): warning('Model can not to be processed in async mode. Switched to sync.') return self.process_dataset_sync(stored_predictions, progress_reporter, *args, **kwargs) - if self._is_stored(stored_predictions) or isinstance(self.launcher, DummyLauncher): - self._annotations, self._predictions = self._load_stored_predictions(stored_predictions, progress_reporter) + if (self._is_stored(stored_predictions) or isinstance(self.launcher, DummyLauncher)) and not store_only: + return self._load_stored_predictions(stored_predictions, progress_reporter) output_callback = kwargs.get('output_callback') metric_config = self._configure_metrics(kwargs, output_callback) _, compute_intermediate_metric_res, metric_interval, ignore_results_formatting = metric_config - predictions_to_store = [] dataset_iterator = iter(enumerate(self.dataset)) infer_requests_pool = {ir.request_id: ir for ir in self.launcher.get_async_requests()} free_irs = list(infer_requests_pool) @@ -182,23 +246,18 @@ def prepare_dataset(): ready_data = infer_requests_pool[ready_ir_id].get_result() (batch_id, batch_input_ids, batch_annotation), batch_meta, batch_raw_predictions = ready_data batch_identifiers = [annotation.identifier for annotation in batch_annotation] - batch_predictions = _process_ready_predictions( - batch_raw_predictions, batch_identifiers, batch_meta, self.adapter - ) free_irs.append(ready_ir_id) if stored_predictions: - predictions_to_store.extend(copy.deepcopy(batch_predictions)) - annotations, predictions = self.postprocessor.process_batch( - batch_annotation, batch_predictions, batch_meta - ) - self.metric_executor.update_metrics_on_batch(batch_input_ids, annotations, predictions) - - if self.metric_executor.need_store_predictions: - self._annotations.extend(annotations) - self._predictions.extend(predictions) + self.prepare_prediction_to_store( + batch_raw_predictions, batch_identifiers, batch_meta, stored_predictions + ) + if not store_only: + self._process_batch_results( + batch_raw_predictions, batch_annotation, batch_identifiers, + batch_input_ids, batch_meta, False, output_callback) if progress_reporter: - progress_reporter.update(batch_id, len(batch_predictions)) + progress_reporter.update(batch_id, len(batch_identifiers)) if compute_intermediate_metric_res and progress_reporter.current % metric_interval == 0: self.compute_metrics( print_results=True, ignore_results_formatting=ignore_results_formatting @@ -208,48 +267,33 @@ def prepare_dataset(): progress_reporter.finish() if stored_predictions: - self.store_predictions(stored_predictions, predictions_to_store) + print_info("prediction objects are save to {}".format(stored_predictions)) def process_dataset_sync(self, stored_predictions, progress_reporter, *args, **kwargs): if progress_reporter: progress_reporter.reset(self.dataset.size) - if self._is_stored(stored_predictions) or isinstance(self.launcher, DummyLauncher): - self._annotations, self._predictions = self.load(stored_predictions, progress_reporter) - self._annotations, self._predictions = self.postprocessor.full_process(self._annotations, self._predictions) + store_only = kwargs.get('store_only', False) - self.metric_executor.update_metrics_on_batch( - range(len(self._annotations)), self._annotations, self._predictions - ) + if (self._is_stored(stored_predictions) or isinstance(self.launcher, DummyLauncher)) and not store_only: + self._load_stored_predictions(stored_predictions, progress_reporter) return self._annotations, self._predictions if self.dataset.batch is None: self.dataset.batch = self.launcher.batch + if store_only and self._is_stored(stored_predictions): + self._reset_stored_predictions(stored_predictions) output_callback = kwargs.get('output_callback') metric_config = self._configure_metrics(kwargs, output_callback) enable_profiling, compute_intermediate_metric_res, metric_interval, ignore_results_formatting = metric_config - predictions_to_store = [] for batch_id, (batch_input_ids, batch_annotation) in enumerate(self.dataset): filled_inputs, batch_meta, batch_identifiers = self._get_batch_input(batch_annotation) batch_predictions = self.launcher.predict(filled_inputs, batch_meta, **kwargs) - - if self.adapter: - self.adapter.output_blob = self.adapter.output_blob or self.launcher.output_blob - batch_predictions = self.adapter.process(batch_predictions, batch_identifiers, batch_meta) - if stored_predictions: - predictions_to_store.extend(copy.deepcopy(batch_predictions)) - - annotations, predictions = self.postprocessor.process_batch(batch_annotation, batch_predictions, batch_meta) - _, profile_result = self.metric_executor.update_metrics_on_batch( - batch_input_ids, annotations, predictions, enable_profiling - ) - if output_callback: - callback_kwargs = {'profiling_result': profile_result} if enable_profiling else {} - output_callback(annotations, predictions, **callback_kwargs) - - if self.metric_executor.need_store_predictions: - self._annotations.extend(annotations) - self._predictions.extend(predictions) + self.prepare_prediction_to_store(batch_predictions, batch_identifiers, batch_meta, stored_predictions) + if not store_only: + self._process_batch_results( + batch_predictions, batch_annotation, batch_identifiers, + batch_input_ids, batch_meta, enable_profiling, output_callback) if progress_reporter: progress_reporter.update(batch_id, len(batch_predictions)) @@ -260,9 +304,30 @@ def process_dataset_sync(self, stored_predictions, progress_reporter, *args, **k progress_reporter.finish() if stored_predictions: - self.store_predictions(stored_predictions, predictions_to_store) + print_info("prediction objects are save to {}".format(stored_predictions)) return self._annotations, self._predictions + def _process_batch_results( + self, batch_predictions, batch_annotations, batch_identifiers, batch_input_ids, batch_meta, + enable_profiling=False, output_callback=None): + if self.adapter: + self.adapter.output_blob = self.adapter.output_blob or self.launcher.output_blob + batch_predictions = self.adapter.process(batch_predictions, batch_identifiers, batch_meta) + + annotations, predictions = self.postprocessor.process_batch( + batch_annotations, batch_predictions, batch_meta + ) + _, profile_result = self.metric_executor.update_metrics_on_batch( + batch_input_ids, annotations, predictions, enable_profiling + ) + if output_callback: + callback_kwargs = {'profiling_result': profile_result} if enable_profiling else {} + output_callback(annotations, predictions, **callback_kwargs) + + if self.metric_executor.need_store_predictions: + self._annotations.extend(annotations) + self._predictions.extend(predictions) + @staticmethod def _is_stored(stored_predictions=None): if not stored_predictions: @@ -275,13 +340,20 @@ def _is_stored(stored_predictions=None): return False def _load_stored_predictions(self, stored_predictions, progress_reporter): - self._annotations, self._predictions = self.load(stored_predictions, progress_reporter) - self._annotations, self._predictions = self.postprocessor.full_process(self._annotations, self._predictions) + predictions = self.load(stored_predictions, progress_reporter) + annotations = self.dataset.annotation + if self.postprocessor.has_processors: + print_info("Postprocess results:") + self.dataset.provide_data_info(self.reader, annotations, progress_reporter) + annotations, predictions = self.postprocessor.full_process(annotations, predictions) self.metric_executor.update_metrics_on_batch( - range(len(self._annotations)), self._annotations, self._predictions + range(len(annotations)), annotations, predictions ) + if self.metric_executor.need_store_predictions: + self._annotations = annotations + self._predictions = predictions - return self._annotations, self._predictions + return annotations, predictions def _fill_free_irs(self, free_irs, queued_irs, infer_requests_pool, dataset_iterator): for ir_id in free_irs: @@ -370,26 +442,24 @@ def print_metrics_results(self, ignore_results_formatting=False): presenter.write_result(metric_result, ignore_results_formatting) def load(self, stored_predictions, progress_reporter): - annotations = self.dataset.annotation - if self.postprocessor.has_processors: - self.dataset.provide_data_info(self.reader, annotations) launcher = self.launcher + identifiers = self.dataset.identifiers if not isinstance(launcher, DummyLauncher): launcher = DummyLauncher({ 'framework': 'dummy', - 'loader': PickleLoader.__provider__, - 'data_path': stored_predictions - }, adapter=None) + 'loader': 'pickle', + 'data_path': stored_predictions, + }, adapter=self.adapter, identifiers=identifiers, progress=progress_reporter) - identifiers = self.dataset.identifiers predictions = launcher.predict(identifiers) - if self.adapter is not None: - predictions = self.adapter.process(predictions, identifiers, []) - if progress_reporter: progress_reporter.finish(False) - return annotations, predictions + return predictions + + def prepare_prediction_to_store(self, batch_predictions, batch_identifiers, batch_meta, stored_predictions): + prediction_to_store = StoredPredictionBatch(batch_predictions, batch_identifiers, batch_meta) + self.store_predictions(stored_predictions, prediction_to_store) @property def metrics_results(self): @@ -402,11 +472,19 @@ def set_profiling_dir(self, profiler_dir): self.metric_executor.set_profiling_dir(profiler_dir) def _configure_metrics(self, config, output_callback): + store_only = config.get('store_only', False) enable_profiling = config.get('profile', False) profile_type = 'json' if output_callback and enable_profiling else config.get('profile_report_type') if enable_profiling: - self.metric_executor.enable_profiling(self.dataset, profile_type) + if not store_only: + self.metric_executor.enable_profiling(self.dataset, profile_type) + else: + warning("Metric profiling disabled for prediction storing mode") + enable_profiling = False compute_intermediate_metric_res = config.get('intermediate_metrics_results', False) + if compute_intermediate_metric_res and store_only: + warning("Metric calculation disabled for prediction storing mode") + compute_intermediate_metric_res = False metric_interval, ignore_results_formatting = None, None if compute_intermediate_metric_res: metric_interval = config.get('metrics_interval', 1000) @@ -416,9 +494,13 @@ def _configure_metrics(self, config, output_callback): @staticmethod def store_predictions(stored_predictions, predictions): # since at the first time file does not exist and then created we can not use it as a pathlib.Path object - with open(stored_predictions, "wb") as content: + with open(stored_predictions, "ab") as content: pickle.dump(predictions, content) - print_info("prediction objects are save to {}".format(stored_predictions)) + + @staticmethod + def _reset_stored_predictions(stored_predictions): + with open(stored_predictions, 'wb'): + print_info("File {} will be cleared for storing predictions".format(stored_predictions)) def reset_progress(self, progress_reporter): progress_reporter.reset(self.dataset.size) diff --git a/tools/accuracy_checker/accuracy_checker/evaluators/module_evaluator.py b/tools/accuracy_checker/accuracy_checker/evaluators/module_evaluator.py index afd0c102225..77ce4d4cf94 100644 --- a/tools/accuracy_checker/accuracy_checker/evaluators/module_evaluator.py +++ b/tools/accuracy_checker/accuracy_checker/evaluators/module_evaluator.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/evaluators/quantization_model_evaluator.py b/tools/accuracy_checker/accuracy_checker/evaluators/quantization_model_evaluator.py index 3d2be2ccbfa..752b04614d6 100644 --- a/tools/accuracy_checker/accuracy_checker/evaluators/quantization_model_evaluator.py +++ b/tools/accuracy_checker/accuracy_checker/evaluators/quantization_model_evaluator.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/launcher/__init__.py b/tools/accuracy_checker/accuracy_checker/launcher/__init__.py index 0b4b6c282c8..4e3eb600187 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/__init__.py +++ b/tools/accuracy_checker/accuracy_checker/launcher/__init__.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -53,6 +53,13 @@ 'tf_lite', "TensorFlow isn't installed. Please, install it before using. \n{}".format(import_error.msg) ) +try: + from .tf2_launcher import TF2Launcher +except ImportError as import_error: + TF2Launcher = unsupported_launcher( + 'tf2', "Tensorflow isn't installed. Please, install it before using. \n{}".format(import_error.msg) + ) + from .opencv_launcher import OpenCVLauncher try: diff --git a/tools/accuracy_checker/accuracy_checker/launcher/caffe_launcher.py b/tools/accuracy_checker/accuracy_checker/launcher/caffe_launcher.py index d8fc67266d3..88da46ec986 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/caffe_launcher.py +++ b/tools/accuracy_checker/accuracy_checker/launcher/caffe_launcher.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ import numpy as np from ..config import PathField, StringField, NumberField, BoolField, ConfigError -from .launcher import Launcher, LauncherConfigValidator +from .launcher import Launcher from ..logging import print_info DEVICE_REGEX = r'(?Pcpu$|gpu)(_(?P\d+))?' @@ -38,10 +38,7 @@ def __init__(self, config_entry: dict, *args, **kwargs): super().__init__(config_entry, *args, **kwargs) self._delayed_model_loading = kwargs.get('delayed_model_loading', False) - caffe_launcher_config = LauncherConfigValidator( - 'Caffe_Launcher', fields=self.parameters(), delayed_model_loading=self._delayed_model_loading - ) - caffe_launcher_config.validate(self.config) + self.validate_config(config_entry, delayed_model_loading=self._delayed_model_loading) self._do_reshape = False if not self._delayed_model_loading: @@ -104,7 +101,7 @@ def fit_to_input(self, data, layer_name, layout, precision): if layer_shape != data_shape: self._do_reshape = True - return data.astype(precision) if precision else precision + return data.astype(precision) if precision else data def automatic_model_search(self): model = Path(self.get_value_from_config('model')) diff --git a/tools/accuracy_checker/accuracy_checker/launcher/caffe_launcher_readme.md b/tools/accuracy_checker/accuracy_checker/launcher/caffe_launcher_readme.md index e47472bea99..38b4e04a85c 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/caffe_launcher_readme.md +++ b/tools/accuracy_checker/accuracy_checker/launcher/caffe_launcher_readme.md @@ -19,6 +19,7 @@ Each input description should has following info: * `IMAGE_INFO` - specific key for setting information about input shape to layer (used in Faster RCNN based topologies). You do not need provide `value`, because it will be calculated in runtime. Format value is `Nx[H, W, S]`, where `N` is batch size, `H` - original image height, `W` - original image width, `S` - scale of original image (default 1). * `ORIG_IMAGE_INFO` - specific key for setting information about original image size before preprocessing. * `INPUT` - network input for main data stream (e. g. images). If you have several data inputs, you should provide regular expression for identifier as `value` for specifying which one data should be provided in specific input. + * `IGNORE_INPUT` - input which should be stayed empty during evaluation. Optionally you can determine `shape` of input (actually does not used, Caffe launcher uses info given from network), `layout` in case when your model was trained with non-standard data layout (For Caffe default layout is `NCHW`). and `precision` (Supported precisions: `FP32` - float, `FP16` - signed shot, `U8` - unsigned char, `U16` - unsigned short int, `I8` - signed char, `I16` - short int, `I32` - int, `I64` - long int). diff --git a/tools/accuracy_checker/accuracy_checker/launcher/dlsdk_async_request.py b/tools/accuracy_checker/accuracy_checker/launcher/dlsdk_async_request.py index 39e47bbbd22..5b3b3d2863a 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/dlsdk_async_request.py +++ b/tools/accuracy_checker/accuracy_checker/launcher/dlsdk_async_request.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/launcher/dlsdk_launcher.py b/tools/accuracy_checker/accuracy_checker/launcher/dlsdk_launcher.py index b06ff019b01..5c346cccf1c 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/dlsdk_launcher.py +++ b/tools/accuracy_checker/accuracy_checker/launcher/dlsdk_launcher.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -62,6 +62,11 @@ except ImportError: Blob, TensorDesc = None, None +try: + import ngraph as ng +except ImportError as error: + ng = UnsupportedPackage('ngraph', error) + # pylint:disable=R0904 class DLSDKLauncher(Launcher): @@ -169,16 +174,19 @@ def __init__( if '_list_lstm_inputs' in self.config: self._configure_lstm_inputs() + @classmethod + def validate_config(cls, config, fetch_only=False, delayed_model_loading=False, uri_prefix=''): + return DLSDKLauncherConfigValidator( + uri_prefix or 'launcher.{}'.format(cls.__provider__), fields=cls.parameters(), + delayed_model_loading=delayed_model_loading + ).validate(config, fetch_only=fetch_only) + @property def device(self): return self._device @property def inputs(self): - """ - Returns: - inputs in NCHW format. - """ if self.network is None: has_info = hasattr(self.exec_network, 'input_info') if not has_info: @@ -195,16 +203,11 @@ def batch(self): @property def output_blob(self): - return next(iter(self.original_outputs)) + if hasattr(self, 'original_outputs'): + return next(iter(self.original_outputs)) + return None def predict(self, inputs, metadata=None, **kwargs): - """ - Args: - inputs: dictionary where keys are input layers names and values are data for them. - metadata: metadata of input representations - Returns: - raw data from network. - """ if self._lstm_inputs: return self._predict_sequential(inputs, metadata) @@ -301,6 +304,31 @@ def _set_affinity(self, affinity_map_path): for layer in custom_affinity: if layer not in automatic_affinity: raise ConfigError('Layer \'{layer}\' is not present in network'.format(layer=layer)) + if hasattr(self.network, 'layers'): + self._set_affinity_via_layers(custom_affinity, automatic_affinity) + return + if isinstance(ng, UnsupportedPackage): + ng.raise_error('affinity setting') + self._set_affinity_ng(custom_affinity, automatic_affinity) + + def _set_affinity_ng(self, custom_affinity, auto_affinity): + ng_function = ng.function_from_cnn(self.network) + for node in ng_function.get_ordered_ops(): + layer_name = node.get_friendly_name() + device = custom_affinity.get(layer_name, auto_affinity.get(layer_name)) + if device is None: + continue + if not (device in self._devices_list() or device == self._device): + raise ConfigError( + 'Device \'{device}\' set for \'{layer}\' layer is not present in ' + 'provided configuration \'{configuration}\''.format( + device=device, layer=layer_name, configuration=self._device + ) + ) + rt_info = node.get_rt_info() + rt_info["affinity"] = device + + def _set_affinity_via_layers(self, custom_affinity, automatic_affinity): layers = self.network.layers for layer_name in layers: device = custom_affinity.get(layer_name, automatic_affinity.get(layer_name)) @@ -462,7 +490,6 @@ def get_cpu_extensions_list(file_format, base_name, selection_mode): if not extension_list: raise ConfigError('suitable CPU extension lib not found in {}'.format(extensions_path)) - return extension_list[0] @staticmethod @@ -472,22 +499,18 @@ def convert_model(config, framework=None): config_model = config.get('{}_model'.format(framework.name), '') config_weights = config.get('{}_weights'.format(framework.name), '') config_meta = config.get('{}_meta'.format(framework.name), '') - mo_search_paths = [] model_optimizer = get_parameter_value_from_config(config, DLSDKLauncher.parameters(), '_model_optimizer') if model_optimizer: mo_search_paths.append(model_optimizer) - model_optimizer_directory_env = os.environ.get('MO_DIR') if model_optimizer_directory_env: mo_search_paths.append(model_optimizer_directory_env) - model_name = ( Path(config_model).name.rsplit('.', 1)[0] or Path(config_weights).name.rsplit('.', 1)[0] or Path(config_meta).name.rsplit('.', 1)[0] ) - should_log_mo_cmd = get_parameter_value_from_config(config, DLSDKLauncher.parameters(), 'should_log_cmd') return convert_model( @@ -536,7 +559,6 @@ def _reshape_input(self, shapes): if hasattr(self, 'exec_network'): del self.exec_network self.network.reshape(shapes) - self.exec_network = self.ie_core.load_network(self.network, self.device, num_requests=self._num_requests) def _set_batch_size(self, batch_size): @@ -559,14 +581,12 @@ def _set_batch_size(self, batch_size): if ind_batch != -1: layer_shape[ind_batch] = batch_size new_non_const_input_shapes[layer_name] = layer_shape - self.network.reshape({**const_inputs_shapes, **new_non_const_input_shapes}) def _align_data_shape(self, data, input_blob, data_layout): input_shape = self.inputs[input_blob].shape data_batch_size = data.shape[0] input_batch_size = input_shape[0] - if data_batch_size < input_batch_size: warning_message = 'data batch {} is not equal model input batch_size {}.'.format( data_batch_size, input_batch_size @@ -586,7 +606,6 @@ def _align_data_shape(self, data, input_blob, data_layout): self._target_layout_mapping[input_blob] = data_layout self._use_set_blob = True return data - return data.reshape(input_shape) if not self.disable_resize_to_input else data def _prepare_ie(self, log=True): @@ -597,7 +616,6 @@ def _prepare_ie(self, log=True): else: self.async_mode = self.get_value_from_config('async_mode') self._set_nireq() - if log: self._log_versions() self._device_specific_configuration() @@ -649,13 +667,7 @@ def _set_nireq(self): print_info('Infer requests number:{}'.format(self.num_requests)) def auto_num_requests(self, return_list=False): - concurrency_device = { - 'CPU': 1, - 'GPU': 1, - 'HDDL': 100, - 'MYRIAD': 4, - 'FPGA': 3 - } + concurrency_device = {'CPU': 1, 'GPU': 1, 'HDDL': 100, 'MYRIAD': 4, 'FPGA': 3} platform_list = self._devices_list() if 'CPU' in platform_list and len(platform_list) == 1: min_requests = [4, 5, 3] @@ -669,7 +681,6 @@ def auto_num_requests(self, return_list=False): per_device_requests = [] for device in platform_list: per_device_requests.append(concurrency_device.get(device, 1)) - return per_device_requests if return_list else sum(per_device_requests) def _prepare_multi_device(self, log=True): @@ -691,10 +702,8 @@ def _prepare_multi_device(self, log=True): num_per_device_requests = get_or_parse_value(self.config['num_request'], casting_type=int) else: num_per_device_requests = self.auto_num_requests(return_list=True) - if len(num_per_device_requests) == 1: num_per_device_requests = [num_per_device_requests[0]] * len(device_list) - if num_devices != len(num_per_device_requests): raise ConfigError('num requests for all {} should be specified'.format(num_devices)) self._num_requests = sum(num_per_device_requests) * 2 @@ -762,13 +771,10 @@ def output_preprocessing(output_string): if len(output_tuple) == 1: return output_string return tuple([output_tuple[0], int(output_tuple[1])]) - preprocessed_outputs = [output_preprocessing(output) for output in outputs] self.network.add_outputs(preprocessed_outputs) - if input_shapes is not None: self.network.reshape(input_shapes) - self._batch = self.config.get('batch', self.network.batch_size) if self._batch != self.network.batch_size: self._set_batch_size(self._batch) @@ -792,7 +798,6 @@ def load_network(self, network=None, log=False, preprocessing=None): self._print_input_output_info() if preprocessing: self._set_preprocess(preprocessing) - if self.network and not preprocessing: self.exec_network = self.ie_core.load_network( self.network, self._device, num_requests=self.num_requests @@ -805,7 +810,6 @@ def update_input_configuration(self, input_config): self._print_input_output_info() if self.preprocessor: self._set_preprocess(self.preprocessor) - if self.network: self.exec_network = self.ie_core.load_network( self.network, self._device, num_requests=self.num_requests @@ -821,7 +825,6 @@ def read_network(self, model, weights): network = self.ie_core.read_network(model=str(model), weights=str(weights)) else: network = ie.IENetwork(model=str(model), weights=str(weights)) - return network def inputs_info_for_meta(self): @@ -832,17 +835,14 @@ def inputs_info_for_meta(self): def fit_to_input(self, data, layer_name, layout, precision): layer_shape = tuple(self.inputs[layer_name].shape) - data = self._data_to_blob(layer_shape, data, layout) if precision: data = data.astype(precision) - data_shape = np.shape(data) if data_shape != layer_shape: if self.allow_reshape_input: self._do_reshape = True return data - return self._align_data_shape(data, layer_name, layout) @staticmethod @@ -851,32 +851,28 @@ def _data_to_blob(layer_shape, data, layout): # pylint:disable=R0911 if len(layer_shape) == 4: if len(data_shape) == 5: data = data[0] - if len(data_shape) < 4: if len(np.squeeze(np.zeros(layer_shape))) == len(np.squeeze(np.zeros(data_shape))): return np.resize(data, layer_shape) return np.transpose(data, layout) - if len(layer_shape) == 2: if len(data_shape) == 1: return np.transpose([data]) if len(data_shape) > 2: + if all([dim == 1 for dim in layer_shape]) and all([dim == 1 for dim in data_shape]): + return np.resize(data, layer_shape) if len(np.squeeze(np.zeros(layer_shape))) == len(np.squeeze(np.zeros(data_shape))): return np.resize(data, layer_shape) - if len(layer_shape) == 3 and len(data_shape) == 4: data = np.transpose(data, layout) return data[0] - if len(layer_shape) == len(layout): return np.transpose(data, layout) - if ( len(layer_shape) == 1 and len(data_shape) > 1 and len(np.squeeze(np.zeros(layer_shape))) == len(np.squeeze(np.zeros(data_shape))) ): return np.resize(data, layer_shape) - return np.array(data) def _set_precision(self): @@ -918,7 +914,6 @@ def _fill_lstm_inputs(self, infer_outputs=None): layer_shape = self.inputs[lstm_var].shape input_data = infer_outputs[output_layer].reshape(layer_shape) if infer_outputs else np.zeros(layer_shape) feed_dict[lstm_var] = input_data - return feed_dict def _print_input_output_info(self): diff --git a/tools/accuracy_checker/accuracy_checker/launcher/dlsdk_launcher_config.py b/tools/accuracy_checker/accuracy_checker/launcher/dlsdk_launcher_config.py index c41691f37f3..de901696c31 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/dlsdk_launcher_config.py +++ b/tools/accuracy_checker/accuracy_checker/launcher/dlsdk_launcher_config.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -38,16 +38,20 @@ class CPUExtensionPathField(PathField): def __init__(self, **kwargs): super().__init__(is_directory=False, **kwargs) - def validate(self, entry, field_uri=None): + def validate(self, entry, field_uri=None, fetch_only=False): + errors = [] if entry is None: - return + return errors field_uri = field_uri or self.field_uri validation_entry = '' try: validation_entry = Path(entry) except TypeError: - self.raise_error(entry, field_uri, "values is expected to be path-like") + msg = "values is expected to be path-like" + if not fetch_only: + self.raise_error(entry, field_uri, msg) + errors.append(self.build_error(entry, field_uri, msg)) is_directory = False if validation_entry.parts[-1] == 'AUTO': validation_entry = validation_entry.parent @@ -55,11 +59,21 @@ def validate(self, entry, field_uri=None): try: get_path(validation_entry, is_directory) except FileNotFoundError: - self.raise_error(validation_entry, field_uri, "path does not exist") + msg = "path does not exist" + if not fetch_only: + self.raise_error(validation_entry, field_uri, msg) + errors.append(self.build_error(validation_entry, field_uri, msg)) except NotADirectoryError: - self.raise_error(validation_entry, field_uri, "path is not a directory") + msg = "path is not a directory" + if not fetch_only: + self.raise_error(validation_entry, field_uri, msg) + errors.append(self.build_error(validation_entry, field_uri, msg)) except IsADirectoryError: - self.raise_error(validation_entry, field_uri, "path is a directory, regular file expected") + msg = "path is a directory, regular file expected" + if not fetch_only: + self.raise_error(validation_entry, field_uri, msg) + errors.append(self.build_error(validation_entry, field_uri, msg)) + return errors class DLSDKLauncherConfigValidator(LauncherConfigValidator): @@ -82,19 +96,22 @@ def create_device_regex(self, available_devices): ) self.fields['device'].set_regex(self.supported_device_regex) - def validate(self, entry, field_uri=None, ie_core=None): + def validate(self, entry, field_uri=None, ie_core=None, fetch_only=False): """ Validate that launcher entry meets all configuration structure requirements. Args: entry: launcher configuration file entry. field_uri: id of launcher entry. ie_core: IECore instance. + fetch_only: only fetch possible error without raising """ if not self.delayed_model_loading: framework_parameters = self.check_model_source(entry) self._set_model_source(framework_parameters) - super().validate(entry, field_uri) + error_stack = super().validate(entry, field_uri, fetch_only) self.create_device_regex(known_plugins) + if 'device' not in entry: + return error_stack try: self.fields['device'].validate(entry['device'], field_uri) except ConfigError as error: @@ -106,7 +123,10 @@ def validate(self, entry, field_uri=None, ie_core=None): # workaround for devices where this metric is non implemented warning('unknown device: {}'.format(entry['device'])) else: - raise error + if not fetch_only: + raise error + error_stack.append(error) + return error_stack def _set_model_source(self, framework): self.need_conversion = framework.name != 'dlsdk' diff --git a/tools/accuracy_checker/accuracy_checker/launcher/dlsdk_launcher_readme.md b/tools/accuracy_checker/accuracy_checker/launcher/dlsdk_launcher_readme.md index 99634ca3f72..c4769b8ec84 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/dlsdk_launcher_readme.md +++ b/tools/accuracy_checker/accuracy_checker/launcher/dlsdk_launcher_readme.md @@ -71,6 +71,7 @@ Each input description should has following info: * `ORIG_IMAGE_INFO` - specific key for setting information about original image size before preprocessing. * `INPUT` - network input for main data stream (e. g. images). If you have several data inputs, you should provide regular expression for identifier as `value` for specifying which one data should be provided in specific input. * `LSTM_INPUT` - input which should be filled by hidden state from previous iteration. The hidden state layer name should be provided via `value` parameter. + * `IGNORE_INPUT` - input which should be stayed empty during evaluation. Optionally you can determine `shape` of input (by default DLSDK launcher uses info given from network, this option allows override default. It required for running ONNX\* models with dynamic input shape on devices, where dynamic shape is not supported), `layout` in case when your model was trained with non-standard data layout (For DLSDK default layout is `NCHW`) and `precision` (Supported precisions: `FP32` - float, `FP16` - signed shot, `U8` - unsigned char, `U16` - unsigned short int, `I8` - signed char, `I16` - short int, `I32` - int, `I64` - long int). diff --git a/tools/accuracy_checker/accuracy_checker/launcher/dummy_launcher.py b/tools/accuracy_checker/accuracy_checker/launcher/dummy_launcher.py index e4dabfece24..0f027101e55 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/dummy_launcher.py +++ b/tools/accuracy_checker/accuracy_checker/launcher/dummy_launcher.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ from ..logging import print_info from ..config import PathField, StringField, BoolField from .loaders import Loader -from .launcher import Launcher, LauncherConfigValidator +from .launcher import Launcher class DummyLauncher(Launcher): @@ -42,9 +42,8 @@ def parameters(cls): def __init__(self, config_entry: dict, *args, **kwargs): super().__init__(config_entry, *args, **kwargs) - dummy_launcher_config = LauncherConfigValidator('Dummy_Launcher', fields=self.parameters()) - dummy_launcher_config.validate(self.config) - + self.validate_config(config_entry) + print_info('Predictions objects loading started') self.data_path = get_path(self.get_value_from_config('data_path')) identfiers_file = self.get_value_from_config('identifiers_list') if identfiers_file is not None: @@ -52,7 +51,7 @@ def __init__(self, config_entry: dict, *args, **kwargs): self._loader = Loader.provide(self.get_value_from_config('loader'), self.data_path, **kwargs) - print_info("{} predictions objects loaded from {}".format(len(self._loader), self.data_path)) + print_info("\n{} predictions objects loaded from {}".format(len(self._loader), self.data_path)) def predict(self, identifiers, *args, **kwargs): return [self._loader[identifier] for identifier in identifiers] diff --git a/tools/accuracy_checker/accuracy_checker/launcher/input_feeder.py b/tools/accuracy_checker/accuracy_checker/launcher/input_feeder.py index 241af40d701..0f01c41e2dd 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/input_feeder.py +++ b/tools/accuracy_checker/accuracy_checker/launcher/input_feeder.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -58,6 +58,8 @@ 'STR': np.str, # string } +INPUT_TYPES_WITHOUT_VALUE = ['IMAGE_INFO', 'ORIG_IMAGE_INFO', 'IGNORE_INPUT', 'LSTM_INPUT'] + class InputFeeder: def __init__( @@ -83,7 +85,7 @@ def configure(self, inputs_config, precisions_list): parsing_results = self._parse_inputs_config(inputs_config, self.default_layout, precisions_list) self.const_inputs, self.non_constant_inputs, self.inputs_mapping = parsing_results[:3] self.image_info_inputs, self.orig_image_info_inputs, self.lstm_inputs = parsing_results[3:6] - self.layouts_mapping, self.precision_mapping, self.inputs_config = parsing_results[6:] + self.ignore_inputs, self.layouts_mapping, self.precision_mapping, self.inputs_config = parsing_results[6:] if not self.non_constant_inputs: raise ConfigError('Network should contain at least one layer for setting variable data.') @@ -181,34 +183,26 @@ def _parse_inputs_config(self, inputs_entry, default_layout='NCHW', precisions_l image_info_inputs = [] orig_image_info_inputs = [] lstm_inputs = [] + ignore_inputs = [] for input_ in inputs_entry: name = input_['name'] if name not in self.network_inputs: raise ConfigError('network does not contain input "{}"'.format(name)) - - if input_['type'] == 'IMAGE_INFO': - image_info_inputs.append(name) - self.get_layer_precision(input_, name, precision_info, precisions) - continue - - if input_['type'] == 'ORIG_IMAGE_INFO': - orig_image_info_inputs.append(name) - self.get_layer_precision(input_, name, precision_info, precisions) - continue - - if input_['type'] == 'LSTM_INPUT': - lstm_inputs.append(name) - self.get_layer_precision(input_, name, precision_info, precisions) + if input_['type'] in INPUT_TYPES_WITHOUT_VALUE: + self._configure_inputs_without_value( + input_, image_info_inputs, orig_image_info_inputs, lstm_inputs, ignore_inputs, + precision_info, precisions) continue value = input_.get('value') if input_['type'] == 'CONST_INPUT': + precision = self.get_layer_precision(input_, name, precision_info, precisions) or np.float32 if isinstance(value, list): - value = np.array(value) - precision = self.get_layer_precision(input_, name, precision_info, precisions) - value = value.astype(precision) if precision is not None else value + value = np.array(value, dtype=precision) + if isinstance(value, (int, float)) and 'shape' in input_: + value = np.full(input_['shape'], value, dtype=precision) constant_inputs[name] = value else: config_non_constant_inputs.append(name) @@ -221,7 +215,7 @@ def _parse_inputs_config(self, inputs_entry, default_layout='NCHW', precisions_l all_config_inputs = ( config_non_constant_inputs + list(constant_inputs.keys()) + - image_info_inputs + lstm_inputs + orig_image_info_inputs + image_info_inputs + lstm_inputs + orig_image_info_inputs + ignore_inputs ) not_config_inputs = [input_layer for input_layer in self.network_inputs if input_layer not in all_config_inputs] if config_non_constant_inputs and not_config_inputs: @@ -239,11 +233,32 @@ def _parse_inputs_config(self, inputs_entry, default_layout='NCHW', precisions_l image_info_inputs, orig_image_info_inputs, lstm_inputs, + ignore_inputs, layouts, precisions, inputs_entry ) + def _configure_inputs_without_value( + self, input_config, image_info_inputs, + orig_image_info_inputs, lstm_inputs, ignore_inputs, + precision_info, precisions): + name = input_config['name'] + if input_config['type'] == 'IMAGE_INFO': + image_info_inputs.append(name) + self.get_layer_precision(input_config, name, precision_info, precisions) + + if input_config['type'] == 'ORIG_IMAGE_INFO': + orig_image_info_inputs.append(name) + self.get_layer_precision(input_config, name, precision_info, precisions) + + if input_config['type'] == 'LSTM_INPUT': + lstm_inputs.append(name) + self.get_layer_precision(input_config, name, precision_info, precisions) + + if input_config['type'] == 'IGNORE_INPUT': + ignore_inputs.append(name) + def _transform_batch(self, batch_data, meta): def calculate_num_splits(layers_data, batch_size): max_split_num = 1 diff --git a/tools/accuracy_checker/accuracy_checker/launcher/launcher.py b/tools/accuracy_checker/accuracy_checker/launcher/launcher.py index 0f83b02a860..d083a9e9aa7 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/launcher.py +++ b/tools/accuracy_checker/accuracy_checker/launcher/launcher.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ import numpy as np from ..adapters import AdapterField from ..config import ConfigValidator, StringField, ListField, ConfigError, InputField, ListInputsField -from ..dependency import ClassProvider +from ..dependency import ClassProvider, UnregisteredProviderException from ..utils import get_parameter_value_from_config, contains_all @@ -26,7 +26,7 @@ def __init__(self, config_uri, fields=None, delayed_model_loading=False, **kwarg super().__init__(config_uri, fields=fields, **kwarg) self.delayed_model_loading = delayed_model_loading - def validate(self, entry, field_uri=None): + def validate(self, entry, field_uri=None, fetch_only=False): if self.delayed_model_loading: if 'model' in self.fields: self.fields['model'].optional = True @@ -34,32 +34,55 @@ def validate(self, entry, field_uri=None): if 'weights' in self.fields: self.fields['weights'].optional = True self.fields['weights'].check_exists = False - super().validate(entry, field_uri) + error_stack = super().validate(entry, field_uri, fetch_only=fetch_only) + if 'inputs' in entry: + error_stack.extend(self._validate_inputs(entry, fetch_only=fetch_only)) + + return error_stack + + def _validate_inputs(self, entry, fetch_only): inputs = entry.get('inputs') + error_stack = [] count_non_const_inputs = 0 required_input_params = ['type', 'name'] - if inputs: - inputs_by_type = {input_type: [] for input_type in InputField.INPUTS_TYPES} - for input_layer in inputs: - if not contains_all(input_layer, required_input_params): - raise ConfigError('fields: {} are required for all input configurations'.format( - ', '.join(required_input_params))) - input_type = input_layer['type'] - if input_type not in InputField.INPUTS_TYPES: - raise ConfigError('undefined input type {}'.format(input_type)) - inputs_by_type[input_type].append(input_layer['name']) - if input_type == 'INPUT': - input_value = input_layer.get('value') - if not input_value and count_non_const_inputs: - raise ConfigError('input value should be specified in case of several non constant inputs') - count_non_const_inputs += 1 - - additional_attributes = { - '_list_{}s'.format(input_type.lower()): inputs for input_type, inputs in inputs_by_type.items() - } - - for additional_attribute, values in additional_attributes.items(): - entry[additional_attribute] = values + inputs_by_type = {input_type: [] for input_type in InputField.INPUTS_TYPES} + for input_layer in inputs: + if not contains_all(input_layer, required_input_params): + req = ', '.join(required_input_params) + reason = 'fields: {} are required for all input configurations'.format(req) + if not fetch_only: + raise ConfigError(reason) + error_stack.append(self.build_error(input_layer, '{}.inputs'.format(self.field_uri), reason)) + input_type = input_layer['type'] + if input_type not in InputField.INPUTS_TYPES: + reason = 'undefined input type {}'.format(input_type) + if not fetch_only: + raise ConfigError(reason) + error_stack.append( + self.build_error(input_type, '{}.inputs.{}'.format(self.field_uri, input_layer['name']), reason) + ) + inputs_by_type[input_type].append(input_layer['name']) + if input_type == 'INPUT': + reason = 'input value should be specified in case of several non constant inputs' + input_value = input_layer.get('value') + if not input_value and count_non_const_inputs: + if not fetch_only: + raise ConfigError(reason) + error_stack.append( + self.build_error( + input_layer, + '{}.inputs.{}'.format(self.field_uri, input_layer['name']), reason) + ) + count_non_const_inputs += 1 + + additional_attributes = { + '_list_{}s'.format(input_type.lower()): inputs for input_type, inputs in inputs_by_type.items() + } + + for additional_attribute, values in additional_attributes.items(): + entry[additional_attribute] = values + + return error_stack class Launcher(ClassProvider): @@ -76,6 +99,8 @@ def __init__(self, config_entry, *args, model_name='', **kwargs): self.const_inputs = self.config.get('_list_const_inputs', []) self.image_info_inputs = self.config.get('_list_image_infos', []) self._lstm_inputs = self.config.get('_list_lstm_inputs', []) + self._ignore_inputs = self.config.get('_list_ignore_inputs', []) + self._delayed_model_loading = kwargs.get('delayed_model_loading', False) @classmethod def parameters(cls): @@ -102,13 +127,39 @@ def parameters(cls): '_list_lstm_inputs': ListField( allow_empty=True, optional=True, default=[], description="List of lstm inputs." ), + '_list_ignore_inputs': ListField( + allow_empty=True, optional=True, default=[], description='List of ignored inputs' + ), '_input_precision': ListField( allow_empty=True, optional=True, default=[], description='Input precision list from command line.' ) } - def validate(self): - LauncherConfigValidator('Launcher', fields=self.parameters()).validate(self.config) + @classmethod + def validate_config(cls, config, delayed_model_loading=False, fetch_only=False, uri_prefix=''): + if cls.__name__ == Launcher.__name__: + errors = [] + framework = config.get('framework') + if not framework: + error = ConfigError('framework is not provided', config, uri_prefix or 'launcher') + if not fetch_only: + raise error + errors.append(error) + return errors + try: + launcher_cls = cls.resolve(framework) + return launcher_cls.validate_config(config, fetch_only=fetch_only, uri_prefix=uri_prefix) + except UnregisteredProviderException as exception: + if not fetch_only: + raise exception + errors.append( + ConfigError("launcher {} is not unregistered".format(framework), config, uri_prefix or 'launcher') + ) + return errors + uri = uri_prefix or'launcher.{}'.format(cls.__provider__) + return LauncherConfigValidator( + uri, fields=cls.parameters(), delayed_model_loading=delayed_model_loading + ).validate(config, fetch_only=fetch_only) def get_value_from_config(self, key): return get_parameter_value_from_config(self.config, self.parameters(), key) @@ -155,10 +206,10 @@ def fit_to_input(data, layer_name, layout, precision): data = np.array(data) return data.astype(precision) if precision else data - def inputs_info_for_meta(self): + def inputs_info_for_meta(self, *args, **kwargs): return { layer_name: shape for layer_name, shape in self.inputs.items() - if layer_name not in self.const_inputs + self.image_info_inputs + if layer_name not in self.const_inputs + self.image_info_inputs + self._ignore_inputs } def update_input_configuration(self, input_config): diff --git a/tools/accuracy_checker/accuracy_checker/launcher/loaders/__init__.py b/tools/accuracy_checker/accuracy_checker/launcher/loaders/__init__.py index e51d25d0c96..8af97c5215d 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/loaders/__init__.py +++ b/tools/accuracy_checker/accuracy_checker/launcher/loaders/__init__.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ limitations under the License. """ -from .loader import Loader +from .loader import Loader, StoredPredictionBatch from .pickle_loader import PickleLoader from .xml_loader import XMLLoader @@ -24,5 +24,7 @@ 'Loader', 'PickleLoader', 'XMLLoader', - 'JSONLoader' + 'JSONLoader', + + 'StoredPredictionBatch' ] diff --git a/tools/accuracy_checker/accuracy_checker/launcher/loaders/json_loader.py b/tools/accuracy_checker/accuracy_checker/launcher/loaders/json_loader.py index 4430cf89868..efb074a77e3 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/loaders/json_loader.py +++ b/tools/accuracy_checker/accuracy_checker/launcher/loaders/json_loader.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -26,8 +26,12 @@ class JSONLoader(DictLoaderMixin, Loader): __provider__ = 'json' - def load(self, identifiers=None, **kwargs): + def load(self, identifiers=None, adapter=None, **kwargs): + progress_reporter = kwargs.get('progress') detection_list = read_json(self._data_path) + if progress_reporter: + num_iters = len(identifiers) if identifiers else len(detection_list) + progress_reporter.reset(num_iters) data = defaultdict(dict) idx = 0 for detection in detection_list: @@ -37,5 +41,12 @@ def load(self, identifiers=None, **kwargs): break identifier = identifiers[idx] if identifiers else idx idx += 1 + if adapter: + detection = adapter.process(detection, [identifier], [{}]) data[identifier] = detection + if progress_reporter: + progress_reporter.update(idx, 1) return data + + def __getitem__(self, item): + return self.data[item] diff --git a/tools/accuracy_checker/accuracy_checker/launcher/loaders/loader.py b/tools/accuracy_checker/accuracy_checker/launcher/loaders/loader.py index d78baa8fd18..79c7c3750c7 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/loaders/loader.py +++ b/tools/accuracy_checker/accuracy_checker/launcher/loaders/loader.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -15,10 +15,14 @@ """ from pathlib import Path +from collections import namedtuple from ...dependency import ClassProvider +StoredPredictionBatch = namedtuple('StoredPredictionBatch', ['raw_predictions', 'identifiers', 'meta']) + + class Loader(ClassProvider): """ Interface that describes loading output from another tool. @@ -45,8 +49,8 @@ def __len__(self): return len(self.data) def __getitem__(self, item): - # if item not in self.data: - # raise IndexError('There is no prediction object for "{}" input data'.format(item)) + if item not in self.data: + raise IndexError('There is no prediction object for "{}" input data'.format(item)) return self.data[item] diff --git a/tools/accuracy_checker/accuracy_checker/launcher/loaders/pickle_loader.py b/tools/accuracy_checker/accuracy_checker/launcher/loaders/pickle_loader.py index 295c82c5a2d..3778124a0af 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/loaders/pickle_loader.py +++ b/tools/accuracy_checker/accuracy_checker/launcher/loaders/pickle_loader.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,8 +14,8 @@ limitations under the License. """ -from ...utils import read_pickle -from .loader import Loader, DictLoaderMixin +import pickle +from .loader import Loader, DictLoaderMixin, StoredPredictionBatch class PickleLoader(DictLoaderMixin, Loader): @@ -26,9 +26,50 @@ class PickleLoader(DictLoaderMixin, Loader): __provider__ = 'pickle' def load(self, *args, **kwargs): - data = read_pickle(self._data_path) + progress_reporter = kwargs.get('progress') + data = self.read_pickle(self._data_path) - if isinstance(data, list) and all(hasattr(entry, 'identifier') for entry in data): - return dict(zip([representation.identifier for representation in data], data)) + if isinstance(data, list): + if progress_reporter: + progress_reporter.reset(len(data)) + if all(isinstance(entry, StoredPredictionBatch) for entry in data): + return self.load_batched_predictions(data, kwargs.get('adapter'), progress_reporter) + + if all(hasattr(entry, 'identifier') for entry in data): + predictions = {} + for idx, rep in enumerate(data): + predictions[rep.identifier] = rep + if progress_reporter: + progress_reporter.update(idx, 1) + return predictions + if 'identifiers' in kwargs: + identifiers = kwargs['identifiers'] + return dict(zip(identifiers, data)) return data + + @staticmethod + def read_pickle(data_path): + result = [] + with open(data_path, 'rb') as content: + while True: + try: + result.append(pickle.load(content)) + except EOFError: + break + return result + + @staticmethod + def load_batched_predictions(data, adapter=None, progress_reporter=None): + predictions = {} + for idx, entry in enumerate(data): + if adapter: + pred_list = adapter.process(*entry) + for pred in pred_list: + predictions[pred.identifier] = pred + else: + for identifier in entry.identifiers: + predictions[identifier] = entry + if progress_reporter: + progress_reporter.update(idx, 1) + return predictions diff --git a/tools/accuracy_checker/accuracy_checker/launcher/loaders/xml_loader.py b/tools/accuracy_checker/accuracy_checker/launcher/loaders/xml_loader.py index 1ac0f6cc8cb..e5e56abfc1b 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/loaders/xml_loader.py +++ b/tools/accuracy_checker/accuracy_checker/launcher/loaders/xml_loader.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/launcher/model_conversion.py b/tools/accuracy_checker/accuracy_checker/launcher/model_conversion.py index be8436ef959..be4fecaaec9 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/model_conversion.py +++ b/tools/accuracy_checker/accuracy_checker/launcher/model_conversion.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/launcher/mxnet_launcher.py b/tools/accuracy_checker/accuracy_checker/launcher/mxnet_launcher.py index d8868002f85..754a760e3c3 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/mxnet_launcher.py +++ b/tools/accuracy_checker/accuracy_checker/launcher/mxnet_launcher.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -26,13 +26,17 @@ class MxNetLauncherConfigValidator(LauncherConfigValidator): - def validate(self, entry, field_uri=None): - super().validate(entry, field_uri) - inputs = entry['inputs'] - - for input_layer in inputs: - if 'shape' not in input_layer: - raise ConfigError('shape for input {} is not provided'.format(input_layer['name'])) + def validate(self, entry, field_uri=None, fetch_only=False): + self.fields['inputs'].optional = self.delayed_model_loading + error_stack = super().validate(entry, field_uri) + if not self.delayed_model_loading: + inputs = entry.get('inputs') + for input_layer in inputs: + if 'shape' not in input_layer: + if not fetch_only: + raise ConfigError('input value should have shape field') + error_stack.extend(self.build_error(entry, field_uri, 'input value should have shape field')) + return error_stack class MxNetLauncher(Launcher): @@ -64,10 +68,7 @@ def __init__(self, config_entry: dict, *args, **kwargs): super().__init__(config_entry, *args, **kwargs) self._delayed_model_loading = kwargs.get('delayed_model_loading', False) - mxnet_launcher_config = MxNetLauncherConfigValidator( - 'MxNet_Launcher', fields=self.parameters(), delayed_model_loading=self._delayed_model_loading - ) - mxnet_launcher_config.validate(self.config) + self.validate_config(config_entry, delayed_model_loading=self._delayed_model_loading) if not self._delayed_model_loading: # Get model name, prefix, epoch self.model = self.automatic_model_search() @@ -118,6 +119,13 @@ def fit_to_input(self, data, input_layer, layout, precision): def inputs(self): return self._inputs + @classmethod + def validate_config(cls, config, fetch_only=False, delayed_model_loading=False, uri_prefix=''): + return MxNetLauncherConfigValidator( + uri_prefix or 'launcher.{}'.format(cls.__provider__), fields=cls.parameters(), + delayed_model_loading=delayed_model_loading + ).validate(config, fetch_only=fetch_only) + def predict(self, inputs, metadata=None, **kwargs): """ Args: diff --git a/tools/accuracy_checker/accuracy_checker/launcher/mxnet_launcher_readme.md b/tools/accuracy_checker/accuracy_checker/launcher/mxnet_launcher_readme.md index d672ed4d1cd..d364d5ac118 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/mxnet_launcher_readme.md +++ b/tools/accuracy_checker/accuracy_checker/launcher/mxnet_launcher_readme.md @@ -13,6 +13,7 @@ Each input description should has following info: * `CONST_INPUT` - input will be filled using constant provided in config. It also requires to provide `value`. * `IMAGE_INFO` - specific key for setting information about input shape to layer (used in Faster RCNN based topologies). You do not need provide `value`, because it will be calculated in runtime. Format value is `Nx[H, W, S]`, where `N` is batch size, `H` - original image height, `W` - original image width, `S` - scale of original image (default 1). * `ORIG_IMAGE_INFO` - specific key for setting information about original image size before preprocessing. + * `IGNORE_INPUT` - input which should be stayed empty during evaluation. * `INPUT` - network input for main data stream (e. g. images). If you have several data inputs, you should provide regular expression for identifier as `value` for specifying which one data should be provided in specific input. * `shape` - shape of input layer described as comma-separated of all dimensions size except batch size. Optionally you can determine `layout` in case when your model was trained with non-standard data layout (For MXNet default layout is `NCHW`) diff --git a/tools/accuracy_checker/accuracy_checker/launcher/onnx_launcher.py b/tools/accuracy_checker/accuracy_checker/launcher/onnx_launcher.py index 15fea83a8bf..65edcd33958 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/onnx_launcher.py +++ b/tools/accuracy_checker/accuracy_checker/launcher/onnx_launcher.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ import onnxruntime as onnx_rt from ..logging import warning from ..config import PathField, StringField, ListField, ConfigError -from .launcher import Launcher, LauncherConfigValidator +from .launcher import Launcher from ..utils import contains_all from ..logging import print_info @@ -36,10 +36,7 @@ def __init__(self, config_entry: dict, *args, **kwargs): super().__init__(config_entry, *args, **kwargs) self._delayed_model_loading = kwargs.get('delayed_model_loading', False) - onnx_launcher_config = LauncherConfigValidator( - 'ONNX_Launcher', fields=self.parameters(), delayed_model_loading=self._delayed_model_loading, - ) - onnx_launcher_config.validate(self.config) + self.validate_config(config_entry, delayed_model_loading=self._delayed_model_loading) if not self._delayed_model_loading: self.model = self.automatic_model_search() self._inference_session = self.create_inference_session(str(self.model)) @@ -149,4 +146,5 @@ def predict_async(self, *args, **kwargs): raise ValueError('ONNX Runtime Launcher does not support async mode yet') def release(self): - del self._inference_session + if hasattr(self, '_inference_session'): + del self._inference_session diff --git a/tools/accuracy_checker/accuracy_checker/launcher/onnx_runtime_launcher_readme.md b/tools/accuracy_checker/accuracy_checker/launcher/onnx_runtime_launcher_readme.md index 991e4c7b49b..1548710bb65 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/onnx_runtime_launcher_readme.md +++ b/tools/accuracy_checker/accuracy_checker/launcher/onnx_runtime_launcher_readme.md @@ -19,6 +19,7 @@ Each input description should has following info: * `CONST_INPUT` - input will be filled using constant provided in config. It also requires to provide `value`. * `IMAGE_INFO` - specific key for setting information about input shape to layer (used in Faster RCNN based topologies). You do not need provide `value`, because it will be calculated in runtime. Format value is `Nx[H, W, S]`, where `N` is batch size, `H` - original image height, `W` - original image width, `S` - scale of original image (default 1). * `ORIG_IMAGE_INFO` - specific key for setting information about original image size before preprocessing. + * `IGNORE_INPUT` - input which should be stayed empty during evaluation. * `INPUT` - network input for main data stream (e. g. images). If you have several data inputs, you should provide regular expression for identifier as `value` for specifying which one data should be provided in specific input. Optionally you can determine `shape` of input (actually does not used, ONNX Runtime launcher uses info given from network),`layout` in case when your model was trained with non-standard data layout (For ONNX Runtime default layout is `NCHW`) and `precision` (Supported precisions: `FP32` - float, `FP16` - signed shot, `U8` - unsigned char, `U16` - unsigned short int, `I8` - signed char, `I16` - short int, `I32` - int, `I64` - long int). diff --git a/tools/accuracy_checker/accuracy_checker/launcher/opencv_launcher.py b/tools/accuracy_checker/accuracy_checker/launcher/opencv_launcher.py index 1091a1693bb..72432422d97 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/opencv_launcher.py +++ b/tools/accuracy_checker/accuracy_checker/launcher/opencv_launcher.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -29,14 +29,17 @@ class OpenCVLauncherConfigValidator(LauncherConfigValidator): - def validate(self, entry, field_uri=None): + def validate(self, entry, field_uri=None, fetch_only=False): self.fields['inputs'].optional = self.delayed_model_loading - super().validate(entry, field_uri) + error_stack = super().validate(entry, field_uri) if not self.delayed_model_loading: inputs = entry.get('inputs') for input_layer in inputs: if 'shape' not in input_layer: - raise ConfigError('input value should have shape field') + if not fetch_only: + raise ConfigError('input value should have shape field') + error_stack.extend(self.build_error(entry, field_uri, 'input value should have shape field')) + return error_stack class OpenCVLauncher(Launcher): @@ -78,11 +81,7 @@ def parameters(cls): def __init__(self, config_entry: dict, *args, **kwargs): super().__init__(config_entry, *args, **kwargs) self._delayed_model_loading = kwargs.get('delayed_model_loading', False) - - opencv_launcher_config = OpenCVLauncherConfigValidator( - 'OpenCV_Launcher', fields=self.parameters(), delayed_model_loading=self._delayed_model_loading - ) - opencv_launcher_config.validate(self.config) + self.validate_config(config_entry, delayed_model_loading=self._delayed_model_loading) match = re.match(BACKEND_REGEX, self.get_value_from_config('backend').lower()) selected_backend = match.group('backend') print_info('backend: {}'.format(selected_backend)) @@ -108,6 +107,13 @@ def __init__(self, config_entry: dict, *args, **kwargs): self.network.setInputsNames(list(self._inputs_shapes.keys())) self.output_names = self.network.getUnconnectedOutLayersNames() + @classmethod + def validate_config(cls, config, fetch_only=False, delayed_model_loading=False, uri_prefix=''): + return OpenCVLauncherConfigValidator( + uri_prefix or 'launcher.{}'.format(cls.__provider__), + fields=cls.parameters(), delayed_model_loading=delayed_model_loading + ).validate(config, fetch_only=fetch_only) + @property def inputs(self): """ diff --git a/tools/accuracy_checker/accuracy_checker/launcher/opencv_launcher_readme.md b/tools/accuracy_checker/accuracy_checker/launcher/opencv_launcher_readme.md index 325e0cb6443..5b9d0d8a1ec 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/opencv_launcher_readme.md +++ b/tools/accuracy_checker/accuracy_checker/launcher/opencv_launcher_readme.md @@ -15,6 +15,7 @@ Each input description should has following info: * `CONST_INPUT` - input will be filled using constant provided in config. It also requires to provide `value`. * `IMAGE_INFO` - specific key for setting information about input shape to layer (used in Faster RCNN based topologies). You do not need provide `value`, because it will be calculated in runtime. Format value is `Nx[H, W, S]`, where `N` is batch size, `H` - original image height, `W` - original image width, `S` - scale of original image (default 1). * `ORIG_IMAGE_INFO` - specific key for setting information about original image size before preprocessing. + * `IGNORE_INPUT` - input which should be stayed empty during evaluation. * `INPUT` - network input for main data stream (e. g. images). If you have several data inputs, you should provide regular expression for identifier as `value` for specifying which one data should be provided in specific input. * `shape` - shape of input layer described as comma-separated of all dimensions size except batch size. Optionally you can determine `layout` in case when your model was trained with non-standard data layout (For OpenCV default layout is `NCHW`) and `precision` (Supported precisions: `FP32` - float, `FP16` - signed shot, `U8` - unsigned char, `U16` - unsigned short int, `I8` - signed char, `I16` - short int, `I32` - int, `I64` - long int). diff --git a/tools/accuracy_checker/accuracy_checker/launcher/pytorch_launcher.py b/tools/accuracy_checker/accuracy_checker/launcher/pytorch_launcher.py index 078cade74a5..d7ac60344a9 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/pytorch_launcher.py +++ b/tools/accuracy_checker/accuracy_checker/launcher/pytorch_launcher.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ import numpy as np from ..config import PathField, StringField, DictField, NumberField, ListField -from .launcher import Launcher, LauncherConfigValidator +from .launcher import Launcher MODULE_REGEX = r'(?:\w+)(?:(?:.\w+)*)' DEVICE_REGEX = r'(?Pcpu$|cuda)?' @@ -43,7 +43,7 @@ def parameters(cls): description='appendix for PYTHONPATH for making network module visible in current python environment' ), 'module_args': ListField(optional=True, description='positional arguments for network module'), - 'module_kwargs': DictField( + 'module_kwargs': DictField( key_type=str, validate_values=False, optional=True, default={}, description='keyword arguments for network module' ), @@ -64,8 +64,7 @@ def __init__(self, config_entry: dict, *args, **kwargs): except ImportError as import_error: raise ValueError("PyTorch isn't installed. Please, install it before using. \n{}".format(import_error.msg)) self._torch = torch - pytorch_launcher_config = LauncherConfigValidator('Pytorch_Launcher', fields=self.parameters()) - pytorch_launcher_config.validate(self.config) + self.validate_config(config_entry) module_args = config_entry.get("module_args", ()) module_kwargs = config_entry.get("module_kwargs", {}) self.cuda = 'cuda' in self.get_value_from_config('device') diff --git a/tools/accuracy_checker/accuracy_checker/launcher/pytorch_launcher_readme.md b/tools/accuracy_checker/accuracy_checker/launcher/pytorch_launcher_readme.md index c7dd4e89d09..039b3020324 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/pytorch_launcher_readme.md +++ b/tools/accuracy_checker/accuracy_checker/launcher/pytorch_launcher_readme.md @@ -17,6 +17,7 @@ Each input description should has following info: * `CONST_INPUT` - input will be filled using constant provided in config. It also requires to provide `value`. * `IMAGE_INFO` - specific key for setting information about input shape to layer (used in Faster RCNN based topologies). You do not need provide `value`, because it will be calculated in runtime. Format value is `Nx[H, W, S]`, where `N` is batch size, `H` - original image height, `W` - original image width, `S` - scale of original image (default 1). * `ORIG_IMAGE_INFO` - specific key for setting information about original image size before preprocessing. + * `IGNORE_INPUT` - input which should be stayed empty during evaluation. * `INPUT` - network input for main data stream (e. g. images). If you have several data inputs, you should provide regular expression for identifier as `value` for specifying which one data should be provided in specific input. * `shape` - shape of input layer described as comma-separated of all dimensions size except batch size. Optionally you can determine `layout` in case when your model was trained with non-standard data layout (For PyTorch default layout is `NCHW`) and`precision` (Supported precisions: `FP32` - float, `FP16` - signed shot, `U8` - unsigned char, `U16` - unsigned short int, `I8` - signed char, `I16` - short int, `I32` - int, `I64` - long int). diff --git a/tools/accuracy_checker/accuracy_checker/launcher/tf2_launcher.py b/tools/accuracy_checker/accuracy_checker/launcher/tf2_launcher.py new file mode 100644 index 00000000000..7ab8fb2e295 --- /dev/null +++ b/tools/accuracy_checker/accuracy_checker/launcher/tf2_launcher.py @@ -0,0 +1,132 @@ +""" +Copyright (c) 2018-2021 Intel Corporation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +import numpy as np +from .launcher import Launcher +from ..config import BaseField, ListField, PathField, StringField, ConfigError + + +class TF2Launcher(Launcher): + __provider__ = 'tf2' + + @classmethod + def parameters(cls): + parameters = super().parameters() + parameters.update({ + 'saved_model_dir': PathField(is_directory=True, optional=True, description='Path to saved model directory'), + 'device': StringField( + choices=('cpu', 'gpu'), default='cpu', optional=True, description="Device name: cpu or gpu"), + 'inputs': BaseField(optional=True, description="Inputs."), + 'output_names': ListField( + allow_empty=False, optional=True, value_type=StringField(), description="Output names." + ) + }) + return parameters + + def __init__(self, config_entry, *args, **kwargs): + super().__init__(config_entry, *args, **kwargs) + try: + import tensorflow # pylint: disable=C0415 + if tensorflow.__version__ < '2.0.0': + raise ConfigError('TF2 launcher supports only tensorflow >= 2.0') + except ImportError as import_error: + raise ValueError( + "TensorFlow isn't installed. Please, install it before using. \n{}".format(import_error.msg) + ) + self.tf = tensorflow + self.default_layout = 'NHWC' + self._delayed_model_loading = kwargs.get('delayed_model_loading', False) + self.validate_config(config_entry, delayed_model_loading=self._delayed_model_loading) + + if not self._delayed_model_loading: + if 'saved_model_dir' not in self.config: + raise ConfigError('saved model directory should be provided') + + self._config_outputs = self.get_value_from_config('output_names') + self._model_fn = self._load_saved_model(str(self.get_value_from_config('saved_model_dir'))) + self.device = '/{}:0'.format(self.get_value_from_config('device').lower()) + + def predict(self, inputs, metadata=None, **kwargs): + """ + Args: + inputs: dictionary where keys are input layers names and values are data for them. + metadata: metadata of input representations + Returns: + raw data from network. + """ + results = [] + for infer_input in inputs: + outputs = self._model_fn(**infer_input) + res = {key: value.numpy() for key, value in outputs.items()} + results.append(res) + if metadata is not None: + for meta_ in metadata: + meta_['input_shape'] = self.inputs_info_for_meta(infer_input) + + return results + + def fit_to_input(self, data, layer_name, layout, precision): + if len(np.shape(data)) == len(layout): + data = np.transpose(data, layout) + else: + data = np.array(data) + precision = self.tf.as_dtype(precision) if precision else self.inputs[layer_name]['precision'] + return self.tf.convert_to_tensor(data, dtype=precision) + + def inputs_info_for_meta(self, feed_dict=None): + if feed_dict is None: + return super().inputs_info_for_meta() + return { + input_name: tuple(input_data.shape) + for input_name, input_data in feed_dict.items() + } + + @property + def batch(self): + return 1 + + @property + def inputs(self): + graph_inputs = self._get_inputs() + return { + node_name.split('import/')[-1]: { + 'shape': tuple(node.shape), + 'precision': self.tf.as_dtype(node.dtype) + } + for node_name, node in graph_inputs.items() + } + + def release(self): + del self._model_fn + if hasattr(self, '_loaded'): + del self._loaded + + @property + def output_blob(self): + return next(iter(self._model_fn.structured_outputs)) + + def predict_async(self, *args, **kwargs): + raise ValueError('TensorFlow Launcher does not support async mode yet') + + def _load_saved_model(self, model_dir): + self._loaded = self.tf.saved_model.load(model_dir) + self._model_fn = self._loaded.signatures["serving_default"] + return self._model_fn + + def _get_inputs(self): + inputs = [node for node in self._model_fn.inputs if node.name.split(':')[0] in self._model_fn._arg_keywords] + + return {node.name.split(':')[0]: node for node in inputs} diff --git a/tools/accuracy_checker/accuracy_checker/launcher/tf2_launcher_readme.md b/tools/accuracy_checker/accuracy_checker/launcher/tf2_launcher_readme.md new file mode 100644 index 00000000000..04ab7b6cf4f --- /dev/null +++ b/tools/accuracy_checker/accuracy_checker/launcher/tf2_launcher_readme.md @@ -0,0 +1,32 @@ +# How to configure TensorFlow 2.0 launcher +**Important note**: this launcher supports only TensorFlow 2.0 and higher version and works with [saved models](https://www.tensorflow.org/guide/saved_model) format, which contains tf.function object. For other model saving formats please use [TensorFlow launcher](tf_launcher_readme.md) + +For enabling TensorFlow 2.0 launcher you need to add `framework: tf2` in launchers section of your configuration file and provide following parameters: + +* `saved_model_dir` - path to directory with saved model. +* `adapter` - approach how raw output will be converted to representation of dataset problem, some adapters can be specific to framework. You can find detailed instruction how to use adapters [here](../adapters/README.md). +* `device` - specifies which device will be used for infer (`cpu` or `gpu`). + +## Specifying model inputs in config. + +In case when you model has several inputs you should provide list of input layers in launcher config section using key `inputs`. +Each input description should has following info: + * `name` - input layer name in network + * `type` - type of input values, it has impact on filling policy. Available options: + * `CONST_INPUT` - input will be filled using constant provided in config. It also requires to provide `value`. + * `IMAGE_INFO` - specific key for setting information about input shape to layer (used in Faster RCNN based topologies). You do not need provide `value`, because it will be calculated in runtime. Format value is `Nx[H, W, S]`, where `N` is batch size, `H` - original image height, `W` - original image width, `S` - scale of original image (default 1). + * `ORIG_IMAGE_INFO` - specific key for setting information about original image size before preprocessing. + * `IGNORE_INPUT` - input which should be stayed empty during evaluation. + * `INPUT` - network input for main data stream (e. g. images). If you have several data inputs, you should provide regular expression for identifier as `value` for specifying which one data should be provided in specific input. + Optionally you can determine `shape` of input and `layout` in case when your model was trained with non-standard data layout (For TensorFlow default layout is `NHWC`) + and `precision` (Supported precisions: `FP32` - float, `FP16` - signed shot, `U8` - unsigned char, `U16` - unsigned short int, `I8` - signed char, `I16` - short int, `I32` - int, `I64` - long int). + +TensorFlow 2 launcher config example: + +```yml +launchers: + - framework: tf2 + device: CPU + saved_model_dir: saved_model/ + adapter: classification +``` diff --git a/tools/accuracy_checker/accuracy_checker/launcher/tf_launcher.py b/tools/accuracy_checker/accuracy_checker/launcher/tf_launcher.py index 7976f1c8965..432b141f5de 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/tf_launcher.py +++ b/tools/accuracy_checker/accuracy_checker/launcher/tf_launcher.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,9 @@ import re from pathlib import Path -from .launcher import Launcher, LauncherConfigValidator +import numpy as np + +from .launcher import Launcher from ..config import BaseField, ListField, PathField, StringField, ConfigError from ..utils import contains_any, contains_all @@ -44,9 +46,14 @@ def parameters(cls): def __init__(self, config_entry, *args, **kwargs): super().__init__(config_entry, *args, **kwargs) try: - import tensorflow as tf # pylint: disable=C0415 + import tensorflow # pylint: disable=C0415 from tensorflow.python.saved_model import tag_constants # pylint: disable=C0415 - self.tf = tf + if tensorflow.__version__ >= '2.0.0': + self.tf = tensorflow.compat.v1 + self.tf_gfile = tensorflow.io.gfile + else: + self.tf = tensorflow + self.tf_gfile = tensorflow.gfile self.tag_constants = tag_constants except ImportError as import_error: raise ValueError( @@ -54,12 +61,7 @@ def __init__(self, config_entry, *args, **kwargs): ) self.default_layout = 'NHWC' self._delayed_model_loading = kwargs.get('delayed_model_loading', False) - - tf_launcher_config = LauncherConfigValidator( - 'TF_Launcher', fields=self.parameters(), delayed_model_loading=self._delayed_model_loading - ) - tf_launcher_config.validate(self.config) - + self.validate_config(config_entry, delayed_model_loading=self._delayed_model_loading) if not self._delayed_model_loading: if not contains_any(self.config, ['model', 'saved_model_dir']): raise ConfigError('model or saved model directory should be provided') @@ -89,6 +91,108 @@ def __init__(self, config_entry, *args, **kwargs): self._outputs_tensors.append(tensor) self.device = '/{}:0'.format(self.get_value_from_config('device').lower()) + self._output_layouts = dict() + self._lstm_inputs = None + if '_list_lstm_inputs' in self.config: + self._configure_lstm_inputs() + + @staticmethod + def _data_to_blob(layer_shape, data, layout): # pylint:disable=R0911 + data_shape = np.shape(data) + if len(layer_shape) == 4: + if len(data_shape) == 5: + data = data[0] + if len(data_shape) < 4: + if len(np.squeeze(np.zeros(layer_shape))) == len(np.squeeze(np.zeros(data_shape))): + return np.resize(data, layer_shape) + return np.transpose(data, layout) + if len(layer_shape) == 2: + if len(data_shape) == 1: + return np.transpose([data]) + if len(data_shape) > 2: + if all([dim == 1 for dim in layer_shape]) and all([dim == 1 for dim in data_shape]): + return np.resize(data, layer_shape) + if len(np.squeeze(np.zeros(layer_shape))) == len(np.squeeze(np.zeros(data_shape))): + return np.resize(data, layer_shape) + if len(layer_shape) == 3 and len(data_shape) == 4: + data = np.transpose(data, layout) + return data[0] + if len(layer_shape) == len(layout): + return np.transpose(data, layout) + if ( + len(layer_shape) == 1 and len(data_shape) > 1 and + len(np.squeeze(np.zeros(layer_shape))) == len(np.squeeze(np.zeros(data_shape))) + ): + return np.resize(data, layer_shape) + return np.array(data) + + def _set_precision(self): + has_info = hasattr(self.network if self.network is not None else self.exec_network, 'input_info') + config_inputs = self.config.get('inputs', []) + for input_config in config_inputs: + if 'precision' in input_config: + if self.network: + if not has_info: + self.network.inputs[input_config['name']].precision = input_config['precision'] + else: + self.network.input_info[input_config['name']].precision = input_config['precision'] + + def _set_input_shape(self): + if not self.network: + return + config_inputs = self.config.get('inputs', []) + input_shapes = {} + for input_config in config_inputs: + if 'shape' in input_config: + input_shapes[input_config['name']] = input_config['shape'] + if not input_shapes: + return + orig_input_shapes = {input_name: input_info.shape for input_name, input_info in self.inputs.items()} + orig_input_shapes.update(input_shapes) + self._reshape_input(orig_input_shapes) + + def _configure_lstm_inputs(self): + lstm_mapping = {} + config_inputs = self.config.get('inputs', []) + for input_config in config_inputs: + if input_config['type'] == 'LSTM_INPUT': + lstm_mapping[input_config['name']] = input_config['value'] + self._lstm_inputs = lstm_mapping + + def _fill_lstm_inputs(self, infer_outputs=None): + feed_dict = {} + for lstm_var, output_layer in self._lstm_inputs.items(): + layer_shape = self.inputs[lstm_var] + input_data = infer_outputs[output_layer].reshape(layer_shape) if infer_outputs else np.zeros(layer_shape) + feed_dict[lstm_var] = input_data + return feed_dict + + def _predict_sequential(self, inputs, metadata=None, **kwargs): + lstm_inputs_feed = self._fill_lstm_inputs() + results = [] + for feed_dict in inputs: + feed_dict.update(lstm_inputs_feed) + + with self.tf.device(self.device): + with self.tf.Session(graph=self._graph) as session: + feed_dictionary = { + self.node_pattern.format(input_name): input_data + for input_name, input_data in feed_dict.items() + } + result = session.run(self._outputs_tensors, feed_dict=feed_dictionary) + res = dict(zip(self._outputs_names, result)) + results.append(res) + + + lstm_inputs_feed = self._fill_lstm_inputs(res) + + if metadata is not None: + for meta_ in metadata: + meta_['input_shape'] = self.inputs_info_for_meta() + if self._output_layouts: + meta_['output_layout'] = self._output_layouts + + return results def predict(self, inputs, metadata=None, **kwargs): """ @@ -98,6 +202,9 @@ def predict(self, inputs, metadata=None, **kwargs): Returns: raw data from network. """ + if self._lstm_inputs: + return self._predict_sequential(inputs, metadata) + results = [] for infer_input in inputs: with self.tf.device(self.device): @@ -111,10 +218,17 @@ def predict(self, inputs, metadata=None, **kwargs): results.append(res) if metadata is not None: for meta_ in metadata: - meta_['input_shape'].update({name: data.shape for name, data in infer_input.items()}) + meta_['input_shape'] = meta_.get('input_shape', {}).update( + {name: data.shape for name, data in infer_input.items()} + ) return results + def inputs_info_for_meta(self, feed_dict=None): + if feed_dict is None: + return super().inputs_info_for_meta() + return {input_name: input_data.shape for input_name, input_data in feed_dict.items()} + @property def batch(self): return 1 @@ -166,7 +280,7 @@ def _load_graph_using_meta(self, model): return graph def _load_frozen_graph(self, model): - with self.tf.gfile.GFile(model, 'rb') as file: + with self.tf_gfile.GFile(model, 'rb') as file: graph_def = self.tf.GraphDef() graph_def.ParseFromString(file.read()) diff --git a/tools/accuracy_checker/accuracy_checker/launcher/tf_launcher_readme.md b/tools/accuracy_checker/accuracy_checker/launcher/tf_launcher_readme.md index cb21516a8ae..ab1c09127e9 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/tf_launcher_readme.md +++ b/tools/accuracy_checker/accuracy_checker/launcher/tf_launcher_readme.md @@ -16,6 +16,7 @@ Each input description should has following info: * `CONST_INPUT` - input will be filled using constant provided in config. It also requires to provide `value`. * `IMAGE_INFO` - specific key for setting information about input shape to layer (used in Faster RCNN based topologies). You do not need provide `value`, because it will be calculated in runtime. Format value is `Nx[H, W, S]`, where `N` is batch size, `H` - original image height, `W` - original image width, `S` - scale of original image (default 1). * `ORIG_IMAGE_INFO` - specific key for setting information about original image size before preprocessing. + * `IGNORE_INPUT` - input which should be stayed empty during evaluation. * `INPUT` - network input for main data stream (e. g. images). If you have several data inputs, you should provide regular expression for identifier as `value` for specifying which one data should be provided in specific input. Optionally you can determine `shape` of input and `layout` in case when your model was trained with non-standard data layout (For TensorFlow default layout is `NHWC`) and `precision` (Supported precisions: `FP32` - float, `FP16` - signed shot, `U8` - unsigned char, `U16` - unsigned short int, `I8` - signed char, `I16` - short int, `I32` - int, `I64` - long int). diff --git a/tools/accuracy_checker/accuracy_checker/launcher/tf_lite_launcher.py b/tools/accuracy_checker/accuracy_checker/launcher/tf_lite_launcher.py index 719178b4911..8148304c24b 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/tf_lite_launcher.py +++ b/tools/accuracy_checker/accuracy_checker/launcher/tf_lite_launcher.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ limitations under the License. """ -from .launcher import Launcher, LauncherConfigValidator, ListInputsField +from .launcher import Launcher, ListInputsField from ..config import PathField, StringField @@ -46,10 +46,7 @@ def __init__(self, config_entry, *args, **kwargs): self.default_layout = 'NHWC' self._delayed_model_loading = kwargs.get('delayed_model_loading', False) - tf_launcher_config = LauncherConfigValidator( - 'TF_Lite_Launcher', fields=self.parameters(), delayed_model_loading=self._delayed_model_loading - ) - tf_launcher_config.validate(self.config) + self.validate_config(config_entry, delayed_model_loading=self._delayed_model_loading) if not self._delayed_model_loading: self._interpreter = self.tf_lite.Interpreter(model_path=str(self.config['model'])) self._interpreter.allocate_tensors() diff --git a/tools/accuracy_checker/accuracy_checker/launcher/tf_lite_launcher_readme.md b/tools/accuracy_checker/accuracy_checker/launcher/tf_lite_launcher_readme.md index 38105a4f3de..ec01edb6de6 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/tf_lite_launcher_readme.md +++ b/tools/accuracy_checker/accuracy_checker/launcher/tf_lite_launcher_readme.md @@ -15,6 +15,7 @@ Each input description should has following info: * `CONST_INPUT` - input will be filled using constant provided in config. It also requires to provide `value`. * `IMAGE_INFO` - specific key for setting information about input shape to layer (used in Faster RCNN based topologies). You do not need provide `value`, because it will be calculated in runtime. Format value is `Nx[H, W, S]`, where `N` is batch size, `H` - original image height, `W` - original image width, `S` - scale of original image (default 1). * `ORIG_IMAGE_INFO` - specific key for setting information about original image size before preprocessing. + * `IGNORE_INPUT` - input which should be stayed empty during evaluation. * `INPUT` - network input for main data stream (e. g. images). If you have several data inputs, you should provide regular expression for identifier as `value` for specifying which one data should be provided in specific input. Optionally you can determine `shape` of input and `layout` in case when your model was trained with non-standard data layout (For TensorFlow Lite default layout is `NHWC`) and `precision` (Supported precisions: `FP32` - float, `FP16` - signed shot, `U8` - unsigned char, `U16` - unsigned short int, `I8` - signed char, `I16` - short int, `I32` - int, `I64` - long int). diff --git a/tools/accuracy_checker/accuracy_checker/logging.py b/tools/accuracy_checker/accuracy_checker/logging.py index 402d3f6f254..ccc9b43c5b3 100644 --- a/tools/accuracy_checker/accuracy_checker/logging.py +++ b/tools/accuracy_checker/accuracy_checker/logging.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/main.py b/tools/accuracy_checker/accuracy_checker/main.py index 72203165c72..f9043f27437 100644 --- a/tools/accuracy_checker/accuracy_checker/main.py +++ b/tools/accuracy_checker/accuracy_checker/main.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -277,6 +277,7 @@ def build_arguments_parser(): 'Providing several values required : format. ' 'If single value without layer_name provided, then it will be applayed to all input layers.' ) + parser.add_argument('--store_only', required=False, default=False, type=cast_to_bool) return parser @@ -295,12 +296,15 @@ def main(): evaluator_kwargs['intermediate_metrics_results'] = intermdeiate_metrics evaluator_kwargs['metrics_interval'] = args.metrics_interval evaluator_kwargs['ignore_result_formatting'] = args.ignore_result_formatting + evaluator_kwargs['store_only'] = args.store_only config, mode = ConfigReader.merge(args) evaluator_class = EVALUATION_MODE.get(mode) if not evaluator_class: raise ValueError('Unknown evaluation mode') for config_entry in config[mode]: + config_entry['_store_only'] = args.store_only + config_entry['_stored_data'] = args.stored_predictions try: processing_info = evaluator_class.get_processing_info(config_entry) print_processing_info(*processing_info) @@ -313,11 +317,12 @@ def main(): evaluator.process_dataset( stored_predictions=args.stored_predictions, progress_reporter=progress_reporter, **evaluator_kwargs ) - metrics_results, _ = evaluator.extract_metrics_results( - print_results=True, ignore_results_formatting=args.ignore_result_formatting - ) - if args.csv_result: - write_csv_result(args.csv_result, processing_info, metrics_results) + if not args.store_only: + metrics_results, _ = evaluator.extract_metrics_results( + print_results=True, ignore_results_formatting=args.ignore_result_formatting + ) + if args.csv_result: + write_csv_result(args.csv_result, processing_info, metrics_results) evaluator.release() except Exception as e: # pylint:disable=W0703 exception(e) diff --git a/tools/accuracy_checker/accuracy_checker/metrics/README.md b/tools/accuracy_checker/accuracy_checker/metrics/README.md index 20eeaba579b..d1e145eceb9 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/README.md +++ b/tools/accuracy_checker/accuracy_checker/metrics/README.md @@ -25,6 +25,7 @@ Supported representation: `ClassificationAnnotation`, `TextClassificationAnnotat * `label_map` - the field in annotation metadata, which contains dataset label map (Optional, should be provided if different from default). * `metthews_correlation_coef` - [Matthews correlation coefficient (MCC)](https://en.wikipedia.org/wiki/Matthews_correlation_coefficient) for binary classification. Supported representation: `ClassificationAnnotation`, `TextClassificationAnnotation`, `ClassificationPrediction`. * `roc_auc_score` - [ROC AUC score](https://en.wikipedia.org/wiki/Receiver_operating_characteristic) for binary classification. Supported representation: `ClassificationAnnotation`, `TextClassificationAnnotation`, `ClassificationPrediction` `ArgMaxClassificationPrediction`. +* `acer_score` - metric for the classification tasks. Can be obtained from the following formula: `ACER = (APCER + BPCER)/2 = ((fp / (tn + fp)) + (fn / (fn + tp)))/2`. For more details about metrics see the section 9.3: . Supported representation: `ClassificationAnnotation`, `TextClassificationAnnotation`, `ClassificationPrediction`. * `map` - mean average precision. Supported representations: `DetectionAnnotation`, `DetectionPrediction`. * `overlap_threshold` - minimal value for intersection over union that allows to make decision that prediction bounding box is true positive. * `overlap_method` - method for calculation bbox overlap. You can choose between intersection over union (`iou`), defined as area of intersection divided by union of annotation and prediction boxes areas, and intersection over area (`ioa`), defined as area of intersection divided by ara of prediction box. @@ -69,7 +70,7 @@ Supported representation: `ClassificationAnnotation`, `TextClassificationAnnotat * `frequency_weighted_accuracy` - frequency weighted accuracy for semantic segmentation models. Supported representations: `SegmentationAnnotation`, `SegmentationPrediction`. * `use_argmax` - allows to use argmax for prediction mask. * `ignore_label` - specified which class_id prediction should be ignored during metric calculation. (Optional, if not provided, all labels will be used) -More detailed information about calculation segmentation metrics you can find [here](https://arxiv.org/abs/1411.4038v2). +More detailed information about calculation segmentation metrics you can find [here](https://arxiv.org/abs/1411.4038). * `cmc` - Cumulative Matching Characteristics (CMC) score. Supported representations: `ReIdentificationAnnotation`, `ReIdentificationPrediction`. * `top_k` - number of k highest ranked samples to consider when matching. * `separate_camera_set` - should identities from the same camera view be filtered out. @@ -79,28 +80,33 @@ More detailed information about calculation segmentation metrics you can find [h * `reid_map` - Mean Average Precision score for object reidentification. Supported representations: `ReIdentificationAnnotation`, `ReIdentificationPrediction`. * `uninterpolated_auc` - should area under precision recall curve be computed using trapezoidal rule or directly. * `pairwise_accuracy` - pairwise accuracy for object reidentification. Supported representations: `ReIdentificationClassificationAnnotation`, `ReIdentificationPrediction`. - * `min_score` - min score for determining that objects are different. You can provide value or use `train_median` value which will be calculated if annotations has training subset. + * `min_score` - min score for determining that objects are different. You can provide value or use `train_median` or `best_train_threshold` values which will be calculated if annotations has training subset. + * `distance_method` - allows to choose one of the distance calculation methods (optional, supported methods are `euclidian_distance` and `cosine_distance`, default - `euclidian_distance`). + * `subtract_mean` - allows to subtract mean calculated on train embeddings before calculating the distance(optional, default - `False`). * `pairwise_accuracy_subsets` - object reidentification pairwise accuracy with division dataset on test and train subsets for calculation mean score. Supported representations: `ReIdentificationClassificationAnnotation`, `ReIdentificationPrediction`. * `subset_number` - number of subsets for separating. + * `min_score` - min score for determining that objects are different. You can provide value or use `train_median` or `best_train_threshold` values which will be calculated if annotations has training subset. + * `distance_method` - allows to choose one of the distance calculation methods (optional, supported methods are `euclidian_distance` and `cosine_distance`, default - `euclidian_distance`). + * `subtract_mean` - allows to subtract mean calculated on train embeddings before calculating the distance(optional, default - `False`). * `localization_recall` - recall metric used for evaluation place recognition task. Supported representations: `PlaceRecognitionAnnotation`, `ReidentificationPrediction`. * `top_k` - number of k highest ranked samples to consider when matching. * `distance_threshold` - distance threshold for search positive matching pairs between query and gallery (Optional, default 25). -* `mae` - [Mean Absolute Error](https://en.wikipedia.org/wiki/Mean_absolute_error). Supported representations: `RegressionAnnotation`, `RegressionPrediction`, `FeatureRegressionAnnotation`, `DepthEstimationAnnotation`, `DepthEstimationPrediction`. +* `mae` - [Mean Absolute Error](https://en.wikipedia.org/wiki/Mean_absolute_error). Supported representations: `RegressionAnnotation`, `RegressionPrediction`, `FeatureRegressionAnnotation`, `DepthEstimationAnnotation`, `DepthEstimationPrediction`, `ImageProcessingAnnotation`, `ImageProcessingPrediction`. * `mae_on_intervals` - Mean Absolute Error estimated magnitude for specific value range. Supported representations: `RegressionAnnotation`, `RegressionPrediction`. * `intervals` - comma-separated list of interval boundaries. * `ignore_values_not_in_interval` - allows create additional intervals for values less than minimal value in interval and greater than maximal. * `start` , `step`, `end` - way to generate range of intervals from `start` to `end` with length `step`. -* `mse` - [Mean Squared Error](https://en.wikipedia.org/wiki/Mean_squared_error). Supported representations: `RegressionAnnotation`, `RegressionPrediction`, `FeatureRegressionAnnotation`, `DepthEstimationAnnotation`, `DepthEstimationPrediction`. +* `mse` - [Mean Squared Error](https://en.wikipedia.org/wiki/Mean_squared_error). Supported representations: `RegressionAnnotation`, `RegressionPrediction`, `FeatureRegressionAnnotation`, `DepthEstimationAnnotation`, `DepthEstimationPrediction`, `ImageProcessingAnnotation`, `ImageProcessingPrediction`. * `mse_on_intervals` - Mean Squared Error estimated magnitude for specific value range. Supported representations: `RegressionAnnotation`, `RegressionPrediction`. * `intervals` - comma-separated list of interval boundaries. * `ignore_values_not_in_interval` - allows create additional intervals for values less than minimal value in interval and greater than maximal. * `start`, `step`, `end` - generate range of intervals from `start` to `end` with length `step`. -* `rmse` - [Root Mean Squared Error](https://en.wikipedia.org/wiki/Root-mean-square_deviation). Supported representations: `RegressionAnnotation`, `RegressionPrediction`, `FeatureRegressionAnnotation`, `DepthEstimationAnnotation`, `DepthEstimationPrediction`. +* `rmse` - [Root Mean Squared Error](https://en.wikipedia.org/wiki/Root-mean-square_deviation). Supported representations: `RegressionAnnotation`, `RegressionPrediction`, `FeatureRegressionAnnotation`, `DepthEstimationAnnotation`, `DepthEstimationPrediction`, `ImageProcessingAnnotation`, `ImageProcessingPrediction`. * `rmse_on_intervals` - Root Mean Squared Error estimated magnitude for specific value range. Supported representations: `RegressionAnnotation`, `RegressionPrediction`. * `intervals` - comma-separated list of interval boundaries. * `ignore_values_not_in_interval` - allows create additional intervals for values less than minimal value in interval and greater than maximal. * `start`, `step`, `end` - generate range of intervals from `start` to `end` with length `step`. -* `mape` - [Mean Absolute Percentage Error](https://en.wikipedia.org/wiki/Mean_absolute_percentage_error). Supported representations: `RegressionAnnotation`, `RegressionPrediction`, `FeatureRegressionAnnotation`, `DepthEstimationAnnotation`, `DepthEstimationPrediction`. +* `mape` - [Mean Absolute Percentage Error](https://en.wikipedia.org/wiki/Mean_absolute_percentage_error). Supported representations: `RegressionAnnotation`, `RegressionPrediction`, `FeatureRegressionAnnotation`, `DepthEstimationAnnotation`, `DepthEstimationPrediction`, `ImageProcessingAnnotation`, `ImageProcessingPrediction`. * `log10_error` - Logarithmic mean absolute error. Supported representations: Supported representations: `RegressionAnnotation`, `RegressionPrediction`, `FeatureRegressionAnnotation`, `DepthEstimationAnnotation`, `DepthEstimationPrediction`. * `per_point_normed_error` - Normed Error for measurement the quality of landmarks' positions. Estimated results for each point independently. Supported representations: `FacialLandmarksAnnotation`, `FacialLandmarksPrediction`, `FacialLandmarks3DAnnotation`, `FacialLandmarks3DPrediction`. * `normed_error` - Normed Error for measurement the quality of landmarks' positions. Supported representations: `FacialLandmarksAnnotation`, `FacialLandmarksPrediction`, `FacialLandmarks3DAnnotation`, `FacialLandmarks3DPrediction`. @@ -110,8 +116,11 @@ More detailed information about calculation segmentation metrics you can find [h `only_2d` - evaluate metric only for 2d case. * `psnr` - [Peak signal to noise ratio](https://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio). Supported representations: `SuperResolutionAnnotation`, `SuperResolutionPrediction`, `ImageProcessingAnnotation`, `ImageProcessingPrediction`, `ImageInpaintingAnnotation`, `ImageInpaintingPrediction`. * `color_order` - the field specified which color order `BGR` or `RGB` will be used during metric calculation (Optional. Default value is RGB), used only if you have 3-channel images. + * `normalized_images` - whether the images are normalized in [0, 1] range or not. Optional, default `False`. * `ssim` - [Structural similarity](https://en.wikipedia.org/wiki/Structural_similarity). Supported representations: `ImageProcessingAnnotation`, `ImageProcessingPrediction`, `ImageInpaintingAnnotation`, `ImageInpaintingPrediction`, `SuperResolutionAnnotation`, `SuperResolutionPrediction`. * `angle_error` - Mean angle error and Standard deviation of angle error for gaze estimation. Supported representations: `GazeVectorAnnotation`, `GazeVectorPrediction`. +* `relative_l2_error` - Mean relative error defined like L2 norm for difference between annotation and prediction normalized by L2 norm for annotation value. Supported representations: + `FeatureRegressionAnnotation`, `RegressionPrediction`. * `multi_accuracy` - accuracy for multilabel recognition task. Supported representations: `MultiLabelRecognitionAnnotation`, `MultiLabelRecognitionPrediction`. * `label_map` - the field in annotation metadata, which contains dataset label map (Optional, should be provided if different from default). * `calculate_average` - allows calculation of average accuracy (default value: `True`). @@ -193,6 +202,14 @@ Applied for models trained on brats data with labels in range (0, 1, 2, 3). The * `f1` - F1-score for question answering task. Supported representations: `QuestionAnsweringAnnotation`, `QuestionAnsweringPrediction`. * `exact_match` - Exact matching (EM) metric for question answering task. Supported representations: `QuestionAnsweringAnnotation`, `QuestionAnsweringPrediction`. * `qa_embedding_accuracy` - Right context detection accuracy metric for question answering task solved by question vs context embeddings comparison. Supported representations: `QuestionAnsweringEmbeddingAnnotation`, `QuestionAnsweringEmbeddingPrediction`. +* `ner_accuracy` - Token-level accuracy used for Named Entity Recognition task. Supported representations: `BERTNamedEntityRecognitionAnnotation`, `SequenceClassificationAnnotation`, `SequenceClassificationPrediction`. + * `label_map` - the field in annotation metadata, which contains dataset label map (Optional, should be provided if different from default). +* `ner_recall` - Token-level recall used for Named Entity Recognition task. Supported representations: `BERTNamedEntityRecognitionAnnotation`, `SequenceClassificationAnnotation`, `SequenceClassificationPrediction`. + * `label_map` - the field in annotation metadata, which contains dataset label map (Optional, should be provided if different from default). +* `ner_precision` - Token-level precision for Named Entity Recognition task. Supported representations: `BERTNamedEntityRecognitionAnnotation`, `SequenceClassificationAnnotation`, `SequenceClassificationPrediction`. + * `label_map` - the field in annotation metadata, which contains dataset label map (Optional, should be provided if different from default). +* `ner_f_score` - Token-level F-score used for Named Entity Recognition task. Supported representations: `BERTNamedEntityRecognitionAnnotation`, `SequenceClassificationAnnotation`, `SequenceClassificationPrediction`. + * `label_map` - the field in annotation metadata, which contains dataset label map (Optional, should be provided if different from default). * `mpjpe_multiperson` - [Mean Per Joint Position Error](http://vision.imar.ro/human3.6m/pami-h36m.pdf) extended for multi-person case. Supported representations: `PoseEstimation3dAnnotation`, `PoseEstimation3dPrediction`. As the first step, correspondence between ground truth and prediction skeletons is established for each image. Then MPJPE is computed for each ground truth and prediction pair. The error is averaged over poses in each frame, then over all frames. * `face_recognition_tafa_pair_metric` - accuracy for face recognition models based on dot product of embedding values. Supported representations: `ReIdentificationAnnotation`, `ReIdentificationPrediction`. * `threshold` - minimal dot product value of embeddings to identify as matched face pair. @@ -224,12 +241,17 @@ Applied for models trained on brats data with labels in range (0, 1, 2, 3). The * `dna_seq_accuracy` - accuracy for DNA sequencing task. Supported representations: `DNASequenceAnnotation`, `DNASequencePrediction`, `CharacterRecognitionAnnotation`, `CharacterRecognitionPrediction`. * `min_coverage` - minimum sequence coverage between predicted sequence and reference for positive measurement (Optional, default 0.5). * `balansed` - balanced accuracy metric (Optional, default false). -* `inception_score` - [Inception score](https://arxiv.org/pdf/1801.01973) for generated images by GAN models. Supported representations: `ImageProcessingAnnotation`, `ImageProcessingPrediction`. - * `eps` - epsilon to avoid nan during calculate log for metric - * `length` - length of input feature vector for metric +* `inception_score` - [Inception score](https://arxiv.org/abs/1801.01973) for generated images by GAN models. Supported representations: `ImageProcessingAnnotation`, `ImageProcessingPrediction`. + * `eps` - epsilon to avoid nan during calculate log for metric. + * `length` - length of input feature vector for metric. * `fid` - Frechet Inception Distance to measure the distance between the distributions of synthesized images and real images. Supported representations: `ImageProcessingAnnotation`, `ImageProcessingPrediction`. - * `eps` - epsilon to avoid nan during calculate sqrtm for metric - * `length` - length of input feature vector for metric + * `eps` - epsilon to avoid nan during calculate sqrtm for metric. + * `length` - length of input feature vector for metric. +* `epe` - Average End Point Error (EPE) metric for optical flow estimation task, defined as Euclidean distance between ground truth and predicted flow. Supported representations: `OpticalFlowAnnotation`, `OpticalFlowPrediction`. +* `salience_mae` - Mean Absolute Error for salient object detection task. Supported representations: `SalientRegionAnnotation`, `SalientRegionPrediction`. +* `salience_f-measure` - f-measure metric for salient object detection task. Supported representations: `SalientRegionAnnotation`, `SalientRegionPrediction`. +* `salience_e-measure` - enhanced alignment measure for salient object detection task, defined in following [paper](https://arxiv.org/abs/1805.10421). Supported representations: `SalientRegionAnnotation`, `SalientRegionPrediction`. +* `salience_s-measure` - simularity measure for salient object detection task, defined in following [paper](https://arxiv.org/abs/1708.00786). Supported representations: `SalientRegionAnnotation`, `SalientRegionPrediction`. ## Metrics profiling Accuracy Checker supports providing detailed information necessary for understanding metric calculation for each data object. diff --git a/tools/accuracy_checker/accuracy_checker/metrics/__init__.py b/tools/accuracy_checker/accuracy_checker/metrics/__init__.py index f8b8d35170c..1a872c4e659 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/__init__.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/__init__.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,7 +23,8 @@ ClipAccuracy, ClassificationF1Score, MetthewsCorrelation, - RocAucScore + RocAucScore, + AcerScore, ) from .detection import ( DetectionMAP, @@ -51,6 +52,7 @@ MeanSquaredError, Log10Error, MeanAbsolutePercentageError, + RelativeL2Error, RootMeanSquaredErrorOnInterval, RootMeanSquaredError, @@ -86,7 +88,8 @@ ) from .hit_ratio import HitRatioMetric, NDSGMetric from .machine_translation import BilingualEvaluationUnderstudy -from .question_answering import ExactMatchScore, ScoreF1, QuestionAnsweringEmbeddingAccurcay +from .question_answering import ExactMatchScore, ScoreF1, QuestionAnsweringEmbeddingAccuracy +from .ner import NERAccuracy, NERFScore, NERPrecision, NERRecall from .mpjpe_multiperson import MpjpeMultiperson from .language_modeling import ScorePerplexity @@ -102,6 +105,9 @@ from .dna_seq_accuracy import DNASequenceAccuracy from .gan_metrics import InceptionScore, FrechetInceptionDistance + +from .salient_objects_detection import SalienceMapMAE, SalienceEMeasure, SalienceMapFMeasure, SalienceSMeasure + __all__ = [ 'Metric', 'MetricsExecutor', @@ -111,6 +117,7 @@ 'ClassificationAccuracyClasses', 'ClipAccuracy', 'ClassificationF1Score', + 'MetthewsCorrelation', 'DetectionMAP', 'MissRate', @@ -147,6 +154,7 @@ 'AngleError', 'MeanAbsolutePercentageError', 'Log10Error', + 'RelativeL2Error', 'MultiLabelAccuracy', 'MultiLabelRecall', @@ -177,7 +185,12 @@ 'ScoreF1', 'ExactMatchScore', - 'QuestionAnsweringEmbeddingAccurcay', + 'QuestionAnsweringEmbeddingAccuracy', + + 'NERAccuracy', + 'NERPrecision', + 'NERRecall', + 'NERFScore', 'MpjpeMultiperson', @@ -202,4 +215,11 @@ 'InceptionScore', 'FrechetInceptionDistance', + + 'AcerScore', + + 'SalienceMapMAE', + 'SalienceMapFMeasure', + 'SalienceSMeasure', + 'SalienceEMeasure' ] diff --git a/tools/accuracy_checker/accuracy_checker/metrics/attribute_classification.py b/tools/accuracy_checker/accuracy_checker/metrics/attribute_classification.py index 6573abec3b9..8f81cfee8c1 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/attribute_classification.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/attribute_classification.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/metrics/average_editdistance_meter.py b/tools/accuracy_checker/accuracy_checker/metrics/average_editdistance_meter.py index c060056163f..2aa488e9f7c 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/average_editdistance_meter.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/average_editdistance_meter.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/metrics/average_meter.py b/tools/accuracy_checker/accuracy_checker/metrics/average_meter.py index 44a166b7fe6..fc02311caa1 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/average_meter.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/average_meter.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/metrics/character_recognition.py b/tools/accuracy_checker/accuracy_checker/metrics/character_recognition.py index 2293f29c4a5..84e3808173e 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/character_recognition.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/character_recognition.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/metrics/classification.py b/tools/accuracy_checker/accuracy_checker/metrics/classification.py index cc074755e40..076f481c831 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/classification.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/classification.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -29,14 +29,11 @@ from ..utils import UnsupportedPackage try: - from sklearn.metrics import roc_auc_score -except ImportError as import_error: - roc_auc_score = UnsupportedPackage("sklearn.metric.roc_auc_score", import_error.msg) - -try: - from sklearn.metrics import accuracy_score + from sklearn.metrics import accuracy_score, confusion_matrix, roc_auc_score except ImportError as import_error: accuracy_score = UnsupportedPackage("sklearn.metric.accuracy_score", import_error.msg) + confusion_matrix = UnsupportedPackage("sklearn.metric.confusion_matrix", import_error.msg) + roc_auc_score = UnsupportedPackage("sklearn.metric.roc_auc_score", import_error.msg) class ClassificationAccuracy(PerImageEvaluationMetric): """ @@ -241,6 +238,7 @@ class ClassificationF1Score(PerImageEvaluationMetric): annotation_types = (ClassificationAnnotation, TextClassificationAnnotation) prediction_types = (ClassificationPrediction, ) + @classmethod def parameters(cls): parameters = super().parameters() @@ -353,3 +351,35 @@ def evaluate(self, annotations, predictions): def reset(self): self.targets = [] self.results = [] + +class AcerScore(PerImageEvaluationMetric): + __provider__ = 'acer_score' + annotation_types = (ClassificationAnnotation, TextClassificationAnnotation) + prediction_types = (ClassificationPrediction, ) + + def configure(self): + if isinstance(confusion_matrix, UnsupportedPackage): + confusion_matrix.raise_error(self.__provider__) + self.reset() + + def update(self, annotation, prediction): + self.targets.append(annotation.label) + self.results.append(prediction.label) + return prediction.label == annotation.label + + def evaluate(self, annotations, predictions): + all_results = np.array(self.results) + all_targets = np.array(self.targets) + tn, fp, fn, tp = confusion_matrix(y_true=all_targets, + y_pred=all_results, + ).ravel() + + apcer = fp / (tn + fp) if (tn + fp) != 0 else 0 + bpcer = fn / (fn + tp) if (fn + tp) != 0 else 0 + acer = (apcer + bpcer) / 2 + + return acer + + def reset(self): + self.targets = [] + self.results = [] diff --git a/tools/accuracy_checker/accuracy_checker/metrics/coco_metrics.py b/tools/accuracy_checker/accuracy_checker/metrics/coco_metrics.py index fa31fb4529d..587e84f83cf 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/coco_metrics.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/coco_metrics.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ def parameters(cls): description="Max number of predicted results per image. If you have more predictions, " "the results with minimal confidence will be ignored." ), - 'threshold' : BaseField( + 'threshold': BaseField( optional=True, default='.50:.05:.95', description="Intersection over union threshold. " "You can specify one value or comma separated range of values. " @@ -238,7 +238,7 @@ def evaluate(self, annotations, predictions): class MSCOCOKeypointsRecall(MSCOCOKeypointsBaseMetric): - __provider__ = 'coco_keypoints_precision' + __provider__ = 'coco_keypoints_recall' def update(self, annotation, prediction): per_class_matching = super().update(annotation, prediction) diff --git a/tools/accuracy_checker/accuracy_checker/metrics/coco_orig_metrics.py b/tools/accuracy_checker/accuracy_checker/metrics/coco_orig_metrics.py index 9c3faa269fc..0f430b1f0e4 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/coco_orig_metrics.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/coco_orig_metrics.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -360,10 +360,10 @@ def _run_coco_evaluation(coco, coco_res, iou_type='bbox', threshold=None): def _use_original_coco(self): subsample_size = self.dataset.config.get('subsample_size') if not subsample_size: - annotation_conversion_parameters = self.dataset.config.get('annotation_conversion') - if annotation_conversion_parameters: - annotation_file = annotation_conversion_parameters.get('annotation_file') - return annotation_file.is_file() + annotation_conversion_parameters = self.dataset.config.get('annotation_conversion', {}) + if 'annotation_file' in annotation_conversion_parameters: + annotation_file = Path(annotation_conversion_parameters['annotation_file']) + return annotation_file.is_file() and annotation_file.suffix == '.json' return False diff --git a/tools/accuracy_checker/accuracy_checker/metrics/detection.py b/tools/accuracy_checker/accuracy_checker/metrics/detection.py index da11bd5f5fe..5374e94992b 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/detection.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/detection.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ class APIntegralType(enum.Enum): voc_max = 'max' + class BaseDetectionMetricMixin(Metric): @classmethod def parameters(cls): @@ -103,7 +104,7 @@ def per_class_detection_statistics(self, annotations, predictions, labels, profi self.ignore_difficult, self.allow_multiple_matches_per_ignored, self.include_boundaries, self.use_filtered_tp ) - gt_boxes = [np.array(ann.boxes)[ann.labels == label] for ann in annotations] + gt_boxes = [np.array(ann.boxes)[ann.labels == label] for ann in annotations] if not tp.size: labels_stat[label] = { @@ -236,7 +237,7 @@ class MissRate(BaseDetectionMetricMixin, FullDatasetEvaluationMetric, PerImageEv def parameters(cls): parameters = super().parameters() parameters.update({ - 'fppi_level' : NumberField(min_value=0, max_value=1, description="False Positive Per Image level.") + 'fppi_level': NumberField(min_value=0, max_value=1, description="False Positive Per Image level.") }) return parameters diff --git a/tools/accuracy_checker/accuracy_checker/metrics/gan_metrics.py b/tools/accuracy_checker/accuracy_checker/metrics/gan_metrics.py index 02ece798577..ae7bd4ac0dd 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/gan_metrics.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/gan_metrics.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/tools/accuracy_checker/accuracy_checker/metrics/hit_ratio.py b/tools/accuracy_checker/accuracy_checker/metrics/hit_ratio.py index 894e4affa34..3a91eb76fa5 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/hit_ratio.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/hit_ratio.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/metrics/im2latex_images_match.py b/tools/accuracy_checker/accuracy_checker/metrics/im2latex_images_match.py index 85e80157721..28825056872 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/im2latex_images_match.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/im2latex_images_match.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -46,6 +46,7 @@ from multiprocessing.dummy import Pool as ThreadPool from threading import Timer from subprocess import PIPE +from pathlib import Path import cv2 as cv import numpy as np @@ -78,7 +79,8 @@ def check_environment(): command = subprocess.run("pdflatex --version", stdout=PIPE, stderr=PIPE, check=False, shell=True) if command.stderr: raise EnvironmentError("pdflatex not installed, please install it: \n{}".format(command.stderr)) - command = subprocess.run("gs --version", stdout=PIPE, stderr=PIPE, check=False, shell=True) + gs_executable = "gs" if os.name != 'nt' else "gswin64c.exe" + command = subprocess.run("{} --version".format(gs_executable), stdout=PIPE, stderr=PIPE, check=False, shell=True) if command.stderr: raise EnvironmentError("ghostscript not installed, please install it: \n{}".format(command.stderr)) command = subprocess.run("convert --version", stdout=PIPE, stderr=PIPE, check=False, shell=True) @@ -122,7 +124,7 @@ def kill_proc(process): timer.cancel() -def preprocess_formula(l): +def preprocess_formula(formula): """Formula preprocessing Args: @@ -131,25 +133,19 @@ def preprocess_formula(l): Returns: str: Preprocessed formula """ - l = l.strip() - l = l.replace(r'\pmatrix', r'\mypmatrix') - l = l.replace(r'\matrix', r'\mymatrix') + formula = formula.strip() + formula = formula.replace(r'\pmatrix', r'\mypmatrix') + formula = formula.replace(r'\matrix', r'\mymatrix') # remove leading comments - l = l.strip('%') - if len(l) == 0: - l = '\\hspace{1cm}' + formula = formula.strip('%') + if not formula: + formula = '\\hspace{1cm}' # \hspace {1 . 5 cm} -> \hspace {1.5cm} - for space in ["hspace", "vspace"]: - match = re.finditer(space + " {(.*?)}", l) - if match: - new_l = "" - last = 0 - for m in match: - new_l = new_l + l[last:m.start(1)] + m.group(1).replace(" ", "") - last = m.end(1) - new_l = new_l + l[last:] - l = new_l - return l + formula = re.sub("([hv]space )({.*?})", + lambda m: m[1] + m[2].replace(" ", ""), + formula) + + return formula def render_routine(line): @@ -159,31 +155,36 @@ def render_routine(line): line (tuple): formula idx, formula string, path to store rendered image """ formula, file_idx, folder_path = line - output_path = os.path.join(folder_path, file_idx) - pre_name = output_path.replace('/', '_').replace('.', '_') + output_path = folder_path / file_idx + pre_name = os.path.normcase(output_path).replace('/', '_').replace('.', '_') formula = preprocess_formula(formula) - if not os.path.exists(output_path): - tex_filename = pre_name + '.tex' - log_filename = pre_name + '.log' - aux_filename = pre_name + '.aux' - with open(tex_filename, "w") as w: + if not output_path.exists(): + tex_filename = folder_path / (pre_name + '.tex') + log_filename = tex_filename.with_suffix('.log') + aux_filename = tex_filename.with_suffix('.aux') + with tex_filename.open(mode="w") as w: w.write(template % formula) - run("pdflatex -interaction=nonstopmode {}".format(tex_filename), TIMEOUT) + subprocess.run(['pdflatex', '-interaction=nonstopmode', '-output-directory', + str(folder_path), str(tex_filename)], + check=False, stdout=PIPE, stderr=PIPE, shell=os.name == 'nt') for filename in (tex_filename, log_filename, aux_filename): - if os.path.exists(filename): - os.remove(filename) - pdf_filename = tex_filename[:-4] + '.pdf' - png_filename = tex_filename[:-4] + '.png' - if not os.path.exists(pdf_filename): - logging.info('ERROR: %s cannot compile\n', file_idx) + if filename.exists(): + filename.unlink() + pdf_filename = tex_filename.with_suffix('.pdf') + png_filename = tex_filename.with_suffix('.png') + if not pdf_filename.exists(): + print_info('ERROR: {} cannot compile\n'.format(file_idx)) else: subprocess.run(['convert', '+profile', '"icc"', '-density', '200', '-quality', '100', - pdf_filename, png_filename], check=True, stdout=PIPE, stderr=PIPE) - if os.path.exists(pdf_filename): - os.remove(pdf_filename) - if os.path.exists(png_filename): - crop_image(png_filename, output_path) - os.remove(png_filename) + str(pdf_filename), str(png_filename)], + check=True, stdout=PIPE, stderr=PIPE, shell=os.name == 'nt') + if pdf_filename.exists(): + pdf_filename.unlink() + if png_filename.exists(): + crop_image(str(png_filename), str(output_path)) + png_filename.unlink() + else: + print_info("ERROR: {png_filename} does not exists".format(png_filename=png_filename)) def check_differ(diff): @@ -318,7 +319,7 @@ def parameters(cls): def configure(self): self.num_threads = self.get_value_from_config('num_threads') if self.num_threads is None: - self.num_threads = cpu_count() + self.num_threads = cpu_count() if os.name != 'nt' else 1 self.max_pixel_column_diff = self.get_value_from_config('max_pixel_column_diff') check_environment() @@ -334,17 +335,17 @@ def compare_pics(self, images_dir): total_correct_eliminate = 0 lines = [] pool = ThreadPool(self.num_threads) - gold_dir = os.path.join(images_dir, 'images_gold') - pred_dir = os.path.join(images_dir, 'images_pred') - plots_dir = os.path.join(images_dir, 'diff') - filenames = os.listdir(gold_dir) - if not os.path.exists(plots_dir): - os.makedirs(plots_dir) + gold_dir = Path(images_dir, 'images_gold') + pred_dir = Path(images_dir, 'images_pred') + plots_dir = Path(images_dir, 'diff') + filenames = gold_dir.iterdir() + if not plots_dir.exists(): + plots_dir.mkdir() for filename in filenames: - filename = os.path.join(gold_dir, filename) - filename2 = os.path.join(pred_dir, os.path.basename(filename)) - plotfilename = os.path.join(plots_dir, os.path.basename(filename)) - lines.append((filename, filename2, plotfilename, + filename = gold_dir / filename + filename2 = str(pred_dir / filename.name) + plotfilename = str(plots_dir / filename.name) + lines.append((str(filename), filename2, plotfilename, self.max_pixel_column_diff)) results = [] for num, elem in enumerate(pool.imap_unordered(match_images, lines)): @@ -380,11 +381,11 @@ def render_images(self, annotations, predictions, images_dir): annotations (str): Ground-truth formula predictions (str): Predicted formula """ - out_path_gold = os.path.join(images_dir, 'images_gold') - out_path_pred = os.path.join(images_dir, 'images_pred') + out_path_gold = Path(images_dir, 'images_gold') + out_path_pred = Path(images_dir, 'images_pred') for dir_ in [out_path_gold, out_path_pred]: - if not os.path.exists(dir_): - os.makedirs(dir_) + if not dir_.exists(): + dir_.mkdir() lines_gold = [(ann.label, ann.identifier, out_path_gold) for ann in annotations] lines_pred = [(pred.label, pred.identifier, out_path_pred) for pred in predictions] lines = lines_gold + lines_pred @@ -403,7 +404,7 @@ def render_images(self, annotations, predictions, images_dir): def evaluate(self, annotations, predictions): result = 0 - with tempfile.TemporaryDirectory() as images_dir: + with tempfile.TemporaryDirectory(prefix='im2latex', dir=Path.cwd()) as images_dir: self.render_images(annotations, predictions, images_dir) result = self.compare_pics(images_dir) return result diff --git a/tools/accuracy_checker/accuracy_checker/metrics/language_modeling.py b/tools/accuracy_checker/accuracy_checker/metrics/language_modeling.py index e8d021cfda4..589990d4378 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/language_modeling.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/language_modeling.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/metrics/machine_translation.py b/tools/accuracy_checker/accuracy_checker/metrics/machine_translation.py index df9beca7531..3f56ce00927 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/machine_translation.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/machine_translation.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/metrics/metric.py b/tools/accuracy_checker/accuracy_checker/metrics/metric.py index ce6bc1bad09..45a652ee823 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/metric.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/metric.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -17,11 +17,10 @@ import copy from collections import namedtuple from ..representation import ContainerRepresentation -from ..config import ConfigError from ..utils import is_single_metric_source, get_supported_representations from ..presenters import BasePresenter -from ..config import ConfigValidator, NumberField, StringField -from ..dependency import ClassProvider +from ..config import ConfigValidator, NumberField, StringField, ConfigError +from ..dependency import ClassProvider, UnregisteredProviderException from ..utils import zipped_transform, get_parameter_value_from_config, contains_any PerImageMetricResult = namedtuple('PerImageMetricResult', ['metric_name', 'metric_type', 'result', 'direction']) @@ -49,7 +48,7 @@ def __init__(self, config, dataset, name=None, state=None, profiler=None): self.meta = {'target': 'higher-better'} self._initial_state = copy.deepcopy(state) - self.validate_config() + self.validate_config(config) self.configure() message_unsupported_multi_source = 'metric {} does not support several {} sources' self.annotation_source = self.config.get('annotation_source') @@ -115,13 +114,35 @@ def configure(self): pass - def validate_config(self): + @classmethod + def validate_config(cls, config, fetch_only=False, uri_prefix=''): """ Validate that metric entry meets all configuration structure requirements. """ - ConfigValidator( - self.name, on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT, fields=self.parameters() - ).validate(self.config) + errors = [] + if cls.__name__ == Metric.__name__: + metric_provider = config.get('type') + if not metric_provider: + error = ConfigError('type does not found', config, uri_prefix or 'metric') + if not fetch_only: + raise error + errors.append(error) + return errors + try: + metric_cls = cls.resolve(metric_provider) + except UnregisteredProviderException as exception: + if not fetch_only: + raise exception + errors.append( + ConfigError("metric {} unregistered".format(metric_provider), config, uri_prefix or 'metric') + ) + return errors + errors.extend(metric_cls.validate_config(config, fetch_only=fetch_only, uri_prefix=uri_prefix)) + return errors + metric_uri = uri_prefix or 'metrics.{}'.format(cls.__provider__) + return ConfigValidator( + metric_uri, on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT, fields=cls.parameters() + ).validate(config, fetch_only=fetch_only) def _update_state(self, fn, state_key, default_factory=None): iter_key = "{}_global_it".format(state_key) diff --git a/tools/accuracy_checker/accuracy_checker/metrics/metric_executor.py b/tools/accuracy_checker/accuracy_checker/metrics/metric_executor.py index 02765d28823..61a0dfc2351 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/metric_executor.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/metric_executor.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,11 +16,10 @@ from collections import namedtuple, OrderedDict +from ..config import ConfigValidator, ConfigError, StringField from ..presenters import BasePresenter, EvaluationResult -from ..config import StringField from .metric import Metric, FullDatasetEvaluationMetric from .metric_profiler import ProfilingExecutor -from ..config import ConfigValidator, ConfigError MetricInstance = namedtuple( 'MetricInstance', ['name', 'metric_type', 'metric_fn', 'reference', 'threshold', 'presenter'] @@ -66,13 +65,6 @@ def dataset(self): def _set_dataset(self, dataset): self._dataset = dataset - def __call__(self, context, *args, **kwargs): - self.update_metrics_on_batch( - context.input_ids_batch, context.annotation_batch, context.prediction_batch - ) - context.annotations.extend(context.annotation_batch) - context.predictions.extend(context.prediction_batch) - def update_metrics_on_object(self, annotation, prediction): """ Updates metric value corresponding given annotation and prediction objects. @@ -175,7 +167,7 @@ def get_metrics_direction(self): def get_metrics_attributes(self): return { metric.name: { - 'direction': metric.metric_fn.meta.get('target', 'higher-better'), + 'direction': metric.metric_fn.meta.get('target', 'higher-better'), 'type': metric.metric_type } for metric in self.metrics } @@ -189,3 +181,15 @@ def set_processing_info(self, processing_info): def reset(self): for metric in self.metrics: metric.metric_fn.reset() + + @classmethod + def validate_config(cls, metrics, fetch_only=False, uri_prefix=''): + if not metrics: + if fetch_only: + return [ConfigError("Metrics are not provided", metrics, uri_prefix or 'metrics')] + errors = [] + for metric_id, metric in enumerate(metrics): + metric_uri = '{}.{}'.format(uri_prefix or 'metrics', metric_id) + errors.extend(Metric.validate_config(metric, fetch_only=fetch_only, uri_prefix=metric_uri)) + + return errors diff --git a/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/base_profiler.py b/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/base_profiler.py index 112d7688e90..4519ec90250 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/base_profiler.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/base_profiler.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/classifcation_metric_profiler.py b/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/classifcation_metric_profiler.py index 9caa5cab23c..064b554e527 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/classifcation_metric_profiler.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/classifcation_metric_profiler.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/instance_segmentation_metric_profiler.py b/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/instance_segmentation_metric_profiler.py index 436d290c3e9..f44b06de265 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/instance_segmentation_metric_profiler.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/instance_segmentation_metric_profiler.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ """ import numpy as np -from .base_profiler import MetricProfiler +from .base_profiler import MetricProfiler class InstanceSegmentationProfiler(MetricProfiler): __provider__ = 'instance_segmentation' @@ -123,9 +123,9 @@ def set_dataset_meta(self, meta): def generate_result_matching(per_class_result, metric_name): matching_result = { 'prediction_matches': per_class_result['dt_matches'][0].tolist(), - 'annotation_matches': per_class_result['gt_matches'][0].tolist(), + 'annotation_matches': per_class_result['gt_matches'][0].tolist(), metric_name: per_class_result['result'] - } + } return matching_result def register_metric(self, metric_name): diff --git a/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/object_detection_metric_profiler.py b/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/object_detection_metric_profiler.py index b921d671eeb..6d5c19cd09e 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/object_detection_metric_profiler.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/object_detection_metric_profiler.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -133,9 +133,9 @@ def generate_result_matching(per_class_result, metric_name): if contains_all(per_class_result, ['gt_matches', 'dt_matches']): matching_result = { 'prediction_matches': per_class_result['dt_matches'][0], - 'annotation_matches': per_class_result['gt_matches'][0], + 'annotation_matches': per_class_result['gt_matches'][0], metric_name: per_class_result['result'] - } + } return matching_result matches = per_class_result['matched'] dt_matches = np.zeros_like(per_class_result['scores'], dtype=int) diff --git a/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/profiling_executor.py b/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/profiling_executor.py index 80af9c8be40..97315a734ad 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/profiling_executor.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/profiling_executor.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/regression_metric_profiler.py b/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/regression_metric_profiler.py index cb2f7b6470b..eec8e9b0135 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/regression_metric_profiler.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/regression_metric_profiler.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/segmentation_metric_profiler.py b/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/segmentation_metric_profiler.py index 9b00641526e..aef177a0cc9 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/segmentation_metric_profiler.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/metric_profiler/segmentation_metric_profiler.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/metrics/mpjpe_multiperson.py b/tools/accuracy_checker/accuracy_checker/metrics/mpjpe_multiperson.py index c9b4e8fa4c3..dedd746f69a 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/mpjpe_multiperson.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/mpjpe_multiperson.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/metrics/multilabel_recognition.py b/tools/accuracy_checker/accuracy_checker/metrics/multilabel_recognition.py index f0547e43bc5..22745a916b0 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/multilabel_recognition.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/multilabel_recognition.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -197,12 +197,13 @@ def parameters(cls): return parameters - def validate_config(self): + @classmethod + def validate_config(cls, config): ConfigValidator( 'f1_score', on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT, - fields=self.parameters() - ).validate(self.config) + fields=cls.parameters() + ).validate(config) def configure(self): if not self.dataset.metadata: diff --git a/tools/accuracy_checker/accuracy_checker/metrics/ner.py b/tools/accuracy_checker/accuracy_checker/metrics/ner.py new file mode 100644 index 00000000000..a1fb081f145 --- /dev/null +++ b/tools/accuracy_checker/accuracy_checker/metrics/ner.py @@ -0,0 +1,416 @@ +""" +Copyright (c) 2018-2021 Intel Corporation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" +from collections import defaultdict + +import numpy as np + +from .metric import PerImageEvaluationMetric +from ..config import StringField, BoolField, ConfigError +from ..representation import ( + SequenceClassificationAnnotation, BERTNamedEntityRecognitionAnnotation, SequenceClassificationPrediction +) + + +def align_sequences(gt_seq, pred_seq, label_map, convert_token_ids=True, label_mask=None, valid_ids=None): + aligned_gt, aligned_pred = [], [] + if label_mask is not None and valid_ids is not None: + gt_seq = np.array(gt_seq)[label_mask] + pred_seq = np.array(pred_seq[valid_ids]) + start_id = 0 if gt_seq[0] in label_map and label_map[gt_seq[0]] != '[CLS]' else 1 + for gt_tok, pred_tok in zip(gt_seq[start_id:], pred_seq[start_id:]): + if gt_tok not in label_map: + continue + if gt_tok == len(label_map): + break + aligned_gt.append(gt_tok if not convert_token_ids else label_map[gt_tok]) + aligned_pred.append(pred_tok if not convert_token_ids else label_map.get(pred_tok, '[unk]')) + return aligned_gt, aligned_pred + + +def _prf_divide(numerator, denominator): + mask = denominator == 0.0 + denominator = denominator.copy() + denominator[mask] = 1 # avoid infs/nans + result = numerator / denominator + + if not np.any(mask): + return result + + # if ``zero_division=1``, set those with denominator == 0 equal to 1 + result[mask] = 0.0 + + return result + + +def _precision_recall_fscore_support(pred_sum, tp_sum, true_sum): + precision = _prf_divide( + numerator=tp_sum, + denominator=pred_sum + ) + recall = _prf_divide( + numerator=tp_sum, + denominator=true_sum, + ) + + denom = precision + recall + + denom[denom == 0] = 1 # avoid division by 0 + f_score = 2 * precision * recall / denom + + return precision, recall, f_score + + +def extract_tp_actual_correct(y_true, y_pred): + entities_true = defaultdict(set) + entities_pred = defaultdict(set) + for type_name, start, end in get_entities(y_true): + entities_true[type_name].add((start, end)) + for type_name, start, end in get_entities(y_pred): + entities_pred[type_name].add((start, end)) + + target_names = sorted(set(entities_true.keys()) | set(entities_pred.keys())) + + tp_sum = defaultdict(lambda: 0) + pred_sum = defaultdict(lambda: 0) + true_sum = defaultdict(lambda: 0) + for type_name in target_names: + entities_true_type = entities_true.get(type_name, set()) + entities_pred_type = entities_pred.get(type_name, set()) + tp_sum[type_name] += len(entities_true_type & entities_pred_type) + pred_sum[type_name] += len(entities_pred_type) + true_sum[type_name] += len(entities_true_type) + + return pred_sum, tp_sum, true_sum, target_names + + +def get_entities(seq, suffix=False): + if any(isinstance(s, list) for s in seq): + seq = [item for sublist in seq for item in sublist + ['O']] + + prev_tag = 'O' + prev_type = '' + begin_offset = 0 + chunks = [] + for i, chunk in enumerate(seq + ['O']): + if suffix: + tag = chunk[-1] + type_ = chunk[:-1].rsplit('-', maxsplit=1)[0] or '_' + else: + tag = chunk[0] + type_ = chunk[1:].split('-', maxsplit=1)[-1] or '_' + + if end_of_chunk(prev_tag, tag, prev_type, type_): + chunks.append((prev_type, begin_offset, i - 1)) + if start_of_chunk(prev_tag, tag, prev_type, type_): + begin_offset = i + prev_tag = tag + prev_type = type_ + + return chunks + + +def end_of_chunk(prev_tag, tag, prev_type, type_): + chunk_end = False + + if prev_tag == 'E': + chunk_end = True + if prev_tag == 'S': + chunk_end = True + + if prev_tag == 'B' and tag == 'B': + chunk_end = True + if prev_tag == 'B' and tag == 'S': + chunk_end = True + if prev_tag == 'B' and tag == 'O': + chunk_end = True + if prev_tag == 'I' and tag == 'B': + chunk_end = True + if prev_tag == 'I' and tag == 'S': + chunk_end = True + if prev_tag == 'I' and tag == 'O': + chunk_end = True + + if prev_tag != 'O' and prev_tag != '.' and prev_type != type_: + chunk_end = True + + return chunk_end + + +def start_of_chunk(prev_tag, tag, prev_type, type_): + chunk_start = False + + if tag == 'B': + chunk_start = True + if tag == 'S': + chunk_start = True + + if prev_tag == 'E' and tag == 'E': + chunk_start = True + if prev_tag == 'E' and tag == 'I': + chunk_start = True + if prev_tag == 'S' and tag == 'E': + chunk_start = True + if prev_tag == 'S' and tag == 'I': + chunk_start = True + if prev_tag == 'O' and tag == 'E': + chunk_start = True + if prev_tag == 'O' and tag == 'I': + chunk_start = True + + if tag != 'O' and tag != '.' and prev_type != type_: + chunk_start = True + + return chunk_start + + +class NERAccuracy(PerImageEvaluationMetric): + __provider__ = 'ner_accuracy' + annotation_types = (SequenceClassificationAnnotation, BERTNamedEntityRecognitionAnnotation,) + prediction_types = (SequenceClassificationPrediction, ) + + @classmethod + def parameters(cls): + parameters = super().parameters() + parameters.update({ + 'label_map': StringField(optional=True, default='label_map', description="Label map."), + 'include_all_tokens': BoolField( + optional=True, default=False, + description='should all tokens will be considered during metirc calculation or not' + ) + }) + return parameters + + def configure(self): + label_map = self.get_value_from_config('label_map') + if self.dataset.metadata: + self.labels = self.dataset.metadata.get(label_map) + if not self.labels: + raise ConfigError('ner_accuracy metric requires label_map providing in dataset_meta' + 'Please provide dataset meta file or regenerate annotation') + else: + raise ConfigError('ner_accuracy metric requires dataset metadata' + 'Please provide dataset meta file or regenerate annotation') + self.include_all_tokens = self.get_value_from_config('include_all_tokens') + self.correct = 0 + self.total = 0 + + def update(self, annotation, prediction): + gt_seq = annotation.label + pred_seq = prediction.label + label_mask = annotation.label_mask if not self.include_all_tokens else None + valid_ids = annotation.valid_ids if not self.include_all_tokens else None + y_true, y_pred = align_sequences( + gt_seq, pred_seq, self.labels, False, label_mask, valid_ids + ) + nb_correct = sum(y_t == y_p for y_t, y_p in zip(y_true, y_pred)) + nb_true = len(y_true) + self.correct += nb_correct + self.total += nb_true + + return nb_correct / nb_true if nb_true else 0 + + def evaluate(self, annotations, predictions): + return self.correct / self.total if self.total else 0 + + def reset(self): + self.correct = 0 + self.total = 0 + + +class NERPrecision(PerImageEvaluationMetric): + __provider__ = 'ner_recall' + annotation_types = (SequenceClassificationAnnotation, BERTNamedEntityRecognitionAnnotation,) + prediction_types = (SequenceClassificationPrediction, ) + + @classmethod + def parameters(cls): + parameters = super().parameters() + parameters.update({ + 'label_map': StringField(optional=True, default='label_map', description="Label map."), + 'include_all_tokens': BoolField( + optional=True, default=False, + description='should all tokens will be considered during metirc calculation or not' + )}) + return parameters + + def configure(self): + label_map = self.get_value_from_config('label_map') + if self.dataset.metadata: + self.labels = self.dataset.metadata.get(label_map) + if not self.labels: + raise ConfigError('ner_recall metric requires label_map providing in dataset_meta' + 'Please provide dataset meta file or regenerate annotation') + else: + raise ConfigError('ner_recall metric requires dataset metadata' + 'Please provide dataset meta file or regenerate annotation') + self.reset() + self.imclude_all_tokens = self.get_value_from_config('include_all_tokens') + + def update(self, annotation, prediction): + gt_seq = annotation.label + pred_seq = prediction.label + label_mask = annotation.label_mask if not self.include_all_tokens else None + valid_ids = annotation.valid_ids if not self.include_all_tokens else None + y_true, y_pred = align_sequences(gt_seq, pred_seq, self.labels, False, label_mask, valid_ids) + pred_sum, tp_sum, true_sum, target_names = extract_tp_actual_correct(y_true, y_pred) + for type_name in target_names: + + self.tp_sum[type_name] += tp_sum[type_name] + self.pred_sum[type_name] += pred_sum[type_name] + self.true_sum[type_name] += true_sum[type_name] + pred_sum_arr = np.array(list(pred_sum.values())) + tp_sum_arr = np.array(list(tp_sum.values())) + true_sum_arr = np.array(list(true_sum.values())) + _, r, _ = _precision_recall_fscore_support(pred_sum_arr, tp_sum_arr, true_sum_arr) + return r + + def evaluate(self, annotations, predictions): + pred_sum_arr = np.array(list(self.pred_sum.values())) + tp_sum_arr = np.array(list(self.tp_sum.values())) + true_sum_arr = np.array(list(self.true_sum.values())) + _, recall, _ = _precision_recall_fscore_support(pred_sum_arr, tp_sum_arr, true_sum_arr) + self.meta['names'] = list(self.pred_sum.keys()) + + return recall + + def reset(self): + self.tp_sum = defaultdict(lambda: 0) + self.pred_sum = defaultdict(lambda: 0) + self.true_sum = defaultdict(lambda: 0) + + +class NERRecall(PerImageEvaluationMetric): + __provider__ = 'ner_precision' + annotation_types = (SequenceClassificationAnnotation, BERTNamedEntityRecognitionAnnotation,) + prediction_types = (SequenceClassificationPrediction, ) + + @classmethod + def parameters(cls): + parameters = super().parameters() + parameters.update({ + 'label_map': StringField(optional=True, default='label_map', description="Label map."), + 'include_all_tokens': BoolField( + optional=True, default=False, + description='should all tokens will be considered during metric calculation or not' + ) + }) + return parameters + + def configure(self): + label_map = self.get_value_from_config('label_map') + if self.dataset.metadata: + self.labels = self.dataset.metadata.get(label_map) + if not self.labels: + raise ConfigError('ner_precision metric requires label_map providing in dataset_meta' + 'Please provide dataset meta file or regenerate annotation') + else: + raise ConfigError('ner_precision metric requires dataset metadata' + 'Please provide dataset meta file or regenerate annotation') + self.reset() + self.include_all_tokens = self.get_value_from_config('include_all_tokens') + + def update(self, annotation, prediction): + gt_seq = annotation.label + pred_seq = prediction.label + label_mask = annotation.label_mask if not self.include_all_tokens else None + valid_ids = annotation.valid_ids if not self.include_all_tokens else None + y_true, y_pred = align_sequences(gt_seq, pred_seq, self.labels, False, label_mask, valid_ids) + pred_sum, tp_sum, true_sum, target_names = extract_tp_actual_correct(y_true, y_pred) + for type_name in target_names: + self.tp_sum[type_name] += tp_sum[type_name] + self.pred_sum[type_name] += pred_sum[type_name] + self.true_sum[type_name] += true_sum[type_name] + pred_sum_arr = np.array(list(pred_sum.values())) + tp_sum_arr = np.array(list(tp_sum.values())) + true_sum_arr = np.array(list(true_sum.values())) + p, _, _ = _precision_recall_fscore_support(pred_sum_arr, tp_sum_arr, true_sum_arr) + return p + + def evaluate(self, annotations, predictions): + pred_sum_arr = np.array(list(self.pred_sum.values())) + tp_sum_arr = np.array(list(self.tp_sum.values())) + true_sum_arr = np.array(list(self.true_sum.values())) + precision, _, _ = _precision_recall_fscore_support(pred_sum_arr, tp_sum_arr, true_sum_arr) + self.meta['names'] = list(self.pred_sum.keys()) + + return precision + + def reset(self): + self.tp_sum = defaultdict(lambda: 0) + self.pred_sum = defaultdict(lambda: 0) + self.true_sum = defaultdict(lambda: 0) + + +class NERFScore(PerImageEvaluationMetric): + __provider__ = 'ner_f_score' + annotation_types = (SequenceClassificationAnnotation, BERTNamedEntityRecognitionAnnotation,) + prediction_types = (SequenceClassificationPrediction, ) + + @classmethod + def parameters(cls): + parameters = super().parameters() + parameters.update({ + 'label_map': StringField(optional=True, default='label_map', description="Label map."), + 'include_all_tokens': BoolField( + optional=True, default=False, + description='should all tokens will be considered during metirc calculation or not' + ) + }) + return parameters + + def configure(self): + label_map = self.get_value_from_config('label_map') + if self.dataset.metadata: + self.labels = self.dataset.metadata.get(label_map) + if not self.labels: + raise ConfigError('ner_f_score metric requires label_map providing in dataset_meta' + 'Please provide dataset meta file or regenerate annotation') + else: + raise ConfigError('ner_f_score metric requires dataset metadata' + 'Please provide dataset meta file or regenerate annotation') + self.reset() + self.include_all_tokens = self.get_value_from_config('include_all_tokens') + + def update(self, annotation, prediction): + gt_seq = annotation.label + pred_seq = prediction.label + label_mask = annotation.label_mask if not self.include_all_tokens else None + valid_ids = annotation.valid_ids if not self.include_all_tokens else None + y_true, y_pred = align_sequences(gt_seq, pred_seq, self.labels, True, label_mask, valid_ids) + pred_sum, tp_sum, true_sum, target_names = extract_tp_actual_correct(y_true, y_pred) + for type_name in target_names: + self.tp_sum[type_name] += tp_sum[type_name] + self.pred_sum[type_name] += pred_sum[type_name] + self.true_sum[type_name] += true_sum[type_name] + pred_sum_arr = np.array(list(pred_sum.values())) + tp_sum_arr = np.array(list(tp_sum.values())) + true_sum_arr = np.array(list(true_sum.values())) + _, _, f = _precision_recall_fscore_support(pred_sum_arr, tp_sum_arr, true_sum_arr) + return f + + def evaluate(self, annotations, predictions): + pred_sum_arr = np.array(list(self.pred_sum.values())) + tp_sum_arr = np.array(list(self.tp_sum.values())) + true_sum_arr = np.array(list(self.true_sum.values())) + _, _, f_score = _precision_recall_fscore_support(pred_sum_arr, tp_sum_arr, true_sum_arr) + self.meta['names'] = list(self.pred_sum.keys()) + + return f_score + + def reset(self): + self.tp_sum = defaultdict(lambda: 0) + self.pred_sum = defaultdict(lambda: 0) + self.true_sum = defaultdict(lambda: 0) diff --git a/tools/accuracy_checker/accuracy_checker/metrics/overlap.py b/tools/accuracy_checker/accuracy_checker/metrics/overlap.py index 9a12f3deb44..9c86377e917 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/overlap.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/overlap.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/metrics/question_answering.py b/tools/accuracy_checker/accuracy_checker/metrics/question_answering.py index 997f8f7edea..c6c86bb27cf 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/question_answering.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/question_answering.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -51,6 +51,7 @@ def get_tokens(s): return [] return normalize_answer(s).split() + class ScoreF1(PerImageEvaluationMetric): __provider__ = 'f1' @@ -127,7 +128,8 @@ def reset(self): del self.per_question_results self.per_question_results = {} -class QuestionAnsweringEmbeddingAccurcay(FullDatasetEvaluationMetric): + +class QuestionAnsweringEmbeddingAccuracy(FullDatasetEvaluationMetric): __provider__ = 'qa_embedding_accuracy' annotation_types = (QuestionAnsweringEmbeddingAnnotation,) diff --git a/tools/accuracy_checker/accuracy_checker/metrics/regression.py b/tools/accuracy_checker/accuracy_checker/metrics/regression.py index 837b40be828..a5910f01c75 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/regression.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/regression.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ import warnings import math +from collections import OrderedDict from functools import singledispatch import numpy as np @@ -40,7 +41,9 @@ StyleTransferPrediction, FeaturesRegressionAnnotation, PoseEstimationAnnotation, - PoseEstimationPrediction + PoseEstimationPrediction, + OpticalFlowAnnotation, + OpticalFlowPrediction ) from .metric import PerImageEvaluationMetric @@ -49,8 +52,10 @@ class BaseRegressionMetric(PerImageEvaluationMetric): - annotation_types = (RegressionAnnotation, FeaturesRegressionAnnotation, DepthEstimationAnnotation) - prediction_types = (RegressionPrediction, DepthEstimationPrediction) + annotation_types = ( + RegressionAnnotation, FeaturesRegressionAnnotation, DepthEstimationAnnotation, ImageProcessingAnnotation + ) + prediction_types = (RegressionPrediction, DepthEstimationPrediction, ImageProcessingPrediction) def __init__(self, value_differ, *args, **kwargs): super().__init__(*args, **kwargs) @@ -66,6 +71,15 @@ def configure(self): def update(self, annotation, prediction): diff = self.calculate_diff(annotation, prediction) + if isinstance(diff, dict): + if not self.magnitude: + self.magnitude = OrderedDict() + for key, difference in diff.items(): + v_mag = self.magnitude.get(key, []) + v_mag.append(difference) + self.magnitude[key] = v_mag + return np.mean(next(iter(diff.values()))) + if self.profiler: if isinstance(annotation, RegressionAnnotation): ann_value, pred_value = annotation.value, prediction.value @@ -79,7 +93,29 @@ def update(self, annotation, prediction): return diff def _calculate_diff_regression_rep(self, annotation, prediction): - return self.value_differ(annotation.value, prediction.value) + if isinstance(annotation.value, dict): + if not isinstance(prediction.value, dict): + if len(annotation.value) != 1: + raise ConfigError('both annotation and prediction should be dict-like in case of multiple outputs') + return self.value_differ(next(iter(annotation.value.values())), prediction.value) + diff_dict = OrderedDict() + for key in annotation.value: + diff = self.value_differ(annotation.value[key], prediction.value[key]) + if np.ndim(diff) > 1: + diff = np.mean(diff) + diff_dict[key] = diff + return diff_dict + if isinstance(prediction.value, dict): + if len(prediction.value) != 1: + raise ConfigError('annotation for all predictions should be provided') + diff = self.value_differ(annotation.value, next(iter(prediction.value.values()))) + if not np.isscalar(diff) and np.size(diff) > 1: + diff = np.mean(diff) + return diff + diff = self.value_differ(annotation.value, prediction.value) + if not np.isscalar(diff) and np.size(diff) > 1: + diff = np.mean(diff) + return diff def _calculate_diff_depth_estimation_rep(self, annotation, prediction): diff = annotation.mask * self.value_differ(annotation.depth_map, prediction.depth_map) @@ -93,6 +129,14 @@ def _calculate_diff_depth_estimation_rep(self, annotation, prediction): def evaluate(self, annotations, predictions): if self.profiler: self.profiler.finish() + if isinstance(self.magnitude, dict): + names, result = [], [] + for key, values in self.magnitude.items(): + names.extend(['{}@mean'.format(key), '{}@std'.format(key)]) + result.extend([np.mean(values), np.std(values)]) + self.meta['names'] = names + return result + return np.mean(self.magnitude), np.std(self.magnitude) def reset(self): @@ -290,6 +334,21 @@ def evaluate(self, annotations, predictions): return result +def relative_err(target, pred): + if len(target.shape) > 2: + target = target.flatten() + if len(pred.shape) > 2: + pred = pred.flatten() + return np.linalg.norm(target - pred, 2) / (np.linalg.norm(target, 2) + np.finfo(float).eps) + + +class RelativeL2Error(BaseRegressionMetric): + __provider__ = 'relative_l2_error' + + def __init__(self, *args, **kwargs): + super().__init__(relative_err, *args, **kwargs) + + class FacialLandmarksPerPointNormedError(PerImageEvaluationMetric): __provider__ = 'per_point_normed_error' @@ -505,7 +564,8 @@ def parameters(cls): 'color_order': StringField( optional=True, choices=['BGR', 'RGB'], default='RGB', description="The field specified which color order BGR or RGB will be used during metric calculation." - ) + ), + 'normalized_images': BoolField(optional=True, default=False, description='images in [0, 1] range or not') }) return parameters @@ -524,6 +584,8 @@ def configure(self): } self.meta['postfix'] = 'Db' self.channel_order = channel_order[color_order] + self.normalized_images = self.get_value_from_config('normalized_images') + self.color_scale = 255 if not self.normalized_images else 1 def _psnr_differ(self, annotation_image, prediction_image): prediction = np.asarray(prediction_image).astype(np.float) @@ -538,7 +600,7 @@ def _psnr_differ(self, annotation_image, prediction_image): self.scale_border:height - self.scale_border, self.scale_border:width - self.scale_border ] - image_difference = (prediction - ground_truth) / 255 + image_difference = (prediction - ground_truth) / self.color_scale if len(ground_truth.shape) == 3 and ground_truth.shape[2] == 3: r_channel_diff = image_difference[:, :, self.channel_order[0]] g_channel_diff = image_difference[:, :, self.channel_order[1]] @@ -565,9 +627,11 @@ def angle_differ(gt_gaze_vector, predicted_gaze_vector): def log10_differ(annotation_val, prediction_val): return np.abs(np.log10(annotation_val) - np.log10(prediction_val)) + def mape_differ(annotation_val, prediction_val): return np.abs(annotation_val - prediction_val) / annotation_val + class AngleError(BaseRegressionMetric): __provider__ = 'angle_error' @@ -632,7 +696,7 @@ def configure(self): self.threshold = self.get_value_from_config('threshold') self.score_bias = self.get_value_from_config('score_bias') self.meta.update({ - 'names': ['head', 'shoulder', 'elbow', 'wrist', 'hip', 'knee', 'ankle', 'mean'], + 'names': ['mean', 'head', 'shoulder', 'elbow', 'wrist', 'hip', 'knee', 'ankle', 'mean'], 'calculate_mean': False }) if not contains_all( @@ -648,7 +712,7 @@ def update(self, annotation, prediction): uv_err = np.linalg.norm(uv_error, axis=1) headbox = np.array(annotation.metadata['headbox']) headsizes = headbox[1] - headbox[0] - headsizes = np.linalg.norm(headsizes) + headsizes = np.linalg.norm(headsizes, axis=0) headsizes *= self.score_bias scale = headsizes scaled_uv_err = np.divide(uv_err, scale) @@ -656,13 +720,19 @@ def update(self, annotation, prediction): self.jnt_count += jnt_visible less_than_threshold = np.multiply((scaled_uv_err < self.threshold), jnt_visible) self.pck += less_than_threshold - return np.divide( - less_than_threshold, jnt_visible, out=np.zeros_like(less_than_threshold), where=jnt_visible != 0 - ) + return np.mean(np.divide( + less_than_threshold.astype(float), + jnt_visible.astype(float), + out=np.zeros_like(less_than_threshold, dtype=float), + where=jnt_visible != 0 + )) def evaluate(self, annotations, predictions): full_score = np.divide(self.pck, self.jnt_count, out=np.zeros_like(self.jnt_count), where=self.jnt_count != 0) + full_score = np.ma.array(full_score, mask=False) + full_score[6:8].mask = True return [ + np.mean(full_score), full_score[self.joints['head']], 0.5 * (full_score[self.joints['lsho']] + full_score[self.joints['rsho']]), 0.5 * (full_score[self.joints['lelb']] + full_score[self.joints['relb']]), @@ -670,9 +740,19 @@ def evaluate(self, annotations, predictions): 0.5 * (full_score[self.joints['lhip']] + full_score[self.joints['rhip']]), 0.5 * (full_score[self.joints['lkne']] + full_score[self.joints['rkne']]), 0.5 * (full_score[self.joints['lank']] + full_score[self.joints['rank']]), - np.mean(full_score), - ] + ] def reset(self): self.jnt_count = np.zeros(self.num_joints) self.pck = np.zeros(self.num_joints) + + +class EndPointError(BaseRegressionMetric): + __provider__ = 'epe' + annotation_types = (OpticalFlowAnnotation, ) + prediction_types = (OpticalFlowPrediction, ) + + def __init__(self, *args, **kwargs): + def l2_diff(ann_value, pred_value): + return np.mean(np.linalg.norm(ann_value - pred_value, ord=2, axis=2)) + super().__init__(l2_diff, *args, **kwargs) diff --git a/tools/accuracy_checker/accuracy_checker/metrics/reid.py b/tools/accuracy_checker/accuracy_checker/metrics/reid.py index a701c7c2a0d..b9260ca6591 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/reid.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/reid.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,18 +24,72 @@ PlaceRecognitionAnnotation, ReIdentificationPrediction ) -from ..config import BaseField, BoolField, NumberField +from ..config import BaseField, BoolField, NumberField, StringField from .metric import FullDatasetEvaluationMetric -from ..utils import UnsupportedPackage + + +def _auc(x, y): + if x.shape[0] < 2: + raise ValueError('At least 2 points are needed to compute' + ' area under curve, but x.shape = {}'.format(x.shape)) + direction = 1 + dx = np.diff(x) + if np.any(dx < 0): + if np.all(dx <= 0): + direction = -1 + else: + raise ValueError("x is neither increasing nor decreasing " + ": {}.".format(x)) + area = direction * np.trapz(y, x) + return area + + +def _binary_clf_curve(y_true, y_score): + pos_label = 1. + + # make y_true a boolean vector + y_true = (y_true == pos_label) + + # sort scores and corresponding truth values + desc_score_indices = np.argsort(y_score, kind="mergesort")[::-1] + y_score = y_score[desc_score_indices] + y_true = y_true[desc_score_indices] + weight = 1. + + distinct_value_indices = np.where(np.diff(y_score))[0] + threshold_idxs = np.r_[distinct_value_indices, y_true.size - 1] + + # accumulate the true positives with decreasing threshold + tps = np.cumsum((y_true * weight), axis=None, dtype=np.float64)[threshold_idxs] + fps = 1 + threshold_idxs - tps + return fps, tps, y_score[threshold_idxs] + + +def _precision_recall_curve(y_true, probas_pred): + + fps, tps, thresholds = _binary_clf_curve(y_true, probas_pred,) + + precision = tps / (tps + fps) + precision[np.isnan(precision)] = 0 + recall = tps / tps[-1] + + # stop when full recall attained + # and reverse the outputs so recall is decreasing + last_ind = tps.searchsorted(tps[-1]) + sl = slice(last_ind, None, -1) + return np.r_[precision[sl], 1], np.r_[recall[sl], 0], thresholds[sl] + try: from sklearn.metrics import auc, precision_recall_curve -except ImportError as import_error: - auc = UnsupportedPackage("sklearn.metrics.auc", import_error.msg) - precision_recall_curve = UnsupportedPackage("sklearn.metrics.precision_recall_curve", import_error.msg) +except ImportError: + auc = _auc + precision_recall_curve = _precision_recall_curve + PairDesc = namedtuple('PairDesc', 'image1 image2 same') + def _average_binary_score(binary_metric, y_true, y_score): def binary_target(y): return not (len(np.unique(y)) > 2) or (y.ndim >= 2 and len(y[0]) > 1) @@ -175,33 +229,69 @@ def parameters(cls): 'min_score': BaseField( optional=True, default='train_median', description="Min score for determining that objects are different. " - "You can provide value or use train_median value which will be calculated " - "if annotations has training subset." + "You can provide value or use train_median or best_train_threshold values " + "which will be calculated if annotations has training subset." + ), + 'distance_method': StringField( + optional=True, default='euclidian_distance', + description='Allows to choose one of the distance calculation methods', + choices=['euclidian_distance', 'cosine_distance'] + ), + 'subtract_mean': BoolField( + optional=True, default=False, description='Allows to subtract mean calculated on train embeddings ' + 'before calculating the distance' ) }) return parameters def configure(self): self.min_score = self.get_value_from_config('min_score') + self.distance_method = self.get_value_from_config('distance_method') + self.subtract_mean = self.get_value_from_config('subtract_mean') def evaluate(self, annotations, predictions): - embed_distances, pairs = get_embedding_distances(annotations, predictions) - if not pairs: - return np.nan - min_score = self.min_score if min_score == 'train_median': - train_distances, _train_pairs = get_embedding_distances(annotations, predictions, train=True) - min_score = np.median(train_distances) + train_distances, _train_pairs, mean = get_embedding_distances(annotations, predictions, train=True, + distance_method=self.distance_method, + save_mean=self.subtract_mean) + min_score_value = np.median(train_distances) + elif min_score == 'best_train_threshold': + train_distances, train_pairs, mean = get_embedding_distances(annotations, predictions, train=True, + distance_method=self.distance_method, + save_mean=self.subtract_mean) + thresholds = np.arange(0, 4, 0.01) + accuracy_train = np.zeros((thresholds.size)) + for threshold_idx, threshold in enumerate(thresholds): + train_same_class = train_distances < threshold + accuracy = 0 + for i, pair in enumerate(train_pairs): + same_label = pair.same + out_same = train_same_class[i] + + correct_prediction = (same_label and out_same) or (not same_label and not out_same) + + if correct_prediction: + accuracy += 1 + accuracy_train[threshold_idx] = accuracy + min_score_value = thresholds[np.argmax(accuracy_train)] + else: + min_score_value = min_score + mean = 0.0 + + embed_distances, pairs, _ = get_embedding_distances(annotations, predictions, mean=mean, + distance_method=self.distance_method) + if not pairs: + return np.nan - embed_same_class = embed_distances < min_score + embed_same_class = embed_distances < min_score_value accuracy = 0 for i, pair in enumerate(pairs): same_label = pair.same out_same = embed_same_class[i] - correct_prediction = same_label and out_same or (not same_label and not out_same) + correct_prediction = (same_label and out_same) or (not same_label and not out_same) if correct_prediction: accuracy += 1 @@ -221,6 +311,21 @@ def parameters(cls): params.update({ 'subset_number': NumberField( optional=True, min_value=1, value_type=int, default=10, description="Number of subsets for separating." + ), + 'min_score': BaseField( + optional=True, default='train_median', + description="Min score for determining that objects are different. " + "You can provide value or use train_median or best_train_threshold values " + "which will be calculated if annotations has training subset." + ), + 'distance_method': StringField( + optional=True, default='euclidian_distance', + description='Allows to choose one of the distance calculation methods', + choices=['euclidian_distance', 'cosine_distance'] + ), + 'subtract_mean': BoolField( + optional=True, default=False, description='Allows to subtract mean calculated on train embeddings ' + 'before calculating the distance' ) }) return params @@ -287,6 +392,7 @@ def get_subset(container, subset_bounds): return subset + class FaceRecognitionTAFAPairMetric(FullDatasetEvaluationMetric): __provider__ = 'face_recognition_tafa_pair_metric' @@ -337,6 +443,7 @@ def evaluate(self, annotations, predictions): return [(tp+tn) / (tp+fp+tn+fn)] + class NormalizedEmbeddingAccuracy(FullDatasetEvaluationMetric): """ Accuracy score calculated with normalized embedding dot products @@ -396,8 +503,7 @@ def evaluate(self, annotations, predictions): dist_mat *= valid_mask sorted_idx = np.argsort(-dist_mat, axis=1)[:, :self.top_k] - apply_func = lambda row: np.fromiter(map(lambda i: gallery_person_ids[i], row), dtype=np.int) - pred_top_k_query_ids = np.apply_along_axis(apply_func, 1, sorted_idx).T + pred_top_k_query_ids = gallery_person_ids[sorted_idx].T query_person_ids = np.tile(query_person_ids, (self.top_k, 1)) tp = np.any(query_person_ids == pred_top_k_query_ids, axis=0).sum() @@ -407,6 +513,7 @@ def evaluate(self, annotations, predictions): return 0 return tp/(tp+fp) + def regroup_pairs(annotations, predictions): image_indexes = {} @@ -424,10 +531,12 @@ def regroup_pairs(annotations, predictions): return pairs + def extract_embeddings(annotation, prediction, query): embeddings = [pred.embedding for pred, ann in zip(prediction, annotation) if ann.query == query] return np.stack(embeddings) if embeddings else embeddings + def get_gallery_query_pids(annotation): gallery_pids = np.asarray([ann.person_id for ann in annotation if not ann.query]) query_pids = np.asarray([ann.person_id for ann in annotation if ann.query]) @@ -546,7 +655,8 @@ def get_valid_subset(gallery_cams, gallery_ids, query_index, indices, query_cams return valid -def get_embedding_distances(annotation, prediction, train=False): +def get_embedding_distances(annotation, prediction, train=False, distance_method='euclidian_distance', + save_mean=False, mean=0.0): image_indexes = {} for i, pred in enumerate(prediction): image_indexes[pred.identifier] = i @@ -569,15 +679,25 @@ def get_embedding_distances(annotation, prediction, train=False): if pairs: embed1 = np.asarray([prediction[idx].embedding for idx, _, _ in pairs]) embed2 = np.asarray([prediction[idx].embedding for _, idx, _ in pairs]) - return 0.5 * (1 - np.sum(embed1 * embed2, axis=1)), pairs - return None, pairs - + if save_mean: + mean = np.mean(np.concatenate([embed1, embed2]), axis=0) + dist = distance(embed1 - mean, embed2 - mean, distance_method) + return dist, pairs, mean + return None, pairs, mean + +def distance(embed1, embed2, distance_method='euclidian_distance'): + if distance_method == 'euclidian_distance': + dist = 0.5 * (1 - np.sum(embed1 * embed2, axis=1)) + else: + # Distance based on cosine similarity + dot = np.sum(np.multiply(embed1, embed2), axis=1) + norm = np.linalg.norm(embed1, axis=1) * np.linalg.norm(embed2, axis=1) + similarity = dot / norm + dist = np.arccos(similarity) / np.pi + + return dist def binary_average_precision(y_true, y_score, interpolated_auc=True): - if isinstance(auc, UnsupportedPackage): - auc.raise_error("reid metric") - if isinstance(precision_recall_curve, UnsupportedPackage): - precision_recall_curve.raise_error("reid metric") def _average_precision(y_true_, y_score_): precision, recall, _ = precision_recall_curve(y_true_, y_score_) if not interpolated_auc: diff --git a/tools/accuracy_checker/accuracy_checker/metrics/salient_objects_detection.py b/tools/accuracy_checker/accuracy_checker/metrics/salient_objects_detection.py new file mode 100644 index 00000000000..4f0b0557fed --- /dev/null +++ b/tools/accuracy_checker/accuracy_checker/metrics/salient_objects_detection.py @@ -0,0 +1,241 @@ +""" +Copyright (c) 2018-2021 Intel Corporation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +import numpy as np +from .metric import PerImageEvaluationMetric +from ..representation import SalientRegionAnnotation, SalientRegionPrediction + + +class SalienceMapMAE(PerImageEvaluationMetric): + __provider__ = 'salience_mae' + annotation_types = (SalientRegionAnnotation, ) + prediction_types = (SalientRegionPrediction, ) + + def configure(self): + self.errors = [] + self.meta.update({ + 'names': ['mean', 'std'], + 'scale': 1, + 'postfix': ' ', + 'calculate_mean': False, + 'target': 'higher-worse' + }) + self.cnt = 0 + + def update(self, annotation, prediction): + self.cnt += 1 + if np.max(annotation.mask) == 0 or np.max(prediction.mask) == 0: + return 0 + foreground_pixels = prediction.mask[np.where(annotation.mask)] + foreground_error = np.size(foreground_pixels) - np.sum(foreground_pixels) + background_error = np.sum(prediction.mask[np.where(~annotation.mask)]) + mae = (foreground_error + background_error) / np.size(annotation.mask) + self.errors.append(mae) + return mae + + def evaluate(self, annotations, predictions): + return np.mean(self.errors), np.std(self.errors) + + def reset(self): + del self.errors + self.errors = [] + self.cnt = 0 + + +class SalienceMapFMeasure(PerImageEvaluationMetric): + __provider__ = 'salience_f-measure' + annotation_types = (SalientRegionAnnotation, ) + prediction_types = (SalientRegionPrediction, ) + + def configure(self): + self.recalls, self.precisions, self.fmeasure = [], [], [] + self.meta.update({ + 'names': ['f-measure', 'recall', 'precision'], + 'calculate_mean': False, + }) + + def update(self, annotation, prediction): + sum_label = 2 * np.mean(prediction.mask) + if sum_label > 1: + sum_label = 1 + + label3 = np.zeros_like(annotation.mask) + label3[prediction.mask >= sum_label] = 1 + + num_recall = np.sum(label3 == 1) + label_and = np.logical_and(label3, annotation.mask) + num_and = np.sum(label_and == 1) + num_obj = np.sum(annotation.mask) + + if num_and == 0: + self.recalls.append(0) + self.precisions.append(0) + self.fmeasure.append(0) + return 0 + precision = num_and / num_recall if num_recall != 0 else 0 + recall = num_and / num_obj if num_obj != 0 else 0 + fmeasure = (1.3 * precision * recall) / (0.3 * precision + recall) if precision + recall != 0 else 0 + self.recalls.append(recall) + self.precisions.append(precision) + self.fmeasure.append(fmeasure) + return fmeasure + + def evaluate(self, annotations, predictions): + return np.mean(self.fmeasure), np.mean(self.recalls), np.mean(self.precisions) + + def reset(self): + self.recalls, self.precisions, self.fmeasure = [], [], [] + + +class SalienceEMeasure(PerImageEvaluationMetric): + __provider__ = 'salience_e-measure' + annotation_types = (SalientRegionAnnotation, ) + prediction_types = (SalientRegionPrediction, ) + + def configure(self): + self.scores = [] + + def update(self, annotation, prediction): + if np.sum(annotation.mask) == 0: + enhance_matrix = 1 - prediction.mask + elif np.sum(~annotation.mask) == 0: + enhance_matrix = prediction.mask + else: + align_matrix = self.alignment_term(prediction.mask, annotation.mask) + enhance_matrix = ((align_matrix + 1)**2) / 4 + h, w = annotation.mask.shape[:2] + score = np.sum(enhance_matrix)/(w * h + np.finfo(float).eps) + self.scores.append(score) + return score + + @staticmethod + def alignment_term(pred_mask, gt_mask): + mu_fm = np.mean(pred_mask) + mu_gt = np.mean(gt_mask) + align_fm = pred_mask - mu_fm + align_gt = gt_mask - mu_gt + + align_matrix = 2. * (align_gt * align_fm) / (align_gt * align_gt + align_fm * align_fm + np.finfo(float).eps) + return align_matrix + + def evaluate(self, annotations, predictions): + return np.mean(self.scores) + + def reset(self): + self.scores = [] + + +class SalienceSMeasure(PerImageEvaluationMetric): + __provider__ = 'salience_s-measure' + annotation_types = (SalientRegionAnnotation, ) + prediction_types = (SalientRegionPrediction, ) + + def configure(self): + self.scores = [] + + def update(self, annotation, prediction): + y = np.mean(annotation.mask) + x = np.mean(prediction.mask) + if y == 0: + self.scores.append(1 - x) + return 1 - x + if y == 1: + self.scores.append(x) + return x + score = 0.5 * ( + self.s_object(prediction.mask, annotation.mask) + self.s_region(prediction.mask, annotation.mask) + ) + self.scores.append(score) + return score + + @staticmethod + def s_object(pred_mask, gt_mask): + def obj(pred, gt): + x = np.mean(pred[np.where(gt)]) + x_sigma = np.std(pred(np.where(gt))) + return 2 * x / (x ** 2 + 1 + x_sigma + np.finfo(float).eps) + + pred_fg = pred_mask + pred_fg[np.where(~gt_mask)] = 0 + o_fg = obj(pred_fg, gt_mask) + pred_bg = 1 - pred_mask + pred_bg[np.where(gt_mask)] = 0 + o_bg = obj(pred_bg, ~gt_mask) + union = np.mean(gt_mask) + return union * o_fg + (1 - union) * o_bg + + def s_region(self, pred_mask, gt_mask): + x, y = self.centroid(gt_mask) + g1, g2, g3, g4, w1, w2, w3, w4 = self.get_regions(gt_mask, x, y, True) + p1, p2, p3, p4 = self.get_regions(pred_mask, x, y) + q1 = self.ssim(p1, g1) + q2 = self.ssim(p2, g2) + q3 = self.ssim(p3, g3) + q4 = self.ssim(p4, g4) + return w1 * q1 + w2 * q2 + w3 * q3 + w4 * q4 + + @staticmethod + def centroid(gt_mask): + h, w = gt_mask.shape[:2] + area = np.sum(gt_mask) + if area == 0: + return w // 2, h // 2 + x = np.ones((h, 1)) @ np.arange(w) + y = np.arange(h).T @ np.ones((1, w)) + x = np.round(np.sum(x * gt_mask)) // area + y = np.round(np.sum(y * gt_mask)) // area + return x, y + + @staticmethod + def get_regions(mask, x, y, get_width=False): + height, width = mask.shape[:2] + lt = mask[:y, :x] + rt = mask[:y, (x + 1):] + lb = mask[(y + 1):, :x] + rb = mask[(y + 1):, (x + 1):] + if not get_width: + return lt, rt, lb, rb + area = height * width + w1 = x*y / area + w2 = (width - x) * y / area + w3 = (height - y) * x / area + w4 = 1 - w1 - w2 - w3 + return lt, rt, lb, rb, w1, w2, w3, w4 + + @staticmethod + def ssim(pred, gt): + h, w = pred.shape[:2] + n = h * w + x = np.mean(pred) + y = np.mean(gt) + sigma_x2 = np.sum((pred - x) ** 2) / (n - 1 + np.finfo(float).eps) + sigma_y2 = np.sum((gt - y) ** 2) / (n - 1 + np.finfo(float).eps) + sigma_xy = np.sum((pred - x) * (gt - y)) / (n - 1 + np.finfo(float).eps) + + alpha = 4 * x * y * sigma_xy + beta = (x ** 2 + y ** 2) * (sigma_x2 + sigma_y2) + + if alpha != 0: + return alpha / (beta + np.finfo(float).eps) + if alpha == 0 and beta == 0: + return 1.0 + return 0.0 + + def evaluate(self, annotations, predictions): + return np.mean(self.scores) + + def reset(self): + self.scores = [] diff --git a/tools/accuracy_checker/accuracy_checker/metrics/score_class_comparison.py b/tools/accuracy_checker/accuracy_checker/metrics/score_class_comparison.py index cd704f902cd..f9d200cfa88 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/score_class_comparison.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/score_class_comparison.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/metrics/semantic_segmentation.py b/tools/accuracy_checker/accuracy_checker/metrics/semantic_segmentation.py index a29a3ee8394..91514a9c431 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/semantic_segmentation.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/semantic_segmentation.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/metrics/speech_recognition.py b/tools/accuracy_checker/accuracy_checker/metrics/speech_recognition.py index f757cb3fd2a..45600a8f456 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/speech_recognition.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/speech_recognition.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ from ..representation import ( CharacterRecognitionAnnotation, CharacterRecognitionPrediction, - ) +) from .metric import PerImageEvaluationMetric from ..utils import UnsupportedPackage diff --git a/tools/accuracy_checker/accuracy_checker/metrics/text_detection.py b/tools/accuracy_checker/accuracy_checker/metrics/text_detection.py index f5c24af2ae2..18b81da380b 100644 --- a/tools/accuracy_checker/accuracy_checker/metrics/text_detection.py +++ b/tools/accuracy_checker/accuracy_checker/metrics/text_detection.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -103,16 +103,16 @@ class FocusedTextLocalizationMetric(PerImageEvaluationMetric): def parameters(cls): parameters = super().parameters() parameters.update({ - 'area_recall_constrain': NumberField( + 'area_recall_constrain': NumberField( min_value=0, max_value=1, optional=True, default=0.5, description="Minimal value for recall that allows to make decision " "that prediction polygon matched with annotation." ), - 'ignore_difficult': BoolField( + 'ignore_difficult': BoolField( optional=True, default=True, description="Allows to ignore difficult ground truth text polygons in metric calculation." ), - 'area_precision_constrain': NumberField( + 'area_precision_constrain': NumberField( min_value=0, max_value=1, optional=True, default=0.5, description="Minimal value for precision that allows to make decision " "that prediction polygon matched with annotation." @@ -408,16 +408,16 @@ class IncidentalSceneTextLocalizationMetric(PerImageEvaluationMetric): def parameters(cls): parameters = super().parameters() parameters.update({ - 'iou_constrain': NumberField( + 'iou_constrain': NumberField( min_value=0, max_value=1, optional=True, default=0.5, description="Minimal value for intersection over union that allows to make decision " "that prediction polygon is true positive." ), - 'ignore_difficult': BoolField( + 'ignore_difficult': BoolField( optional=True, default=True, description="Allows to ignore difficult ground truth text polygons in metric calculation." ), - 'area_precision_constrain': NumberField( + 'area_precision_constrain': NumberField( min_value=0, max_value=1, optional=True, default=0.5, description="Minimal value for intersection over union that allows to make decision " "that prediction polygon matched with ignored annotation." diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/README.md b/tools/accuracy_checker/accuracy_checker/postprocessor/README.md index a65f597d3a9..e97de539f5f 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/README.md +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/README.md @@ -81,7 +81,15 @@ Accuracy Checker supports following set of postprocessors: * `resize_style_transfer` - resizing style transfer predicted image. Supported representations: `StyleTransferAnotation`, `StyleTransferPrediction`. * `dst_width` and `dst_height` - destination width and height for resizing respectively. * `crop_ground_truth_image` - cropping ground truth image. Supported representations: `ImageInpaintingAnnotation`. -* `resize` - resizing image or segmentation mask. Supported representations: `SegmentationAnotation`, `SegmentationPrediction`, `StyleTransferAnotation`, `StyleTransferPrediction`, `SuperResolutionAnotation`, `SuperResolutionPrediction`, `ImageProcessingAnnotation`, `ImageProcessingPrediction`. +* `corner_crop_ground_truth_image` - Corner crop of the ground truth image. Supported representations: `ImageInpaintingAnnotation`. + * `dst_width` and `dst_height` are destination width and height + * `corner_type` is type of the corner crop. Options are: + * `top-left` + * `top-right` + * `bottom-left` + * `bottom-right` + Default choice is `top-left` +* `resize` - resizing image or segmentation mask. Supported representations: `SegmentationAnotation`, `SegmentationPrediction`, `StyleTransferAnotation`, `StyleTransferPrediction`, `SuperResolutionAnotation`, `SuperResolutionPrediction`, `ImageProcessingAnnotation`, `ImageProcessingPrediction`, `SalientRegionAnnotation`, `SalientRegionPrediction`. * `dst_width` and `dst_height` - destination width and height for resize respectively. You can also use `size` instead in case when destination sizes are equal. If any of these parameters are not specified, image size will be used as default. * `apply_to` - determines target masks for processing (`annotation` for ground truth and `prediction` for detection results, `all` for both). @@ -93,6 +101,12 @@ Accuracy Checker supports following set of postprocessors: * `target_color` - target color space for super resolution image - `bgr` and `rgb` are supported. (Optional, default `rgb`). * `size` - size of model input for recovering YCrCb image. * `dst_width` and `dst_height` - width and height of model input respectively for recovering YCrCb image. +* `colorization_recovery` - restores BGR image from Colorization models results represented as AB-channels in LAB color space. Supported representations: `ImageProcessingAnnotation`, `ImageProcessingPrediction`. * `argmax_segmentation_mask` - translates categorical annotation segmentation mask to numerical. Supported representations: `SegmentationAnnotation`, `SegmentationPrediction`. * `shift_labels` - shifts predicted detection labels. Supported representation: `DetectionPrediction`. * `offset` - value for shift. +* `normalize_salience_map` - converts reference salience map from [0, 255] to [0, 1] range. Supported representations: `SalientRegionAnnotation`, `SalientRegionPrediction`. +* `min_max_normalization` - normalize regression data into [0, 1] with given min and max values. Supported representation: `FeatureRegressionAnnotation`, `RegressionAnnotation`, `RegressionPrediction` + * `min` - minimal value in range, optional, default 0. + * `max`- maximal value in range. + * `apply_to` - determines target masks for processing (`annotation` for ground truth and `prediction` for detection results, `all` for both). diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/__init__.py b/tools/accuracy_checker/accuracy_checker/postprocessor/__init__.py index fbaea79e917..6c265e9a6d0 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/__init__.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/__init__.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -51,13 +51,15 @@ from .resize_prediction_depth_map import ResizeDepthMap from .resize_super_resolution import ResizeSuperResolution from .resize_style_transfer import ResizeStyleTransfer -from .crop_ground_truth_image import CropGTImage +from .crop_ground_truth_image import CropGTImage, CornerCropGTImage from .resize import Resize from .to_gray_scale_ref_image import RGB2GRAYAnnotation, BGR2GRAYAnnotation from .remove_repeats import RemoveRepeatTokens from .tokens_to_lower_case import TokensToLowerCase -from .super_resolution_image_recovery import SRImageRecovery +from .super_resolution_image_recovery import SRImageRecovery, ColorizationLABRecovery from .argmax_segmentation_mask import ArgMaxSegmentationMask +from .normalize_salient_map import SalientMapNormalizer +from .min_max_normalization import MinMaxRegressionNormalization __all__ = [ @@ -88,6 +90,7 @@ 'ExtendSegmentationMask', 'ZoomSegMask', 'CropSegmentationMask', + 'CropOrPadSegmentationMask', 'ClipSegmentationMask', 'ArgMaxSegmentationMask', @@ -96,6 +99,8 @@ 'NormalizeLandmarksPoints', + 'ClipPoints', + 'ExtractSQUADPrediction', 'ExtractSQUADPredictionBiDAF', @@ -115,10 +120,17 @@ 'BGR2GRAYAnnotation', 'CropGTImage', + 'CornerCropGTImage', 'Resize', 'RemoveRepeatTokens', 'TokensToLowerCase', + 'SRImageRecovery', + 'ColorizationLABRecovery', + + 'SalientMapNormalizer', + + 'MinMaxRegressionNormalization', ] diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/align_prediction_depth_map.py b/tools/accuracy_checker/accuracy_checker/postprocessor/align_prediction_depth_map.py index c3996a91040..c247aeda64e 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/align_prediction_depth_map.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/align_prediction_depth_map.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ from .postprocessor import Postprocessor from ..representation import DepthEstimationAnnotation, DepthEstimationPrediction + class AlignDepth(Postprocessor): __provider__ = 'align_prediction_depth_map' diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/argmax_segmentation_mask.py b/tools/accuracy_checker/accuracy_checker/postprocessor/argmax_segmentation_mask.py index a5023b7cc77..99c6e5b48f1 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/argmax_segmentation_mask.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/argmax_segmentation_mask.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/brats_postprocessing.py b/tools/accuracy_checker/accuracy_checker/postprocessor/brats_postprocessing.py index 2fab82f7786..9fae99bf353 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/brats_postprocessing.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/brats_postprocessing.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/cast_to_int.py b/tools/accuracy_checker/accuracy_checker/postprocessor/cast_to_int.py index 262f458223e..0d33f2cb6e7 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/cast_to_int.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/cast_to_int.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/clip_boxes.py b/tools/accuracy_checker/accuracy_checker/postprocessor/clip_boxes.py index e0a024ff777..573be901aea 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/clip_boxes.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/clip_boxes.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ def parameters(cls): value_type=int, optional=True, min_value=1, description="Destination size for box clipping for both dimensions." ), - 'boxes_normalized' : BoolField( + 'boxes_normalized': BoolField( optional=True, default=False, description="Flag which says that target bounding boxes are in normalized format." ) diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/clip_points.py b/tools/accuracy_checker/accuracy_checker/postprocessor/clip_points.py index 8557fffb398..33ef4a21464 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/clip_points.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/clip_points.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/clip_segmentation_mask.py b/tools/accuracy_checker/accuracy_checker/postprocessor/clip_segmentation_mask.py index e9369bb89ea..173b25161f6 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/clip_segmentation_mask.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/clip_segmentation_mask.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/correct_yolo_v2_boxes.py b/tools/accuracy_checker/accuracy_checker/postprocessor/correct_yolo_v2_boxes.py index e5566a31ec8..bf0fa85f7d6 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/correct_yolo_v2_boxes.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/correct_yolo_v2_boxes.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/crop_ground_truth_image.py b/tools/accuracy_checker/accuracy_checker/postprocessor/crop_ground_truth_image.py index 8771596e963..3482e60048e 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/crop_ground_truth_image.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/crop_ground_truth_image.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -15,9 +15,9 @@ """ from .postprocessor import Postprocessor -from ..preprocessor import Crop +from ..preprocessor import Crop, CornerCrop from ..representation import ImageInpaintingAnnotation, ImageInpaintingPrediction -from ..config import NumberField +from ..config import NumberField, StringField from ..utils import get_size_from_config @@ -49,6 +49,41 @@ def configure(self): def process_image(self, annotation, prediction): for target in annotation: - target.value = Crop.process_data(target.value, self.dst_height, self.dst_width, None, False, True, {}) + target.value = Crop.process_data( + target.value, self.dst_height, self.dst_width, None, False, False, True, {} + ) + + return annotation, prediction + +class CornerCropGTImage(Postprocessor): + __provider__ = "corner_crop_ground_truth_image" + + annotation_types = (ImageInpaintingAnnotation,) + prediction_types = (ImageInpaintingPrediction,) + + @classmethod + def parameters(cls): + parameters = super().parameters() + parameters.update({ + 'dst_width': NumberField( + value_type=int, optional=True, min_value=1, description="Destination width for mask cropping." + ), + 'dst_height': NumberField( + value_type=int, optional=True, min_value=1, description="Destination height for mask cropping." + ), + 'corner_type': StringField( + optional=True, choices=['top_left', 'top_right', 'bottom_left', 'bottom_right'], + default='top_left', description="Destination height for image cropping respectively." + ), + }) + return parameters + + def configure(self): + self.corner_type = self.get_value_from_config('corner_type') + self.dst_height, self.dst_width = get_size_from_config(self.config) + + def process_image(self, annotation, prediction): + for target in annotation: + target.value = CornerCrop.process_data(target.value, self.dst_height, self.dst_width, self.corner_type) return annotation, prediction diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/crop_segmentation_mask.py b/tools/accuracy_checker/accuracy_checker/postprocessor/crop_segmentation_mask.py index 178aec09367..30a387670f9 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/crop_segmentation_mask.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/crop_segmentation_mask.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -66,11 +66,11 @@ def crop_segmentation_mask(entry, height, width, volume): def _(entry, height, width, volume): shape = len(entry.mask.shape) if shape == 2: - entry.mask = Crop.process_data(entry.mask, height, width, None, False, True, {}) + entry.mask = Crop.process_data(entry.mask, height, width, None, False, False, True, {}) elif shape == 3: entry_mask = [] for class_mask in entry.mask: - mask_channel = Crop.process_data(class_mask, height, width, None, False, True, {}) + mask_channel = Crop.process_data(class_mask, height, width, None, False, False, True, {}) entry_mask.append(mask_channel) entry.mask = np.array(entry_mask) else: diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/encode_segmentation_mask.py b/tools/accuracy_checker/accuracy_checker/postprocessor/encode_segmentation_mask.py index a17208de70c..7a80c28e7df 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/encode_segmentation_mask.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/encode_segmentation_mask.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/extend_segmentation_mask.py b/tools/accuracy_checker/accuracy_checker/postprocessor/extend_segmentation_mask.py index 10f5745d7d8..31a55413b78 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/extend_segmentation_mask.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/extend_segmentation_mask.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/extract_answers_tokens.py b/tools/accuracy_checker/accuracy_checker/postprocessor/extract_answers_tokens.py index c3637d45b59..bbeba9a69f2 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/extract_answers_tokens.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/extract_answers_tokens.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/faster_rcnn_postprocessing_resize.py b/tools/accuracy_checker/accuracy_checker/postprocessor/faster_rcnn_postprocessing_resize.py index d54ce19adad..cdd0ad03a1a 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/faster_rcnn_postprocessing_resize.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/faster_rcnn_postprocessing_resize.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/filter.py b/tools/accuracy_checker/accuracy_checker/postprocessor/filter.py index 6f4201a8f69..ff4eaf9350f 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/filter.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/filter.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/min_max_normalization.py b/tools/accuracy_checker/accuracy_checker/postprocessor/min_max_normalization.py new file mode 100644 index 00000000000..efbc2178fb4 --- /dev/null +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/min_max_normalization.py @@ -0,0 +1,48 @@ +""" +Copyright (c) 2018-2021 Intel Corporation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +from .postprocessor import PostprocessorWithSpecificTargets +from ..config import NumberField +from ..representation import FeaturesRegressionAnnotation, RegressionAnnotation, RegressionPrediction + + +class MinMaxRegressionNormalization(PostprocessorWithSpecificTargets): + __provider__ = 'min_max_normalization' + annotation_types = (FeaturesRegressionAnnotation, RegressionAnnotation) + prediction_types = (RegressionPrediction, ) + + @classmethod + def parameters(cls): + params = super().parameters() + params.update({ + 'min': NumberField(optional=True, default=0, description='minimal value in range'), + 'max': NumberField(description='maximum value in range') + }) + return params + + def configure(self): + super().configure() + self.min = self.get_value_from_config('min') + self.max = self.get_value_from_config('max') + + def process_image(self, annotation, prediction): + for ann in annotation: + ann.value = (ann.value - self.min) / (self.max - self.min) + + for pred in prediction: + pred.value = (pred.value - self.min) / (self.max - self.min) + + return annotation, prediction diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/nms.py b/tools/accuracy_checker/accuracy_checker/postprocessor/nms.py index 2f22baa99e8..ea814a19820 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/nms.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/nms.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/normalize_boxes.py b/tools/accuracy_checker/accuracy_checker/postprocessor/normalize_boxes.py index 6297fd4ab25..7f4957bebf0 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/normalize_boxes.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/normalize_boxes.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/normalize_landmarks_points.py b/tools/accuracy_checker/accuracy_checker/postprocessor/normalize_landmarks_points.py index b51fc4eef0b..27a572786b8 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/normalize_landmarks_points.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/normalize_landmarks_points.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ class NormalizeLandmarksPoints(Postprocessor): def parameters(cls): parameters = super().parameters() parameters.update({ - 'use_annotation_rect' : BoolField( + 'use_annotation_rect': BoolField( optional=True, default=False, description="Allows to use size of rectangle saved in annotation metadata for point scaling" " instead source image size." diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/normalize_recomendation.py b/tools/accuracy_checker/accuracy_checker/postprocessor/normalize_recomendation.py index 8c4f234a388..548397977da 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/normalize_recomendation.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/normalize_recomendation.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/normalize_salient_map.py b/tools/accuracy_checker/accuracy_checker/postprocessor/normalize_salient_map.py new file mode 100644 index 00000000000..798bf140e5b --- /dev/null +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/normalize_salient_map.py @@ -0,0 +1,33 @@ +""" +Copyright (c) 2018-2021 Intel Corporation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" +import cv2 +import numpy as np +from .postprocessor import Postprocessor + + +class SalientMapNormalizer(Postprocessor): + __provider__ = 'normalize_salience_map' + + def process_image(self, annotation, prediction): + for ann in annotation: + gt_mask = ann.mask + if len(gt_mask.shape) == 3 and gt_mask.shape[-1] == 3: + gt_mask = cv2.cvtColor(gt_mask, cv2.COLOR_BGR2GRAY) + gt_mask = gt_mask / 255 + gt_mask[gt_mask >= 0.5] = 1 + gt_mask[gt_mask < 0.5] = 0 + ann.mask = gt_mask.astype(np.uint8) + return annotation, prediction diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/postprocessing_executor.py b/tools/accuracy_checker/accuracy_checker/postprocessor/postprocessing_executor.py index e9c390ee9e2..e2fc7319609 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/postprocessing_executor.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/postprocessing_executor.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -96,6 +96,17 @@ def register_postprocessor(self, config): else: self._dataset_processors.append(postprocessor) + @classmethod + def validate_config(cls, processors, fetch_only=False, uri_prefix=''): + if not processors: + return [] + errors = [] + for processor_id, processor in enumerate(processors): + processor_uri = '{}.{}'.format(uri_prefix or 'postprocessing', processor_id) + errors.extend(Postprocessor.validate_config(processor, fetch_only=fetch_only, uri_prefix=processor_uri)) + + return errors + class PostprocessorConfig(ConfigValidator): type = StringField(choices=Postprocessor.providers) diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/postprocessor.py b/tools/accuracy_checker/accuracy_checker/postprocessor/postprocessor.py index fdc75f07fbe..6c7d9818d71 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/postprocessor.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/postprocessor.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ from enum import Enum from ..representation import ContainerRepresentation from ..config import ConfigValidator, StringField, ConfigError, BaseField -from ..dependency import ClassProvider +from ..dependency import ClassProvider, UnregisteredProviderException from ..utils import ( zipped_transform, string_to_list, @@ -71,7 +71,7 @@ def __init__(self, config, name=None, meta=None, state=None): if self.prediction_source and not isinstance(self.prediction_source, list): self.prediction_source = string_to_list(self.prediction_source) - self.validate_config() + self.validate_config(config) self.setup() def __call__(self, *args, **kwargs): @@ -117,10 +117,35 @@ def process_all(self, annotations, predictions, image_metadata=None): def configure(self): pass - def validate_config(self): - ConfigValidator( - self.name, on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT, fields=self.parameters() - ).validate(self.config) + @classmethod + def validate_config(cls, config, fetch_only=False, uri_prefix=''): + errors = [] + if cls.__name__ == Postprocessor.__name__: + processing_provider = config.get('type') + if not processing_provider: + error = ConfigError('type does not found', config, uri_prefix or 'postprocessing') + if not fetch_only: + raise error + errors.append(error) + return errors + try: + processor_cls = cls.resolve(processing_provider) + except UnregisteredProviderException as exception: + if not fetch_only: + raise exception + errors.append( + ConfigError( + "postprocessor {} unregistered".format(processing_provider), config, + uri_prefix or 'postprocessing') + ) + return errors + errors.extend(processor_cls.validate_config(config, fetch_only=fetch_only, uri_prefix=uri_prefix)) + return errors + + postprocessing_uri = uri_prefix or 'postprocessing.{}'.format(cls.__provider__) + return ConfigValidator( + postprocessing_uri, on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT, fields=cls.parameters() + ).validate(config, fetch_only=fetch_only) def get_entries(self, annotation, prediction): message_not_found = '{}: {} is not found in container' diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/remove_repeats.py b/tools/accuracy_checker/accuracy_checker/postprocessor/remove_repeats.py index c2f7be55e0c..61fe5874f19 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/remove_repeats.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/remove_repeats.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/resize.py b/tools/accuracy_checker/accuracy_checker/postprocessor/resize.py index a4765ba3927..09e0168f453 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/resize.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/resize.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,7 +22,8 @@ StyleTransferAnnotation, StyleTransferPrediction, SuperResolutionPrediction, SuperResolutionAnnotation, ImageProcessingPrediction, ImageProcessingAnnotation, - ImageInpaintingAnnotation, ImageInpaintingPrediction + ImageInpaintingAnnotation, ImageInpaintingPrediction, + SalientRegionAnnotation, SalientRegionPrediction ) from ..postprocessor.postprocessor import PostprocessorWithSpecificTargets, ApplyToOption from ..postprocessor import ResizeSegmentationMask @@ -99,6 +100,7 @@ def _(entry, height, width): return entry @resize.register(SegmentationPrediction) + @resize.register(SalientRegionPrediction) def _(entry, height, width): if len(entry.mask.shape) == 2: entry.mask = ResizeSegmentationMask.segm_resize(entry.mask, width, height) @@ -113,6 +115,7 @@ def _(entry, height, width): return entry @resize.register(SegmentationAnnotation) + @resize.register(SalientRegionAnnotation) def _(entry, height, width): entry.mask = ResizeSegmentationMask.segm_resize(entry.mask, width, height) @@ -144,6 +147,7 @@ def _(entry): return height, width @set_sizes.register(SegmentationPrediction) + @set_sizes.register(SalientRegionPrediction) def _(entry): if self._deprocess_predictions: return self.image_size[:2] diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/resize_prediction_boxes.py b/tools/accuracy_checker/accuracy_checker/postprocessor/resize_prediction_boxes.py index ea9b0aeb9ab..e5716b46dcb 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/resize_prediction_boxes.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/resize_prediction_boxes.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ from ..representation import DetectionPrediction, DetectionAnnotation from ..postprocessor.postprocessor import Postprocessor -from ..config import BoolField +from ..config import BoolField class ResizePredictionBoxes(Postprocessor): diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/resize_prediction_depth_map.py b/tools/accuracy_checker/accuracy_checker/postprocessor/resize_prediction_depth_map.py index 48dc9074e09..faeef8629c6 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/resize_prediction_depth_map.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/resize_prediction_depth_map.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/resize_segmentation_mask.py b/tools/accuracy_checker/accuracy_checker/postprocessor/resize_segmentation_mask.py index adeb6c1ae54..b126e79ddc3 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/resize_segmentation_mask.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/resize_segmentation_mask.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -124,6 +124,8 @@ def _bytescale(data): return data cmin = data.min() cmax = data.max() + if cmin >= 0 and cmax <= 255: + return data.astype(np.uint8) cscale = cmax - cmin if cscale == 0: cscale = 1 diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/resize_style_transfer.py b/tools/accuracy_checker/accuracy_checker/postprocessor/resize_style_transfer.py index 706ce55eede..68fb6849f66 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/resize_style_transfer.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/resize_style_transfer.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/resize_super_resolution.py b/tools/accuracy_checker/accuracy_checker/postprocessor/resize_super_resolution.py index 2cd3fbabc24..4868972c1dd 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/resize_super_resolution.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/resize_super_resolution.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/shift.py b/tools/accuracy_checker/accuracy_checker/postprocessor/shift.py index f9e6b6860b0..dcd6f52f082 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/shift.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/shift.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ class Shift(PostprocessorWithSpecificTargets): annotation_types = (SegmentationAnnotation, ) prediction_types = (SegmentationPrediction, ) + @classmethod def parameters(cls): parameters = super().parameters() diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/super_resolution_image_recovery.py b/tools/accuracy_checker/accuracy_checker/postprocessor/super_resolution_image_recovery.py index d656522f8fc..7032cdf8b8a 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/super_resolution_image_recovery.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/super_resolution_image_recovery.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,15 +20,17 @@ from ..config import StringField, NumberField, ConfigError from .postprocessor import Postprocessor -from ..representation import SuperResolutionPrediction, SuperResolutionAnnotation +from ..representation import ( + SuperResolutionPrediction, SuperResolutionAnnotation, ImageProcessingAnnotation, ImageProcessingPrediction +) from ..utils import get_size_from_config class SRImageRecovery(Postprocessor): __provider__ = 'sr_image_recovery' - annotation_types = (SuperResolutionAnnotation, ) - prediction_types = (SuperResolutionPrediction, ) + annotation_types = (SuperResolutionAnnotation, ImageProcessingAnnotation) + prediction_types = (SuperResolutionPrediction, ImageProcessingPrediction) @classmethod def parameters(cls): @@ -72,3 +74,21 @@ def process_image(self, annotation, prediction): ycrcb = np.concatenate([prediction_.value, cr, cb], axis=2) prediction_.value = cv2.cvtColor(ycrcb, self.color) return annotation, prediction + + +class ColorizationLABRecovery(Postprocessor): + __provider__ = 'colorization_recovery' + annotation_types = (ImageProcessingAnnotation, ) + prediction_types = (ImageProcessingPrediction, ) + + def process_image(self, annotation, prediction): + for ann, pred in zip(annotation, prediction): + target = ann.value + h, w = pred.value.shape[:2] + r_target = cv2.resize(target, (w, h)).astype(np.float32) + target_l = cv2.cvtColor(r_target / 255, cv2.COLOR_BGR2LAB)[:, :, 0] + pred_ab = pred.value + out_lab = np.concatenate((target_l[:, :, np.newaxis], pred_ab), axis=2) + result_bgr = cv2.cvtColor(out_lab, cv2.COLOR_Lab2BGR) * 255 + pred.value = result_bgr.astype(np.uint8) + return annotation, prediction diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/to_gray_scale_ref_image.py b/tools/accuracy_checker/accuracy_checker/postprocessor/to_gray_scale_ref_image.py index 3e6773060a5..d08038508b3 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/to_gray_scale_ref_image.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/to_gray_scale_ref_image.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/tokens_to_lower_case.py b/tools/accuracy_checker/accuracy_checker/postprocessor/tokens_to_lower_case.py index 442321c493a..187e7ee5311 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/tokens_to_lower_case.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/tokens_to_lower_case.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/translate_3d_poses.py b/tools/accuracy_checker/accuracy_checker/postprocessor/translate_3d_poses.py index 4da64cb2ccd..96787ffa230 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/translate_3d_poses.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/translate_3d_poses.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/postprocessor/zoom_segmentation_mask.py b/tools/accuracy_checker/accuracy_checker/postprocessor/zoom_segmentation_mask.py index bfe8ebfe7a5..16235b1acbb 100644 --- a/tools/accuracy_checker/accuracy_checker/postprocessor/zoom_segmentation_mask.py +++ b/tools/accuracy_checker/accuracy_checker/postprocessor/zoom_segmentation_mask.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/preprocessor/README.md b/tools/accuracy_checker/accuracy_checker/preprocessor/README.md index ee567786819..7526b2eef9d 100644 --- a/tools/accuracy_checker/accuracy_checker/preprocessor/README.md +++ b/tools/accuracy_checker/accuracy_checker/preprocessor/README.md @@ -65,8 +65,10 @@ Accuracy Checker supports following set of preprocessors: * `rgb_to_gray` - converting image in RGB to gray scale color space. * `bgr_to_yuv` - converting image in BGR to YUV. * `split_channels` - split image channels to independent input data after conversion (Optional, default `False`). + * `shrink_uv` - resize uv-channels in 1:2 resolution to y-channel (Optional, available only with `split_channels` combination). * `rgb_to_yuv` - converting image in RGB to YUV. * `split_channels` - split image channels to independent input data after conversion (Optional, default `False`). + * `shrink_uv` - resize uv-channels in 1:2 resolution to y-channel (Optional, available only with `split_channels` combination). * `bgr_to_nv12` - converting BGR image to NV12 format. * `rgb_to_nv12` - converting RGB image to NV12 format. * `nv12_to_bgr` - converting NV12 data to BGR format. @@ -75,13 +77,16 @@ Accuracy Checker supports following set of preprocessors: * `split_channels` - split image channels to independent input data after conversion (Optional, default `False`). * `rgb_to_ycrcb` - converting image in RGB to YCrCb. * `split_channels` - split image channels to independent input data after conversion (Optional, default `False`). +* `bgr_to_lab` - converts image in RGB format to LAB. +* `rgb_to_lab` - converts image in BGR format to LAB. * `select_channel` - select channel only one specified channel from multichannel image. * `channel` - channel id in image (e.g. if you read image in RGB and want to select green channel, you need to specify 1 as channel) * `flip` - image mirroring around specified axis. * `mode` specifies the axis for flipping (`vertical` or `horizontal`). + * `merge_with_original` - allows addition flipped image to original (Optional, default `False`, original image will be replaced with flipped). * `crop` - central cropping for image. - * `dst_width` and `dst_height` are destination width and height for image resizing respectively. You can also use `size` instead in case when destination sizes are equal or - `central_fraction` to define fraction of size to crop (float value (0, 1])) + * `dst_width` and `dst_height` are destination width and height for image resizing respectively. You can also use `size` instead in case when destination sizes are equal, + `central_fraction` to define fraction of size to crop (float value (0, 1])) or `max_square` for cropping central part for image by minimal image size (`True` value for enabling this feature). * `use_pillow` parameter specifies usage of Pillow library for cropping. * `crop_rectangle` - cropping region of interest using coordinates given as annotation metadata. * `extend_around_rect` - scaling region of interest using annotation metadata. @@ -127,8 +132,8 @@ Accuracy Checker supports following set of preprocessors: * `decode_by_sentence_piece_bpe_tokenizer` - Decode words to set of indexes using SentencePieceBPETokenizer. * `vocabulary_file` - path to vocabulary file for decoding. Path can be prefixed with `--models` argument. * `merges_file` - path to merges file for decoding. Path can be prefixed with `--models` argument. - * `sos_symbol` - string representation of start_of_sentence symbol (default=''). - * `eos_symbol` - string representation of end_of_sentence symbol (default=''). + * `sos_symbol` - string representation of start_of_sentence symbol (default=``). + * `eos_symbol` - string representation of end_of_sentence symbol (default=``). * `add_symbols` - add sos/eos symbols to sentence (default=True). * `pad_with_eos` - supplement the input sequence to a specific size using a line terminator character or index. * `eos_symbol` or `eos_index` - line terminator symbol or index of this symbol in vocab for encoded sequence respectively. @@ -179,6 +184,15 @@ Accuracy Checker supports following set of preprocessors: * `scale_height` - value to scale height relative to the original candidate height. * `object_crop_with_scale` - crop region from image using `center` coordinate and `scale` from annotation. * `dst_width` and `dst_height` are destination width and height for image cropping respectively. You can also use `size` instead in case when destination sizes are equal. +* `one_hot_encoding` - create label map based on array of indexes (analog scatter). + * `value` - number for encoding label. + * `base` - number for encoding other classes. + * `axis` - axis responsible for classes. + * `number_of_classes` - number of used classes. +* `pack_raw_image` - pack raw image to [H, W, 4] normalized image format with black level removal. + * `black_level` - black level on the input image. + * `ratio` - exposure scale ratio, optional, can be replaced by value from annotation if not provided. + * `9-channels` - for packing 9 channels images (Optional, default `False`). ## Optimized preprocessing via OpenVINO Inference Engine OpenVINO™ is able perform preprocessing during model execution. For enabling this behaviour you can use command line parameter `--ie_preprocessing True`. diff --git a/tools/accuracy_checker/accuracy_checker/preprocessor/__init__.py b/tools/accuracy_checker/accuracy_checker/preprocessor/__init__.py index eded98b9feb..906b756ec1a 100644 --- a/tools/accuracy_checker/accuracy_checker/preprocessor/__init__.py +++ b/tools/accuracy_checker/accuracy_checker/preprocessor/__init__.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,7 +24,8 @@ BGR2YUVConverter, RGB2YUVConverter, BGRtoNV12Converter, RGBtoNV12Converter, NV12toBGRConverter, NV12toRGBConverter, - RGB2YCrCbConverter, BGR2YCrCbConverter + RGB2YCrCbConverter, BGR2YCrCbConverter, + BGRToLAB, RGBToLAB ) from .audio_preprocessing import ( ResampleAudio, @@ -59,6 +60,8 @@ from .centernet_preprocessing import CenterNetAffineTransformation from .brats_preprocessing import Resize3D, NormalizeBrats, CropBraTS, SwapModalitiesBrats from .inpainting_preprocessor import FreeFormMask, RectMask, CustomMask +from .one_hot_encoding import OneHotEncoding +from .raw_image_preprocessing import PackBayerImage __all__ = [ 'PreprocessingExecutor', @@ -93,6 +96,13 @@ 'RgbToGray', 'RgbToBgr', 'BGR2YUVConverter', + 'RGB2YUVConverter', + 'BGRtoNV12Converter', + 'RGBtoNV12Converter', + 'NV12toBGRConverter', + 'NV12toRGBConverter', + 'BGRToLAB', + 'RGBToLAB', 'TfConvertImageDType', 'SelectInputChannel', 'CropOrPad', @@ -101,7 +111,9 @@ 'CornerCrop', 'CandidateCrop', 'CropRect', + 'ExtendAroundRect', 'Crop3D', + 'TransformedCropWithAutoScale', 'ObjectCropWithScale', 'Normalize3d', @@ -120,4 +132,7 @@ 'CustomMask', 'RGB2YCrCbConverter', 'BGR2YCrCbConverter', + 'OneHotEncoding', + + 'PackBayerImage' ] diff --git a/tools/accuracy_checker/accuracy_checker/preprocessor/audio_preprocessing.py b/tools/accuracy_checker/accuracy_checker/preprocessor/audio_preprocessing.py index 60cd33e153e..a68125f6567 100644 --- a/tools/accuracy_checker/accuracy_checker/preprocessor/audio_preprocessing.py +++ b/tools/accuracy_checker/accuracy_checker/preprocessor/audio_preprocessing.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/preprocessor/brats_preprocessing.py b/tools/accuracy_checker/accuracy_checker/preprocessor/brats_preprocessing.py index 82f9891eada..33450d1b8d7 100644 --- a/tools/accuracy_checker/accuracy_checker/preprocessor/brats_preprocessing.py +++ b/tools/accuracy_checker/accuracy_checker/preprocessor/brats_preprocessing.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/preprocessor/centernet_preprocessing.py b/tools/accuracy_checker/accuracy_checker/preprocessor/centernet_preprocessing.py index 6554cbfb284..0a15e675f34 100644 --- a/tools/accuracy_checker/accuracy_checker/preprocessor/centernet_preprocessing.py +++ b/tools/accuracy_checker/accuracy_checker/preprocessor/centernet_preprocessing.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/preprocessor/color_space_conversion.py b/tools/accuracy_checker/accuracy_checker/preprocessor/color_space_conversion.py index af4a577626b..1c10df3ace4 100644 --- a/tools/accuracy_checker/accuracy_checker/preprocessor/color_space_conversion.py +++ b/tools/accuracy_checker/accuracy_checker/preprocessor/color_space_conversion.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -37,7 +37,12 @@ class BgrToGray(Preprocessor): __provider__ = 'bgr_to_gray' def process(self, image, annotation_meta=None): - image.data = np.expand_dims(cv2.cvtColor(image.data, cv2.COLOR_BGR2GRAY).astype(np.float32), -1) + def process_data(data): + return np.expand_dims(cv2.cvtColor(data, cv2.COLOR_BGR2GRAY).astype(np.float32), -1) + + image.data = process_data(image.data) if not isinstance(image.data, list) else [ + process_data(fragment) for fragment in image.data + ] return image @@ -57,10 +62,40 @@ class RgbToGray(Preprocessor): __provider__ = 'rgb_to_gray' def process(self, image, annotation_meta=None): - image.data = np.expand_dims(cv2.cvtColor(image.data, cv2.COLOR_RGB2GRAY).astype(np.float32), -1) + def process_data(data): + return np.expand_dims(cv2.cvtColor(data, cv2.COLOR_RGB2GRAY).astype(np.float32), -1) + + image.data = process_data(image.data) if not isinstance(image.data, list) else [ + process_data(fragment) for fragment in image.data + ] return image +class BGRToLAB(Preprocessor): + __provider__ = 'bgr_to_lab' + + def process(self, image, annotation_meta=None): + def process_data(data): + return cv2.cvtColor(data.astype(np.float32) / 255, cv2.COLOR_BGR2LAB) + + image.data = process_data(image.data) if not isinstance(image.data, list) else [ + process_data(fragment) for fragment in image.data + ] + return image + + +class RGBToLAB(Preprocessor): + __provider__ = 'bgr_to_lab' + + def process(self, image, annotation_meta=None): + def process_data(data): + return cv2.cvtColor(data.astype(np.float32) / 255, cv2.COLOR_RGB2LAB) + + image.data = process_data(image.data) if not isinstance(image.data, list) else [ + process_data(fragment) for fragment in image.data + ] + return image + class TfConvertImageDType(Preprocessor): __provider__ = 'tf_convert_image_dtype' @@ -73,7 +108,8 @@ def __init__(self, config, name): '*tf_convert_image_dtype* operation requires TensorFlow. ' 'Please install it before usage. {}'.format(import_error.msg) ) - tf.enable_eager_execution() + if tf.__version__ < '2.0.0': + tf.enable_eager_execution() self.converter = tf.image.convert_image_dtype self.dtype = tf.float32 @@ -118,12 +154,18 @@ def parameters(cls): parameters.update({ 'split_channels': BoolField( optional=True, default=False, description='Allow treat channels as independent input' + ), + 'shrink_uv': BoolField( + optional=True, default=False, description='Allow shrink uv-channels after split' ) }) return parameters def configure(self): self.split_channels = self.get_value_from_config('split_channels') + self.shrink_uv = self.get_value_from_config('shrink_uv') + if self.shrink_uv and not self.split_channels: + self.split_channels = True def process(self, image, annotation_meta=None): data = image.data @@ -134,6 +176,9 @@ def process(self, image, annotation_meta=None): v = yuvdata[:, :, 2] identifier = image.identifier new_identifier = ['{}_y'.format(identifier), '{}_u'.format(identifier), '{}_v'.format(identifier)] + if self.shrink_uv: + u = cv2.resize(u, None, fx=0.5, fy=0.5, interpolation=cv2.INTER_LINEAR) + v = cv2.resize(v, None, fx=0.5, fy=0.5, interpolation=cv2.INTER_LINEAR) yuvdata = [np.expand_dims(y, -1), np.expand_dims(u, -1), np.expand_dims(v, -1)] image.identifier = new_identifier image.data = yuvdata diff --git a/tools/accuracy_checker/accuracy_checker/preprocessor/crop.py b/tools/accuracy_checker/accuracy_checker/preprocessor/crop.py index 23961b18d3d..578a96b1551 100644 --- a/tools/accuracy_checker/accuracy_checker/preprocessor/crop.py +++ b/tools/accuracy_checker/accuracy_checker/preprocessor/crop.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -53,14 +53,15 @@ def configure(self): self.dst_height, self.dst_width = get_size_from_config(self.config, allow_none=True) def process(self, image, annotation_meta=None): - data = image.data - image.data = self.process_data( - data, self.dst_height, self.dst_width, self.corner_type - ) if not isinstance(data, list) else [ + if isinstance(image.data, list): + image.data = [ self.process_data( - fragment, self.dst_height, self.dst_width, self.corner_type - ) for fragment in image.data + fragment, self.dst_height, self.dst_width, self.corner_type) + for fragment in image.data ] + else: + image.data = self.process_data( + image.data, self.dst_height, self.dst_width, self.corner_type) return image @@ -131,6 +132,9 @@ def parameters(cls): ), 'central_fraction': NumberField( value_type=float, min_value=0, max_value=1, optional=True, description="Central Fraction." + ), + 'max_square': BoolField( + optional=True, default=False, description='crop center area by shortest side' ) }) @@ -140,12 +144,17 @@ def configure(self): self.use_pillow = self.get_value_from_config('use_pillow') self.dst_height, self.dst_width = get_size_from_config(self.config, allow_none=True) self.central_fraction = self.get_value_from_config('central_fraction') - if self.dst_height is None and self.dst_width is None and self.central_fraction is None: - raise ConfigError('sizes for crop or central_fraction should be provided') + self.max_square = self.get_value_from_config('max_square') + if self.dst_height is None and self.dst_width is None and self.central_fraction is None and not self.max_square: + raise ConfigError('sizes for crop or central_fraction or max_square should be provided') if self.dst_height and self.dst_width and self.central_fraction: - raise ConfigError('both sizes and central fraction provided for cropping') + raise ConfigError('both sizes and central fraction provided for cropping') + if self.dst_height and self.dst_width and self.max_square: + raise ConfigError('both sizes and max_square provided for cropping') + if self.central_fraction and self.max_square: + raise ConfigError('both central fraction and nax_square provided for cropping') - if not self.central_fraction: + if not self.central_fraction and not self.max_square: if self.dst_height is None or self.dst_width is None: raise ConfigError('one from crop dimensions is not provided') @@ -154,11 +163,11 @@ def process(self, image, annotation_meta=None): data = image.data image.data = self.process_data( - data, self.dst_height, self.dst_width, self.central_fraction, + data, self.dst_height, self.dst_width, self.central_fraction, self.max_square, self.use_pillow, is_simple_case, image.metadata ) if not isinstance(data, list) else [ self.process_data( - fragment, self.dst_height, self.dst_width, self.central_fraction, + fragment, self.dst_height, self.dst_width, self.central_fraction, self.max_square, self.use_pillow, is_simple_case, image.metadata ) for fragment in image.data ] @@ -166,11 +175,14 @@ def process(self, image, annotation_meta=None): return image @staticmethod - def process_data(data, dst_height, dst_width, central_fraction, use_pillow, is_simple_case, metadata): + def process_data(data, dst_height, dst_width, central_fraction, max_square, use_pillow, is_simple_case, metadata): height, width = data.shape[:2] - if not central_fraction: + if not central_fraction and not max_square: new_height = dst_height new_width = dst_width + elif max_square: + new_height = min(height, width) + new_width = min(height, width) else: new_height = int(height * central_fraction) new_width = int(width * central_fraction) @@ -629,7 +641,7 @@ def crop(self, img, center, scale): # Preprocessing for efficient cropping height, width = img.shape[:2] sf = scale * 200.0 / self.dst_width - if sf <= 2: + if sf >= 2: new_size = int(np.math.floor(max(height, width) / sf)) new_height = int(np.math.floor(height / sf)) new_width = int(np.math.floor(width / sf)) diff --git a/tools/accuracy_checker/accuracy_checker/preprocessor/geometric_transformations.py b/tools/accuracy_checker/accuracy_checker/preprocessor/geometric_transformations.py index 0e5e703b0b1..6b49c3038f6 100644 --- a/tools/accuracy_checker/accuracy_checker/preprocessor/geometric_transformations.py +++ b/tools/accuracy_checker/accuracy_checker/preprocessor/geometric_transformations.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -47,6 +47,9 @@ def parameters(cls): 'mode': StringField( choices=FLIP_MODES.keys(), default='horizontal', description="Specifies the axis for flipping (vertical or horizontal)." + ), + 'merge_with_original': BoolField( + optional=True, description='allow joint flipped image to original', default=False ) }) return parameters @@ -55,9 +58,16 @@ def configure(self): mode = self.get_value_from_config('mode') if isinstance(mode, str): self.mode = FLIP_MODES[mode] + self.merge = self.get_value_from_config('merge_with_original') def process(self, image, annotation_meta=None): - image.data = cv2.flip(image.data, self.mode) + flipped_data = cv2.flip(image.data, self.mode) + if self.merge: + image.data = [image.data, flipped_data] + image.metadata['multi_infer'] = True + else: + image.data = flipped_data + image.metadata.setdefault( 'geometric_operations', []).append(GeometricOperationMetadata('flip', {'mode': self.mode})) return image @@ -304,10 +314,10 @@ def parameters(cls): value_type=int, optional=True, min_value=1, description="Destination size of tiled fragment for both dimensions." ), - 'dst_width' : NumberField( + 'dst_width': NumberField( value_type=int, optional=True, min_value=1, description="Destination width of tiled fragment." ), - 'dst_height' : NumberField( + 'dst_height': NumberField( value_type=int, optional=True, min_value=1, description="Destination height of tiled fragment." ), }) diff --git a/tools/accuracy_checker/accuracy_checker/preprocessor/ie_preprocessor.py b/tools/accuracy_checker/accuracy_checker/preprocessor/ie_preprocessor.py index eb4f50665d2..44aafd7d514 100644 --- a/tools/accuracy_checker/accuracy_checker/preprocessor/ie_preprocessor.py +++ b/tools/accuracy_checker/accuracy_checker/preprocessor/ie_preprocessor.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/preprocessor/inpainting_preprocessor.py b/tools/accuracy_checker/accuracy_checker/preprocessor/inpainting_preprocessor.py index 22b4df80c4d..05ad9f78136 100644 --- a/tools/accuracy_checker/accuracy_checker/preprocessor/inpainting_preprocessor.py +++ b/tools/accuracy_checker/accuracy_checker/preprocessor/inpainting_preprocessor.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -117,6 +117,10 @@ def parameters(cls): def configure(self): self.mask_height, self.mask_width = get_size_from_config(self.config, allow_none=True) + if self.mask_height is None: + self.mask_height = 128 + if self.mask_width is None: + self.mask_width = 128 self.inverse_mask = self.get_value_from_config('inverse_mask') def process(self, image, annotation_meta=None): @@ -125,8 +129,8 @@ def process(self, image, annotation_meta=None): img = image.data[0] img_height, img_width = img.shape[:2] - mp0 = (img_height - self.mask_height)//2 - mp1 = (img_width - self.mask_width)//2 + mp0 = max(0, (img_height - self.mask_height)//2) + mp1 = max(0, (img_width - self.mask_width)//2) mask = np.zeros((img_height, img_width)).astype(np.float32) mask[mp0:mp0 + self.mask_height, mp1:mp1 + self.mask_width] = 1 diff --git a/tools/accuracy_checker/accuracy_checker/preprocessor/nlp_preprocessors.py b/tools/accuracy_checker/accuracy_checker/preprocessor/nlp_preprocessors.py index 45a03d32558..92acd438885 100644 --- a/tools/accuracy_checker/accuracy_checker/preprocessor/nlp_preprocessors.py +++ b/tools/accuracy_checker/accuracy_checker/preprocessor/nlp_preprocessors.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/preprocessor/normalization.py b/tools/accuracy_checker/accuracy_checker/preprocessor/normalization.py index 539bf01a23a..43f3afd42b0 100644 --- a/tools/accuracy_checker/accuracy_checker/preprocessor/normalization.py +++ b/tools/accuracy_checker/accuracy_checker/preprocessor/normalization.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/preprocessor/one_hot_encoding.py b/tools/accuracy_checker/accuracy_checker/preprocessor/one_hot_encoding.py new file mode 100644 index 00000000000..f2a3e357b8d --- /dev/null +++ b/tools/accuracy_checker/accuracy_checker/preprocessor/one_hot_encoding.py @@ -0,0 +1,79 @@ +""" +Copyright (c) 2018-2021 Intel Corporation +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +import numpy as np +from ..config import NumberField +from .preprocessor import Preprocessor + + +class OneHotEncoding(Preprocessor): + __provider__ = 'one_hot_encoding' + + @classmethod + def parameters(cls): + parameters = super().parameters() + parameters.update({ + 'value': NumberField( + optional=True, + value_type=int, + default=1, + description="Number for label encoding. Integer which used to indicate label" + ), + 'number_of_classes': NumberField( + optional=True, + value_type=int, + default=1, + description="Number of encoding classes" + ), + 'axis': NumberField( + optional=True, + value_type=int, + default=1, + description="Axis for encoding" + ), + 'base': NumberField( + optional=True, + value_type=int, + default=0, + description="Number that specifies the values of the other classes at one hot label map" + ) + }) + return parameters + + def configure(self): + self.value = self.get_value_from_config('value') + self.base = self.get_value_from_config('base') + self.classes = self.get_value_from_config('number_of_classes') + self.axis = self.get_value_from_config('axis') + + def process(self, image, annotation_meta=None): + def process_data(data, classes, axis, value, base): + data = data.astype(np.int32) + shapes = list(data.shape) + ndim = len(shapes) + shapes[axis] = classes + base_arr = np.full(shapes, base, np.int) + expanded_index = [] + for i in range(ndim): + arr = (data if axis == i + else np.arange(shapes[i]).reshape([shapes[i] if i == j else 1 for j in range(ndim)])) + expanded_index.append(arr) + base_arr[tuple(expanded_index)] = value + return base_arr + + image.data = (process_data(image.data, self.classes, self.axis, self.value, self.base) + if not isinstance(image.data, list) else [ + process_data(data_fragment, self.classes, self.axis, self.value, self.base) + for data_fragment in image.data]) + + return image diff --git a/tools/accuracy_checker/accuracy_checker/preprocessor/preprocessing_executor.py b/tools/accuracy_checker/accuracy_checker/preprocessor/preprocessing_executor.py index c75d8612fff..e87708af6f5 100644 --- a/tools/accuracy_checker/accuracy_checker/preprocessor/preprocessing_executor.py +++ b/tools/accuracy_checker/accuracy_checker/preprocessor/preprocessing_executor.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -102,6 +102,17 @@ def ie_preprocess_steps(self): return [] return self.ie_processor.steps + @classmethod + def validate_config(cls, processors, fetch_only=False, uri_prefix=''): + if not processors: + return [] + errors = [] + for preprocessor_id, processor in enumerate(processors): + preprocessor_uri = '{}.{}'.format(uri_prefix or 'preprocessing', preprocessor_id) + errors.extend(Preprocessor.validate_config(processor, fetch_only=fetch_only, uri_prefix=preprocessor_uri)) + + return errors + class PreprocessorConfig(ConfigValidator): type = StringField(choices=Preprocessor.providers) diff --git a/tools/accuracy_checker/accuracy_checker/preprocessor/preprocessor.py b/tools/accuracy_checker/accuracy_checker/preprocessor/preprocessor.py index 19f7269de37..bb71f827a17 100644 --- a/tools/accuracy_checker/accuracy_checker/preprocessor/preprocessor.py +++ b/tools/accuracy_checker/accuracy_checker/preprocessor/preprocessor.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,8 +14,8 @@ limitations under the License. """ -from ..config import ConfigValidator, StringField -from ..dependency import ClassProvider +from ..config import ConfigValidator, StringField, ConfigError +from ..dependency import ClassProvider, UnregisteredProviderException from ..utils import get_parameter_value_from_config @@ -30,7 +30,7 @@ def __init__(self, config, name=None): self.name = name self.input_shapes = None - self.validate_config() + self.validate_config(config) self.configure() def __call__(self, *args, **kwargs): @@ -53,10 +53,35 @@ def process(self, image, annotation_meta=None): def configure(self): pass - def validate_config(self): - ConfigValidator( - self.name, on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT, fields=self.parameters() - ).validate(self.config) + @classmethod + def validate_config(cls, config, fetch_only=False, uri_prefix=''): + errors = [] + if cls.__name__ == Preprocessor.__name__: + processing_provider = config.get('type') + if not processing_provider: + error = ConfigError('type is not found', config, uri_prefix or 'preprocessing') + if not fetch_only: + raise error + errors.append(error) + return errors + try: + preprocessor_cls = cls.resolve(processing_provider) + except UnregisteredProviderException as exception: + if not fetch_only: + raise exception + errors.append( + ConfigError( + "preprocessor {} unregistered".format(processing_provider), config, + uri_prefix or 'preprocessing') + ) + return errors + errors.extend(preprocessor_cls.validate_config(config, fetch_only=fetch_only, uri_prefix=uri_prefix)) + return errors + + preprocessor_uri = uri_prefix or 'preprocessing.{}'.format(cls.__provider__) + return ConfigValidator( + preprocessor_uri, on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT, fields=cls.parameters() + ).validate(config, fetch_only=fetch_only) def set_input_shape(self, input_shape): pass diff --git a/tools/accuracy_checker/accuracy_checker/preprocessor/raw_image_preprocessing.py b/tools/accuracy_checker/accuracy_checker/preprocessor/raw_image_preprocessing.py new file mode 100644 index 00000000000..da68a474b5c --- /dev/null +++ b/tools/accuracy_checker/accuracy_checker/preprocessor/raw_image_preprocessing.py @@ -0,0 +1,94 @@ +""" +Copyright (c) 2018-2021 Intel Corporation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +import numpy as np +from .preprocessor import Preprocessor +from ..config import NumberField, BoolField + + +class PackBayerImage(Preprocessor): + __provider__ = 'pack_raw_image' + + @classmethod + def parameters(cls): + params = super().parameters() + params.update({ + 'black_level': NumberField(min_value=1, description='black level for removal'), + 'ratio': NumberField(optional=True, default=1, description='exposure scale ratio'), + '9-channels': BoolField(optional=True, default=False, description='pack 9-channles inage') + }) + return params + + def configure(self): + self.black_level = self.get_value_from_config('black_level') + self.ratio = self.get_value_from_config('ratio') + self.nine_channels = self.get_value_from_config('9-channels') + + def process(self, image, annotation_meta=None): + ratio = (annotation_meta or {}).get('ratio', self.ratio) + im = image.data + im = np.maximum(im - self.black_level, 0) / (16383 - self.black_level) + im = np.expand_dims(im, axis=2) + + height, width = im.shape[:2] + if not self.nine_channels: + out = np.concatenate(( + im[0:height:2, 0:width:2, :], + im[0:height:2, 1:width:2, :], + im[1:height:2, 1:width:2, :], + im[1:height:2, 0:width:2, :]), axis=2) + else: + H = (height // 6) * 6 + W = (width // 6) * 6 + + out = np.zeros((H // 3, W // 3, 9)) + + # 0 R + out[0::2, 0::2, 0] = np.squeeze(im[0:H:6, 0:W:6]) + out[0::2, 1::2, 0] = np.squeeze(im[0:H:6, 4:W:6]) + out[1::2, 0::2, 0] = np.squeeze(im[3:H:6, 1:W:6]) + out[1::2, 1::2, 0] = np.squeeze(im[3:H:6, 3:W:6]) + + # 1 G + out[0::2, 0::2, 1] = np.squeeze(im[0:H:6, 2:W:6]) + out[0::2, 1::2, 1] = np.squeeze(im[0:H:6, 5:W:6]) + out[1::2, 0::2, 1] = np.squeeze(im[3:H:6, 2:W:6]) + out[1::2, 1::2, 1] = np.squeeze(im[3:H:6, 5:W:6]) + + # 1 B + out[0::2, 0::2, 2] = np.squeeze(im[0:H:6, 1:W:6]) + out[0::2, 1::2, 2] = np.squeeze(im[0:H:6, 3:W:6]) + out[1::2, 0::2, 2] = np.squeeze(im[3:H:6, 0:W:6]) + out[1::2, 1::2, 2] = np.squeeze(im[3:H:6, 4:W:6]) + + # 4 R + out[0::2, 0::2, 3] = np.squeeze(im[1:H:6, 2:W:6]) + out[0::2, 1::2, 3] = np.squeeze(im[2:H:6, 5:W:6]) + out[1::2, 0::2, 3] = np.squeeze(im[5:H:6, 2:W:6]) + out[1::2, 1::2, 3] = np.squeeze(im[4:H:6, 5:W:6]) + + # 5 B + out[0::2, 0::2, 4] = np.squeeze(im[2:H:6, 2:W:6]) + out[0::2, 1::2, 4] = np.squeeze(im[1:H:6, 5:W:6]) + out[1::2, 0::2, 4] = np.squeeze(im[4:H:6, 2:W:6]) + out[1::2, 1::2, 4] = np.squeeze(im[5:H:6, 5:W:6]) + + out[:, :, 5] = np.squeeze(im[1:H:3, 0:W:3]) + out[:, :, 6] = np.squeeze(im[1:H:3, 1:W:3]) + out[:, :, 7] = np.squeeze(im[2:H:3, 0:W:3]) + out[:, :, 8] = np.squeeze(im[2:H:3, 1:W:3]) + image.data = out * ratio + return image diff --git a/tools/accuracy_checker/accuracy_checker/preprocessor/resize.py b/tools/accuracy_checker/accuracy_checker/preprocessor/resize.py index c124da74a12..b6008d918c7 100644 --- a/tools/accuracy_checker/accuracy_checker/preprocessor/resize.py +++ b/tools/accuracy_checker/accuracy_checker/preprocessor/resize.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -250,15 +250,17 @@ def __init__(self, interpolation): import tensorflow as tf # pylint: disable=C0415 except ImportError as import_error: UnsupportedPackage("tf", import_error.msg).raise_error(self.__provider__) - tf.enable_eager_execution() + if tf.__version__ < '2.0.0': + tf.enable_eager_execution() + self._resize = tf.image.resize_images + else: + self._resize = tf.image.resize self._supported_interpolations = { 'BILINEAR': tf.image.ResizeMethod.BILINEAR, 'AREA': tf.image.ResizeMethod.AREA, 'BICUBIC': tf.image.ResizeMethod.BICUBIC, } self.default_interpolation = 'BILINEAR' - self._resize = tf.image.resize_images - super().__init__(interpolation) def resize(self, data, new_height, new_width): diff --git a/tools/accuracy_checker/accuracy_checker/presenters.py b/tools/accuracy_checker/accuracy_checker/presenters.py index 1dd74e682af..1818c43b4ee 100644 --- a/tools/accuracy_checker/accuracy_checker/presenters.py +++ b/tools/accuracy_checker/accuracy_checker/presenters.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -120,7 +120,7 @@ def extract_result(self, evaluation_result): value = value[0] result_dict = { 'name': value_names[0] if 'names' in meta else name, - 'value':value, + 'value': value, 'type': metric_type, 'ref': reference or '' } diff --git a/tools/accuracy_checker/accuracy_checker/progress_reporters.py b/tools/accuracy_checker/accuracy_checker/progress_reporters.py index 2fa767b3efc..2ef9c577ced 100644 --- a/tools/accuracy_checker/accuracy_checker/progress_reporters.py +++ b/tools/accuracy_checker/accuracy_checker/progress_reporters.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/representation/__init__.py b/tools/accuracy_checker/accuracy_checker/representation/__init__.py index e4e1fee8580..98d0ae2e9fb 100644 --- a/tools/accuracy_checker/accuracy_checker/representation/__init__.py +++ b/tools/accuracy_checker/accuracy_checker/representation/__init__.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -19,7 +19,9 @@ Classification, ClassificationAnnotation, ClassificationPrediction, - ArgMaxClassificationPrediction + ArgMaxClassificationPrediction, + SequenceClassificationAnnotation, + SequenceClassificationPrediction ) from .detection_representation import ( Detection, @@ -45,6 +47,8 @@ CoCoInstanceSegmentationAnnotation, CoCocInstanceSegmentationPrediction, OAR3DTilingSegmentationAnnotation, + SalientRegionAnnotation, + SalientRegionPrediction ) from .character_recognition_representation import ( CharacterRecognition, @@ -79,7 +83,8 @@ TextClassificationAnnotation, LanguageModelingAnnotation, LanguageModelingPrediction, - QuestionAnsweringBiDAFAnnotation + QuestionAnsweringBiDAFAnnotation, + BERTNamedEntityRecognitionAnnotation ) from .image_inpainting import ImageInpaintingAnnotation, ImageInpaintingPrediction from .style_transfer import StyleTransferAnnotation, StyleTransferPrediction @@ -90,6 +95,9 @@ from .dna_sequence import DNASequenceAnnotation, DNASequencePrediction from .raw_representation import RawTensorAnnotation, RawTensorPrediction + +from .optical_flow import OpticalFlowAnnotation, OpticalFlowPrediction + __all__ = [ 'BaseRepresentation', @@ -97,6 +105,8 @@ 'ClassificationAnnotation', 'ClassificationPrediction', 'ArgMaxClassificationPrediction', + 'SequenceClassificationAnnotation', + 'SequenceClassificationPrediction', 'Detection', 'DetectionAnnotation', @@ -116,6 +126,9 @@ 'SegmentationAnnotation', 'SegmentationPrediction', + 'SalientRegionAnnotation', + 'SalientRegionPrediction', + 'BrainTumorSegmentationAnnotation', 'BrainTumorSegmentationPrediction', 'OAR3DTilingSegmentationAnnotation', @@ -175,6 +188,7 @@ 'TextClassificationAnnotation', 'LanguageModelingAnnotation', 'LanguageModelingPrediction', + 'BERTNamedEntityRecognitionAnnotation', 'DepthEstimationAnnotation', 'DepthEstimationPrediction', @@ -184,6 +198,10 @@ 'DNASequenceAnnotation', 'DNASequencePrediction', + 'RawTensorAnnotation', 'RawTensorPrediction', + + 'OpticalFlowAnnotation', + 'OpticalFlowPrediction', ] diff --git a/tools/accuracy_checker/accuracy_checker/representation/base_representation.py b/tools/accuracy_checker/accuracy_checker/representation/base_representation.py index b4711a280bb..1974d9996cb 100644 --- a/tools/accuracy_checker/accuracy_checker/representation/base_representation.py +++ b/tools/accuracy_checker/accuracy_checker/representation/base_representation.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/representation/character_recognition_representation.py b/tools/accuracy_checker/accuracy_checker/representation/character_recognition_representation.py index 7a5999a9f71..cf1bb1dabda 100644 --- a/tools/accuracy_checker/accuracy_checker/representation/character_recognition_representation.py +++ b/tools/accuracy_checker/accuracy_checker/representation/character_recognition_representation.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/representation/classification_representation.py b/tools/accuracy_checker/accuracy_checker/representation/classification_representation.py index 545bef94cf5..1e13db51d05 100644 --- a/tools/accuracy_checker/accuracy_checker/representation/classification_representation.py +++ b/tools/accuracy_checker/accuracy_checker/representation/classification_representation.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -67,3 +67,16 @@ def label(self, value): def top_k(self, k): return np.full(k, self._label) + + +class SequenceClassificationAnnotation(ClassificationAnnotation): + pass + + +class SequenceClassificationPrediction(ClassificationPrediction): + @property + def label(self): + return np.argmax(self.scores, axis=1) + + def top_k(self, k): + return np.argpartition(self.scores, -k, axis=1)[:, -k:] diff --git a/tools/accuracy_checker/accuracy_checker/representation/depth_estimation.py b/tools/accuracy_checker/accuracy_checker/representation/depth_estimation.py index cd87f477208..dc6a5d4740a 100644 --- a/tools/accuracy_checker/accuracy_checker/representation/depth_estimation.py +++ b/tools/accuracy_checker/accuracy_checker/representation/depth_estimation.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/representation/detection_representation.py b/tools/accuracy_checker/accuracy_checker/representation/detection_representation.py index d5a36b68c12..2fb58cf49f8 100644 --- a/tools/accuracy_checker/accuracy_checker/representation/detection_representation.py +++ b/tools/accuracy_checker/accuracy_checker/representation/detection_representation.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/representation/dna_sequence.py b/tools/accuracy_checker/accuracy_checker/representation/dna_sequence.py index 7fc5f31807f..78bb48809ca 100644 --- a/tools/accuracy_checker/accuracy_checker/representation/dna_sequence.py +++ b/tools/accuracy_checker/accuracy_checker/representation/dna_sequence.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/representation/hit_ratio_representation.py b/tools/accuracy_checker/accuracy_checker/representation/hit_ratio_representation.py index 3587cf0a869..8891ff9cc26 100644 --- a/tools/accuracy_checker/accuracy_checker/representation/hit_ratio_representation.py +++ b/tools/accuracy_checker/accuracy_checker/representation/hit_ratio_representation.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/representation/image_inpainting.py b/tools/accuracy_checker/accuracy_checker/representation/image_inpainting.py index 75d2a5b4289..4610696383c 100644 --- a/tools/accuracy_checker/accuracy_checker/representation/image_inpainting.py +++ b/tools/accuracy_checker/accuracy_checker/representation/image_inpainting.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/representation/image_processing.py b/tools/accuracy_checker/accuracy_checker/representation/image_processing.py index 9451814daaf..300f9b5bbcb 100644 --- a/tools/accuracy_checker/accuracy_checker/representation/image_processing.py +++ b/tools/accuracy_checker/accuracy_checker/representation/image_processing.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ class GTLoader(Enum): PILLOW = 0 OPENCV = 1 DICOM = 2 + RAWPY = 3 class ImageProcessingRepresentation(BaseRepresentation): @@ -35,7 +36,8 @@ class ImageProcessingAnnotation(ImageProcessingRepresentation): LOADERS = { GTLoader.PILLOW: 'pillow_imread', GTLoader.OPENCV: 'opencv_imread', - GTLoader.DICOM: 'dicom_reader' + GTLoader.DICOM: 'dicom_reader', + GTLoader.RAWPY: 'rawpy' } def __init__(self, identifier, path_to_gt, gt_loader=GTLoader.PILLOW): @@ -59,7 +61,7 @@ def value(self): data_source = self.metadata['data_source'] loader = BaseReader.provide(self._gt_loader, data_source) gt = loader.read(self._image_path) - return gt.astype(np.uint8) if self._gt_loader != 'dicom_reader' else gt + return gt.astype(np.uint8) if self._gt_loader not in ['dicom_reader', 'rawpy'] else gt return self._value @value.setter diff --git a/tools/accuracy_checker/accuracy_checker/representation/multilabel_recognition.py b/tools/accuracy_checker/accuracy_checker/representation/multilabel_recognition.py index 4a4bc075f4e..ff0872e69ad 100644 --- a/tools/accuracy_checker/accuracy_checker/representation/multilabel_recognition.py +++ b/tools/accuracy_checker/accuracy_checker/representation/multilabel_recognition.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/representation/nlp_representation.py b/tools/accuracy_checker/accuracy_checker/representation/nlp_representation.py index 4169834cadf..3ecc2fcfd50 100644 --- a/tools/accuracy_checker/accuracy_checker/representation/nlp_representation.py +++ b/tools/accuracy_checker/accuracy_checker/representation/nlp_representation.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,8 +14,9 @@ limitations under the License. """ +import numpy as np from .base_representation import BaseRepresentation -from .classification_representation import ClassificationAnnotation +from .classification_representation import ClassificationAnnotation, SequenceClassificationAnnotation class MachineTranslationRepresentation(BaseRepresentation): @@ -34,10 +35,12 @@ def __init__(self, identifier, translation=''): super().__init__(identifier) self.translation = translation + class LanguageModeling(BaseRepresentation): def __init__(self, identifier=''): super().__init__(identifier) + class LanguageModelingAnnotation(LanguageModeling): def __init__(self, identifier, unique_id, input_ids, tokens, labels=None): super().__init__(identifier) @@ -46,15 +49,18 @@ def __init__(self, identifier, unique_id, input_ids, tokens, labels=None): self.input_ids = input_ids self.labels = labels if labels is not None else [] + class LanguageModelingPrediction(LanguageModeling): def __init__(self, identifier, logits): super().__init__(identifier) self.logits = logits + class QuestionAnswering(BaseRepresentation): def __init__(self, identifier=''): super().__init__(identifier) + class QuestionAnsweringAnnotation(QuestionAnswering): def __init__(self, identifier, question_id, unique_id, input_ids, input_mask, segment_ids, position_ids, @@ -100,6 +106,7 @@ def __init__(self, identifier, input_ids, input_mask, segment_ids, position_ids, self.position_ids = position_ids self.context_pos_indetifier = context_pos_identifier + class QuestionAnsweringEmbeddingPrediction(QuestionAnswering): def __init__(self, identifier, embedding): super().__init__(identifier) @@ -129,3 +136,13 @@ def __init__(self, identifier, label, input_ids, input_mask=None, segment_ids=No self.input_mask = input_mask if input_mask is not None else [] self.segment_ids = segment_ids if segment_ids is not None else [] self.tokens = tokens if tokens is not None else [] + + +class BERTNamedEntityRecognitionAnnotation(SequenceClassificationAnnotation): + def __init__(self, identifier, input_ids, input_mask, segment_ids, label_id, valid_ids=None, label_mask=None): + super().__init__(identifier, label_id) + self.input_ids = input_ids + self.input_mask = input_mask if input_mask is not None else [] + self.segment_ids = segment_ids if segment_ids is not None else [] + self.valid_ids = np.array(valid_ids, dtype=bool) if valid_ids is not None else valid_ids + self.label_mask = np.array(label_mask, dtype=bool) if label_mask is not None else label_mask diff --git a/tools/accuracy_checker/accuracy_checker/representation/optical_flow.py b/tools/accuracy_checker/accuracy_checker/representation/optical_flow.py new file mode 100644 index 00000000000..ec81bf1c000 --- /dev/null +++ b/tools/accuracy_checker/accuracy_checker/representation/optical_flow.py @@ -0,0 +1,87 @@ +""" +Copyright (c) 2018-2021 Intel Corporation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" +import cv2 +import numpy as np +from .base_representation import BaseRepresentation +TAG_FLOAT = 202021.25 + + +class OpticalFlowRepresentation(BaseRepresentation): + pass + + +class OpticalFlowAnnotation(OpticalFlowRepresentation): + def __init__(self, identifier, path_to_gt): + super().__init__(identifier) + self.path_to_gt = path_to_gt + self._value = None + + @property + def value(self): + return self._value if self._value is not None else self._load_flow() + + @value.setter + def value(self, flow): + self._value = flow + + def _load_flow(self): + if self._value is not None: + return self._value + data_source = self.metadata.get('segmentation_masks_source') or self.metadata.get('additional_data_source') + if data_source is None: + data_source = self.metadata['data_source'] + src_file = data_source / self.path_to_gt + if self.path_to_gt.lower().endswith('.flo'): + with open(str(src_file), 'rb') as f: + tag = float(np.fromfile(f, np.float32, count=1)[0]) + assert tag == TAG_FLOAT + w = np.fromfile(f, np.int32, count=1)[0] + h = np.fromfile(f, np.int32, count=1)[0] + flow = np.fromfile(f, np.float32, count=h * w * 2) + flow.resize((h, w, 2)) + return flow + + if self.path_to_gt.lower().endswith('.png'): + flow_raw = cv2.imread(str(src_file), -1) + flow = flow_raw[:, :, 2:0:-1].astype(np.float32) + flow = flow - 32768 + flow = flow / 64 + + flow[np.abs(flow) < 1e-10] = 1e-10 + + invalid = (flow_raw[:, :, 0] == 0) + flow[invalid, :] = 0 + return flow + + if self.path_to_gt.lower().endswith('.pfm'): + with open(str(src_file), 'rb') as f: + tag = f.readline().rstrip().decode("utf-8") + assert tag == 'PF' + dims = f.readline().rstrip().decode("utf-8") + w, h = map(int, dims.split(' ')) + scale = float(f.readline().rstrip().decode("utf-8")) + + flow = np.fromfile(f, 'f') + flow = np.reshape(flow, (h, w, 3))[:, :, 0:2] + flow = np.flipud(flow) + return flow + raise ValueError('Unsupported flow format {}'.format(self.path_to_gt)) + + +class OpticalFlowPrediction(OpticalFlowRepresentation): + def __init__(self, identifier, flow): + super().__init__(identifier) + self.value = flow diff --git a/tools/accuracy_checker/accuracy_checker/representation/pose_estimation_3d_representation.py b/tools/accuracy_checker/accuracy_checker/representation/pose_estimation_3d_representation.py index f4b4e6598c5..4d71147c6d9 100644 --- a/tools/accuracy_checker/accuracy_checker/representation/pose_estimation_3d_representation.py +++ b/tools/accuracy_checker/accuracy_checker/representation/pose_estimation_3d_representation.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/representation/pose_estimation_representation.py b/tools/accuracy_checker/accuracy_checker/representation/pose_estimation_representation.py index c2ae341dc90..99854937acb 100644 --- a/tools/accuracy_checker/accuracy_checker/representation/pose_estimation_representation.py +++ b/tools/accuracy_checker/accuracy_checker/representation/pose_estimation_representation.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/representation/quality_assessment.py b/tools/accuracy_checker/accuracy_checker/representation/quality_assessment.py index 5c4d32c73b7..5d4b69f89dc 100644 --- a/tools/accuracy_checker/accuracy_checker/representation/quality_assessment.py +++ b/tools/accuracy_checker/accuracy_checker/representation/quality_assessment.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/representation/raw_representation.py b/tools/accuracy_checker/accuracy_checker/representation/raw_representation.py index d76caee7cf2..8e311ff3cb3 100644 --- a/tools/accuracy_checker/accuracy_checker/representation/raw_representation.py +++ b/tools/accuracy_checker/accuracy_checker/representation/raw_representation.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/representation/regression_representation.py b/tools/accuracy_checker/accuracy_checker/representation/regression_representation.py index f1fd71dc92e..7ce0f3a0a70 100644 --- a/tools/accuracy_checker/accuracy_checker/representation/regression_representation.py +++ b/tools/accuracy_checker/accuracy_checker/representation/regression_representation.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,9 +14,9 @@ limitations under the License. """ -from pathlib import Path import numpy as np from .base_representation import BaseRepresentation +from ..data_readers import BaseReader class RegressionRepresentation(BaseRepresentation): @@ -111,13 +111,27 @@ class FacialLandmarks3DPrediction(FacialLandmarks3DRepresentation): class FeaturesRegressionAnnotation(BaseRepresentation): - def __init__(self, identifier, value_file): + def __init__(self, identifier, value_file, dict_features=False, is_bin=False, bin_dtype='float32'): super().__init__(identifier) self.value_file = value_file + if not dict_features: + self._reader_config = {'type': 'numpy_txt_reader'} if not is_bin else { + "type": 'numpy_bin_reader', "dtype": bin_dtype + } + else: + self._reader_config = {'type': 'numpy_dict_reader'} + self._value = None @property def value(self): - data_source = self.metadata.get('additional_data_source') - if data_source is None: - data_source = self.metadata['data_source'] - return np.loadtxt(str(Path(data_source) / self.value_file)) + if self._value is None: + data_source = self.metadata.get('additional_data_source') + if data_source is None: + data_source = self.metadata['data_source'] + reader = BaseReader.provide(self._reader_config['type'], data_source, self._reader_config) + return reader.read(self.value_file) + return self._value + + @value.setter + def value(self, value): + self._value = value diff --git a/tools/accuracy_checker/accuracy_checker/representation/reid_representation.py b/tools/accuracy_checker/accuracy_checker/representation/reid_representation.py index 20e0d03a0e9..83161d384ee 100644 --- a/tools/accuracy_checker/accuracy_checker/representation/reid_representation.py +++ b/tools/accuracy_checker/accuracy_checker/representation/reid_representation.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/representation/representaton_container.py b/tools/accuracy_checker/accuracy_checker/representation/representaton_container.py index f65c2c495da..517e77b1ea0 100644 --- a/tools/accuracy_checker/accuracy_checker/representation/representaton_container.py +++ b/tools/accuracy_checker/accuracy_checker/representation/representaton_container.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/representation/segmentation_representation.py b/tools/accuracy_checker/accuracy_checker/representation/segmentation_representation.py index eda22e59479..a2ed8ce4c4e 100644 --- a/tools/accuracy_checker/accuracy_checker/representation/segmentation_representation.py +++ b/tools/accuracy_checker/accuracy_checker/representation/segmentation_representation.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -39,11 +39,13 @@ class GTMaskLoader(Enum): NIFTI = 3 NUMPY = 4 NIFTI_CHANNELS_FIRST = 5 + PILLOW_CONVERT_TO_RGB = 6 LOADERS_MAPPING = { 'opencv': GTMaskLoader.OPENCV, 'pillow': GTMaskLoader.PILLOW, + 'pillow_convert_to_rgb': GTMaskLoader.PILLOW_CONVERT_TO_RGB, 'scipy': GTMaskLoader.SCIPY, 'nifti': GTMaskLoader.NIFTI, 'nifti_channels_first': GTMaskLoader.NIFTI_CHANNELS_FIRST, @@ -58,6 +60,7 @@ class SegmentationRepresentation(BaseRepresentation): class SegmentationAnnotation(SegmentationRepresentation): LOADERS = { GTMaskLoader.PILLOW: 'pillow_imread', + GTMaskLoader.PILLOW_CONVERT_TO_RGB: {'type': 'pillow_imread', 'convert_to_rgb': True}, GTMaskLoader.OPENCV: 'opencv_imread', GTMaskLoader.SCIPY: 'scipy_imread', GTMaskLoader.NIFTI: 'nifti_reader', @@ -135,7 +138,7 @@ def to_polygon(self, segmentation_colors=None, label_map=None): mask = self._encode_mask(self.mask, segmentation_colors) if segmentation_colors else self.mask polygons = defaultdict(list) - indexes = np.unique(mask) if not label_map else set(np.unique(mask))&set(label_map.keys()) + indexes = np.unique(mask) if not label_map else set(np.unique(mask)) & set(label_map.keys()) for i in indexes: binary_mask = np.uint8(mask == i) contours, _ = cv.findContours(binary_mask, cv.RETR_TREE, cv.CHAIN_APPROX_SIMPLE) @@ -340,6 +343,7 @@ def remove(self, indexes): def to_annotation(self, **kwargs): return CoCoInstanceSegmentationAnnotation(self.identifier, self.mask, self.labels) + class OAR3DTilingSegmentationAnnotation(SegmentationAnnotation): def __init__(self, identifier, path_to_mask): super().__init__(identifier, path_to_mask, GTMaskLoader.NUMPY) @@ -355,3 +359,10 @@ def _load_mask(self): return mask return self._mask + + +class SalientRegionAnnotation(SegmentationAnnotation): + pass + +class SalientRegionPrediction(SegmentationPrediction): + pass diff --git a/tools/accuracy_checker/accuracy_checker/representation/style_transfer.py b/tools/accuracy_checker/accuracy_checker/representation/style_transfer.py index 93ae9480361..023f7b7e8b6 100644 --- a/tools/accuracy_checker/accuracy_checker/representation/style_transfer.py +++ b/tools/accuracy_checker/accuracy_checker/representation/style_transfer.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/representation/super_resolution_representation.py b/tools/accuracy_checker/accuracy_checker/representation/super_resolution_representation.py index 9dde336f34f..85de0738eb2 100644 --- a/tools/accuracy_checker/accuracy_checker/representation/super_resolution_representation.py +++ b/tools/accuracy_checker/accuracy_checker/representation/super_resolution_representation.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/representation/text_detection_representation.py b/tools/accuracy_checker/accuracy_checker/representation/text_detection_representation.py index b4dbe2f4f9a..e8ab981293e 100644 --- a/tools/accuracy_checker/accuracy_checker/representation/text_detection_representation.py +++ b/tools/accuracy_checker/accuracy_checker/representation/text_detection_representation.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/accuracy_checker/serialize_parameters.py b/tools/accuracy_checker/accuracy_checker/serialize_parameters.py deleted file mode 100644 index 5d159cb96f0..00000000000 --- a/tools/accuracy_checker/accuracy_checker/serialize_parameters.py +++ /dev/null @@ -1,242 +0,0 @@ -""" -Copyright (c) 2018-2020 Intel Corporation - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -# pylint:disable=W0614,W0401 - -import json -from collections import OrderedDict -from argparse import Action, ArgumentParser - -from .adapters import * -from .annotation_converters import * -from .metrics import * -from .preprocessor import * -from .postprocessor import * -from .topology_types import * -from .launcher import * -from .logging import print_info - - -def inheritors(cls, recursively=True): - subclasses = set() - work = [cls] - while work: - parent = work.pop() - for child in parent.__subclasses__(): - if child not in subclasses: - subclasses.add(child) - if recursively: - work.append(child) - return subclasses - - -def parents(cls, excluded_classes=None): - cls_parents = set() - work = [cls] - while work: - child = work.pop() - for parent in child.__bases__: - if parent not in cls_parents: - if not excluded_classes or parent not in excluded_classes: - cls_parents.add(parent) - work.append(parent) - return cls_parents - - -def check_topology_is_supported(supported_topology_types, filter_topology_types): - if list(set(supported_topology_types) & set(filter_topology_types)): - return True - - supported_topology_classes = [y for x, y in globals().items() - if (hasattr(y, '__provider__') and y.__provider__ in supported_topology_types)] - filter_topology_classes = [y for x, y in globals().items() - if (hasattr(y, '__provider__') and y.__provider__ in filter_topology_types)] - for cls in supported_topology_classes: - for filter_cls in filter_topology_classes: - filter_cls_parents = parents(filter_cls, [GenericTopology]) - filter_cls_children = inheritors(filter_cls) - if cls in filter_cls_children or cls in filter_cls_parents: - return True - return False - - -def add_section(base_class, topology_types=None, representations=None, filtered_providers=None): - providers = inheritors(base_class) - class_parameters = OrderedDict() - for provider in providers: - if provider.__provider__: - provider_parameters = OrderedDict() - - supported_topology_types = [] - if hasattr(provider, 'topology_types'): - supported_topology_types = [x.__provider__ for x in provider.topology_types] - if topology_types and not check_topology_is_supported(supported_topology_types, topology_types): - continue - - if supported_topology_types: - provider_parameters["topology_types"] = supported_topology_types - - supported_representations = [] - if hasattr(provider, 'annotation_types'): - supported_representations.extend({x.__name__ for x in provider.annotation_types}) - if hasattr(provider, 'prediction_types'): - supported_representations.extend({x.__name__ for x in provider.prediction_types}) - if supported_representations: - if representations and not list(set(supported_representations) & set(representations)): - continue - provider_parameters["representations"] = supported_representations - - if filtered_providers and provider.__provider__ not in filtered_providers: - continue - - parameters = provider.parameters() - parameters_json = OrderedDict() - for key in parameters: - parameters_json[key] = parameters[key].parameters() - provider_parameters["parameters"] = parameters_json - - if provider_parameters: - class_parameters[provider.__provider__] = provider_parameters - - return class_parameters - - -all_topology_types = [x.__provider__ for x in inheritors(Topology)] -all_launchers = [x.__provider__ for x in inheritors(Launcher)] - -valid_values_map_for_action = { - "topology_types": all_topology_types, - "launchers": all_launchers -} - - -class ListAction(Action): - def __init__(self, option_strings, dest, nargs=None, **kwargs): - if nargs is not None: - raise ValueError("nargs not allowed") - super(ListAction, self).__init__(option_strings, dest, **kwargs) - - def __call__(self, parser, namespace, values, option_string=None): - values = [x.strip() for x in values.split(',')] - if self.dest in valid_values_map_for_action.keys() and valid_values_map_for_action[self.dest]: - for v in values: - if v not in valid_values_map_for_action[self.dest]: - raise Exception("Unknown " + self.dest + ': ' + v + - ".\nSelect from list:\n" + '\n'.join(valid_values_map_for_action[self.dest])) - setattr(namespace, self.dest, values) - - -def get_recursively(search_dict, field): - fields_found = set() - - for key, value in search_dict.items(): - if key == field: - if isinstance(value, list): - for item in value: - fields_found.add(item) - else: - fields_found.add(value) - - elif isinstance(value, dict): - results = get_recursively(value, field) - for result in results: - fields_found.add(result) - - elif isinstance(value, list): - for item in value: - if isinstance(item, dict): - more_results = get_recursively(item, field) - for another_result in more_results: - fields_found.add(another_result) - - return fields_found - - -def add_topology_types(cls): - topology_descriptions = {} - topology_descriptions[cls.__name__] = {'description': cls.description} - child_topology_types = {} - for child in inheritors(cls, False): - child_topology_types.update(add_topology_types(child)) - - if child_topology_types: - topology_descriptions[cls.__name__].update({'topology_types': child_topology_types}) - - return topology_descriptions - - -def fetch(topology_types=None, launchers=None): - if topology_types: - topology_types = set(sorted(topology_types)) - - if launchers: - launchers = set(sorted(launchers)) - - json_dict = {} - json_dict[Topology.__provider_type__] = add_section(Topology, filtered_providers=topology_types) - - models_dict = {} - models_dict[Launcher.__provider_type__] = add_section(Launcher, filtered_providers=launchers) - json_dict['models'] = models_dict - - dataset_dict = {} - for base_provider in [Adapter, BaseFormatConverter]: - dataset_dict[base_provider.__provider_type__] = add_section(base_provider, topology_types=topology_types) - - representations = get_recursively(dataset_dict, 'representations') - for base_provider in [Metric, Preprocessor, Postprocessor]: - dataset_dict[base_provider.__provider_type__] = add_section(base_provider, representations=representations) - - json_dict['datasets'] = dataset_dict - return json_dict - - -def main(): - parser = ArgumentParser(description='Accuracy Checker Parameter Fetcher', allow_abbrev=False) - parser.add_argument( - '-t', '--topology_types', - help='Topology types: ' + ', '.join(all_topology_types), - required=False, - action=ListAction, - default=all_topology_types - ) - parser.add_argument( - '-l', '--launchers', - help='Launchers: ' + ', '.join(all_launchers), - required=False, - action=ListAction, - default=all_launchers - ) - parser.add_argument( - '-o', '--output', - help='Output file', - required=False, - default='serialized_parameters.json' - ) - - args = parser.parse_args() - - print_info("Gather parameters for following topology types: " + ", ".join(args.topology_types)) - json_dict = fetch(args.topology_types, args.launchers) - json_content = json.dumps(json_dict, sort_keys=True, indent=4) - - print_info('Writing to {}...'.format(args.output)) - with open(args.output, 'w') as f: - f.write(json_content) - - -if __name__ == '__main__': - main() diff --git a/tools/accuracy_checker/accuracy_checker/topology_types.py b/tools/accuracy_checker/accuracy_checker/topology_types.py deleted file mode 100644 index c4cf501b6fc..00000000000 --- a/tools/accuracy_checker/accuracy_checker/topology_types.py +++ /dev/null @@ -1,57 +0,0 @@ -""" -Copyright (c) 2018-2020 Intel Corporation - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -from .dependency import ClassProvider - -class Topology(ClassProvider): - __provider_type__ = 'topology_type' - - @classmethod - def parameters(cls): - return {} - -class GenericTopology(Topology): - __provider__ = 'generic_topology' - -class ImageClassification(GenericTopology): - __provider__ = 'image_classification' - -class ObjectDetection(GenericTopology): - __provider__ = 'object_detection' - -class SSD(ObjectDetection): - __provider__ = 'ssd' - -class FasterRCNN(ObjectDetection): - __provider__ = 'faster_rcnn' - -class Yolo(ObjectDetection): - __provider__ = 'yolo' - -class YoloV1Tiny(Yolo): - __provider__ = 'yolo_v1_tiny' - -class YoloV2(Yolo): - __provider__ = 'yolo_v2' - -class YoloV2Tiny(Yolo): - __provider__ = 'yolo_v2_tiny' - -class YoloV3(Yolo): - __provider__ = 'yolo_v3' - -class YoloV3Tiny(Yolo): - __provider__ = 'yolo_v3_tiny' diff --git a/tools/accuracy_checker/accuracy_checker/utils.py b/tools/accuracy_checker/accuracy_checker/utils.py index 4b4346e1edc..58b97dbcc8c 100644 --- a/tools/accuracy_checker/accuracy_checker/utils.py +++ b/tools/accuracy_checker/accuracy_checker/utils.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -99,7 +99,7 @@ def string_to_tuple(string, casting_type=float): processed = processed.replace(')', '') processed = processed.split(',') - return tuple([casting_type(entry) for entry in processed]) if not casting_type is None else tuple(processed) + return tuple([casting_type(entry) for entry in processed]) if casting_type else tuple(processed) def string_to_list(string): @@ -413,7 +413,7 @@ def set_image_metadata(annotation, images): if not isinstance(data, list): data = [data] for image in data: - data_shape = image.shape if not np.isscalar(image) else 1 + data_shape = np.shape(image) if not np.isscalar(image) else 1 image_sizes.append(data_shape) annotation.set_image_size(image_sizes) @@ -490,6 +490,14 @@ def __eq__(self, other): return set(self) == set(other) +def is_relative_to(path, *other): + try: + Path(path).relative_to(*other) + return True + except ValueError: + return False + + def get_parameter_value_from_config(config, parameters, key): if key not in parameters.keys(): return None @@ -525,6 +533,14 @@ def softmax(x): return np.exp(x) / sum(np.exp(x)) +def is_iterable(maybe_iterable): + try: + iter(maybe_iterable) + return True + except TypeError: + return False + + class ParseError(Exception): pass @@ -723,7 +739,6 @@ def _read_struct_array(self, fd, endian, header): if isinstance(fields, str): fields = [fields] - empty = lambda: [list() for i in range(header['dims'][0])] array = {} for row in range(header['dims'][0]): for _col in range(header['dims'][1]): @@ -731,7 +746,7 @@ def _read_struct_array(self, fd, endian, header): vheader, next_pos, fd_var = self.read_var_header(fd, endian) data = self.read_var_array(fd_var, endian, vheader) if field not in array: - array[field] = empty() + array[field] = [[] for _ in range(header['dims'][0])] array[field][row].append(data) fd.seek(next_pos) for field in fields: diff --git a/tools/accuracy_checker/configs/README.md b/tools/accuracy_checker/configs/README.md index bf0c5816693..c8f0ecea7b8 100644 --- a/tools/accuracy_checker/configs/README.md +++ b/tools/accuracy_checker/configs/README.md @@ -55,7 +55,7 @@ Example: 1. To run configuration specify the path to the required configuration file to `-c, --config` command line. 2. Configuration files don't contain paths to used models and weights. The model and weights are searched automatically by name of model in path specified in `-m, --models` command line option. 3. There is global configuration file with dataset conversion parameters which is used to avoiding duplication. Global definitions will be merged with evaluation config in the runtime by dataset name. You can use global_definitions to specify path to this file via command line arguments `-d, --definitions`. In order, if you want use definitions file in quantization via Post Training Optimization Toolkit, you should use environment variable `DEFINITIONS_FILE` for specifying path to definitions. -4. The path relative to which the `data_source` is specified can be provided via `-s, --source` command line. If you want to evaluate models using well-known datasets, you need to organize folders with validation datasets in a certain way. More detailed information about dataset preparation you can find in [Dataset Preparation Guide](../../../datasets.md). In order, if you want use data source in quantization via Post Training Optimization Toolkit, you should use environment variable `DATA_DIR` for specifying path to root of directories with datasets. +4. The path relative to which the `data_source` is specified can be provided via `-s, --source` command line. If you want to evaluate models using well-known datasets, you need to organize folders with validation datasets in a certain way. More detailed information about dataset preparation you can find in [Dataset Preparation Guide](../../../data/datasets.md). In order, if you want use data source in quantization via Post Training Optimization Toolkit, you should use environment variable `DATA_DIR` for specifying path to root of directories with datasets. 5. The path relative to which the `annotation` and `dataset_meta` are specified can be provided via `-a, --annotations` command line. Annotation and dataset_meta (if required) will be stored to this directory after annotation conversion step if they do not exist and can be used for the next running to skip annotation conversion. Detailed information about annotation conversion you can find in [Annotation Conversion Guide](../accuracy_checker/annotation_converters/README.md). 6. Some models can have additional files for evaluation (for example, vocabulary files for NLP models), generally, named as model attributes. The relative paths to model specific attributes(vocabulary files, merges files, etc.) can be provided in the configuration file, if it is required. The path prefix for them should be passed through `--model_attributes` command line option (usually, it is the model directory). 7. To specify devices for infer use `-td, --target_devices` command line option. Several devices should be separated by spaces (e.g. -td CPU GPU). @@ -70,7 +70,7 @@ See how to evaluate model with using predefined configuration file for [densenet - `MODEL_DIR` - root directory with model - `OPENVINO_DIR` - root directory with installed the OpenVINO™ toolkit -1. First of all, you need to prepare dataset according to [Dataset Preparation Guide](../../../datasets.md) +1. First of all, you need to prepare dataset according to [Dataset Preparation Guide](../../../data/datasets.md) 2. Download original model files from online source using [Model Downloader](../../../tools/downloader/README.md) ```sh OMZ_ROOT/tools/downloader/downloader.py --name densenet-121-tf --output_dir MODEL_DIR diff --git a/tools/accuracy_checker/configs/aclnet.yml b/tools/accuracy_checker/configs/aclnet.yml new file mode 120000 index 00000000000..04574953975 --- /dev/null +++ b/tools/accuracy_checker/configs/aclnet.yml @@ -0,0 +1 @@ +../../../models/public/aclnet/accuracy-check.yml \ No newline at end of file diff --git a/tools/accuracy_checker/configs/anti-spoof-mn3.yml b/tools/accuracy_checker/configs/anti-spoof-mn3.yml new file mode 120000 index 00000000000..79c0b4297c3 --- /dev/null +++ b/tools/accuracy_checker/configs/anti-spoof-mn3.yml @@ -0,0 +1 @@ +../../../models/public/anti-spoof-mn3/accuracy-check.yml \ No newline at end of file diff --git a/tools/accuracy_checker/configs/bert-large-uncased-whole-word-masking-squad-0001.yml b/tools/accuracy_checker/configs/bert-large-uncased-whole-word-masking-squad-0001.yml new file mode 120000 index 00000000000..c945af0a257 --- /dev/null +++ b/tools/accuracy_checker/configs/bert-large-uncased-whole-word-masking-squad-0001.yml @@ -0,0 +1 @@ +../../../models/intel/bert-large-uncased-whole-word-masking-squad-0001/accuracy-check.yml \ No newline at end of file diff --git a/tools/accuracy_checker/configs/bert-large-uncased-whole-word-masking-squad-fp32-0001.yml b/tools/accuracy_checker/configs/bert-large-uncased-whole-word-masking-squad-fp32-0001.yml deleted file mode 120000 index 2c68b958f7a..00000000000 --- a/tools/accuracy_checker/configs/bert-large-uncased-whole-word-masking-squad-fp32-0001.yml +++ /dev/null @@ -1 +0,0 @@ -../../../models/intel/bert-large-uncased-whole-word-masking-squad-fp32-0001/accuracy-check.yml \ No newline at end of file diff --git a/tools/accuracy_checker/configs/cocosnet.yml b/tools/accuracy_checker/configs/cocosnet.yml new file mode 120000 index 00000000000..ab01086c761 --- /dev/null +++ b/tools/accuracy_checker/configs/cocosnet.yml @@ -0,0 +1 @@ +../../../models/public/cocosnet/accuracy-check.yml \ No newline at end of file diff --git a/tools/accuracy_checker/configs/densenet-201-tf.yml b/tools/accuracy_checker/configs/densenet-201-tf.yml new file mode 120000 index 00000000000..192dafd925a --- /dev/null +++ b/tools/accuracy_checker/configs/densenet-201-tf.yml @@ -0,0 +1 @@ +../../../models/public/densenet-201-tf/accuracy-check.yml \ No newline at end of file diff --git a/tools/accuracy_checker/configs/dla-34.yml b/tools/accuracy_checker/configs/dla-34.yml new file mode 120000 index 00000000000..aad87083d00 --- /dev/null +++ b/tools/accuracy_checker/configs/dla-34.yml @@ -0,0 +1 @@ +../../../models/public/dla-34/accuracy-check.yml \ No newline at end of file diff --git a/tools/accuracy_checker/configs/efficientdet-d0-tf.yml b/tools/accuracy_checker/configs/efficientdet-d0-tf.yml new file mode 120000 index 00000000000..dd0e27251ae --- /dev/null +++ b/tools/accuracy_checker/configs/efficientdet-d0-tf.yml @@ -0,0 +1 @@ +../../../models/public/efficientdet-d0-tf/accuracy-check.yml \ No newline at end of file diff --git a/tools/accuracy_checker/configs/efficientdet-d1-tf.yml b/tools/accuracy_checker/configs/efficientdet-d1-tf.yml new file mode 120000 index 00000000000..7a9faa8a50d --- /dev/null +++ b/tools/accuracy_checker/configs/efficientdet-d1-tf.yml @@ -0,0 +1 @@ +../../../models/public/efficientdet-d1-tf/accuracy-check.yml \ No newline at end of file diff --git a/tools/accuracy_checker/configs/forward-tacotron-duration-prediction.yml b/tools/accuracy_checker/configs/forward-tacotron-duration-prediction.yml new file mode 120000 index 00000000000..89a86415c9d --- /dev/null +++ b/tools/accuracy_checker/configs/forward-tacotron-duration-prediction.yml @@ -0,0 +1 @@ +../../../models/public/forward-tacotron/forward-tacotron-duration-prediction/accuracy-check.yml \ No newline at end of file diff --git a/tools/accuracy_checker/configs/forward-tacotron-regression.yml b/tools/accuracy_checker/configs/forward-tacotron-regression.yml new file mode 120000 index 00000000000..9819cb35a78 --- /dev/null +++ b/tools/accuracy_checker/configs/forward-tacotron-regression.yml @@ -0,0 +1 @@ +../../../models/public/forward-tacotron/forward-tacotron-regression/accuracy-check.yml \ No newline at end of file diff --git a/tools/accuracy_checker/configs/human-pose-estimation-0002.yml b/tools/accuracy_checker/configs/human-pose-estimation-0002.yml new file mode 120000 index 00000000000..b1e5c63e0a3 --- /dev/null +++ b/tools/accuracy_checker/configs/human-pose-estimation-0002.yml @@ -0,0 +1 @@ +../../../models/intel/human-pose-estimation-0002/accuracy-check.yml \ No newline at end of file diff --git a/tools/accuracy_checker/configs/human-pose-estimation-0003.yml b/tools/accuracy_checker/configs/human-pose-estimation-0003.yml new file mode 120000 index 00000000000..0b2774baea3 --- /dev/null +++ b/tools/accuracy_checker/configs/human-pose-estimation-0003.yml @@ -0,0 +1 @@ +../../../models/intel/human-pose-estimation-0003/accuracy-check.yml \ No newline at end of file diff --git a/tools/accuracy_checker/configs/human-pose-estimation-0004.yml b/tools/accuracy_checker/configs/human-pose-estimation-0004.yml new file mode 120000 index 00000000000..c8f2d4b7f6b --- /dev/null +++ b/tools/accuracy_checker/configs/human-pose-estimation-0004.yml @@ -0,0 +1 @@ +../../../models/intel/human-pose-estimation-0004/accuracy-check.yml \ No newline at end of file diff --git a/tools/accuracy_checker/configs/mozilla-deepspeech-0.8.2.yml b/tools/accuracy_checker/configs/mozilla-deepspeech-0.8.2.yml new file mode 120000 index 00000000000..1621a792109 --- /dev/null +++ b/tools/accuracy_checker/configs/mozilla-deepspeech-0.8.2.yml @@ -0,0 +1 @@ +../../../models/public/mozilla-deepspeech-0.8.2/accuracy-check.yml \ No newline at end of file diff --git a/tools/accuracy_checker/configs/person-detection-0203.yml b/tools/accuracy_checker/configs/person-detection-0203.yml new file mode 120000 index 00000000000..7e0739c44f2 --- /dev/null +++ b/tools/accuracy_checker/configs/person-detection-0203.yml @@ -0,0 +1 @@ +../../../models/intel/person-detection-0203/accuracy-check.yml \ No newline at end of file diff --git a/tools/accuracy_checker/configs/regnetx-3.2gf.yml b/tools/accuracy_checker/configs/regnetx-3.2gf.yml new file mode 120000 index 00000000000..fcda17a848f --- /dev/null +++ b/tools/accuracy_checker/configs/regnetx-3.2gf.yml @@ -0,0 +1 @@ +../../../models/public/regnetx-3.2gf/accuracy-check.yml \ No newline at end of file diff --git a/tools/accuracy_checker/configs/rexnet-v1-x1.0.yml b/tools/accuracy_checker/configs/rexnet-v1-x1.0.yml new file mode 120000 index 00000000000..83bb0bd0ade --- /dev/null +++ b/tools/accuracy_checker/configs/rexnet-v1-x1.0.yml @@ -0,0 +1 @@ +../../../models/public/rexnet-v1-x1.0/accuracy-check.yml \ No newline at end of file diff --git a/tools/accuracy_checker/configs/ssh-mxnet.yml b/tools/accuracy_checker/configs/ssh-mxnet.yml new file mode 120000 index 00000000000..9edcb2d59a7 --- /dev/null +++ b/tools/accuracy_checker/configs/ssh-mxnet.yml @@ -0,0 +1 @@ +../../../models/public/ssh-mxnet/accuracy-check.yml \ No newline at end of file diff --git a/tools/accuracy_checker/configs/text-spotting-0002.yml b/tools/accuracy_checker/configs/text-spotting-0002.yml deleted file mode 120000 index 0d2c9405940..00000000000 --- a/tools/accuracy_checker/configs/text-spotting-0002.yml +++ /dev/null @@ -1 +0,0 @@ -../../../models/intel/text-spotting-0002/accuracy-check.yml \ No newline at end of file diff --git a/tools/accuracy_checker/configs/text-spotting-0003.yml b/tools/accuracy_checker/configs/text-spotting-0003.yml new file mode 120000 index 00000000000..7d8f9500cf6 --- /dev/null +++ b/tools/accuracy_checker/configs/text-spotting-0003.yml @@ -0,0 +1 @@ +../../../models/intel/text-spotting-0003/accuracy-check.yml \ No newline at end of file diff --git a/tools/accuracy_checker/configs/wavernn-rnn.yml b/tools/accuracy_checker/configs/wavernn-rnn.yml new file mode 120000 index 00000000000..39425f1ff14 --- /dev/null +++ b/tools/accuracy_checker/configs/wavernn-rnn.yml @@ -0,0 +1 @@ +../../../models/public/wavernn/wavernn-rnn/accuracy-check.yml \ No newline at end of file diff --git a/tools/accuracy_checker/configs/wavernn-upsampler.yml b/tools/accuracy_checker/configs/wavernn-upsampler.yml new file mode 120000 index 00000000000..8294faf593e --- /dev/null +++ b/tools/accuracy_checker/configs/wavernn-upsampler.yml @@ -0,0 +1 @@ +../../../models/public/wavernn/wavernn-upsampler/accuracy-check.yml \ No newline at end of file diff --git a/tools/accuracy_checker/data/test_models/SampLeNet.bin b/tools/accuracy_checker/data/test_models/SampLeNet.bin index 1e39635b001..2bfc237984c 100644 Binary files a/tools/accuracy_checker/data/test_models/SampLeNet.bin and b/tools/accuracy_checker/data/test_models/SampLeNet.bin differ diff --git a/tools/accuracy_checker/data/test_models/SampLeNet.xml b/tools/accuracy_checker/data/test_models/SampLeNet.xml index 21df9716898..0ed9f56cfbe 100644 --- a/tools/accuracy_checker/data/test_models/SampLeNet.xml +++ b/tools/accuracy_checker/data/test_models/SampLeNet.xml @@ -12,7 +12,7 @@ - + @@ -228,15 +228,84 @@ - - + + + 1 + + + + + + + + 120 + 400 + + + + + + + + 120 + 400 + + + + + 2 + + + + + + + + 1 + + + + + + + + + + + + + 2 + + + 1 + + + + + + 1 + + + + + + + + 1 + + + 1 + + + + 2 - + @@ -256,16 +325,7 @@ - - - - - 120 - 400 - - - - + @@ -284,8 +344,8 @@ - - + + 1 @@ -293,7 +353,7 @@ - + 1 @@ -311,7 +371,7 @@ - + 1 @@ -325,15 +385,84 @@ - - + + + 1 + + + + + + + + 84 + 120 + + + + + + + + 84 + 120 + + + + + 2 + + + + + + + + 1 + + + + + + + + + + + + + 2 + + + 1 + + + + + + 1 + + + + + + + + 1 + + + 1 + + + + 2 - + @@ -351,16 +480,7 @@ - - - - - 84 - 120 - - - - + @@ -379,8 +499,8 @@ - - + + 1 @@ -388,7 +508,7 @@ - + 1 @@ -406,7 +526,7 @@ - + 1 @@ -420,15 +540,84 @@ - - + + + + + 1 + + + + + + + + 10 + 84 + + + + + + + + 10 + 84 + + 2 - + + + + + 1 + + + + + + + + + + + + + 2 + + + 1 + + + + + + 1 + + + + + + + + 1 + + + 1 + + + + + 2 + + + + @@ -446,16 +635,7 @@ - - - - - 10 - 84 - - - - + @@ -474,8 +654,8 @@ - - + + 1 @@ -483,7 +663,7 @@ - + 1 @@ -501,7 +681,7 @@ - + 1 @@ -523,30 +703,48 @@ - - - - - - - - - + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -565,13 +763,12 @@ - + - @@ -581,8 +778,9 @@ + - + diff --git a/tools/accuracy_checker/data/test_models/pytorch_model/__init__.py b/tools/accuracy_checker/data/test_models/pytorch_model/__init__.py index 7375355084f..fefb21dec89 100644 --- a/tools/accuracy_checker/data/test_models/pytorch_model/__init__.py +++ b/tools/accuracy_checker/data/test_models/pytorch_model/__init__.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/data/test_models/pytorch_model/samplenet.py b/tools/accuracy_checker/data/test_models/pytorch_model/samplenet.py index 970624a5360..2ae47482a2c 100644 --- a/tools/accuracy_checker/data/test_models/pytorch_model/samplenet.py +++ b/tools/accuracy_checker/data/test_models/pytorch_model/samplenet.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/data/test_models/samplenet_tf2/saved_model.pb b/tools/accuracy_checker/data/test_models/samplenet_tf2/saved_model.pb new file mode 100644 index 00000000000..aebf7880427 Binary files /dev/null and b/tools/accuracy_checker/data/test_models/samplenet_tf2/saved_model.pb differ diff --git a/tools/accuracy_checker/data/test_models/samplenet_tf2/variables/variables.data-00000-of-00001 b/tools/accuracy_checker/data/test_models/samplenet_tf2/variables/variables.data-00000-of-00001 new file mode 100644 index 00000000000..dcdb99f3c03 Binary files /dev/null and b/tools/accuracy_checker/data/test_models/samplenet_tf2/variables/variables.data-00000-of-00001 differ diff --git a/tools/accuracy_checker/data/test_models/samplenet_tf2/variables/variables.index b/tools/accuracy_checker/data/test_models/samplenet_tf2/variables/variables.index new file mode 100644 index 00000000000..8d3435e7ccb Binary files /dev/null and b/tools/accuracy_checker/data/test_models/samplenet_tf2/variables/variables.index differ diff --git a/tools/accuracy_checker/dataset_definitions.yml b/tools/accuracy_checker/dataset_definitions.yml deleted file mode 100644 index feb12adcc5e..00000000000 --- a/tools/accuracy_checker/dataset_definitions.yml +++ /dev/null @@ -1,1047 +0,0 @@ -datasets: - - name: ms_coco_mask_rcnn - annotation_conversion: - converter: mscoco_mask_rcnn - annotation_file: instances_val2017.json - has_background: True - sort_annotations: True - annotation: mscoco_mask_rcnn.pickle - dataset_meta: mscoco_mask_rcnn.json - data_source: val2017 - - - name: ms_coco_mask_rcnn_short_80_classes - annotation_conversion: - converter: mscoco_mask_rcnn - annotation_file: instances_val2017_short.json - has_background: True - sort_annotations: True - annotation: mscoco_mask_rcnn_short_80.pickle - dataset_meta: mscoco_mask_rcnn_short_80.json - data_source: val2017 - - - name: ms_coco_mask_rcnn_short_80_classes_without_background - annotation_conversion: - converter: mscoco_mask_rcnn - annotation_file: instances_val2017.json - has_background: False - sort_annotations: True - annotation: mscoco_mask_rcnn_short_80_without_bkgr.pickle - dataset_meta: mscoco_mask_rcnn_short_80_without_bkgr.json - data_source: val2017 - - - name: ms_coco_mask_rcnn_short_91_classes - annotation_conversion: - converter: mscoco_mask_rcnn - annotation_file: instances_val2017_short.json - has_background: True - sort_annotations: True - use_full_label_map: True - annotation: mscoco_mask_rcnn_short_91.pickle - dataset_meta: mscoco_mask_rcnn_short_91.json - data_source: val2017 - preprocessing: - - type: resize - aspect_ratio_scale: fit_to_window - dst_height: 800 - dst_width: 1365 - - type: padding - dst_height: 800 - dst_width: 1365 - pad_type: right_bottom - - postprocessing: - - type: faster_rcnn_postprocessing_resize - dst_height: 800 - dst_width: 1365 - - - name: ms_coco_detection_91_classes - annotation_conversion: - converter: mscoco_detection - annotation_file: instances_val2017.json - has_background: True - sort_annotations: True - use_full_label_map: True - annotation: mscoco_det_91.pickle - dataset_meta: mscoco_det_91.json - data_source: val2017 - preprocessing: - - type: resize - aspect_ratio_scale: fit_to_window - dst_height: 600 - dst_width: 1024 - - type: padding - dst_height: 600 - dst_width: 1024 - pad_type: right_bottom - - postprocessing: - - type: faster_rcnn_postprocessing_resize - dst_height: 600 - dst_width: 1024 - - - name: ms_coco_detection_80_class_without_background - data_source: val2017 - annotation_conversion: - converter: mscoco_detection - annotation_file: instances_val2017.json - has_background: False - sort_annotations: True - use_full_label_map: False - annotation: mscoco_det_80.pickle - dataset_meta: mscoco_det_80.json - - - name: ms_coco_detection_80_class_with_background - data_source: val2017 - annotation_conversion: - converter: mscoco_detection - annotation_file: instances_val2017.json - has_background: True - sort_annotations: True - use_full_label_map: False - annotation: mscoco_det_80_bkgr.pickle - dataset_meta: mscoco_det_80_bkgr.json - - - name: ms_coco_keypoints - data_source: val2017 - annotation_conversion: - converter: mscoco_keypoints - annotation_file: person_keypoints_val2017.json - sort_key: image_size - annotation: mscoco_keypoints.pickle - dataset_meta: mscoco_keypoints.json - metrics: - - name: AP - type: coco_precision - max_detections: 20 - - - name: imagenet_1000_classes - annotation_conversion: - converter: imagenet - annotation_file: val.txt - annotation: imagenet1000.pickle - data_source: ILSVRC2012_img_val - metrics: - - name: accuracy@top1 - type: accuracy - top_k: 1 - - name: accuracy@top5 - type: accuracy - top_k: 5 - - - name: imagenet_1000_classes_2015 - annotation_conversion: - converter: imagenet - annotation_file: val15.txt - annotation: imagenet1000_2015.pickle - data_source: ILSVRC2012_img_val - metrics: - - name: accuracy@top1 - type: accuracy - top_k: 1 - - name: accuracy@top5 - type: accuracy - top_k: 5 - - - name: imagenet_1001_classes - annotation_conversion: - converter: imagenet - annotation_file: val.txt - has_background: True - annotation: imagenet1001.pickle - data_source: ILSVRC2012_img_val - metrics: - - name: accuracy@top1 - type: accuracy - top_k: 1 - - name: accuracy@top5 - type: accuracy - top_k: 5 - - - name: VOC2012 - annotation_conversion: - converter: voc_detection - annotations_dir: VOCdevkit/VOC2012/Annotations - images_dir: VOCdevkit/VOC2012/JPEGImages - imageset_file: VOCdevkit/VOC2012/ImageSets/Main/val.txt - data_source: VOCdevkit/VOC2012/JPEGImages - annotation: voc12.pickle - dataset_meta: voc12.json - postprocessing: - - type: resize_prediction_boxes - metrics: - - type: map - integral: 11point - ignore_difficult: True - presenter: print_scalar - - - name: VOC2012_without_background - annotation_conversion: - converter: voc_detection - annotations_dir: VOCdevkit/VOC2012/Annotations - images_dir: VOCdevkit/VOC2012/JPEGImages - imageset_file: VOCdevkit/VOC2012/ImageSets/Main/val.txt - has_background: False - data_source: VOCdevkit/VOC2012/JPEGImages - annotation: voc12_without_background.pickle - dataset_meta: voc12_without_background.json - postprocessing: - - type: resize_prediction_boxes - metrics: - - type: map - integral: 11point - ignore_difficult: True - presenter: print_scalar - - - name: VOC2012_Segmentation - annotation_conversion: - converter: voc_segmentation - imageset_file: VOCdevkit/VOC2012/ImageSets/Segmentation/val.txt - images_dir: VOCdevkit/VOC2012/JPEGImages/ - mask_dir: VOCdevkit/VOC2012/SegmentationClass/ - data_source: VOCdevkit/VOC2012/JPEGImages/ - segmentation_masks_source: VOCdevkit/VOC2012/SegmentationClass/ - annotation: voc2012_segmentation.pickle - dataset_meta: voc2012_segmentation.json - - - name: mapillary_20 - annotation_conversion: - converter: mapillary_20 - data_dir: Mapillary_20 - annotation: mapillary_20.pickle - dataset_meta: mapillary_20.json - - - name: wider - data_source: WIDER_val/images - annotation_conversion: - converter: wider - annotation_file: wider_face_split/wider_face_val_bbx_gt.txt - annotation: wider.pickle - dataset_meta: wider.json - - - name: wider_without_bkgr - data_source: WIDER_val/images - annotation_conversion: - converter: wider - annotation_file: wider_face_split/wider_face_val_bbx_gt.txt - label_start: 0 - annotation: wider_0.pickle - dataset_meta: wider_0.json - - - name: facial_landmarks_35 - data_source: VOCdevkit/VOC2012/JPEGImages - annotation_conversion: - converter: cvat_facial_landmarks - annotation_file: 3632_OMZ_task3_facial_landmarks_35_adas.xml - annotation: facial_landmarks_35.pickle - preprocessing: - - type: resize - size: 60 - postprocessing: - - type: normalize_landmarks_points - - - name: emotions_recognition - data_source: VOCdevkit/VOC2012/JPEGImages - annotation_conversion: - converter: cvat_attributes_recognition - annotation_file: 3631_OMZ_task2_emotions_recognition.xml - label: face - annotation: emotions_recognition.pickle - dataset_meta: emotions_recognition.json - preprocessing: - - type: extend_around_rect - augmentation_param: 0.3 - - type: crop_rect - - type: resize - size: 64 - - - name: age_gender - data_source: ILSVRC2012_img_val - annotation_conversion: - converter: cvat_age_gender - annotation_file: 3630_OMZ_task1_age_gender.xml - annotation: age_gender.pickle - dataset_meta: age_gender.json - - - name: vehicle_attributes - data_source: val2017 - annotation_conversion: - converter: cvat_attributes_recognition - annotation_file: 3634_OMZ_task8_vehicle_attributes_recognition_barrier_0039.xml - label: vehicle - annotation: vehicle_attributes.pickle - dataset_meta: vehicle_attributes.json - - - name: vehicle_attributes_0042 - data_source: val2017 - annotation_conversion: - converter: cvat_attributes_recognition - annotation_file: 3634_OMZ_task8_vehicle_attributes_recognition_barrier_0039.xml - label: vehicle - annotation: vehicle_attributes.pickle - dataset_meta: vehicle_attributes.json - - - name: person_8_attributes - data_source: ILSVRC2012_img_val - annotation_conversion: - converter: cvat_multilabel_binary_attributes_recognition - annotation_file: 3640_OMZ_task6_person_attributes_recognition_crossroad_0230.xml - label: person - annotation: person_8_attributes.pickle - dataset_meta: person_8_attributes.json - - - name: vehicle_license_plate_detection - data_source: ILSVRC2012_img_val - annotation_conversion: - converter: cvat_object_detection - annotation_file: 3638_OMZ_task13_vehicle_license_plate_detection_barrier_0106.xml - has_background: True - annotation: vlpd.pickle - dataset_meta: vlpd.json - - - name: action_detection_dataset_3_classes - data_source: WIDER_val/images/44--Aerobics - annotation_conversion: - converter: cvat_person_detection_action_recognition - use_case: common_3_actions - annotation_file: 3766_OMZ_task14_person-detection-raisinghand-recognition-0001.xml - annotation: action_detection_3classes.pickle - dataset_meta: action_detection_3classes.json - - - name: action_detection_dataset_6_classes - data_source: WIDER_val/images/44--Aerobics - annotation_conversion: - converter: cvat_person_detection_action_recognition - use_case: common_6_actions - annotation_file: 3766_OMZ_task14_person-detection-raisinghand-recognition-0001.xml - annotation: action_detection_6classes.pickle - dataset_meta: action_detection_6classes.json - - - name: action_detection_dataset_teacher - data_source: WIDER_val/images/44--Aerobics - annotation_conversion: - converter: cvat_person_detection_action_recognition - use_case: teacher - annotation_file: 3766_OMZ_task14_person-detection-raisinghand-recognition-0001.xml - annotation: action_detection_teacher.pickle - dataset_meta: action_detection_teacher.json - - - name: action_detection_dataset_raising_hand - data_source: WIDER_val/images/44--Aerobics - annotation_conversion: - converter: cvat_person_detection_action_recognition - use_case: raising_hand - annotation_file: 3766_OMZ_task14_person-detection-raisinghand-recognition-0001.xml - annotation: action_detection_raising_hand.pickle - dataset_meta: action_detection_raising_hand.json - - - name: person_detection - data_source: val2017 - annotation_conversion: - converter: mscoco_detection - annotation_file: person_keypoints_val2017.json - has_background: True - sort_annotations: True - use_full_label_map: True - annotation: mscoco_person_detection.pickle - dataset_meta: mscoco_person_detection.json - - - name: mscoco_person_detection - data_source: val2017 - annotation_conversion: - converter: mscoco_detection - annotation_file: person_keypoints_val2017.json - has_background: True - sort_annotations: True - use_full_label_map: True - annotation: mscoco_person_detection.pickle - dataset_meta: mscoco_person_detection.json - - - name: crossroad_dataset_1016 - data_source: val2017 - annotation_conversion: - converter: cvat_object_detection - annotation_file: 3637_OMZ_task12_person_vehicle_bike_detection_crossroad_0078.xml - labels_file: person-vehicle-bike-detection-crossroad-1016-labels.json - has_background: True - annotation: crossroad-1016.pickle - dataset_meta: crossroad-1016.json - - - name: crossroad_dataset_0078 - data_source: val2017 - annotation_conversion: - converter: cvat_object_detection - annotation_file: 3637_OMZ_task12_person_vehicle_bike_detection_crossroad_0078.xml - labels_file: person-vehicle-bike-detection-crossroad-0078-labels.json - has_background: True - annotation: crossroad-0078.pickle - dataset_meta: crossroad-0078.json - - - name: crossroad_extra_untagged - data_source: crossroad_extra_untagged/val_data - annotation_conversion: - converter: mscoco_detection - annotation_file: crossroad_extra_untagged/val_coco_no_bg.json - has_background: False - sort_annotations: True - use_full_label_map: False - annotation: crossroad_extra_untagged.pickle - dataset_meta: crossroad_extra_untagged.json - - - name: crossroad_extra_untagged_person - data_source: crossroad_extra_untagged/val_data - annotation_conversion: - converter: mscoco_detection - annotation_file: crossroad_extra_untagged/val_coco_no_bg_person.json - has_background: False - sort_annotations: True - use_full_label_map: False - annotation: crossroad_extra_untagged_person.pickle - dataset_meta: crossroad_extra_untagged_person.json - - - name: crossroad_extra_untagged_person_hb - data_source: crossroad_extra_untagged/val_data - annotation_conversion: - converter: mscoco_detection - annotation_file: crossroad_extra_untagged/val_coco_no_bg_person.json - has_background: True - sort_annotations: True - use_full_label_map: False - annotation: crossroad_extra_untagged_person_hb.pickle - dataset_meta: crossroad_extra_untagged_person_hb.json - - - name: crossroad_extra_untagged_vehicle - data_source: crossroad_extra_untagged/val_data - annotation_conversion: - converter: mscoco_detection - annotation_file: crossroad_extra_untagged/val_coco_no_bg_vehicle.json - has_background: False - sort_annotations: True - use_full_label_map: False - annotation: crossroad_extra_untagged_vehicle.pickle - dataset_meta: crossroad_extra_untagged_vehicle.json - - - name: crossroad_extra_untagged_vehicle_labels_from_1 - data_source: crossroad_extra_untagged/val_data - annotation_conversion: - converter: mscoco_detection - annotation_file: crossroad_extra_untagged/val_coco_no_bg_vehicle.json - has_background: True - annotation: crossroad_extra_untagged_vehicle_labels_from_1.pickle - dataset_meta: crossroad_extra_untagged_vehicle_labels_from_1.json - - - name: pedestrian_and_vehicle_dataset - data_source: val2017 - annotation_conversion: - converter: cvat_object_detection - annotation_file: 3636_OMZ_task11_pedestrian_and_vehicle_detector_adas_0001.xml - labels_file: pedestrian-and-vehicle-labels.json - has_background: True - annotation: pedestrian_and_vehicle.pickle - dataset_meta: pedestrian_and_vehicle.json - - - name: pedestrian_detection_dataset - data_source: val2017 - annotation_conversion: - converter: cvat_object_detection - annotation_file: 3636_OMZ_task11_pedestrian_and_vehicle_detector_adas_0001.xml - labels_file: pedestrian-detection-labels.json - has_background: True - annotation: pedestrian_detection.pickle - dataset_meta: pedestrian_detection.json - - - name: vehicle_detection_dataset - data_source: val2017 - annotation_conversion: - converter: cvat_object_detection - annotation_file: 3636_OMZ_task11_pedestrian_and_vehicle_detector_adas_0001.xml - labels_file: vehicle-detection-labels.json - has_background: True - annotation: vehicle_detection.pickle - dataset_meta: vehicle_detection.json - - - name: barrier_vehicle_detection_dataset_index_class_2 - data_source: val2017 - annotation_conversion: - converter: cvat_object_detection - annotation_file: 3636_OMZ_task11_pedestrian_and_vehicle_detector_adas_0001.xml - labels_file: vehicle-detection-labels.json - has_background: True - annotation: vehicle_detection.pickle - dataset_meta: vehicle_detection.json - - - name: synthetic_chinese_license_plates - data_source: Synthetic_Chinese_License_Plates - annotation_conversion: - converter: lpr_txt - annotation_file: Synthetic_Chinese_License_Plates/annotation - decoding_dictionary_file: dict - annotation: lpr.pickle - dataset_meta: lpr.json - - preprocessing: - - type: resize - dst_width: 94 - dst_height: 24 - - - name: image_retrieval - data_source: textile_crops - annotation_conversion: - converter: image_retrieval - data_dir: textile_crops - gallery_annotation_file: textile_crops/gallery/gallery.txt - queries_annotation_file: textile_crops/queries/quieries.txt - annotation: textile.pickle - dataset_meta: textile.json - preprocessing: - - type: resize - size: 224 - - - name: lfw - data_source: LFW/lfw - annotation_conversion: - converter: lfw - pairs_file: LFW/annotation/pairs.txt - landmarks_file: LFW/annotation/lfw_landmark.txt - annotation: lfw.pickle - - metrics: - - type: pairwise_accuracy_subsets - subset_number: 2 - - - name: ICDAR2015 - data_source: ICDAR15_DET/ch4_test_images - annotation_conversion: - converter: icdar_detection - data_dir: ICDAR15_DET/gt - annotation: icdar15_detection.pickle - - - name: ICDAR2015_word_spotting - data_source: ICDAR15_DET/ch4_test_images - annotation_conversion: - converter: icdar_detection - word_spotting: True - data_dir: ICDAR15_DET/gt - annotation: icdar15_detection.pickle - - - name: ICDAR2013_detection - data_source: ICDAR13_DET - annotation_conversion: - converter: icdar_detection - data_dir: ICDAR13_DET/gt - annotation: icdar13_detection.pickle - - - name: ICDAR2013 - data_source: ICDAR13_REC/Challenge2_Test_Task3_Images - annotation_conversion: - converter: icdar13_recognition - annotation_file: ICDAR13_REC/gt/gt.txt.fixed.alfanumeric - annotation: icdar13_recognition.pickle - dataset_meta: icdar13_recognition.json - - - name: ICDAR2013_detection - data_source: ICDAR13_DET - annotation_conversion: - converter: icdar_detection - data_dir: ICDAR13_DET/gt - annotation: icdar13_detection.pickle - - - name: im2latex_medium_rendered - data_source: im2latex_medium_rendered/images_processed - annotation_conversion: - converter: im2latex_formula_recognition - data_dir: im2latex_medium_rendered - images_dir: im2latex_medium_rendered/images_processed - formula_file: im2latex_medium_rendered/formulas.norm.lst - split_file: im2latex_medium_rendered/validate_filter.lst - vocab_file: im2latex_medium_rendered/vocab.json - annotation: im2latex_medium_rendered.pickle - dataset_meta: im2latex_medium_rendered.json - - - name: im2latex_medium_photographed - data_source: im2latex_medium_photographed/images_processed - annotation_conversion: - converter: im2latex_formula_recognition - data_dir: im2latex_medium_photographed - images_dir: im2latex_medium_photographed/images_processed - formula_file: im2latex_medium_photographed/formulas.norm.lst - split_file: im2latex_medium_photographed/test_filter.lst - vocab_file: im2latex_medium_photographed/vocab.pkl - annotation: im2latex_medium_photographed.pickle - dataset_meta: im2latex_medium_photographed.json - - - name: im2latex_polynomials_handwritten - data_source: im2latex_polynomials_handwritten/images_processed - annotation_conversion: - converter: im2latex_formula_recognition - data_dir: im2latex_polynomials_handwritten - images_dir: im2latex_polynomials_handwritten/images_processed - formula_file: im2latex_polynomials_handwritten/formulas.norm.lst - split_file: im2latex_polynomials_handwritten/validate_filter.lst - vocab_file: im2latex_polynomials_handwritten/vocab.json - annotation: im2latex_polynomials_handwritten.pickle - dataset_meta: im2latex_polynomials_handwritten.json - - - name: market1501 - data_source: Market-1501-v15.09.15 - annotation_conversion: - converter: market1501_reid - data_dir: Market-1501-v15.09.15 - annotation: market1501_reid.pickle - - - name: veri776 - data_source: VeRi-776 - annotation_conversion: - converter: veri776_reid - data_dir: VeRi-776 - annotation: veri776_reid.pickle - - - name: reid_dataset - data_source: Market-1501-v15.09.15 - annotation_conversion: - converter: market1501_reid - data_dir: Market-1501-v15.09.15 - annotation: market1501_reid.pickle - - - name: vgg2face - data_source: VGGFaces2/test - annotation_conversion: - converter: vgg_face - landmarks_csv_file: VGGFaces2/bb_landmark/loose_landmark_test.csv - bbox_csv_file: VGGFaces2/bb_landmark/loose_bb_test.csv - annotation: vggfaces2.pickle - dataset_meta: vggfaces2.json - - - name: semantic_segmentation_adas - data_source: segmentation/images - segmentation_masks_source: segmentation/mask_segmentation_adas - annotation_conversion: - converter: common_semantic_segmentation - images_dir: segmentation/images - masks_dir: segmentation/mask_segmentation_adas - image_postfix: .JPEG - mask_postfix: .png - dataset_meta: segmentation/mask_segmentation_adas/dataset_meta.json - annotation: semantic_segmentation_adas.pickle - dataset_meta: semantic_segmentation_adas.json - - preprocessing: - - type: resize - dst_height: 1024 - dst_width: 2048 - - postprocessing: - - type: encode_segmentation_mask - apply_to: annotation - - type: resize_segmentation_mask - apply_to: annotation - dst_height: 1024 - dst_width: 2048 - - - name: road_segmentation - data_source: segmentation/images - segmentation_masks_source: segmentation/mask_road_segmentation - annotation_conversion: - converter: common_semantic_segmentation - images_dir: segmentation/images - masks_dir: segmentation/mask_road_segmentation - image_postfix: .JPEG - mask_postfix: .png - dataset_meta: segmentation/mask_road_segmentation/dataset_meta.json - annotation: road_segmentation.pickle - dataset_meta: road_segmentation.json - - preprocessing: - - type: resize - dst_height: 512 - dst_width: 896 - - postprocessing: - - type: encode_segmentation_mask - apply_to: annotation - - type: resize_segmentation_mask - apply_to: annotation - dst_height: 512 - dst_width: 896 - - metrics: - - type: mean_iou - presenter: print_vector - - type: mean_accuracy - presenter: print_vector - - - name: super_resolution_x3 - data_source: super_resolution - annotation_conversion: - converter: super_resolution - data_dir: super_resolution - lr_suffix: lr_x3 - upsample_suffix: upsample_x3 - hr_suffix: hr - two_streams: True - annotation: super_resolution_x3.pickle - - preprocessing: - - type: auto_resize - - postprocessing: - - type: resize - apply_to: prediction - - metrics: - - type: psnr - scale_border: 4 - presenter: print_vector - - - name: super_resolution_x4 - data_source: super_resolution - annotation_conversion: - converter: super_resolution - data_dir: super_resolution - lr_suffix: lr_x4 - upsample_suffix: upsample_x4 - hr_suffix: hr - two_streams: True - annotation: super_resolution_x4.pickle - - preprocessing: - - type: auto_resize - - postprocessing: - - type: resize - apply_to: prediction - - metrics: - - type: psnr - scale_border: 4 - presenter: print_vector - - - name: text_super_resolution_x3 - data_source: super_resolution - annotation_conversion: - converter: super_resolution - data_dir: super_resolution - lr_suffix: lr_x3 - hr_suffix: hr_gray - annotation: text_super_resolution_x3.pickle - - preprocessing: - - type: bgr_to_gray - - type: auto_resize - - postprocessing: - - type: resize - apply_to: prediction - - metrics: - - type: psnr - scale_border: 4 - presenter: print_vector - - - name: head_pose - data_source: WIDER_val/images/16--Award_Ceremony - annotation: head_pose.pickle - - preprocessing: - - type: crop_rect - - type: resize - size: 60 - - - name: gaze_estimation_dataset - data_source: gaze_estimation - annotation: gaze_estimation.pickle - - reader: - type: combine_reader - scheme: - ".*.png": opencv_imread - ".*.json": - type: json_reader - key: head_pose_angles - - - name: handwritten_score_recognition - data_source: ILSVRC2012_img_val - annotation: handwritten_score_recognition.pickle - dataset_meta: handwritten_score_recognition.json - - - name: cmu_panoptic_keypoints - data_source: cmu_panoptic_subset - annotation_conversion: - converter: cmu_panoptic_keypoints - data_dir: cmu_panoptic_subset - annotation: cmu_panoptic_keypoints.pickle - - - name: kinetics-400 - data_source: kinetics/frames_val - annotation_conversion: - converter: clip_action_recognition - annotation_file: kinetics/kinetics_400.json - data_dir: kinetics/frames_val - annotation: kinetics_action_recognition.pickle - dataset_meta: kinetics_action_recognition.json - - - name: kinetics-400-frames-79 - data_source: kinetics/frames_val - annotation_conversion: - converter: clip_action_recognition - annotation_file: kinetics/kinetics_400.json - data_dir: kinetics/frames_val - clip_duration: 79 - annotation: kinetics_action_recognition_79.pickle - dataset_meta: kinetics_action_recognition_79.json - - - name: kinetics-400-frames-79-400 - data_source: kinetics/frames_val - annotation_conversion: - converter: clip_action_recognition - annotation_file: kinetics/kinetics_400.json - data_dir: kinetics/frames_val - clip_duration: 79 - temporal_stride: 1 - num_samples: 400 - annotation: kinetics_action_recognition_79_400.pickle - dataset_meta: kinetics_action_recognition_79_400.json - - - name: driver_action_recognition_dataset - data_source: kinetics/frames_val - annotation_conversion: - converter: clip_action_recognition - annotation_file: kinetics/driver_action_recognition.json - data_dir: kinetics/frames_val - annotation: driver_action_recognition.pickle - dataset_meta: driver_action_recognition.json - - - name: BraTS - data_source: BraTS - reader: numpy_reader - annotation_conversion: - converter: brats_numpy - data_dir: BraTS - ids_file: BraTS/val_ids.p - labels_file: BraTS/labels - annotation: brats.pickle - dataset_meta: brats.json - - - name: BraTS_2017 - data_source: BraTS_2017 - reader: - type: nifti_reader - channels_first: True - annotation_conversion: - converter: brats - data_dir: BraTS_2017 - labels_file: BraTS_2017/labels - mask_channels_first: True - annotation: brats2017.pickle - dataset_meta: brats2017.json - - - name: product_detection - annotation: product_detection.pickle - dataset_meta: product_detection.json - data_source: product_detection - - metrics: - - type: coco_precision - - - name: ms_coco_single_keypoints - data_source: val2017 - annotation_conversion: - converter: mscoco_single_keypoints - annotation_file: person_keypoints_val2017.json - annotation: mscoco_single_keypoints.pickle - dataset_meta: mscoco_single_keypoints.json - metrics: - - name: AP - type: coco_orig_keypoints_precision - - - name: CamVid - data_source: CamVid - annotation_conversion: - converter: camvid - annotation_file: CamVid/val.txt - annotation: camvid.pickle - dataset_meta: camvid.json - - - name: msasl-100 - data_source: msasl/global_crops - annotation_conversion: - converter: continuous_clip_action_recognition - annotation_file: msasl/msasl_100.txt - data_dir: msasl/global_crops - out_fps: 15 - clip_length: 16 - annotation: msasl_action_recognition.pickle - - - name: jester - data_source: jester/global_crops - annotation_conversion: - converter: continuous_clip_action_recognition - annotation_file: jester/val.txt - data_dir: jester/global_crops - out_fps: 15 - clip_length: 8 - annotation: jester_action_recognition.pickle - - - name: ReDWeb_V1 - data_source: ReDWeb_V1 - annotation_conversion: - converter: redweb - data_dir: ReDWeb_V1 - annotation_file: ReDWeb_validation_360.txt - annotation: mono_depth.pickle - - - name: Kondate_nakayosi - data_source: Kondate/test_data - annotation_conversion: - converter: unicode_character_recognition - decoding_char_file: Kondate_nakayosi/kondate_nakayosi_char_list.txt - annotation_file: Kondate_nakayosi/test_img_id_gt.txt - annotation: kondate_nakayosi_recognition.pickle - dataset_meta: kondate_nakayosi_recognition.json - - - name: inpainting_free_form_masks - data_source: VOCdevkit/VOC2012/JPEGImages/ - annotation_conversion: - converter: inpainting - images_dir: VOCdevkit/VOC2012/JPEGImages/ - masks_dir: free_form_masks/masks_2k - annotation: inpainting_voc12_masks2k.pickle - - - name: inpainting_rect_mask - data_source: VOCdevkit/VOC2012/JPEGImages/ - annotation_conversion: - converter: inpainting - images_dir: VOCdevkit/VOC2012/JPEGImages/ - annotation: inpainting_voc12.pickle - - preprocessing: - - type: auto_resize - - type: rect_mask - postprocessing: - - type: resize - apply_to: prediction - - - - name: mrlEyes_2018_01 - annotation_conversion: - converter: mrlEyes_2018_01 - data_dir: mrlEyes_2018_01 - annotation: mrlEyes_2018_01.pickle - dataset_meta: mrlEyes_2018_01.json - data_source: mrlEyes_2018_01 - - - name: ms_coco_style_transfer - data_source: val2017 - annotation_conversion: - converter: style_transfer - images_dir: val2017 - metrics: - - type: psnr - scale_border: 0 - presenter: print_vector - - type: ssim - presenter: print_vector - annotation: style_transfer_val2017.pickle - - - name: squad_v1_1_msl384_mql64_ds128_lowercase - annotation_conversion: - converter: squad - testing_file: squad_v1.1/dev-v1.1.json - max_seq_length: 384 - max_query_length: 64 - doc_stride: 128 - lower_case: true - vocab_file: vocab.txt - - - name: squad_emb_v1_1_msl384_mql32_lowercase - annotation_conversion: - converter: squad_emb - testing_file: squad_v1.1/dev-v1.1.json - vocab_file: vocab.txt - max_seq_length: 384 - max_query_length: 32 - lower_case: true - - - name: librispeech-test-clean - data_source: librispeech/test/LibriSpeech/test-clean.wav - annotation_conversion: - converter: librispeech - data_dir: librispeech/test/LibriSpeech/test-clean.wav - annotation: librispeech-test-clean.pickle - metrics: - - name: wer - - - name: librispeech-dev-clean - data_source: librispeech/dev/LibriSpeech/dev-clean.wav - annotation_conversion: - converter: librispeech - data_dir: librispeech/dev/LibriSpeech/dev-clean.wav - annotation: librispeech-dev-clean.pickle - metrics: - - name: wer - - - name: WMT_en_ru - annotation_conversion: - converter: wmt - input_file: wmt19-ru-en.en.spbpe - reference_file: wmt19-ru-en.ru.spbpe - - reader: - type: annotation_features_extractor - features: - - source - - preprocessing: - - type: decode_by_sentence_piece_bpe_tokenizer - vocabulary_file: tokenizer_src/vocab.json - merges_file: tokenizer_src/merges.txt - - - type: pad_with_eos - eos_index: 1 - sequence_len: 192 - - - name: WMT_ru_en - annotation_conversion: - converter: wmt - input_file: wmt19-ru-en.ru.spbpe - reference_file: wmt19-ru-en.en.spbpe - - reader: - type: annotation_features_extractor - features: - - source - - preprocessing: - - type: decode_by_sentence_piece_bpe_tokenizer - vocabulary_file: tokenizer_src/vocab.json - merges_file: tokenizer_src/merges.txt - - - type: pad_with_eos - eos_index: 1 - sequence_len: 192 - - - name: NYU_Depth_V2 - data_source: nyudepthv2/val/converted/images - additional_data_source: nyudepthv2/val/converted/depth - annotation_conversion: - converter: nyu_depth_v2 - images_dir: nyudepthv2/val/converted/images - depth_map_dir: nyudepthv2/val/converted/depth - data_dir: nyudepthv2/val/official - - - name: SCUT_EPT - data_source: SCUT_EPT/test - annotation_conversion: - converter: unicode_character_recognition - decoding_char_file: SCUT_EPT/scut_ept_char_list.txt - annotation_file: SCUT_EPT/test_img_id_gt.txt - annotation: scut_ept_recognition.pickle - dataset_meta: scut_ept_recognition.json - - - name: ADEChallengeData2016 - annotation_conversion: - converter: ade20k - images_dir: ADEChallengeData2016/images/validation - annotations_dir: ADEChallengeData2016/annotations/validation - object_categories_file: ADEChallengeData2016/objectInfo150.txt - data_source: ADEChallengeData2016/images/validation - segmentation_masks_source: ADEChallengeData2016/annotations/validation diff --git a/tools/accuracy_checker/dataset_definitions.yml b/tools/accuracy_checker/dataset_definitions.yml new file mode 120000 index 00000000000..2005f5b4c92 --- /dev/null +++ b/tools/accuracy_checker/dataset_definitions.yml @@ -0,0 +1 @@ +../../data/dataset_definitions.yml \ No newline at end of file diff --git a/tools/accuracy_checker/pylint_checkers.py b/tools/accuracy_checker/pylint_checkers.py index bae64250d62..a4c41841f1c 100644 --- a/tools/accuracy_checker/pylint_checkers.py +++ b/tools/accuracy_checker/pylint_checkers.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/requirements-core.in b/tools/accuracy_checker/requirements-core.in index aef43060ac8..3d296a2a77e 100644 --- a/tools/accuracy_checker/requirements-core.in +++ b/tools/accuracy_checker/requirements-core.in @@ -1,4 +1,4 @@ # core components -numpy>=1.11,<1.18 +numpy>=1.16.3 PyYAML -pillow>=2.6.1 +pillow>=8.1 diff --git a/tools/accuracy_checker/requirements.in b/tools/accuracy_checker/requirements.in index 0d0b96468a1..c2fa8f36773 100644 --- a/tools/accuracy_checker/requirements.in +++ b/tools/accuracy_checker/requirements.in @@ -28,9 +28,9 @@ nltk # editdistance calculation editdistance -# speech recognition with language modeling -pypi-kenlm - # DNA sequence matching -parasail +parasail<=1.2 fast-ctc-decode + +# raw image formats processing +rawpy diff --git a/tools/accuracy_checker/setup.py b/tools/accuracy_checker/setup.py index eb5730db72e..e05a5bbc083 100644 --- a/tools/accuracy_checker/setup.py +++ b/tools/accuracy_checker/setup.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ """ import importlib +import os import re import sys import warnings @@ -26,6 +27,8 @@ from distutils.version import LooseVersion from pathlib import Path +here = Path(__file__).parent + class PyTest(test_command): user_options = [('pytest-args=', 'a', "Arguments to pass to pytest")] @@ -44,10 +47,11 @@ def run_tests(self): def read(*path): - version_file = Path(__file__).parent.joinpath(*path) - with version_file.open() as file: + input_file = os.path.join(here, *path) + with open(str(input_file)) as file: return file.read() + def check_and_update_numpy(min_acceptable='1.15'): try: import numpy as np @@ -57,9 +61,10 @@ def check_and_update_numpy(min_acceptable='1.15'): if update_required: subprocess.call(['pip3', 'install', 'numpy>={}'.format(min_acceptable)]) + def install_dependencies_with_pip(dependencies): for dep in dependencies: - subprocess.call(['pip3', 'install', str(dep)]) + subprocess.call(['pip3', 'install', str(dep)]) class CoreInstall(install_command): @@ -78,6 +83,7 @@ def find_version(*path): long_description = read("README.md") version = find_version("accuracy_checker", "__init__.py") + def prepare_requirements(): requirements_core = read('requirements-core.in').split('\n') if 'install_core' in sys.argv: @@ -85,6 +91,7 @@ def prepare_requirements(): requirements = read("requirements.in").split('\n') return requirements_core + requirements + requirements = prepare_requirements() try: diff --git a/tools/accuracy_checker/tests/__init__.py b/tools/accuracy_checker/tests/__init__.py index 7375355084f..fefb21dec89 100644 --- a/tools/accuracy_checker/tests/__init__.py +++ b/tools/accuracy_checker/tests/__init__.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/tests/common.py b/tools/accuracy_checker/tests/common.py index 0096f680746..0ce812b5e19 100644 --- a/tools/accuracy_checker/tests/common.py +++ b/tools/accuracy_checker/tests/common.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/tests/conftest.py b/tools/accuracy_checker/tests/conftest.py index 3cf909cf847..f515379e984 100644 --- a/tools/accuracy_checker/tests/conftest.py +++ b/tools/accuracy_checker/tests/conftest.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/tests/test_adapters.py b/tools/accuracy_checker/tests/test_adapters.py index a5fcd52f8e7..27ee8ee4d6f 100644 --- a/tools/accuracy_checker/tests/test_adapters.py +++ b/tools/accuracy_checker/tests/test_adapters.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/tests/test_caffe_launcher.py b/tools/accuracy_checker/tests/test_caffe_launcher.py index 14589cba034..127d3da594c 100644 --- a/tools/accuracy_checker/tests/test_caffe_launcher.py +++ b/tools/accuracy_checker/tests/test_caffe_launcher.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/tests/test_config_reader.py b/tools/accuracy_checker/tests/test_config_reader.py index 8ce860a6d61..f7eebb422ac 100644 --- a/tools/accuracy_checker/tests/test_config_reader.py +++ b/tools/accuracy_checker/tests/test_config_reader.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/tests/test_config_validator.py b/tools/accuracy_checker/tests/test_config_validator.py index 5dc33239e08..bb24b456f77 100644 --- a/tools/accuracy_checker/tests/test_config_validator.py +++ b/tools/accuracy_checker/tests/test_config_validator.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -28,6 +28,7 @@ PathField, StringField ) +from accuracy_checker.evaluators import ModelEvaluator from tests.common import mock_filesystem @@ -350,8 +351,9 @@ class SampleValidator(ConfigValidator): stub = mocker.stub(name='custom_on_error') sample_validator = SampleValidator('Sample', on_error=stub) - sample_validator.validate({}) - stub.assert_called_once_with(ANY, 'Sample', ANY) + with pytest.raises(ConfigError): + sample_validator.validate({}) + stub.assert_called_once_with(ANY, 'Sample', ANY) def test_custom_validator(self, mocker): class SampleValidator(ConfigValidator): @@ -383,3 +385,367 @@ class DerivedValidator(ParentValidator): derived_validator = DerivedValidator('Derived', on_extra_argument=ConfigValidator.ERROR_ON_EXTRA_ARGUMENT) derived_validator.validate({'foo': 'foo', 'bar': 'bar'}) + + +class TestConfigValidationAPI: + def test_empty_config(self): + config_errors = ModelEvaluator.validate_config({'models': [{}]}) + assert len(config_errors) == 2 + assert config_errors[0].message == 'launchers section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'models.launchers' + assert config_errors[1].message == 'datasets section is not provided' + assert not config_errors[1].entry + assert config_errors[1].field_uri == 'models.datasets' + + def test_empty_launchers_and_datasets_config(self): + config_errors = ModelEvaluator.validate_config({'models': [{'launchers': [], 'datasets': []}]}) + assert len(config_errors) == 2 + assert config_errors[0].message == 'launchers section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'models.launchers' + assert config_errors[1].message == 'datasets section is not provided' + assert not config_errors[1].entry + assert config_errors[1].field_uri == 'models.datasets' + + def test_launcher_config_without_framework(self): + launcher_config = {'model': 'foo'} + config_errors = ModelEvaluator.validate_config({'models': [{'launchers': [launcher_config], 'datasets': []}]}) + assert len(config_errors) == 2 + assert config_errors[0].message == 'framework is not provided' + assert config_errors[0].entry == launcher_config + assert config_errors[0].field_uri == 'models.launchers.0' + assert config_errors[1].message == 'datasets section is not provided' + assert not config_errors[1].entry + assert config_errors[1].field_uri == 'models.datasets' + + def test_unregistered_launcher_config(self): + launcher_config = {'framework': 'foo'} + config_errors = ModelEvaluator.validate_config({'models': [{'launchers': [launcher_config], 'datasets': []}]}) + assert len(config_errors) == 2 + assert config_errors[0].message == 'launcher foo is not unregistered' + assert config_errors[0].entry == launcher_config + assert config_errors[0].field_uri == 'models.launchers.0' + assert config_errors[1].message == 'datasets section is not provided' + assert not config_errors[1].entry + assert config_errors[1].field_uri == 'models.datasets' + + @pytest.mark.usefixtures('mock_file_exists') + def test_valid_launcher_config(self): + launcher_config = {'model': 'foo', 'framework': 'dlsdk', 'device': 'cpu'} + config_errors = ModelEvaluator.validate_config({'models': [{'launchers': [launcher_config], 'datasets': []}]}) + assert len(config_errors) == 1 + assert config_errors[0].message == 'datasets section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'models.datasets' + + @pytest.mark.usefixtures('mock_file_exists') + def test_adapter_str_config(self): + launcher_config = {'model': 'foo', 'framework': 'dlsdk', 'device': 'cpu', 'adapter': 'classification'} + config_errors = ModelEvaluator.validate_config({'models': [{'launchers': [launcher_config], 'datasets': []}]}) + assert len(config_errors) == 1 + assert config_errors[0].message == 'datasets section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'models.datasets' + + @pytest.mark.usefixtures('mock_file_exists') + def test_adapter_dict_config(self): + launcher_config = {'model': 'foo', 'framework': 'dlsdk', 'device': 'cpu', 'adapter': {'type': 'classification'}} + config_errors = ModelEvaluator.validate_config({'models': [{'launchers': [launcher_config], 'datasets': []}]}) + assert len(config_errors) == 1 + assert config_errors[0].message == 'datasets section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'models.datasets' + + @pytest.mark.usefixtures('mock_file_exists') + def test_unregistered_adapter_config(self): + launcher_config = {'model': 'foo', 'framework': 'dlsdk', 'device': 'cpu', 'adapter': 'not_classification'} + config_errors = ModelEvaluator.validate_config({'models': [{'launchers': [launcher_config], 'datasets': []}]}) + assert len(config_errors) == 2 + assert config_errors[0].message.startswith('Invalid value "not_classification"') + assert config_errors[0].entry == 'not_classification' + assert config_errors[0].field_uri.startswith('models.launchers.0') and config_errors[0].field_uri.endswith('adapter') + assert config_errors[1].message == 'datasets section is not provided' + assert not config_errors[1].entry + assert config_errors[1].field_uri == 'models.datasets' + + @pytest.mark.usefixtures('mock_path_exists') + def test_dataset_config_without_metrics(self): + dataset_config = {'name': 'dataset', 'data_source': 'data', 'annotation': 'annotation'} + config_errors = ModelEvaluator.validate_config({'models': [{'datasets': [dataset_config]}]}) + assert len(config_errors) == 2 + assert config_errors[0].message == 'launchers section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'models.launchers' + assert config_errors[1].message == 'Metrics are not provided' + assert not config_errors[1].entry + assert config_errors[1].field_uri == 'models.datasets.0.metrics' + + @pytest.mark.usefixtures('mock_path_exists') + def test_data_reader_without_data_source(self): + dataset_config = {'name': 'dataset', 'annotation': 'annotation', 'metrics': [{'type': 'accuracy'}]} + config_errors = ModelEvaluator.validate_config({'models': [{'datasets': [dataset_config]}]}) + assert len(config_errors) == 2 + assert config_errors[0].message == 'launchers section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'models.launchers' + assert config_errors[1].message == 'Invalid value "None" for models.datasets.0.reader.data_source: models.datasets.0.reader.data_source is not allowed to be None' + assert not config_errors[1].entry + assert config_errors[1].field_uri == 'models.datasets.0.reader.data_source' + + @pytest.mark.usefixtures('mock_path_exists') + def test_unregistered_data_reader(self): + dataset_config = { + 'name': 'dataset', 'annotation': 'annotation', 'metrics': [{'type': 'accuracy'}], 'reader': 'unknown' + } + config_errors = ModelEvaluator.validate_config({'models': [{'datasets': [dataset_config]}]}) + assert len(config_errors) == 2 + assert config_errors[0].message == 'launchers section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'models.launchers' + assert config_errors[1].message.startswith('Invalid value "unknown" for models.datasets.0.reader') + assert config_errors[-1].entry == 'unknown' + assert config_errors[-1].field_uri == 'models.datasets.0.reader' + + @pytest.mark.usefixtures('mock_path_exists') + def test_str_data_reader(self): + dataset_config = { + 'name': 'dataset', 'annotation': 'annotation', 'metrics': [{'type': 'accuracy'}], + 'reader': 'opencv_imread', 'data_source': 'data' + } + config_errors = ModelEvaluator.validate_config({'datasets': [dataset_config]}) + assert len(config_errors) == 1 + assert config_errors[0].message == 'launchers section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'launchers' + + @pytest.mark.usefixtures('mock_path_exists') + def test_dict_data_reader(self): + dataset_config = { + 'name': 'dataset', 'annotation': 'annotation', 'metrics': [{'type': 'accuracy'}], + 'reader': {'type': 'opencv_imread'}, 'data_source': 'data' + } + config_errors = ModelEvaluator.validate_config({'datasets': [dataset_config]}) + assert len(config_errors) == 1 + assert config_errors[0].message == 'launchers section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'launchers' + + def test_data_source_does_not_exists(self): + dataset_config = {'name': 'dataset', 'metrics': [{'type': 'accuracy'}], 'data_source': 'data_dir'} + config_errors = ModelEvaluator.validate_config({'datasets': [dataset_config]}) + assert len(config_errors) == 3 + assert config_errors[0].message == 'launchers section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'launchers' + assert config_errors[-1].message == 'Invalid value "data_dir" for datasets.0.reader.data_source: path does not exist' + assert config_errors[-1].entry == 'data_dir' + assert config_errors[-1].field_uri == 'datasets.0.reader.data_source' + + @pytest.mark.usefixtures('mock_file_exists') + def test_data_source_is_file(self): + dataset_config = { + 'name': 'dataset', 'metrics': [{'type': 'accuracy'}], 'annotation': 'annotation', 'data_source': 'data' + } + config_errors = ModelEvaluator.validate_config({'datasets': [dataset_config]}) + assert len(config_errors) == 2 + assert config_errors[0].message == 'launchers section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'launchers' + assert config_errors[1].message == 'Invalid value "data" for datasets.0.reader.data_source: path is not a directory' + assert config_errors[1].entry == 'data' + assert config_errors[1].field_uri == 'datasets.0.reader.data_source' + + @pytest.mark.usefixtures('mock_path_exists') + def test_annotation_is_not_provided(self): + dataset_config = { + 'name': 'dataset', 'metrics': [{'type': 'accuracy'}], 'data_source': 'data' + } + config_errors = ModelEvaluator.validate_config({'datasets': [dataset_config]}) + assert len(config_errors) == 2 + assert config_errors[0].message == 'launchers section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'launchers' + assert config_errors[1].message == 'annotation_conversion or annotation field should be provided' + assert config_errors[1].entry == dataset_config + assert config_errors[1].field_uri == 'datasets.0' + + @pytest.mark.usefixtures('mock_path_exists') + def test_annotation_conversion_without_converter(self): + dataset_config = { + 'name': 'dataset', 'metrics': [{'type': 'accuracy'}], 'data_source': 'data', + 'annotation_conversion': {} + } + config_errors = ModelEvaluator.validate_config({'datasets': [dataset_config]}) + assert len(config_errors) == 2 + assert config_errors[0].message == 'launchers section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'launchers' + assert config_errors[1].message == 'converter is not found' + assert config_errors[1].entry == {} + assert config_errors[1].field_uri == 'datasets.0.annotation_conversion' + + @pytest.mark.usefixtures('mock_path_exists') + def test_annotation_conversion_missed_parameter(self): + conversion_parameters = {'converter': 'imagenet'} + dataset_config = { + 'name': 'dataset', 'metrics': [{'type': 'accuracy'}], 'data_source': 'data', + 'annotation_conversion': conversion_parameters + } + config_errors = ModelEvaluator.validate_config({'datasets': [dataset_config]}) + assert len(config_errors) == 2 + assert config_errors[0].message == 'launchers section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'launchers' + assert config_errors[1].message == 'Invalid config for annotation_conversion.imagenet: missing required fields: annotation_file' + assert config_errors[1].entry == conversion_parameters + assert config_errors[1].field_uri == 'annotation_conversion.imagenet' + + @pytest.mark.usefixtures('mock_path_exists') + def test_annotation_conversion_extra_parameter(self): + conversion_parameters = {'converter': 'imagenet', 'annotation_file': 'file', 'something_extra': 'extra'} + dataset_config = { + 'name': 'dataset', 'metrics': [{'type': 'accuracy'}], 'data_source': 'data', + 'annotation_conversion': conversion_parameters + } + config_errors = ModelEvaluator.validate_config({'datasets': [dataset_config]}) + assert len(config_errors) == 2 + assert config_errors[0].message == 'launchers section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'launchers' + assert config_errors[1].message == "annotation_conversion.imagenet specifies unknown options: ['something_extra']" + assert config_errors[1].entry == conversion_parameters + assert config_errors[1].field_uri == 'annotation_conversion.imagenet' + + @pytest.mark.usefixtures('mock_path_exists') + def test_annotation_conversion_config(self): + conversion_parameters = {'converter': 'imagenet', 'annotation_file': 'file'} + dataset_config = { + 'name': 'dataset', 'metrics': [{'type': 'accuracy'}], 'data_source': 'data', + 'annotation_conversion': conversion_parameters + } + config_errors = ModelEvaluator.validate_config({'datasets': [dataset_config]}) + assert len(config_errors) == 1 + assert config_errors[0].message == 'launchers section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'launchers' + + @pytest.mark.usefixtures('mock_path_exists') + def test_preprocessing_config(self): + dataset_config = { + 'name': 'dataset', 'metrics': [{'type': 'accuracy'}], 'data_source': 'data', + 'annotation': 'annotation', 'preprocessing': [{'type': 'auto_resize'}] + } + config_errors = ModelEvaluator.validate_config({'datasets': [dataset_config]}) + assert len(config_errors) == 1 + assert config_errors[0].message == 'launchers section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'launchers' + + @pytest.mark.usefixtures('mock_path_exists') + def test_preprocessing_config_unknown_type(self): + preprocessing_config = [{'type': 'bgr_to_rgb'}, {'type': 'unknown', 'size': 224}] + dataset_config = { + 'name': 'dataset', 'metrics': [{'type': 'accuracy'}], 'data_source': 'data', + 'annotation': 'annotation', 'preprocessing': preprocessing_config + } + config_errors = ModelEvaluator.validate_config({'datasets': [dataset_config]}) + assert len(config_errors) == 2 + assert config_errors[0].message == 'launchers section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'launchers' + assert config_errors[1].message == 'preprocessor unknown unregistered' + assert config_errors[1].entry == preprocessing_config[1] + assert config_errors[1].field_uri == 'datasets.0.preprocessing.1' + + @pytest.mark.usefixtures('mock_path_exists') + def test_preprocessing_config_extra_parameter(self): + preprocessing_config = [{'type': 'bgr_to_rgb'}, {'type': 'resize', 'size': 224, 'something_extra': True}] + dataset_config = { + 'name': 'dataset', 'metrics': [{'type': 'accuracy'}], 'data_source': 'data', + 'annotation': 'annotation', 'preprocessing': preprocessing_config + } + config_errors = ModelEvaluator.validate_config({'datasets': [dataset_config]}) + assert len(config_errors) == 2 + assert config_errors[0].message == 'launchers section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'launchers' + assert config_errors[1].message == "datasets.0.preprocessing.1 specifies unknown options: ['something_extra']" + assert config_errors[1].entry == preprocessing_config[1] + assert config_errors[1].field_uri == 'datasets.0.preprocessing.1' + + @pytest.mark.usefixtures('mock_path_exists') + def test_preprocessing_config_unknown_parameter(self): + preprocessing_config = [{'type': 'bgr_to_rgb'}, {'type': 'not_resize', 'size': 224}] + dataset_config = { + 'name': 'dataset', 'metrics': [{'type': 'accuracy'}], 'data_source': 'data', + 'annotation': 'annotation', 'preprocessing': preprocessing_config + } + config_errors = ModelEvaluator.validate_config({'datasets': [dataset_config]}) + assert len(config_errors) == 2 + assert config_errors[0].message == 'launchers section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'launchers' + assert config_errors[1].message == "preprocessor not_resize unregistered" + assert config_errors[1].entry == preprocessing_config[1] + assert config_errors[1].field_uri == 'datasets.0.preprocessing.1' + + @pytest.mark.usefixtures('mock_path_exists') + def test_postprocessing_config(self): + dataset_config = { + 'name': 'dataset', 'metrics': [{'type': 'accuracy'}], 'data_source': 'data', + 'annotation': 'annotation', 'postprocessing': [{'type': 'resize_prediction_boxes'}] + } + config_errors = ModelEvaluator.validate_config({'datasets': [dataset_config]}) + assert len(config_errors) == 1 + assert config_errors[0].message == 'launchers section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'launchers' + + @pytest.mark.usefixtures('mock_path_exists') + def test_postprocessing_config_unknown_type(self): + postprocessing_config = [{'type': 'unknown', 'size': 224}] + dataset_config = { + 'name': 'dataset', 'metrics': [{'type': 'accuracy'}], 'data_source': 'data', + 'annotation': 'annotation', 'postprocessing': postprocessing_config + } + config_errors = ModelEvaluator.validate_config({'datasets': [dataset_config]}) + assert len(config_errors) == 2 + assert config_errors[0].message == 'launchers section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'launchers' + assert config_errors[1].message == 'postprocessor unknown unregistered' + assert config_errors[1].entry == postprocessing_config[0] + assert config_errors[1].field_uri == 'datasets.0.postprocessing.0' + + @pytest.mark.usefixtures('mock_path_exists') + def test_postprocessing_config_extra_parameter(self): + postprocessing_config = [{'type': 'resize_prediction_boxes', 'something_extra': True}] + dataset_config = { + 'name': 'dataset', 'metrics': [{'type': 'accuracy'}], 'data_source': 'data', + 'annotation': 'annotation', 'postprocessing': postprocessing_config + } + config_errors = ModelEvaluator.validate_config({'datasets': [dataset_config]}) + assert len(config_errors) == 2 + assert config_errors[0].message == 'launchers section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'launchers' + assert config_errors[1].message == "datasets.0.postprocessing.0 specifies unknown options: ['something_extra']" + assert config_errors[1].entry == postprocessing_config[0] + assert config_errors[1].field_uri == 'datasets.0.postprocessing.0' + + @pytest.mark.usefixtures('mock_path_exists') + def test_postprocessing_config_unknown_parameter(self): + postprocessing_config = [{'type': 'bgr_to_rgb'}] + dataset_config = { + 'name': 'dataset', 'metrics': [{'type': 'accuracy'}], 'data_source': 'data', + 'annotation': 'annotation', 'postprocessing': postprocessing_config + } + config_errors = ModelEvaluator.validate_config({'datasets': [dataset_config]}) + assert len(config_errors) == 2 + assert config_errors[0].message == 'launchers section is not provided' + assert not config_errors[0].entry + assert config_errors[0].field_uri == 'launchers' + assert config_errors[1].message == "postprocessor bgr_to_rgb unregistered" + assert config_errors[1].entry == postprocessing_config[0] + assert config_errors[1].field_uri == 'datasets.0.postprocessing.0' diff --git a/tools/accuracy_checker/tests/test_dataset.py b/tools/accuracy_checker/tests/test_dataset.py index a45834ee26b..eb34fce1e21 100644 --- a/tools/accuracy_checker/tests/test_dataset.py +++ b/tools/accuracy_checker/tests/test_dataset.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -122,7 +122,7 @@ def test_annotation_conversion_with_store_annotation(self, mocker): converted_annotation = make_representation('0 0 0 5 5', True) mocker.patch( 'accuracy_checker.annotation_converters.WiderFormatConverter.convert', - return_value=ConverterReturn(converted_annotation,None, None) + return_value=ConverterReturn(converted_annotation, None, None) ) mocker.patch('pathlib.Path.exists', return_value=False) annotation_saver_mock = mocker.patch( @@ -130,7 +130,7 @@ def test_annotation_conversion_with_store_annotation(self, mocker): ) Dataset(config) - annotation_saver_mock.assert_called_once_with(converted_annotation, None, Path('custom'), None) + annotation_saver_mock.assert_called_once_with(converted_annotation, None, Path('custom'), None, config) def test_annotation_conversion_subset_size(self, mocker): addition_options = { @@ -326,7 +326,7 @@ def test_annotation_conversion_save_subset(self, mocker): ) mocker.patch('pathlib.Path.exists', return_value=False) Dataset(config) - annotation_saver_mock.assert_called_once_with([converted_annotation[1]], None, Path('custom'), None) + annotation_saver_mock.assert_called_once_with([converted_annotation[1]], None, Path('custom'), None, config) def test_annotation_conversion_subset_with_disabled_shuffle(self, mocker): addition_options = { diff --git a/tools/accuracy_checker/tests/test_dependency.py b/tools/accuracy_checker/tests/test_dependency.py index 74af4fe8ea5..f4b6f18a56e 100644 --- a/tools/accuracy_checker/tests/test_dependency.py +++ b/tools/accuracy_checker/tests/test_dependency.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/tests/test_detection_metrics.py b/tools/accuracy_checker/tests/test_detection_metrics.py index 544c421062b..778678181de 100644 --- a/tools/accuracy_checker/tests/test_detection_metrics.py +++ b/tools/accuracy_checker/tests/test_detection_metrics.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/tests/test_dlsdk_launcher.py b/tools/accuracy_checker/tests/test_dlsdk_launcher.py index 3ebf08c8d8e..23fc0fa9b26 100644 --- a/tools/accuracy_checker/tests/test_dlsdk_launcher.py +++ b/tools/accuracy_checker/tests/test_dlsdk_launcher.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -33,16 +33,28 @@ from tests.common import update_dict from accuracy_checker.data_readers import DataRepresentation from accuracy_checker.utils import contains_all +try: + import ngraph as ng +except ImportError: + ng = None def no_available_myriad(): try: from openvino.inference_engine import IECore return 'MYRIAD' not in IECore().available_devices - except: + except Exception: return True +def has_layers(): + try: + from openvino.inference_engine import IENetwork + return hasattr(IENetwork, 'layers') + except Exception: + return False + + @pytest.fixture() def mock_inference_engine(mocker): mocker.patch('openvino.inference_engine.IECore') @@ -169,12 +181,15 @@ def test_dlsdk_onnx_import(self, data_dir, models_dir): dlsdk_test_model.predict([{'data': input_blob.astype(np.float32)}], [image.metadata]) assert dlsdk_test_model.output_blob == 'fc3' - - +@pytest.mark.skipif(ng is None and not has_layers(), reason='no functionality to set affinity') class TestDLSDKLauncherAffinity: @pytest.mark.usefixtures('mock_affinity_map_exists') def test_dlsdk_launcher_valid_affinity_map(self, mocker, models_dir): affinity_map = {'conv1': 'GPU'} + if not has_layers(): + affinity_map.update({ + 'conv1/Dims294/copy_const': 'GPU' + }) mocker.patch( 'accuracy_checker.launcher.dlsdk_launcher.read_yaml', return_value=affinity_map @@ -183,9 +198,17 @@ def test_dlsdk_launcher_valid_affinity_map(self, mocker, models_dir): dlsdk_test_model = get_dlsdk_test_model(models_dir, { 'device': 'HETERO:CPU,GPU', 'affinity_map': './affinity_map.yml' }) - layers = dlsdk_test_model.network.layers - for key, value in affinity_map.items(): - assert layers[key].affinity == value + if has_layers(): + layers = dlsdk_test_model.network.layers + for key, value in affinity_map.items(): + assert layers[key].affinity == value + else: + ng_function = ng.function_from_cnn(dlsdk_test_model.network) + for node in ng_function.get_ordered_ops(): + if node.get_friendly_name() != 'conv1': + continue + assert node.get_friendly_name() in affinity_map + assert node.get_rt_info()['affinity'] == affinity_map[node.get_friendly_name()] @pytest.mark.usefixtures('mock_file_exists') def test_dlsdk_launcher_affinity_map_invalid_device(self, mocker, models_dir): @@ -196,18 +219,18 @@ def test_dlsdk_launcher_affinity_map_invalid_device(self, mocker, models_dir): ) with pytest.raises(ConfigError): - get_dlsdk_test_model(models_dir, {'device' : 'HETERO:CPU,CPU', 'affinity_map' : './affinity_map.yml'}) + get_dlsdk_test_model(models_dir, {'device': 'HETERO:CPU,CPU', 'affinity_map': './affinity_map.yml'}) @pytest.mark.usefixtures('mock_file_exists') def test_dlsdk_launcher_affinity_map_invalid_layer(self, mocker, models_dir): - affinity_map = {'none-existing-layer' : 'CPU'} + affinity_map = {'none-existing-layer': 'CPU'} mocker.patch( 'accuracy_checker.launcher.dlsdk_launcher.read_yaml', return_value=affinity_map ) with pytest.raises(ConfigError): - get_dlsdk_test_model(models_dir, {'device' : 'HETERO:CPU,CPU', 'affinity_map' : './affinity_map.yml'}) + get_dlsdk_test_model(models_dir, {'device': 'HETERO:CPU,CPU', 'affinity_map': './affinity_map.yml'}) @pytest.mark.usefixtures('mock_path_exists', 'mock_inference_engine', 'mock_inputs') diff --git a/tools/accuracy_checker/tests/test_dummy_launcher.py b/tools/accuracy_checker/tests/test_dummy_launcher.py new file mode 100644 index 00000000000..2d3004eb59f --- /dev/null +++ b/tools/accuracy_checker/tests/test_dummy_launcher.py @@ -0,0 +1,83 @@ +""" +Copyright (c) 2018-2021 Intel Corporation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +import pytest +import numpy as np +from accuracy_checker.launcher import DummyLauncher +from accuracy_checker.launcher.loaders import StoredPredictionBatch +from accuracy_checker.adapters import ClassificationAdapter +from accuracy_checker.representation import ClassificationPrediction + + +@pytest.mark.usefixtures('mock_file_exists') +class TestDummyLauncher: + def test_empty_predictions_loading(self, mocker): + launcher_config = { + 'framework': 'dummy', + 'loader': 'pickle', + 'data_path': '/path' + } + mocker.patch('accuracy_checker.launcher.loaders.pickle_loader.PickleLoader.read_pickle', return_value=[]) + launcher = DummyLauncher(launcher_config) + assert not launcher._loader.data + + def test_access_to_non_existing_index(self, mocker): + launcher_config = { + 'framework': 'dummy', + 'loader': 'pickle', + 'data_path': '/path' + } + mocker.patch('accuracy_checker.launcher.loaders.pickle_loader.PickleLoader.read_pickle', return_value=[]) + launcher = DummyLauncher(launcher_config) + assert not launcher._loader.data + with pytest.raises(IndexError): + launcher.predict([1]) + + def test_predictions_loading_without_adapter(self, mocker): + launcher_config = { + 'framework': 'dummy', + 'loader': 'pickle', + 'data_path': '/path' + } + raw_prediction_batch = StoredPredictionBatch({'prediction': np.array([[0, 1]])}, [1], [{}]) + mocker.patch( + 'accuracy_checker.launcher.loaders.pickle_loader.PickleLoader.read_pickle', + return_value=[raw_prediction_batch]) + launcher = DummyLauncher(launcher_config) + assert len(launcher._loader.data) == 1 + assert launcher.predict([1]) == [raw_prediction_batch] + + def test_predictions_loading_with_adapter(self, mocker): + launcher_config = { + 'framework': 'dummy', + 'loader': 'pickle', + 'data_path': '/path' + } + raw_prediction_batch = StoredPredictionBatch( + {'prediction': np.array([[0, 1]])}, [1], [{}] + ) + expected_prediction = ClassificationPrediction(1, np.array([0, 1])) + adapter = ClassificationAdapter({'type': 'classification'}) + mocker.patch( + 'accuracy_checker.launcher.loaders.pickle_loader.PickleLoader.read_pickle', + return_value=[raw_prediction_batch]) + launcher = DummyLauncher(launcher_config, adapter=adapter) + assert len(launcher._loader.data) == 1 + prediction = launcher.predict([1]) + assert len(prediction) == 1 + assert isinstance(prediction[0], ClassificationPrediction) + assert prediction[0].identifier == expected_prediction.identifier + assert np.array_equal(prediction[0].scores, expected_prediction.scores) diff --git a/tools/accuracy_checker/tests/test_input_feeder.py b/tools/accuracy_checker/tests/test_input_feeder.py index df7b9327c91..0b213359c7d 100644 --- a/tools/accuracy_checker/tests/test_input_feeder.py +++ b/tools/accuracy_checker/tests/test_input_feeder.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -258,7 +258,7 @@ def test_fill_non_constant_inputs_with_specific_mapping_batch_1(self): {'input1': InputInfo_test(shape=(1, 3, 10, 10)), 'input2': InputInfo_test(shape=(1, 3, 10, 10))} ) result = input_feeder.fill_non_constant_inputs( - [DataRepresentation([np.zeros((10, 10, 3)), np.ones((10, 10, 3))],identifier=['0', '1'])] + [DataRepresentation([np.zeros((10, 10, 3)), np.ones((10, 10, 3))], identifier=['0', '1'])] )[0] expected_data = [np.zeros((1, 3, 10, 10)), np.ones((1, 3, 10, 10))] assert 'input1' in result @@ -363,7 +363,7 @@ def test_set_invalid_input_precision_for_constant_input_raise_config_error(self) def test_set_input_precision_for_non_constant_input(self): input_feeder = InputFeeder( [{'name': 'input_u8', 'type': 'INPUT', 'precision': 'U8'}], - {'input_u8': (1, 3,10, 10)}) + {'input_u8': (1, 3, 10, 10)}) result = input_feeder.fill_non_constant_inputs([ DataRepresentation( np.zeros((10, 10, 3)), @@ -382,7 +382,7 @@ def test_set_invalid_input_precision_for_non_constant_input_raise_config_error(s def test_set_input_precision_for_image_info_input(self): input_feeder = InputFeeder( [{'name': 'im_info', 'type': 'IMAGE_INFO', 'precision': 'U8'}], - {'input': (1, 3,10, 10), 'im_info': (1, 3)}) + {'input': (1, 3, 10, 10), 'im_info': (1, 3)}) result = input_feeder.fill_non_constant_inputs([ DataRepresentation( np.zeros((10, 10, 3)), diff --git a/tools/accuracy_checker/tests/test_metric_evaluator.py b/tools/accuracy_checker/tests/test_metric_evaluator.py index 0c357b52e58..51a005bab82 100644 --- a/tools/accuracy_checker/tests/test_metric_evaluator.py +++ b/tools/accuracy_checker/tests/test_metric_evaluator.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -52,7 +52,7 @@ def test_undefined_metric_type_raises_config_error_exception(self): def test_accuracy_arguments(self): dispatcher = MetricsExecutor([{'type': 'accuracy', 'top_k': 1}], None) assert len(dispatcher.metrics) == 1 - _, _, accuracy_metric, _, _, _ = dispatcher.metrics[0] + _, _, accuracy_metric, _, _, _ = dispatcher.metrics[0] assert isinstance(accuracy_metric, ClassificationAccuracy) assert accuracy_metric.top_k == 1 diff --git a/tools/accuracy_checker/tests/test_model_conversion.py b/tools/accuracy_checker/tests/test_model_conversion.py index 3b1cbfd7388..0451b3dc00a 100644 --- a/tools/accuracy_checker/tests/test_model_conversion.py +++ b/tools/accuracy_checker/tests/test_model_conversion.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/tests/test_model_evaluator.py b/tools/accuracy_checker/tests/test_model_evaluator.py index 7860a840334..eb4690f4047 100644 --- a/tools/accuracy_checker/tests/test_model_evaluator.py +++ b/tools/accuracy_checker/tests/test_model_evaluator.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -102,6 +102,19 @@ def test_process_dataset_with_storing_predictions_and_without_dataset_processors assert not self.postprocessor.process_dataset.called assert not self.postprocessor.full_process.called + def test_process_dataset_store_only(self): + self.postprocessor.has_dataset_processors = False + + self.evaluator.process_dataset('path', None, store_only=True) + + assert self.evaluator.store_predictions.called + assert not self.evaluator.load.called + assert self.launcher.predict.called + assert not self.postprocessor.process_batch.called + assert not self.metric.update_metrics_on_batch.called + assert not self.postprocessor.process_dataset.called + assert not self.postprocessor.full_process.called + def test_process_dataset_with_loading_predictions_and_without_dataset_processors(self, mocker): mocker.patch('accuracy_checker.evaluators.model_evaluator.get_path') self.postprocessor.has_dataset_processors = False @@ -208,7 +221,6 @@ def test_process_dataset_with_storing_predictions_and_without_dataset_processors self.evaluator.process_dataset('path', None) - assert self.evaluator.store_predictions.called assert not self.evaluator.load.called assert not self.launcher.predict.called assert self.launcher.get_async_requests.called diff --git a/tools/accuracy_checker/tests/test_mxnet_launcher.py b/tools/accuracy_checker/tests/test_mxnet_launcher.py index 83a66094f26..fbd3663d825 100644 --- a/tools/accuracy_checker/tests/test_mxnet_launcher.py +++ b/tools/accuracy_checker/tests/test_mxnet_launcher.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/tests/test_onnx_launcher.py b/tools/accuracy_checker/tests/test_onnx_launcher.py index 157f519e374..1684303263d 100644 --- a/tools/accuracy_checker/tests/test_onnx_launcher.py +++ b/tools/accuracy_checker/tests/test_onnx_launcher.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/tests/test_opencv_launcher.py b/tools/accuracy_checker/tests/test_opencv_launcher.py index 97b13584911..c7ca6e13163 100644 --- a/tools/accuracy_checker/tests/test_opencv_launcher.py +++ b/tools/accuracy_checker/tests/test_opencv_launcher.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/tests/test_parameters.py b/tools/accuracy_checker/tests/test_parameters.py deleted file mode 100644 index ec532bd45ac..00000000000 --- a/tools/accuracy_checker/tests/test_parameters.py +++ /dev/null @@ -1,133 +0,0 @@ -""" -Copyright (c) 2018-2020 Intel Corporation - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -import pytest -import json -from accuracy_checker.serialize_parameters import fetch - -def validate(json_dict): - try: - json.dumps(json_dict) - return True - except json.decoder.JSONDecodeError: - return False - -def check_topology_types(json_dict, topology_types): - assert 'topology_type' in json_dict.keys() - for topology_type in topology_types: - assert topology_type in json_dict['topology_type'] - -def check_adapters(json_dict, adapters): - assert 'datasets' in json_dict.keys() - assert 'adapter' in json_dict['datasets'].keys() - for adapter in adapters: - assert adapter in json_dict['datasets']['adapter'].keys() - -def check_converters(json_dict, converters): - assert 'datasets' in json_dict.keys() - assert 'converter' in json_dict['datasets'].keys() - for converter in converters: - assert converter in json_dict['datasets']['converter'].keys() - -def check_launchers(json_dict, launchers): - assert 'models' in json_dict.keys() - assert 'launcher' in json_dict['models'].keys() - for launcher in launchers: - assert launcher in json_dict['models']['launcher'].keys() - -class TestParameters: - def test_all_parameters(self): - json_dict = fetch() - assert validate(json_dict) == True - assert 'datasets' in json_dict.keys() - dataset_content = json_dict['datasets'].keys() - assert 'adapter' in dataset_content - assert 'converter' in dataset_content - assert 'metric' in dataset_content - assert 'preprocessor' in dataset_content - assert 'postprocessor' in dataset_content - assert 'models' in json_dict.keys() - models_content = json_dict['models'].keys() - assert 'launcher' in models_content - assert 'topology_type' in json_dict.keys() - - def test_image_classification(self): - json_dict = fetch(topology_types=['image_classification']) - assert validate(json_dict) == True - check_topology_types(json_dict, ['image_classification']) - check_adapters(json_dict, ['classification' ]) - check_converters(json_dict, [ 'imagenet' ]) - - def test_object_detection(self): - json_dict = fetch(topology_types=[ 'object_detection' ]) - assert validate(json_dict) == True - check_topology_types(json_dict, [ 'object_detection' ]) - check_adapters(json_dict, [ 'ssd', 'tiny_yolo_v1', 'yolo_v2', 'yolo_v3' ]) - check_converters(json_dict, [ 'voc_detection' ]) - - def test_yolo(self): - json_dict = fetch(topology_types=[ 'yolo' ]) - assert validate(json_dict) == True - check_topology_types(json_dict, [ 'yolo' ]) - check_adapters(json_dict, [ 'tiny_yolo_v1', 'yolo_v2', 'yolo_v3' ]) - check_converters(json_dict, [ 'voc_detection' ]) - - def test_yolo_v1_tiny(self): - json_dict = fetch(topology_types=[ 'yolo_v1_tiny' ]) - assert validate(json_dict) == True - check_topology_types(json_dict, [ 'yolo_v1_tiny' ]) - check_adapters(json_dict, [ 'tiny_yolo_v1' ]) - check_converters(json_dict, [ 'voc_detection' ]) - - def test_yolo_v2(self): - json_dict = fetch(topology_types=[ 'yolo_v2' ]) - assert validate(json_dict) == True - check_topology_types(json_dict, [ 'yolo_v2' ]) - check_adapters(json_dict, [ 'yolo_v2' ]) - check_converters(json_dict, [ 'voc_detection' ]) - - def test_yolo_v2_tiny(self): - json_dict = fetch(topology_types=[ 'yolo_v2_tiny' ]) - assert validate(json_dict) == True - check_topology_types(json_dict, [ 'yolo_v2_tiny' ]) - check_adapters(json_dict, [ 'yolo_v2' ]) - check_converters(json_dict, [ 'voc_detection' ]) - - def test_yolo_v3(self): - json_dict = fetch(topology_types=[ 'yolo_v3' ]) - assert validate(json_dict) == True - check_topology_types(json_dict, [ 'yolo_v3' ]) - check_adapters(json_dict, [ 'yolo_v3' ]) - check_converters(json_dict, [ 'voc_detection' ]) - - def test_yolo_v3_tiny(self): - json_dict = fetch(topology_types=[ 'yolo_v3_tiny' ]) - assert validate(json_dict) == True - check_topology_types(json_dict, [ 'yolo_v3_tiny' ]) - check_adapters(json_dict, [ 'yolo_v3' ]) - check_converters(json_dict, [ 'voc_detection' ]) - - def test_faster_rcnn(self): - json_dict = fetch(topology_types=[ 'faster_rcnn' ]) - assert validate(json_dict) == True - check_topology_types(json_dict, [ 'faster_rcnn' ]) - check_adapters(json_dict, [ 'ssd' ]) - check_converters(json_dict, [ 'voc_detection' ]) - - def test_launchers(self): - json_dict = fetch(launchers=[ 'dlsdk', 'opencv' ]) - assert validate(json_dict) == True - check_launchers(json_dict, ['dlsdk', 'opencv']) diff --git a/tools/accuracy_checker/tests/test_postprocessor.py b/tools/accuracy_checker/tests/test_postprocessor.py index ac58beb02e8..eaec085b1f9 100644 --- a/tools/accuracy_checker/tests/test_postprocessor.py +++ b/tools/accuracy_checker/tests/test_postprocessor.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -99,7 +99,7 @@ def test_filter_container_annotations_by_labels_with_ignore_using_source(self): 'type': 'filter', 'annotation_source': 'annotation', 'labels': [1], 'remove_filtered': False }] annotation = ContainerAnnotation({ - 'annotation': make_representation('0 0 0 10 10; 1 0 0 11 11', is_ground_truth=True)[0] + 'annotation': make_representation('0 0 0 10 10; 1 0 0 11 11', is_ground_truth=True)[0] }) expected = ContainerAnnotation({ 'annotation': make_representation( @@ -377,7 +377,7 @@ def test_filter_predictions_by_labels_with_remove_on_container(self): prediction = ContainerPrediction({ 'detection_out': make_representation('0 0 0 10 10; 1 0 0 11 11', score=1)[0] }) - expected = ContainerPrediction({'detection_out': make_representation('1 0 0 11 11', score=1)[0]}) + expected = ContainerPrediction({'detection_out': make_representation('1 0 0 11 11', score=1)[0]}) postprocess_data(PostprocessingExecutor(config), [None], [prediction]) @@ -955,7 +955,7 @@ def test_cast_to_int_to_unknown_raise_config_error(self): postprocess_data(PostprocessingExecutor(config), [None], [None]) def test_extend_segmentation_mask_with_float_filling_raise_config_error(self): - config = [{'type': 'extend_segmentation_mask', 'filling_label': 0.5}] + config = [{'type': 'extend_segmentation_mask', 'filling_label': 0.5}] with pytest.raises(ConfigError): postprocess_data(PostprocessingExecutor(config), [None], [None]) diff --git a/tools/accuracy_checker/tests/test_preprocessor.py b/tools/accuracy_checker/tests/test_preprocessor.py index 4e1658912c5..f87e53dd974 100644 --- a/tools/accuracy_checker/tests/test_preprocessor.py +++ b/tools/accuracy_checker/tests/test_preprocessor.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -140,9 +140,9 @@ def test_resize_save_aspect_ratio_frcnn_keep_aspect_ratio(self): 'original_height': 480, 'preferable_width': 133, 'preferable_height': 150 - } - ) - ], + } + ) + ], 'image_info': [100, 133, 1], 'image_size': (480, 640, 3), 'original_height': 480, @@ -151,7 +151,7 @@ def test_resize_save_aspect_ratio_frcnn_keep_aspect_ratio(self): 'preferable_width': 133, 'scale_x': 0.2078125, 'scale_y': 0.20833333333333334 - } + } def test_resize_to_negative_size_raise_config_error(self): with pytest.raises(ConfigError): @@ -195,7 +195,7 @@ def test_default_auto_resize(self, mocker): input_rep = DataRepresentation(input_data) expected_meta = { 'preferable_width': 200, - 'preferable_height':200, + 'preferable_height': 200, 'image_info': [200, 200, 1], 'scale_x': 2.0, 'scale_y': 2.0, @@ -719,7 +719,7 @@ def test_normalization_raise_config_error_on_extra_args(self): def test_bgr_to_rgb_raise_config_error_on_extra_args(self): with pytest.raises(ConfigError): - Preprocessor.provide('bgr_to_rgb', {'type': 'bgr_to_rgb', 'something_extra': 'extra'}) + Preprocessor.provide('bgr_to_rgb', {'type': 'bgr_to_rgb', 'something_extra': 'extra'}) def test_flip_raise_config_error_on_extra_args(self): with pytest.raises(ConfigError): @@ -877,7 +877,7 @@ def test_mean_values_only(self): assert preprocessor.steps[0].name == 'mean_variant' assert preprocessor.steps[0].value.name == 'MEAN_VALUE' assert preprocessor.mean_values == (255, ) - assert preprocessor.std_values == None + assert preprocessor.std_values is None def test_std_values_only(self): config = [{'type': 'normalization', 'std': 255}] @@ -887,7 +887,7 @@ def test_std_values_only(self): assert preprocessor.steps[0].name == 'mean_variant' assert preprocessor.steps[0].value.name == 'MEAN_VALUE' assert preprocessor.std_values == (255, ) - assert preprocessor.mean_values == None + assert preprocessor.mean_values is None def test_mean_and_std_values(self): config = [{'type': 'normalization', 'mean': 255, 'std': 255}] diff --git a/tools/accuracy_checker/tests/test_presenter.py b/tools/accuracy_checker/tests/test_presenter.py index 4f406685255..d5efb85b50a 100644 --- a/tools/accuracy_checker/tests/test_presenter.py +++ b/tools/accuracy_checker/tests/test_presenter.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -347,7 +347,7 @@ def test_vector_presenter_with_vector_data_with_default_postfix_and_scale(self, ), call( result.evaluated_value[1], result.name, - postfix='%', scale=100, value_name=result.meta['names'][1], result_format='{:.2f}' + postfix='%', scale=100, value_name=result.meta['names'][1], result_format='{:.2f}' ), call( np.mean(np.multiply(result.evaluated_value, 100)), result.name, result.threshold, @@ -403,7 +403,7 @@ def test_vector_presenter_with_vector_data_with_default_formatting_compare_with_ ), call( result.evaluated_value[1], result.name, - postfix='%', scale=100, value_name=result.meta['names'][1], result_format='{:.2f}' + postfix='%', scale=100, value_name=result.meta['names'][1], result_format='{:.2f}' ), call( np.mean(np.multiply(result.evaluated_value, 100)), result.name, result.threshold, @@ -434,7 +434,7 @@ def test_vector_presenter_with_vector_data_has_default_format_with_ignore_format postfix=' ', scale=1, value_name=result.meta['names'][1], result_format='{}' ), call( - np.mean(np.multiply(result.evaluated_value, 1)), result.name, result.threshold, 1, + np.mean(np.multiply(result.evaluated_value, 1)), result.name, result.threshold, 1, value_name='mean', postfix=' ', scale=1, result_format='{}' ) ] @@ -490,7 +490,7 @@ def test_vector_presenter_with_vector_data_with_scalar_postfix(self, mocker): ), call( np.mean(np.multiply(result.evaluated_value, 100)), result.name, - result.threshold, None, value_name='mean', postfix=result.meta['postfix'], scale=1, result_format='{:.2f}' + result.threshold, None, value_name='mean', postfix=result.meta['postfix'], scale=1, result_format='{:.2f}' ) ] mock_write_scalar_res.assert_has_calls(calls) diff --git a/tools/accuracy_checker/tests/test_pytorch_launcher.py b/tools/accuracy_checker/tests/test_pytorch_launcher.py index b918addc32c..d011d416bec 100644 --- a/tools/accuracy_checker/tests/test_pytorch_launcher.py +++ b/tools/accuracy_checker/tests/test_pytorch_launcher.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/tests/test_regression_metrics.py b/tools/accuracy_checker/tests/test_regression_metrics.py index 023a86660a4..f9c7c34142d 100644 --- a/tools/accuracy_checker/tests/test_regression_metrics.py +++ b/tools/accuracy_checker/tests/test_regression_metrics.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -224,7 +224,7 @@ def test_mae_on_interval_default_not_ignore_out_of_range(self): ] config = [{'type': 'mae_on_interval', 'end': 1, 'ignore_values_not_in_interval': False}] expected = EvaluationResult( - pytest.approx([2.0, 0.0, 0.5, 0.0, 0.0, 0.0]), + pytest.approx([2.0, 0.0, 0.5, 0.0, 0.0, 0.0]), None, 'mae_on_interval', 'mae_on_interval', @@ -328,7 +328,7 @@ def test_mae_on_interval_with_unsorted_values(self): RegressionPrediction('identifier', 3), RegressionPrediction('identifier', 1) ] - config = [{'type': 'mae_on_interval', 'intervals': [2.0, 0.0, 4.0]}] + config = [{'type': 'mae_on_interval', 'intervals': [2.0, 0.0, 4.0]}] expected = EvaluationResult( pytest.approx([0.0, 0.0, 1.0, 0.0]), None, diff --git a/tools/accuracy_checker/tests/test_reid_metrics.py b/tools/accuracy_checker/tests/test_reid_metrics.py index 33cfaeec11d..915fd137bf4 100644 --- a/tools/accuracy_checker/tests/test_reid_metrics.py +++ b/tools/accuracy_checker/tests/test_reid_metrics.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/tests/test_segmentation_metrics.py b/tools/accuracy_checker/tests/test_segmentation_metrics.py index b19a45f22e8..bcfd0095503 100644 --- a/tools/accuracy_checker/tests/test_segmentation_metrics.py +++ b/tools/accuracy_checker/tests/test_segmentation_metrics.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/accuracy_checker/tests/test_segmentation_representation.py b/tools/accuracy_checker/tests/test_segmentation_representation.py index 91170347bf6..d3e782a0381 100644 --- a/tools/accuracy_checker/tests/test_segmentation_representation.py +++ b/tools/accuracy_checker/tests/test_segmentation_representation.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -26,11 +26,7 @@ maskUtils = UnsupportedPackage("pycocotools", import_error.msg) def no_available_pycocotools(): - try: - import pycocotools.mask as maskUtils - return False - except: - return True + return isinstance(maskUtils, UnsupportedPackage) def encode_mask(mask): raw_mask = [] diff --git a/tools/accuracy_checker/tests/test_tf_launcher.py b/tools/accuracy_checker/tests/test_tf_launcher.py index c1c1013186e..d299f0e356a 100644 --- a/tools/accuracy_checker/tests/test_tf_launcher.py +++ b/tools/accuracy_checker/tests/test_tf_launcher.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,6 +24,13 @@ from accuracy_checker.config import ConfigError +def no_tf2(): + try: + import tensorflow + return tensorflow.__version__ < '2.0.0' + except ImportError: + return True + def get_tf_test_model(models_dir, config_update=None): config = { "framework": "tf", @@ -37,6 +44,19 @@ def get_tf_test_model(models_dir, config_update=None): return create_launcher(config) +def get_tf2_test_model(models_dir, config_update=None): + config = { + "framework": "tf2", + "saved_model_dir": str(models_dir / "samplenet_tf2"), + "adapter": 'classification', + "device": "cpu" + } + if config_update: + config.update(config_update) + + return create_launcher(config) + + class TestTFLauncher: def test_launcher_creates(self, models_dir): tf_test_model = get_tf_test_model(models_dir) @@ -56,6 +76,26 @@ def test_infer(self, data_dir, models_dir): assert np.argmax(res[0][tf_test_model.output_blob]) == 7 +@pytest.mark.skipif(no_tf2(), reason='tensorflow version lower than required') +class TestTF2Launcher: + def test_launcher_creates(self, models_dir): + tf_test_model = get_tf2_test_model(models_dir) + assert tf_test_model.inputs['conv2d_9_input']['shape'] == (None, 32, 32, 3) + assert tf_test_model.output_blob == 'dense_12' + tf_test_model.release() + + def test_infer(self, data_dir, models_dir): + tf_test_model = get_tf2_test_model(models_dir) + _, h, w, _ = tf_test_model.inputs['conv2d_9_input']['shape'] + img_raw = cv2.imread(str(data_dir / '1.jpg')) + img_rgb = cv2.cvtColor(img_raw, cv2.COLOR_BGR2RGB) + img_resized = cv2.resize(img_rgb, (w, h)).astype(np.float32) / 255 + input_blob = tf_test_model.fit_to_input([img_resized], 'conv2d_9_input', [0, 1, 2, 3], np.float32) + res = tf_test_model.predict([{'conv2d_9_input': input_blob}], [{}]) + + assert np.argmax(res[0][tf_test_model.output_blob]) == 2 + + class TestTFLauncherConfig: def test_missed_model_in_tf_launcher_config_raises_config_error_exception(self): launcher = {'framework': 'tf', 'adapter': 'classification'} @@ -73,3 +113,19 @@ def test_unknown_device_in_tf_launcher_config_raises_config_error_exception(self def test_unknown_output_name_in_create_tf_launcher_raises_config_error_exception(self, models_dir): with pytest.raises(ConfigError): get_tf_test_model(models_dir, {'output_names': ['name']}) + + +@pytest.mark.skipif(no_tf2(), reason='tensorflow version lower than required') +class TestTF2LauncherConfig: + def test_missed_saved_model_dir_in_tf2_launcher_config_raises_config_error_exception(self): + launcher = {'framework': 'tf2', 'adapter': 'classification'} + + with pytest.raises(ConfigError): + create_launcher(launcher) + + @pytest.mark.usefixtures('mock_path_exists') + def test_unknown_device_in_tf2_launcher_config_raises_config_error_exception(self): + launcher = {'framework': 'tf2', 'adapter': 'classification', 'saved_model_dir': 'custom', 'device': 'unknown'} + + with pytest.raises(ConfigError): + create_launcher(launcher) diff --git a/tools/accuracy_checker/tests/test_utils.py b/tools/accuracy_checker/tests/test_utils.py index 5d8e2bcdf9b..1624699d2f0 100644 --- a/tools/accuracy_checker/tests/test_utils.py +++ b/tools/accuracy_checker/tests/test_utils.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2018-2020 Intel Corporation +Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/downloader/README.md b/tools/downloader/README.md index f66f698af03..9f5a533b7cf 100644 --- a/tools/downloader/README.md +++ b/tools/downloader/README.md @@ -33,16 +33,25 @@ For the model converter, you will also need to install the OpenVINO™ toolkit and the prerequisite libraries for Model Optimizer. See the [OpenVINO toolkit documentation](https://docs.openvinotoolkit.org/) for details. -If you using models from PyTorch or Caffe2 framework, you will also need to use intermediate -conversion to ONNX format. To use automatic conversion install additional dependencies. +To convert models from certain frameworks, you will also need to install +additional dependencies. + +For models from Caffe2: + +```sh +python3 -mpip install --user -r ./requirements-caffe2.in +``` For models from PyTorch: + ```sh python3 -mpip install --user -r ./requirements-pytorch.in ``` -For models from Caffe2: + +For models from TensorFlow: + ```sh -python3 -mpip install --user -r ./requirements-caffe2.in +python3 -mpip install --user -r ./requirements-tensorflow.in ``` ## Model downloader usage @@ -417,6 +426,7 @@ describing a single model. Each such object has the following keys: * `action_recognition` * `classification` + * `colorization` * `detection` * `face_recognition` * `feature_extraction` @@ -424,6 +434,7 @@ describing a single model. Each such object has the following keys: * `human_pose_estimation` * `image_inpainting` * `image_processing` + * `image_translation` * `instance_segmentation` * `machine_translation` * `monocular_depth_estimation` @@ -435,6 +446,7 @@ describing a single model. Each such object has the following keys: * `speech_recognition` * `style_transfer` * `token_recognition` + * `text_to_speech` Additional possible values might be added in the future. diff --git a/tools/downloader/common.py b/tools/downloader/common.py index e335526c0a4..d712602a243 100644 --- a/tools/downloader/common.py +++ b/tools/downloader/common.py @@ -61,6 +61,7 @@ 'human_pose_estimation', 'image_inpainting', 'image_processing', + 'image_translation', 'instance_segmentation', 'machine_translation', 'monocular_depth_estimation', @@ -72,6 +73,7 @@ 'speech_recognition', 'style_transfer', 'token_recognition', + 'text_to_speech', } KNOWN_QUANTIZED_PRECISIONS = {p + '-INT8': p for p in ['FP16', 'FP32']} @@ -156,7 +158,7 @@ def start(work_item): try: return [job.complete() for job in jobs] - except: + except BaseException: for job in jobs: job.cancel() raise @@ -345,7 +347,7 @@ def deserialize(cls, source): def start_download(self, session, chunk_size, offset): range_headers = self.http_range_headers(offset) URL = 'https://docs.google.com/uc?export=download' - response = session.get(URL, params={'id' : self.id}, headers=range_headers, + response = session.get(URL, params={'id': self.id}, headers=range_headers, stream=True, timeout=DOWNLOAD_TIMEOUT) response.raise_for_status() @@ -446,7 +448,7 @@ def apply(self, reporter, output_dir): reporter.print_section_heading('Unpacking {}', postproc_file) - shutil.unpack_archive(str(postproc_file), str(output_dir), self.format) + shutil.unpack_archive(str(postproc_file), str(postproc_file.parent), self.format) postproc_file.unlink() # Remove the archive Postproc.types['unpack_archive'] = PostprocUnpackArchive diff --git a/tools/downloader/converter.py b/tools/downloader/converter.py index 8b629269d88..265fa66d502 100755 --- a/tools/downloader/converter.py +++ b/tools/downloader/converter.py @@ -16,7 +16,6 @@ import argparse import os -import re import string import sys diff --git a/tools/downloader/downloader.py b/tools/downloader/downloader.py index 9c807b4872d..bce9cad0b65 100755 --- a/tools/downloader/downloader.py +++ b/tools/downloader/downloader.py @@ -17,13 +17,11 @@ """ import argparse -import concurrent.futures import contextlib import functools import hashlib import re import requests -import shlex import shutil import ssl import sys @@ -125,6 +123,7 @@ def verify_hash(reporter, actual_hash, expected_hash, path): class NullCache: def has(self, hash): return False + def get(self, model_file, path, reporter): return False def put(self, hash, path): pass class DirCache: @@ -147,8 +146,26 @@ def _hash_path(self, hash): def has(self, hash): return self._hash_path(hash).exists() - def get(self, hash, path): - shutil.copyfile(str(self._hash_path(hash)), str(path)) + def get(self, model_file, path, reporter): + cache_path = self._hash_path(model_file.sha256) + cache_sha256 = hashlib.sha256() + cache_size = 0 + + with open(cache_path, 'rb') as cache_file, open(path, 'wb') as destination_file: + while True: + data = cache_file.read(CHUNK_SIZE) + if not data: + break + cache_size += len(data) + if cache_size > model_file.size: + reporter.log_error("Cached file is longer than expected ({} B), copying aborted", model_file.size) + return False + cache_sha256.update(data) + destination_file.write(data) + if cache_size < model_file.size: + reporter.log_error("Cached file is shorter ({} B) than expected ({} B)", cache_size, model_file.size) + return False + return verify_hash(reporter, cache_sha256.digest(), model_file.sha256, path) def put(self, hash, path): # A file in the cache must have the hash implied by its name. So when we upload a file, @@ -163,14 +180,16 @@ def put(self, hash, path): hash_path.parent.mkdir(parents=True, exist_ok=True) staging_path.replace(self._hash_path(hash)) -def try_retrieve_from_cache(reporter, cache, files): +def try_retrieve_from_cache(reporter, cache, model_file, destination): try: - if all(cache.has(file[0]) for file in files): - for hash, destination in files: - reporter.job_context.check_interrupted() + if cache.has(model_file.sha256): + reporter.job_context.check_interrupted() - reporter.print_section_heading('Retrieving {} from the cache', destination) - cache.get(hash, destination) + reporter.print_section_heading('Retrieving {} from the cache', destination) + if not cache.get(model_file, destination, reporter): + reporter.print('Will retry from the original source.') + reporter.print() + return False reporter.print() return True except Exception: @@ -188,7 +207,7 @@ def try_update_cache(reporter, cache, hash, source): def try_retrieve(reporter, destination, model_file, cache, num_attempts, start_download): destination.parent.mkdir(parents=True, exist_ok=True) - if try_retrieve_from_cache(reporter, cache, [[model_file.sha256, destination]]): + if try_retrieve_from_cache(reporter, cache, model_file, destination): return True reporter.print_section_heading('Downloading {}', destination) @@ -295,7 +314,7 @@ def main(): help='download only models whose names match at least one of the specified patterns') parser.add_argument('--list', type=Path, metavar='FILE.LST', help='download only models whose names match at least one of the patterns in the specified file') - parser.add_argument('--all', action='store_true', help='download all available models') + parser.add_argument('--all', action='store_true', help='download all available models') parser.add_argument('--print_all', action='store_true', help='print all available models') parser.add_argument('--precisions', metavar='PREC[,PREC...]', help='download only models with the specified precisions (actual for DLDT networks)') diff --git a/tools/downloader/pytorch_to_onnx.py b/tools/downloader/pytorch_to_onnx.py index 079fcd13ea6..a2d00eea569 100644 --- a/tools/downloader/pytorch_to_onnx.py +++ b/tools/downloader/pytorch_to_onnx.py @@ -100,6 +100,7 @@ def load_model(model_name, weights, model_paths, module_name, model_params): return model +@torch.no_grad() def convert_to_onnx(model, input_shapes, output_file, input_names, output_names): """Convert PyTorch model to ONNX and check the resulting onnx model""" diff --git a/tools/downloader/quantizer.py b/tools/downloader/quantizer.py index 67f2a57cc4d..2d8de5b2bde 100755 --- a/tools/downloader/quantizer.py +++ b/tools/downloader/quantizer.py @@ -17,9 +17,6 @@ import argparse import json import os -import re -import string -import subprocess import sys import tempfile diff --git a/tools/downloader/requirements-pytorch.in b/tools/downloader/requirements-pytorch.in index 2131c0ce87f..365c9b674af 100644 --- a/tools/downloader/requirements-pytorch.in +++ b/tools/downloader/requirements-pytorch.in @@ -1,4 +1,12 @@ onnx scipy # via torchvision -torch>=1.4 -torchvision +# In PyTorch 1.7.0, torch.squeeze emits an If operation into the ONNX graph, +# which breaks the conversion of the midasnet model to IR. This change was made +# in . +# Later on, another change was made in , +# which might undo the effects of the first change. It's not yet been included in any +# release at the time of writing, so whether it helps, remains to be seen. +# For now, just cap the PyTorch version at 1.6.x. +torch>=1.5,<1.7 +torchvision<0.8 +yacs diff --git a/tools/downloader/requirements-tensorflow.in b/tools/downloader/requirements-tensorflow.in new file mode 100644 index 00000000000..0fd73b3f36d --- /dev/null +++ b/tools/downloader/requirements-tensorflow.in @@ -0,0 +1,4 @@ +tensorflow>=2.3 + +# workaround for https://github.com/tensorflow/tensorflow/issues/44467 +h5py<3 diff --git a/tools/downloader/tests/representative-models-quantization.lst b/tools/downloader/tests/representative-models-quantization.lst new file mode 100644 index 00000000000..05d5721cf5c --- /dev/null +++ b/tools/downloader/tests/representative-models-quantization.lst @@ -0,0 +1,3 @@ +# A list of models for testing quantization features. + +mobilenet-v1-0.25-128