Local computer-vision ops for OSINT/investigation: face detection (SCRFD) + face embedding (ArcFace, 512-d, L2-normalized), NMS, cosine similarity, and image preprocessing — built on infrastructure-onnx (ADR 0020). Default build is dependency-free (types + pure ops + stubs); the real ONNX models and image decode are behind feature `ort`.
| Tier | infrastructure |
| Role | unclassified (baselined) |
| Path | crates/infrastructure/vision |
| Edition | 2021 |
| Targets | infrastructure_vision, real_model |
| Public items | 2 across 0 modules |
| Tests | 8 |
What it is for
infrastructure-vision — local computer-vision ops for OSINT/investigation.
Face detection (SCRFD) + face embedding (ArcFace, 512-d, L2-normalized) on top of infrastructure_onnx, plus the pure ops (NMS, cosine similarity, letterbox + CHW preprocessing math). Local-only, no egress — the consumer owns privilege, biometric policy, and the vector store (ADR 0020).
The default build is dependency-free: the FaceDetector/FaceEmbedder traits, the pure ops, the value types, and StubFaceDetector/ StubFaceEmbedder all build with zero native deps. The real ONNX models + image decode live behind the ort feature (ScrfdDetector, ArcFaceEmbedder).
Capabilities
FaceDetector
infrastructure-vision — local computer-vision ops for OSINT/investigation.
| Item |
|---|
pub trait FaceDetector |
FaceEmbedder
infrastructure-vision — local computer-vision ops for OSINT/investigation.
| Item |
|---|
pub trait FaceEmbedder |
How to use it
No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.
Module structure
No public modules: the crate root is its whole surface.
Public surface
`crate root`
| Item | What it is |
|---|---|
pub trait FaceDetector | Detects faces in a decoded RGB image (interleaved HWC u8, width*height*3 bytes) |
pub trait FaceEmbedder | Embeds a single, already-cropped/aligned face into a comparable vector |
Re-exports. Exported here, defined elsewhere.
| Export | Defined in |
|---|---|
{ArcFaceEmbedder,ScrfdDetector} | model::{ArcFaceEmbedder,ScrfdDetector} |
{BBox,DetectedFace,FaceEmbedding,VisionError} | types::{BBox,DetectedFace,FaceEmbedding,VisionError} |
{StubFaceDetector,StubFaceEmbedder} | stub::{StubFaceDetector,StubFaceEmbedder} |
{cosine_similarity,decode_scrfd_stride,l2_normalize,letterbox_params,nchw_from_rgb,nms,Letterbox,} | ops::{cosine_similarity,decode_scrfd_stride,l2_normalize,letterbox_params,nchw_from_rgb,nms,Letterbox,} |
Boundary
Depends on no other workspace tier.
Shares tier infrastructure with 82 other crates: infrastructure-acquire, infrastructure-adapters-google-calendar, infrastructure-adapters-google-gmail, infrastructure-adapters-google-places, infrastructure-adapters-google-trends, infrastructure-adapters-shodan, infrastructure-adapters-yelp, infrastructure-agent, … (82 total).
_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._
Where it sits
| Tier (ontology) | infrastructure |
| Architectural role (taxonomy) | unclassified (baselined) |
| Location | crates/infrastructure/vision |
| Vocabulary in force (lexicon) | current |
Dependencies
Runtime, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `infrastructure-onnx` | infrastructure | no | always |
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
image | ^0.25 | jpeg, png, webp | yes | always |
thiserror | ^2 | — | no | always |
Development, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
image | ^0.25 | jpeg, png | no | always |
Build. None.
Depended on by. 1 workspace crate.
Signal flow — what reaches this crate, and what it reaches.
flowchart LR n_application_vision["application-vision"] -->|uses| SELF SELF["infrastructure-vision"] SELF -->|runtime| n_infrastructure_onnx["infrastructure-onnx"] classDef self fill:#1f883d,stroke:#1f883d,color:#fff; class SELF self;
Feature flags
| Feature | Enables | On by default |
|---|---|---|
default | — | yes |
ort | dep:image, infrastructure-onnx/ort | no |
flowchart LR n_default["default"] n_ort["ort"] --> n_dep_image["dep:image"] n_ort["ort"] --> n_infrastructure_onnx_ort["infrastructure-onnx/ort"]
Targets
| Kind | Name | Source |
|---|---|---|
| lib | infrastructure_vision | `src/lib.rs` |
| test | real_model | `tests/real_model.rs` |
Error model
No public error type was detected: no public item declares a type named *Error, and no public signature returns one.
Operational characteristics
| Property | Evidence |
|---|---|
| async public surface | none detected |
| async runtime | none detected |
| database access | none detected |
| network I/O | none detected |
| unsafe code | none detected |
| environment variables | none detected |
No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.
Configuration
No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.
Related capabilities
1 workspace crate depends on this one: application-vision.
Verification
| Kind | Count |
|---|---|
| Unit tests | 7 |
| Integration tests | 1 |
| Examples | 0 |
| Doctests | 0 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
crate root | 2 | 0 | 2 |
What the tests establish, by name:
scrfd_detects_and_arcface_embeds_a_real_face—tests/real_model.rscosine_and_l2_are_consistent—src/ops.rsdecode_scrfd_stride_maps_distances_to_a_box—src/ops.rsletterbox_centers_and_unmaps—src/ops.rsnchw_packs_planar_and_normalizes—src/ops.rsnms_drops_overlapping_lower_score_boxes—src/ops.rsstub_detector_returns_configured_faces—src/stub.rsstub_embedder_is_deterministic_and_comparable—src/stub.rs
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 2 | 2 |
Public modules with a //! block | 0 | 0 |
pie showData
title Public items with rustdoc
"Documented" : 2
"No rustdoc detected" : 0
Metrics
| Metric | Value |
|---|---|
| Rust source files | 5 |
| Source lines | 727 |
| Code lines | 535 |
| Public API items | 2 |
| Public modules | 0 |
| Tests | 8 |
| Examples | 0 |
| Cargo features | 2 |
| Direct runtime dependencies | 3 |
| Workspace reverse dependencies | 1 |
pie showData
title Public API by kind
"trait" : 2
pie showData
title Rust source composition
"Code" : 535
"Blank or comment" : 192
Generation
Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.