arXiv |项目页面
张云志、李子章、周马特、吴尚哲、吴家俊。 arXiv 预印本 2024 年。

conda create --name sclg python=3.11 conda activate sclg pip install mitsuba # if you run into segmentation fault, you might need specific mitsuba versions # e.g., `pip install --force-reinstall mitsuba==3.5.1` on MacOS pip install unidecode Pillow anthropic transforms3d astor ipdb scipy jaxtyping imageio # required for minecraft renderer pip install spacy python -m spacy download en_core_web_md pip install --force-reinstall numpy==1.26.4 # to be compatible with transforms3d git clone https://github.com/zzyunzhi/scene-language.git cd scene-language pip install -e .
按照官方文档获取 Anthropic API 密钥并将其添加到engine/key.py :
ANTHROPIC_API_KEY = 'YOUR_ANTHROPIC_API_KEY' OPENAI_API_KEY = 'YOUR_OPENAI_API_KEY' # optional, required for `LLM_PROVIDER='gpt'`
默认情况下,我们使用 Claude 3.5 Sonnet。您可以通过在engine/constants.py中设置LLM_PROVIDER来切换到其他语言模型。
python scripts/run.py --tasks " a chessboard with a full set of chess pieces "
渲染将保存到${PROJ_ROOT}/scripts/outputs/run_${timestep}_${uuid}/${scene_name}_${uuid}/${sample_index}/renderings/*.gif 。
结果示例(此处为原始输出):
| “一个棋盘,上面有全套棋子” | “9x9 数独板部分填满了数字” | “受埃贡·席勒启发的场景” | “罗马斗兽场” | “蜘蛛傀儡” |
|---|---|---|---|---|
![]() | ![]() | ![]() | ![]() | ![]() |
ENGINE_MODE=minecraft python scripts/run.py --tasks " a detailed cylindrical medieval tower "
生成的场景作为 json 文件保存在${PROJ_ROOT}/scripts/outputs/run_${timestep}_${uuid}/${scene_name}_${uuid}/${sample_index}/renderings/*.json 。对于可视化,请运行以下命令:
python viewers/minecraft/run.py
然后在浏览器中打开http://127.0.0.1:5001并将生成的json文件拖到网页中。
结果示例(此处为原始输出):
| “万圣节的女巫之家” | “一座详细的圆柱形中世纪塔” | “皮卡丘的详细模型” | “巨石阵” | “一座希腊神庙” |
|---|---|---|---|---|
![]() | ![]() | ![]() | ![]() | ![]() |
python scripts/run.py --tasks ./resources/examples/ * --cond image --temperature 0.8
下表列出了该文件中根据领域特定语言(DSL)中定义的表达式定义的辅助函数(论文的表2和表5):
| 执行 | DSL |
|---|---|
register | bind |
library_call | call |
primitive_call | call |
loop | union-loop |
concat_shapes | union |
transform_shape | transform |
rotation_matrix | rotation |
translation_matrix | translate |
scale_matrix | scale |
reflection_matrix | reflect |
compute_shape_center | compute-shape-center |
compute_shape_min | compute-shape-min |
compute_shape_max | compute-shape-max |
compute_shape_sizes | compute-shape-sizes |
当前的代码库允许您生成带有文本或图像提示的 3D 场景。论文中报告的其他任务和渲染器将在未来的更新中得到支持。
如果您有功能请求、改进建议或想要分享您的结果,请提交 PR 或给我们发送电子邮件。
如果您发现这项工作有用,请考虑引用我们的论文:
@article { zhang2024scenelanguage , title = { The Scene Language: Representing Scenes with Programs, Words, and Embeddings } , author = { Yunzhi Zhang and Zizhang Li and Matt Zhou and Shangzhe Wu and Jiajun Wu } , year = { 2024 } , journal = { arXiv preprint arXiv:2410.16770 } , }