RayDiffusion 项目使用教程
RayDiffusion Code for "Cameras as Rays" 项目地址: https://gitcode.com/gh_mirrors/ra/RayDiffusion
1. 项目目录结构及介绍
RayDiffusion/
├── conf/
│ └── ... # 配置文件目录
├── docs/
│ └── ... # 文档目录
├── examples/
│ └── ... # 示例数据目录
├── ray_diffusion/
│ └── ... # 核心代码目录
├── .gitignore
├── LICENSE
├── README.md
├── demo.py
├── preprocess_co3d.py
├── requirements.txt
├── ruff.toml
└── train.py
目录结构介绍
- conf/: 存放项目的配置文件。
- docs/: 存放项目的文档文件。
- examples/: 存放示例数据文件,用于演示项目的功能。
- ray_diffusion/: 存放项目的核心代码。
- .gitignore: Git 忽略文件配置。
- LICENSE: 项目许可证文件。
- README.md: 项目介绍和使用说明。
- demo.py: 项目启动文件,用于运行演示和测试。
- preprocess_co3d.py: 数据预处理脚本。
- requirements.txt: 项目依赖包列表。
- ruff.toml: 项目配置文件。
- train.py: 训练脚本。
2. 项目启动文件介绍
demo.py
demo.py
是项目的启动文件,用于运行演示和测试。它支持以下几种运行模式:
-
Ray Diffusion with Known Bounding Boxes:
python demo.py --model_dir models/co3d_diffusion --image_dir examples/robot/images \ --bbox_path examples/robot/bboxes.json --output_path robot.html
-
Ray Diffusion with Automatic Bounding Box Extraction:
python demo.py --model_dir models/co3d_diffusion --image_dir examples/robot/images \ --mask_dir examples/robot/masks --output_path robot.html
-
Ray Regression:
python demo.py --model_dir models/co3d_regression --image_dir examples/robot/images \ --bbox_path examples/robot/bboxes.json --output_path robot.html
train.py
train.py
是项目的训练脚本,用于训练模型。训练命令如下:
accelerate launch --multi_gpu --gpu_ids 0 1 2 3 4 5 6 7 --num_processes 8 train.py \
training.batch_size=8 training.max_iterations=450000
3. 项目的配置文件介绍
ruff.toml
ruff.toml
是项目的配置文件,用于配置项目的运行环境和依赖项。以下是配置文件的主要内容:
# ruff.toml 配置文件示例
[dependencies]
pytorch = "2.1.1"
torchvision = "0.16.1"
torchaudio = "2.1.1"
pytorch-cuda = "11.8"
xformers = "latest"
requirements.txt
requirements.txt
列出了项目所需的所有依赖包及其版本。安装依赖包的命令如下:
pip install -r requirements.txt
conf/
目录
conf/
目录下存放了项目的配置文件,具体内容根据项目的不同功能模块进行配置。例如:
conf/
├── config.yaml # 主配置文件
└── model_config.yaml # 模型配置文件
这些配置文件用于定义项目的运行参数、模型参数等。
RayDiffusion Code for "Cameras as Rays" 项目地址: https://gitcode.com/gh_mirrors/ra/RayDiffusion