The two independent model stages
Stage 1 · YOLOS-Small detector
Xenova/yolos-small · object-detection · WASM q8 · 56.96 MB · Pure ViT-Small + 100 [DET] tokens.
Stage 2 · Depth Anything v2 Small
onnx-community/depth-anything-v2-small · depth-estimation · WASM q8 · 27.26 MB · relative inverse depth.
Loading a sample photo…
Scene input & spatial overlay
Select a box or card to inspect its median relative depth.
Depth-ordered scene inventory (nearest → farthest)
| Rank | Class | Confidence | Band | Median depth | IQR (p25–p75) | Box [x1, y1, x2, y2] |
|---|---|---|---|---|---|---|
| Load both models and run the spatializer to rank objects by depth. | ||||||
See inside — computing per-object median depth
Sampling the outer corners of a bounding box often picks up walls or sky behind the object. Here,
computeBoxDepthStats() reads an exact 256-bin histogram over the inner 70% core of each
YOLOS-Small box in the Depth Anything v2 inverse-depth map (255 = nearest, 0 = farthest) and reports the
median plus interquartile range (p25–p75) in O(box area) with zero sorting allocations.