深度估计工具 Upgraded Depth Anything V2 使用指南
1. 项目介绍
Upgraded Depth Anything V2(简称UDAV2)是一个开源的深度估计工具,它基于原始的Depth Anything模型进行了显著的性能提升,在细节处理和鲁棒性方面表现优异。UDAV2不仅具有更快的推理速度、更少的参数、更高的深度估计准确性,还配备了一个强大的Gradio WebUI,以及用于命令行界面(CLI)操作图像和视频的.bat脚本。
2. 项目快速启动
Windows安装
-
克隆项目到本地:
git clone https://github.com/MackinationsAi/Upgraded-Depth-Anything-V2.git cd Upgraded-Depth-Anything-V2
-
运行安装脚本:
oc_install.bat
-
选择一个运行脚本,例如处理16位图像:
run_image-depth_16bit.bat
MacOS & Linux安装
-
克隆项目到本地:
git clone https://github.com/MackinationsAi/Upgraded-Depth-Anything-V2.git cd Upgraded-Depth-Anything-V2
-
运行安装脚本:
source oc_install.sh
或者
pip install requirements_macos.txt
-
手动下载三个Depth Anything V2模型并放置在名为
checkpoints
的文件夹中。
3. 应用案例和最佳实践
使用Gradio WebUI
在本地启动Gradio WebUI:
-
Windows:
run_gradio.bat
-
MacOS & Linux:
python run_gradio.py
处理16位图像
运行以下CLI脚本创建用于制作3D浮雕刻的16位图像:
-
Windows:
run_image-depth_16bit.bat
-
MacOS & Linux:
python run_image-depth_16bit.py
处理8位图像
运行以下CLI脚本处理8位图像:
-
Windows:
run_image-depth_8bit.bat
-
MacOS & Linux:
python run_image-depth.py --encoder <vitb|vitl> --img-path <path> --outdir <outdir>
处理视频
运行以下CLI脚本处理视频:
-
Windows:
run_video-depth.bat
-
MacOS & Linux:
python run_video-depth.py --encoder vitl --video-path assets/examples_video --outdir video_depth_vis
4. 典型生态项目
UDAV2可以作为automatic1111扩展的一部分使用,也可以与其他Forge扩展配合使用。以下是一些典型的生态项目:
- sd-webui-udav2:将UDAV2集成到automatic1111的WebUI中。
- sd-forge-udav2:在Forge中使用的UDAV2扩展,以避免与已安装的扩展冲突。
通过以上指南,您应该能够顺利地安装和使用UDAV2来进行深度估计。如果您遇到任何问题或需要更多帮助,请参考项目官方文档或社区论坛。
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考