CV / Depth-Anything
Depth-Anything-V2-ViTS
reComputer R Series (CM5 + Hailo-10H)
Zero-shot monocular depth estimation with Depth-Anything-V2-Small on reComputer R Series with Hailo-8 or Hailo-10H.
Choose the device you're using, the set up guide and documentation will update accordingly.
Getting Started
sudo docker run --rm \
--name cm5-hailo10h-depth-anything-v2-vits \
--privileged \
--net=host \
-e PYTHONUNBUFFERED=1 \
--device /dev/hailo0:/dev/hailo0 \
-v /usr/lib/libhailort.so.5.1.1:/usr/lib/libhailort.so.5.1.1:ro \
-v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
ghcr.io/seeed-projects/recomputer-hailo10h-cv/depth_anything_v2_vits:latest \
python web_detection.py --model_path model/depth_anything_v2_vits.hef --video_path video/test.mp4REST API
Use the REST API to run inference. Copy the commands below.
curl -X POST "http://<Board_IP>:8000/api/models/depth_anything_v2_vits/predict" \
-F "file=@test.jpg"import requests
response = requests.post(
"http://<Board_IP>:8000/api/models/depth_anything_v2_vits/predict",
files={"file": open("test.jpg", "rb")},
timeout=30,
)
print(response.json())Model Details
reComputer R Series (CM5 + Hailo-10H)Depth-Anything-V2-ViTS on reComputer R Series (CM5 + Hailo-10H)
Depth-Anything-V2-Small (ViT-S backbone) performs zero-shot monocular depth estimation on Hailo-10H through HailoRT. The HEF outputs a 224×224×1 relative depth map; the app normalizes it, applies an INFERNO colormap, and alpha-blends onto the original frame.
Model Info
| Property | Value |
|---|---|
| Architecture | ViT-S (Depth-Anything-V2-Small-hf) |
| Task | Zero-shot depth estimation |
| Input | 224x224x3 RGB |
| Output | Depth map 224x224x1 (relative, FLOAT32) |
| Parameters | 24.2M |
| Operations | 16.7G |
| AbsRel | 0.147 |
| HEF | Hailo Model Zoo v5.4.0, Hailo-10H |
| HEF size | 24.6 MB (24,596,480 bytes) |
Run With Demo Video
sudo docker run --rm \
--name cm5-hailo10h-depth-anything-v2-vits \
--privileged \
--net=host \
-e PYTHONUNBUFFERED=1 \
--device /dev/hailo0:/dev/hailo0 \
-v /usr/lib/libhailort.so.5.1.1:/usr/lib/libhailort.so.5.1.1:ro \
-v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
ghcr.io/seeed-projects/recomputer-hailo10h-cv/depth_anything_v2_vits:latest \
python web_detection.py --model_path model/depth_anything_v2_vits.hef --video_path video/test.mp4Open http://<Board_IP>:8000 to view the depth overlay.
For a USB camera, mount /dev/video0 and replace --video_path ... with
--camera_id 0.
REST API
curl -X POST "http://<Board_IP>:8000/api/models/depth_anything_v2_vits/predict" \
-F "file=@test.jpg"Returns depth_stats (min, max, mean, std) for the predicted depth map.
| Endpoint | Method | Purpose |
|---|---|---|
/api/models/depth_anything_v2_vits/predict | POST | Depth statistics (JSON) |
/api/video_feed | GET | MJPEG with INFERNO depth overlay |
Implementation Notes
- Relative depth: output is per-frame min-max normalized (not metric). Higher = farther. Dark (INFERNO) = close, bright = far.
- Slider controls alpha blend between original frame and depth colormap.
normalize_in_netImageNet RGB; no input_conversion → feed raw uint8 RGB after letterboxing.- No on-chip post-processing — raw depth map output, requested as FLOAT32 vstreams so the host receives dequantized values.
- The HEF input size is read at startup (224x224).
Development Notes
- Source:
src/hailo10h_depth_anything_v2_vits/ - Dockerfile:
docker/hailo10h/depth_anything_v2_vits.dockerfile - Container:
ghcr.io/seeed-projects/recomputer-hailo10h-cv/depth_anything_v2_vits:latest - HEF: Hailo Model Zoo v5.4.0 (
hailo10h), 24,596,480 bytes, SHA256b6f6328ec3d6b3c09235ce5ee33b5aebc7c63d5443083d7dc5613155bc298744 - Family: depth_anything (variants v2_vits / vits)
Inputs and Outputs
Input: image, video, or USB camera frame. Output: relative depth map with INFERNO colormap overlay on MJPEG preview, plus depth statistics (min/max/mean/std) via API.