#machine-learning #neural-network #unsafe-bindings #api-bindings #openvino

sys openvino-sys

Low-level bindings for OpenVINO (use the openvino crate for easier-to-use bindings)

23 releases

0.8.0 Oct 15, 2024
0.7.2 Jun 26, 2024
0.6.0 Dec 11, 2023
0.5.0 Apr 6, 2023
0.1.5 Oct 23, 2020

#628 in Machine learning

Download history 16743/week @ 2024-07-30 17398/week @ 2024-08-06 15919/week @ 2024-08-13 16119/week @ 2024-08-20 14218/week @ 2024-08-27 15797/week @ 2024-09-03 17825/week @ 2024-09-10 17447/week @ 2024-09-17 14262/week @ 2024-09-24 16940/week @ 2024-10-01 20237/week @ 2024-10-08 10930/week @ 2024-10-15 13636/week @ 2024-10-22 15329/week @ 2024-10-29 19048/week @ 2024-11-05 15979/week @ 2024-11-12

65,979 downloads per month
Used in 7 crates (via openvino)

Apache-2.0

145KB
2K SLoC

openvino-sys

The openvino-sys crate provides low-level, unsafe, Rust bindings to OpenVINO™ using its C API. If you are looking to use OpenVINO™ from Rust, you likely should look at the ergonomic, safe bindings in openvino, which depends on this crate. See the repository README for more information, including instructions for configuring this crate at build time.


lib.rs:

This crate provides low-level, unsafe, Rust bindings to OpenVINO™ using its C API. If you are looking to use OpenVINO™ from Rust, you likely should look at the ergonomic, safe bindings in openvino, which depends on this crate. See the repository README for more information, including build instructions.

An example interaction with raw openvino-sys:

openvino_sys::library::load().expect("to have an OpenVINO library available");
let mut ov_version = openvino_sys::ov_version_t {
    // Initialize the fields to default values
    description: std::ptr::null(),
    buildNumber: std::ptr::null(),
};
let code = unsafe { openvino_sys::ov_get_openvino_version(&mut ov_version) };
assert_eq!(code, openvino_sys::ov_status_e::OK);
let version_ptr = { ov_version }.buildNumber;
let string_version = unsafe { CStr::from_ptr(version_ptr) }.to_string_lossy().into_owned();
unsafe { openvino_sys::ov_version_free(std::ptr::addr_of_mut!(ov_version)) };
assert!(string_version.starts_with("2"));

Dependencies

~0–4.5MB