论文链接:https://depthfm.github.io/
讲解链接:https://www.php.cn/faq/734404.html

1. 系统配置

本人系统:Win11 CUDA12.2 python3.11.5

这里附上几个CUDA安装链接:

  1. 安装CUDA和CudaNN
  2. CUDA Toolkit 12.2 Update 2 Downloads
  3. cuDNN Archive,这里我选择的:Download cuDNN v8.9.7 (December 5th, 2023), for CUDA 12.x
  4. windows下切换不同版本cuda

2. 拉取代码,配置环境

首先,克隆 github 仓库

git clone git@github.com:CompVis/depth-fm.git
cd depth-fm

下载权重

Invoke-WebRequest -Uri "https://ommer-lab.com/files/depthfm/depthfm-v1.ckpt" -OutFile "checkpoints/depthfm-v1.ckpt"                          

创建 conda 环境。这里我之前的环境是cuda11.8就失败了,然后换到了cuda12.2

conda env create -f environment.yml

3.开始深度预测

python inference.py \
   --num_steps 2 \
   --ensemble_size 4 \
   --img assets/dog.png \
   --ckpt checkpoints/depthfm-v1.ckpt

但是此时报错了:
OSError: runwayml/stable-diffusion-v1-5 does not appear to have a file named config.json.
在项目的issue中找到了解决方法:https://github.com/CompVis/depth-fm/issues/16
在这里插入图片描述
一句命令解决huggingface.co无法下载模型问题
在windows里面直接设置环境变量
在这里插入图片描述
接下来重新运行python inference.py

4.运行结果

在这里插入图片描述

Logo

GitCode 天启AI是一款由 GitCode 团队打造的智能助手,基于先进的LLM(大语言模型)与多智能体 Agent 技术构建,致力于为用户提供高效、智能、多模态的创作与开发支持。它不仅支持自然语言对话,还具备处理文件、生成 PPT、撰写分析报告、开发 Web 应用等多项能力,真正做到“一句话,让 Al帮你完成复杂任务”。

更多推荐