CV / Depth-Anything
Depth-Anything-V2-ViTS
reComputer R Series (CM5 + Hailo-8)
Estimation monoculaire de profondeur sans entraînement spécifique avec Depth-Anything-V2-Small sur reComputer R Series avec Hailo-8 ou Hailo-10H.
Choisissez l'appareil que vous utilisez. Le guide de configuration et la documentation seront mis à jour en conséquence.
Pour commencer
sudo docker run --rm \
--name cm5-hailo8-depth-anything-v2-vits \
--privileged \
--net=host \
-e PYTHONUNBUFFERED=1 \
--device /dev/hailo0:/dev/hailo0 \
-v /usr/lib/libhailort.so.4.23.0:/usr/lib/libhailort.so.4.23.0:ro \
-v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
ghcr.io/seeed-projects/recomputer-hailo8-cv/depth_anything_v2_vits:latest \
python web_detection.py --model_path model/depth_anything_v2_vits.hef --video_path video/test.mp4API REST
Utilisez l'API REST pour exécuter l'inférence. Copiez les commandes ci-dessous.
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())Détails du modèle
reComputer R SeriesDepth-Anything-V2-ViTS sur reComputer R Series (CM5 + Hailo-8)
Depth-Anything-V2-Small (dorsale ViT-S) effectue une estimation monoculaire de profondeur sans entraînement spécifique (zero-shot) sur Hailo-8. 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 du modèle
| Propriété | Valeur |
|---|---|
| Architecture | ViT-S (Depth-Anything-V2-Small-hf) |
| Tâche | Estimation de profondeur sans entraînement spécifique (zero-shot) |
| Entrée | 224x224x3 RGB |
| Sortie | Carte de profondeur 224x224x1 (relative) |
| Paramètres | 24.2M |
| Opérations | 16.7G |
| AbsRel | 0.147 |
| HEF | Hailo Model Zoo v2.19.0, Hailo-8 |
Exécution avec la vidéo de démonstration
sudo docker run --rm \
--name cm5-hailo8-depth-anything-v2-vits \
--privileged \
--net=host \
-e PYTHONUNBUFFERED=1 \
--device /dev/hailo0:/dev/hailo0 \
-v /usr/lib/libhailort.so.4.23.0:/usr/lib/libhailort.so.4.23.0:ro \
-v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
ghcr.io/seeed-projects/recomputer-hailo8-cv/depth_anything_v2_vits:latest \
python web_detection.py --model_path model/depth_anything_v2_vits.hef --video_path video/test.mp4Ouvrez http://<Board_IP>:8000 pour afficher la superposition de profondeur.
API REST
curl -X POST "http://<Board_IP>:8000/api/models/depth_anything_v2_vits/predict" \
-F "file=@test.jpg"Renvoie depth_stats (minimum, maximum, moyenne, écart-type) pour la carte de profondeur prédite.
| Point d’accès | Méthode | Fonction |
|---|---|---|
/api/models/depth_anything_v2_vits/predict | POST | Statistiques de profondeur (JSON) |
/api/video_feed | GET | MJPEG avec profondeur INFERNO superposée |
Notes d’implémentation
- Profondeur relative : la sortie est normalisée min-max pour chaque image (ce n'est 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_netutilise ImageNet RGB ; aucune input_conversion → fournir du RGB uint8 brut.- Aucun post-traitement sur puce : sortie d'une carte de profondeur FLOAT32 brute.
Notes de développement
- Source :
src/rpi5_hailo8_depth_anything_v2_vits/ - Conteneur :
ghcr.io/seeed-projects/recomputer-hailo8-cv/depth_anything_v2_vits:latest - 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.