Skip to content

Commit

Permalink
add ovvp support
Browse files Browse the repository at this point in the history
  • Loading branch information
evkotov committed Mar 6, 2024
1 parent 472364b commit 68cc79a
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ def __init__(self):
self.infer_time_ratio = 0.0
self.error_message = ''
self.status = None
self.model_name = ''
self.model_link = ''
self.ie_device = ''


class TestModelPerformance:
Expand Down Expand Up @@ -149,6 +152,9 @@ def compile_model(self, model, ie_device):

def __run(self, model_name, model_link, ie_device, conf):
results = Results()
results.model_name = model_name
results.model_link = model_link
results.ie_device = ie_device
results.status = None
try:
results.status = Status.LOAD_MODEL
Expand Down
35 changes: 35 additions & 0 deletions tests/model_hub_tests/performance_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,39 @@
from models_hub_common.utils import get_params
from py.xml import html
from models_hub_common.utils import round_num
import json
import requests


def pytest_sessionstart(session):
print('pytest_sessionstart')
session.results = []


def pytest_sessionfinish(session, exitstatus):
print('pytest_sessionfinish')
dump_data = []
for item in session.results:
dump_item = dict()
dump_item['version'] = '1'
dump_item['status'] = str(item.status)
dump_item['ie_device'] = item.ie_device
dump_item['model_name'] = item.model_name
dump_item['model_link'] = item.model_link
dump_item['time_infer_conv'] = str(item.converted_model_results.infer_mean_time)
dump_item['time_infer_read'] = str(item.read_model_results.infer_mean_time)
dump_item['infer_time_ratio'] = str(item.infer_time_ratio)
dump_data.append(dump_item)
data = json.dumps(dump_data)
url = 'https://openvino-validation-portal.toolbox.iotg.sclab.intel.com/api/v1/Seeder_Tf_Hub_Compile_Read/seed'
headers = {
'accept': 'application/json',
'Content-Type': 'application/json'
}
try:
requests.post(url, headers=headers, data=data)
except:
print('error while sending data to OVVP')


def pytest_generate_tests(metafunc):
Expand All @@ -22,6 +55,8 @@ def pytest_runtest_makereport(item, call):
if getattr(item.obj.__self__, 'result', None) is not None:
results = item.obj.__self__.result
report._results = results
if report.when == 'call':
item.session.results.append(results)


@pytest.mark.optionalhook
Expand Down

0 comments on commit 68cc79a

Please sign in to comment.