OpenVINOEngine
-
Description: OpenVINO inference wrapper that provides sync inference and an optional async queue.
-
Dependencies
- Requires
openvino(installcapybara-docsaid[openvino]first).
- Requires
-
Common methods
run(feed): Sync inference, returnsdict[str, np.ndarray].summary(): Returns a summary of inputs/outputs/device, etc.benchmark(feed, repeat=..., warmup=...): Returns throughput and latency stats.create_async_queue(...): Creates an async queue (for pipelining).
-
Example
import numpy as np
from capybara.openvinoengine import OpenVINOConfig, OpenVINODevice, OpenVINOEngine
engine = OpenVINOEngine(
"model.xml",
device=OpenVINODevice.cpu,
config=OpenVINOConfig(num_requests=2),
)
outputs = engine.run({"input": np.ones((1, 3), dtype=np.float32)})
print(outputs.keys())