2021-04-14 13:24:32 +03:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
# -*- coding: utf-8 -*-
|
2023-01-16 11:02:17 +04:00
|
|
|
# Copyright (C) 2018-2023 Intel Corporation
|
2021-03-26 17:54:28 +03:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2021-04-14 13:24:32 +03:00
|
|
|
import logging as log
|
2019-08-09 19:02:42 +03:00
|
|
|
import sys
|
|
|
|
|
|
2023-08-29 14:48:54 +02:00
|
|
|
import openvino as ov
|
2019-08-09 19:02:42 +03:00
|
|
|
|
|
|
|
|
|
2022-02-02 11:28:41 +03:00
|
|
|
def param_to_string(parameters) -> str:
|
2022-03-30 20:26:36 +03:00
|
|
|
"""Convert a list / tuple of parameters returned from IE to a string."""
|
2022-02-02 11:28:41 +03:00
|
|
|
if isinstance(parameters, (list, tuple)):
|
|
|
|
|
return ', '.join([str(x) for x in parameters])
|
2019-08-09 19:02:42 +03:00
|
|
|
else:
|
2022-02-02 11:28:41 +03:00
|
|
|
return str(parameters)
|
2019-08-09 19:02:42 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
2021-04-14 13:24:32 +03:00
|
|
|
log.basicConfig(format='[ %(levelname)s ] %(message)s', level=log.INFO, stream=sys.stdout)
|
|
|
|
|
|
2021-12-09 23:01:45 +03:00
|
|
|
# --------------------------- Step 1. Initialize OpenVINO Runtime Core --------------------------------------------
|
2023-08-29 14:48:54 +02:00
|
|
|
core = ov.Core()
|
2021-04-14 13:24:32 +03:00
|
|
|
|
2021-12-09 23:01:45 +03:00
|
|
|
# --------------------------- Step 2. Get metrics of available devices --------------------------------------------
|
2021-04-14 13:24:32 +03:00
|
|
|
log.info('Available devices:')
|
2021-12-09 23:01:45 +03:00
|
|
|
for device in core.available_devices:
|
2021-04-14 13:24:32 +03:00
|
|
|
log.info(f'{device} :')
|
2022-02-09 09:18:54 +03:00
|
|
|
log.info('\tSUPPORTED_PROPERTIES:')
|
|
|
|
|
for property_key in core.get_property(device, 'SUPPORTED_PROPERTIES'):
|
|
|
|
|
if property_key not in ('SUPPORTED_METRICS', 'SUPPORTED_CONFIG_KEYS', 'SUPPORTED_PROPERTIES'):
|
2021-04-14 13:24:32 +03:00
|
|
|
try:
|
2022-02-02 11:28:41 +03:00
|
|
|
property_val = core.get_property(device, property_key)
|
2021-04-14 13:24:32 +03:00
|
|
|
except TypeError:
|
2022-02-02 11:28:41 +03:00
|
|
|
property_val = 'UNSUPPORTED TYPE'
|
|
|
|
|
log.info(f'\t\t{property_key}: {param_to_string(property_val)}')
|
2021-04-14 13:24:32 +03:00
|
|
|
log.info('')
|
|
|
|
|
|
2021-12-09 23:01:45 +03:00
|
|
|
# -----------------------------------------------------------------------------------------------------------------
|
2021-04-14 13:24:32 +03:00
|
|
|
return 0
|
2021-04-08 20:07:25 +03:00
|
|
|
|
2019-08-09 19:02:42 +03:00
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2021-04-14 13:24:32 +03:00
|
|
|
sys.exit(main())
|