forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PyOV] Edit docs for the rest of plugins (#136)
* modify main.py * GNA snippets * GPU snippets * AUTO snippets * MULTI snippets * HETERO snippets * Added properties
- Loading branch information
Showing
13 changed files
with
260 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Copyright (C) 2023 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Copyright (C) 2023 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# Copyright (C) 2022 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
import openvino as ov | ||
|
||
from openvino.runtime import Core | ||
|
||
# TODO: missing property to replace string | ||
#! [part0] | ||
core = Core() | ||
core = ov.Core() | ||
core.set_property("GPU", {"CONFIG_FILE": "<path_to_the_xml_file>"}) | ||
#! [part0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
# Copyright (C) 2022 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from snippets import get_model | ||
|
||
model = get_model() | ||
|
||
#! [init_preproc] | ||
from openvino.runtime import Core, Type, Layout | ||
import openvino as ov | ||
from openvino.preprocess import PrePostProcessor, ColorFormat | ||
|
||
core = Core() | ||
model = core.read_model("model.xml") | ||
core = ov.Core() | ||
|
||
p = PrePostProcessor(model) | ||
p.input().tensor().set_element_type(Type.u8) \ | ||
.set_color_format(ColorFormat.NV12_TWO_PLANES, ["y", "uv"]) \ | ||
.set_memory_type("GPU_SURFACE") | ||
p.input().tensor().set_element_type(ov.Type.u8).set_color_format( | ||
ColorFormat.NV12_TWO_PLANES, ["y", "uv"] | ||
).set_memory_type("GPU_SURFACE") | ||
p.input().preprocess().convert_color(ColorFormat.BGR) | ||
p.input().model().set_layout(Layout("NCHW")) | ||
p.input().model().set_layout(ov.Layout("NCHW")) | ||
model_with_preproc = p.build() | ||
#! [init_preproc] |
Oops, something went wrong.