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 } , }