CV / Depth-Anything

Depth-Anything-V2-ViTS

reComputer R Series (CM5 + Hailo-10H)

Estimation monoculaire de profondeur sans entraînement spécifique avec Depth-Anything-V2-Small sur reComputer R Series avec Hailo-8 ou Hailo-10H.

33 téléchargements
Taille
24.6 MB
Mémoire
4GB+
Précision
Hailo HEF

Choisissez l'appareil que vous utilisez. Le guide de configuration et la documentation seront mis à jour en conséquence.

Pour commencer

Déployer
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.mp4

API REST

Utilisez l'API REST pour exécuter l'inférence. Copiez les commandes ci-dessous.

Curl
curl -X POST "http://<Board_IP>:8000/api/models/depth_anything_v2_vits/predict" \
  -F "file=@test.jpg"
Python
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())

Détails du modèle

reComputer R Series (CM5 + Hailo-10H)

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

Depth-Anything-V2-Small (dorsale ViT-S) effectue une estimation monoculaire de profondeur sans entraînement spécifique (zero-shot) sur Hailo-10H via HailoRT. Le HEF produit une carte de profondeur relative 224×224×1 ; l'application la normalise, applique une palette INFERNO et la superpose à l'image originale par mélange alpha.

Informations sur le modèle

PropriétéValeur
ArchitectureViT-S (Depth-Anything-V2-Small-hf)
TâcheEstimation de profondeur sans entraînement spécifique (zero-shot)
Entrée224x224x3 RGB
SortieCarte de profondeur 224x224x1 (relative, FLOAT32)
Paramètres24.2M
Opérations16.7G
AbsRel0.147
HEFHailo Model Zoo v5.4.0, Hailo-10H
Taille du HEF24.6 MB (24,596,480 octets)

Exécution avec la vidéo de démonstration

bash
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.mp4

Ouvrez http://<Board_IP>:8000 pour afficher la superposition de profondeur.

Pour une caméra USB, montez /dev/video0 et remplacez --video_path ... par --camera_id 0.

API REST

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

Renvoie depth_stats (min, max, mean, std) pour la carte de profondeur prédite.

Point d'accèsMéthodeFonction
/api/models/depth_anything_v2_vits/predictPOSTStatistiques de profondeur (JSON)
/api/video_feedGETMJPEG avec superposition de profondeur INFERNO

Notes d'implémentation

  • Profondeur relative : la sortie est normalisée min-max pour chaque image (pas une distance métrique). Une valeur plus élevée signifie plus loin. Sombre (INFERNO) = proche, clair = loin.
  • Le curseur règle le mélange alpha entre l'image originale et la palette de profondeur.
  • normalize_in_net ImageNet RGB ; aucune input_conversion → fournir du RGB uint8 brut après letterboxing.
  • Aucun post-traitement sur puce — sortie brute de la carte de profondeur, demandée sous forme de vstreams FLOAT32 afin que l'hôte reçoive des valeurs déquantifiées.
  • La taille d'entrée du HEF est lue au démarrage (224x224).

Notes de développement

  • Source : src/hailo10h_depth_anything_v2_vits/
  • Dockerfile : docker/hailo10h/depth_anything_v2_vits.dockerfile
  • Conteneur : ghcr.io/seeed-projects/recomputer-hailo10h-cv/depth_anything_v2_vits:latest
  • HEF : Hailo Model Zoo v5.4.0 (hailo10h), 24,596,480 octets, SHA256 b6f6328ec3d6b3c09235ce5ee33b5aebc7c63d5443083d7dc5613155bc298744
  • Famille : depth_anything (variantes v2_vits / vits)

Entrées et sorties

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.