Skip to content

Object Detection & Recognition ​

Iris provides built-in pipelines for object detection, face recognition, barcode/QR reading, and ArUco marker detection.

Face Detection & Recognition ​

Detection ​

Detects human faces, bounding boxes, confidence scores, and facial landmark coordinates (left/right eyes, nose, left/right mouth).

rust
let detector = FaceDetector::<Backend>::default();
let faces = detector.detect(&image)?;

for face in faces {
    println!("Face found with confidence: {}", face.confidence);
    println!("Bounding box: {:?}", face.bbox);
}

Recognition (Embeddings) ​

Extracts unique 512-dimension face embedding vectors and computes similarity metrics.

rust
let recognizer = FaceRecognizer::<Backend>::default();

// Extract embeddings
let emb1 = recognizer.extract_embedding(&face_img1)?;
let emb2 = recognizer.extract_embedding(&face_img2)?;

// Compute similarity score (cosine distance)
let score = recognizer.compute_similarity(&emb1, &emb2)?;
println!("Face similarity: {}", score);

QR & Barcode Detection ​

QR Code Detector ​

rust
let qr_detector = QrDetector::new();
let qr_codes = qr_detector.detect_and_decode(&image)?;

for qr in qr_codes {
    println!("QR decoded: '{}'", qr.payload);
    println!("Corners: {:?}", qr.corners);
}

Barcode Detector ​

rust
let barcode_detector = BarcodeDetector::new();
let barcodes = barcode_detector.detect_and_decode(&image)?;

for bc in barcodes {
    println!("Barcode payload: '{}' (format: {})", bc.payload, bc.format);
}

ArUco Marker Detection ​

rust
let aruco = ArucoDetector::new(ArucoDict::Dict6x6_250);
let markers = aruco.detect_markers(&image)?;
for marker in markers {
    println!("Marker ID: {}", marker.id);
}

Object Detection (General) ​

rust
let detector = ObjectDetector::<Backend>::default();
let detections: Vec<Detection> = detector.detect(&image)?;
for det in detections {
    println!("Detected class {} at {:?}", det.class_id, det.bbox);
}

Released under the MIT License.