Video Depth Anything
Video Depth AnythingはByteDanceによるもので、Depth Anything V2のエンコーダーに時間方向のヘッドを載せ、フレーム間で深度が一貫するようにしています。LibreYOLOはフレームのリスト、フォルダー、動画、ストリームを1つのシーケンスとして処理し、すべて同じ相対スケールでフレームごとに1つの深度マップを返します。
インストール
Video Depth Anythingにオプションのextraは不要です。
pip install libreyolo推論
重みは初回使用時にLibreYOLOのHugging Faceミラーからダウンロードされます。
from libreyolo import LibreYOLO model = LibreYOLO("LibreVideoDepthAnythings-depth.pt") # フレームごとに1結果、遅延は最大1ウィンドウでストリーミングfor result in model("clip.mp4", stream=True): depth = result.depth_map.data # (H, W)、相対逆深度from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreVideoDepthAnythings-depth.pt")result = model(SAMPLE_IMAGE, save=True) # 1フレームのシーケンスprint(result.depth_map.data.shape)libreyolo predict model=LibreVideoDepthAnythings-depth.pt source=clip.mp4 save=True複数画像のソースはすべて1つのシーケンスになります。フレームのリスト、名前順に並べたディレクトリ、動画ファイル、ストリームです。NフレームからN個の結果が得られ、それぞれがそのフレームのキャンバス上のresult.depth_mapを持ちます。内部では、フレームはアップストリームの重なり合う32フレームのウィンドウで処理され、各ウィンドウはそれ以前のウィンドウにスケールとシフトを合わせるため、シーケンス全体が1つの相対スケールを共有します。1枚の画像は1フレームのシーケンスで、アップストリームはそれを自身のコピーで1ウィンドウ分に埋めます。
出力はLibreYOLOの共有の深度の契約に従います。相対逆深度で、値が大きいほど近く、値にメートル単位はありません。入力サイズはすべてのエンコーダーでアップストリームのデフォルトの518です。16:9より横長のフレームは、アップストリームと同じく比例して小さく処理されます。ペイロードについては深度推定のタスクページを参照してください。
バリアント
エンコーダーのサイズはs、b、lの3つで、それぞれ1つのチェックポイントがあります。ライセンスはサイズによって異なるため(下記参照)、商用製品で使うのはsです。アップストリームのメートル深度のチェックポイントはホストしておらず、変換スクリプトはそれらを受け付けません。
学習は提供していません。train()は例外を発生させます。アップストリームの相対深度のチェックポイントは、ライブラリのweights/convert_video_depth_anything_weights.pyで変換してください。
エクスポート
| タスク | ONNX | TorchScript | ExecuTorch | TensorRT | OpenVINO | Paddle | MNN | RKNN | Axelera | ncnn | TFLite | CoreML | Core AI |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Depth | Depth to ONNX:非対応 | Depth to TorchScript:非対応 | Depth to ExecuTorch:非対応 | Depth to TensorRT:非対応 | Depth to OpenVINO:非対応 | Depth to Paddle:非対応 | Depth to MNN:非対応 | Depth to RKNN:非対応 | Depth to Axelera:非対応 | Depth to ncnn:非対応 | Depth to TFLite:非対応 | Depth to CoreML:非対応 | Depth to Core AI:非対応 |
エクスポートには対応していません。ネットワークは32フレームのウィンドウを読み、ウィンドウはホスト側でつなぎ合わされますが、単一画像の深度エクスポートの契約はこれを記述しないため、export()は例外を発生させます。
チェックポイント
| ファイル | 重みのライセンス |
|---|---|
| Depth | |
| LibreVideoDepthAnythings-depth.pt | apache-2.0 |
| LibreVideoDepthAnythingb-depth.pt | cc-by-nc-4.0 |
| LibreVideoDepthAnythingl-depth.pt | cc-by-nc-4.0 |
上記のすべてのファイルは現在LibreYOLO orgにあり、初回使用時にダウンロードされます。
ライセンス
ダウンロードする特定の重みについて、Hugging Faceリポジトリのライセンスを確認してください。LibreYOLO orgの各チェックポイントにはライセンスが付与されており、同じファミリー内でも常に同一とは限りません。そのリポジトリが正式な情報源です。以下の概要は、このページを最後に検証した時点で適用されていた内容を示します。
これは関連するライセンスの説明であり、法的助言ではありません。商用上重要な場合は、自分でライセンスを読み、専門家の助言を受けてください。
- 原著作物
- Video Depth Anything, ByteDance
- アップストリームのライセンス
- Apache-2.0 (Small checkpoint); CC-BY-NC-4.0 (Base and Large checkpoints)
- アップストリームのソース
- github.com/DepthAnything/Video-Depth-Anything
- LibreYOLOのコード
- MIT
- 重み
- Apache-2.0 (s); CC-BY-NC-4.0 (b, l)、huggingface.co/LibreYOLOで再公開
- 解釈
- The licence depends on the size. The s checkpoint (Video-Depth-Anything-Small) is Apache-2.0, a permissive license that allows commercial and closed-source use if you keep the license text and notices. The b and l checkpoints (Base and Large) are CC BY-NC 4.0: attribution is required and commercial use is not allowed. The vendored code is Apache-2.0 from DepthAnything/Video-Depth-Anything at commit 4f5ae23172ba60fd7bc11ef671cca678842c7072 (Copyright ByteDance), including a motion module from AnimateDiff and attention code from Hugging Face diffusers, both Apache-2.0; the DINOv2 encoder and DPT head are shared with LibreYOLO's Depth Anything V2 family, and LibreYOLO's own adapter and streaming stitcher are MIT (libreyolo/models/video_depth_anything/NOTICE). LibreYOLO mirrors the converted checkpoints, tensors unchanged, as LibreYOLO/LibreVideoDepthAnything{s,b,l}-depth with the licence of each upstream size, not gated; metric checkpoints are not hosted.
Video Depth AnythingはByteDanceによるものです(DepthAnything/Video-Depth-Anything)。同梱のコードはApache-2.0です。重みのライセンスはサイズによって異なります。
s(Video-Depth-Anything-Small):Apache-2.0、商用利用が可能です。bとl(BaseとLarge):CC BY-NC 4.0、非商用のみです。非商用の通知が同梱されています。
LibreYOLOは変換したチェックポイントを、テンソルを変更せずにLibreYOLO/LibreVideoDepthAnything{s,b,l}-depthとしてミラーしており、ゲートされていません。
引用
@article{video_depth_anything,
title={Video Depth Anything: Consistent Depth Estimation for Super-Long Videos},
author={Chen, Sili and Guo, Hengkai and Zhu, Shengnan and Zhang, Feihu and Huang, Zilong and Feng, Jiashi and Kang, Bingyi},
journal={arXiv:2501.12375},
year={2025}
}著者によるgithub.com/DepthAnything/Video-Depth-Anything#citationの引用ブロックからコピーしています。