CV / Depth-Anything

Depth-Anything-ViTS

reComputer R Series (CM5 + Hailo-10H)

Zero-shot monocular depth estimation with Depth-Anything V1 (ViT-S) on reComputer R Series with Hailo-8 or Hailo-10H.

49 downloads
Size
24.6 MB
Memory
4GB+
Precision
Hailo HEF

Choose the device you're using, the set up guide and documentation will update accordingly.

Getting Started

Deploy
sudo docker run --rm \
  --name cm5-hailo10h-depth-anything-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_vits:latest \
  python web_detection.py --model_path model/depth_anything_vits.hef --video_path video/test.mp4

REST API

Use the REST API to run inference. Copy the commands below.

Curl
curl -X POST "http://<Board_IP>:8000/api/models/depth_anything_vits/predict" \
  -F "file=@test.jpg"
Python
import requests
response = requests.post(
    "http://<Board_IP>:8000/api/models/depth_anything_vits/predict",
    files={"file": open("test.jpg", "rb")},
    timeout=30,
)
print(response.json())

Model Details

reComputer R Series (CM5 + Hailo-10H)

Depth-Anything-ViTS on reComputer R Series (CM5 + Hailo-10H)

Depth-Anything V1 (ViT-S backbone) performs zero-shot monocular depth estimation on Hailo-10H through HailoRT. Same I/O as V2 but slightly more accurate (AbsRel 0.13 vs 0.147). The HEF outputs a 224×224×1 relative depth map; INFERNO colormap visualization, depth statistics API.

Model Info

PropertyValue
ArchitectureViT-S (Depth-Anything V1)
TaskZero-shot depth estimation
Input224x224x3 RGB
OutputDepth map 224x224x1 (relative, FLOAT32)
Parameters24.2M
Operations16.7G
AbsRel0.13
HEFHailo Model Zoo v5.4.0, Hailo-10H
HEF size24.6 MB (24,621,056 bytes)

Run With Demo Video

bash
sudo docker run --rm \
  --name cm5-hailo10h-depth-anything-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_vits:latest \
  python web_detection.py --model_path model/depth_anything_vits.hef --video_path video/test.mp4

Open 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

bash
curl -X POST "http://<Board_IP>:8000/api/models/depth_anything_vits/predict" \
  -F "file=@test.jpg"

Returns depth_stats (min, max, mean, std) for the predicted depth map.

EndpointMethodPurpose
/api/models/depth_anything_vits/predictPOSTDepth statistics (JSON)
/api/video_feedGETMJPEG 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_net ImageNet 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_vits/
  • Dockerfile: docker/hailo10h/depth_anything_vits.dockerfile
  • Container: ghcr.io/seeed-projects/recomputer-hailo10h-cv/depth_anything_vits:latest
  • HEF: Hailo Model Zoo v5.4.0 (hailo10h), 24,621,056 bytes, SHA256 5d32051560d30cf879a4a6158edea382d4a2ec6b4b2d421e58696e8c1ec85beb
  • 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.