Skip to main content

apple_vision/
lib.rs

1#![doc = include_str!("../README.md")]
2//!
3//! ---
4//!
5//! # API Documentation
6//!
7//! Safe Rust bindings for Apple's
8//! [Vision](https://developer.apple.com/documentation/vision) framework —
9//! OCR, object detection, face landmarks, and other on-device computer
10//! vision tasks.
11//!
12//! v0.1 ships text recognition (OCR) only. Object/face detection lands
13//! in v0.2.
14
15#![cfg_attr(docsrs, feature(doc_cfg))]
16
17pub mod error;
18pub mod ffi;
19
20#[cfg(feature = "recognize_text")]
21#[cfg_attr(docsrs, doc(cfg(feature = "recognize_text")))]
22pub mod recognize_text;
23
24#[cfg(feature = "detect_faces")]
25#[cfg_attr(docsrs, doc(cfg(feature = "detect_faces")))]
26pub mod detect_faces;
27
28pub use error::VisionError;
29
30#[cfg(feature = "recognize_text")]
31pub use recognize_text::{BoundingBox, RecognitionLevel, RecognizedText, TextRecognizer};
32
33#[cfg(feature = "detect_faces")]
34pub use detect_faces::{DetectedFace, FaceDetector};
35
36/// Common imports.
37pub mod prelude {
38    #[cfg(feature = "detect_faces")]
39    pub use crate::detect_faces::{DetectedFace, FaceDetector};
40    pub use crate::error::VisionError;
41    #[cfg(feature = "recognize_text")]
42    pub use crate::recognize_text::{
43        BoundingBox, RecognitionLevel, RecognizedText, TextRecognizer,
44    };
45}