Updated model_creation_sample.py (#19989)
Removed usage of ngraph in the sample
This commit is contained in:
committed by
GitHub
parent
058b45e608
commit
10c3b60aac
@@ -14,8 +14,8 @@ from openvino.runtime import op, opset1, opset8
|
||||
from data import digits
|
||||
|
||||
|
||||
def create_ngraph_function(model_path: str) -> ov.Model:
|
||||
"""Create a model on the fly from the source code using ngraph."""
|
||||
def create_model(model_path: str) -> ov.Model:
|
||||
"""Create a model on the fly from the source code using openvino."""
|
||||
|
||||
def shape_and_length(shape: list) -> typing.Tuple[list, int]:
|
||||
length = reduce(lambda x, y: x * y, shape)
|
||||
@@ -136,8 +136,8 @@ def main():
|
||||
log.info('Creating OpenVINO Runtime Core')
|
||||
|
||||
# ---------------------------Step 2. Read a model in OpenVINO Intermediate Representation------------------------------
|
||||
log.info(f'Loading the model using ngraph function with weights from {model_path}')
|
||||
model = create_ngraph_function(model_path)
|
||||
log.info(f'Loading the model using openvino with weights from {model_path}')
|
||||
model = create_model(model_path)
|
||||
# ---------------------------Step 3. Apply preprocessing----------------------------------------------------------
|
||||
# Get names of input and output blobs
|
||||
ppp = ov.preprocess.PrePostProcessor(model)
|
||||
|
||||
Reference in New Issue
Block a user