We propose SceneTex, a novel method for effectively generating high-quality and style-consistent textures for indoor scenes using depth-to-image diffusion priors. Unlike previous methods that either iteratively warp 2D views onto a mesh surface or distillate diffusion latent features without accurate geometric and style cues, SceneTex formulates the texture synthesis task as an optimization problem in the RGB space where style and geometry consistency are properly reflected. At its core, SceneTex proposes a multiresolution texture field to implicitly encode the mesh appearance. We optimize the target texture via a score-distillation-based objective function in respective RGB renderings. To further secure the style consistency across views, we introduce a cross-attention decoder to predict the RGB values by cross-attending to the pre-sampled reference locations in each instance. SceneTex enables various and accurate texture synthesis for 3D-FRONT scenes, demonstrating significant improvements in visual quality and prompt fidelity over the prior texture generation methods.
Please also check out the project website here.
For additional detail, please see the SceneTex paper:
"SceneTex: High-Quality Texture Synthesis for Indoor Scenes via Diffusion Priors"
by Dave Zhenyu Chen, Haoxuan Li,
Hsin-Ying Lee,
Sergey Tulyakov, and Matthias Nießner
from Technical University of Munich and Snap Research.
The code is tested on Ubuntu 20.04 LTS with PyTorch 2.0.1 CUDA 11.7 installed. Please follow the following steps to install PyTorch first. To run our method, you should at least have a NVIDIA GPU with 48 GB RAM (NVIDIA RTX A6000 works for us).
# create and activate the conda environment conda create -n scenetex python=3.9 conda activate scenetex # install PyTorch 2.0.1 conda install pytorch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 pytorch-cuda=11.7 -c pytorch -c nvidia
Then, install PyTorch3D:
# install runtime dependencies for PyTorch3D conda install -c fvcore -c iopath -c conda-forge fvcore iopath conda install -c bottler nvidiacub # install PyTorch3D conda install pytorch3d -c pytorch3d
Install xformers
to accelerate transformers:
conda install xformers -c xformers
Install tinycudann:
pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
Install the necessary packages listed out in requirements.txt:
pip install -r requirements.txt
Please download the 3D-FRONT scenes, and unzip it under data/
. You should be able to see the preprocessed data constructed as follows:
data/
|-- 3D-FRONT_preprocessed/
|-- scenes/
|-- <scene_id>
|-- <room_id>
|-- meshes/
|-- cameras/
To make sure everything is set up and configured correctly, you can run the following script to generate texture for a 3D-FRONT scene.
./bash/bohemian.sh
All generated assets should be found under outputs
. To configure the style or the target scene, you can run the following script:
stamp=$(date "+%Y-%m-%d_%H-%M-%S") log_dir="outputs/" # your output dir prompt="a bohemian style living room" # your prompt scene_id="93f59740-4b65-4e8b-8a0f-6420b339469d/room_4" # preprocessed scene python python scripts/train_texture.py --config config/template.yaml --stamp $stamp --log_dir $log_dir --prompt "$prompt" --scene_id "$scene_id"
We provide a template file for all critical parameters in config/template.yaml
. Please take a look at it in case you want to further costumize the optimization process.
Our method is of course not limited to 3D-FRONT synthetic scenes. It can also be applied to your own synthetic scenes, and even to real indoor scenes such as ScanNet or to outdoor scenes. We provide some cool results beyond 3D-FRONT scenes:
Here, we provide a thorough guideline for setting up the input data structure. On a high level, your data should be constructed under data/
like this:
data/
|-- <your-data-dir>/ # this is the root directory for your meshes
|-- <name-of-your-scene>/ # name your scene as you like, e.g. living_room/
|-- cameras/ # root dir of all pre-sampled cameras
|-- sphere.yaml # (if applicable) spherical cameras pointing at the scene center
|-- blender.json # (if applicable) interpolated cameras in the scene via Blender
|-- blenderproc.json # (if applicable) sampled cameras in the scene via BlenderProc
|-- meshes/ # root dir of all your mesh data
|-- stuff/ # dir of structural meshes, e.g. wall, floor, ceiling, etc.
|-- 0_wall.obj
|-- 0_wall.mtl # note .mtl is not necessary - we only support .obj with single material
|-- ...
|-- (or simply use a composed 0_room.obj for the whole scene structure)
|-- things/ # dir of object meshes, e.g. table, chair, lamp, etc.
|-- 1_table.obj
|-- 1_table.mtl
|-- ...
|-- scene_config.json # configuration file, see details below
|-- scene.obj # (if applicable) a composed .obj file for the whole scene,
|-- scene.mtl # (if applicable) a scene material, note only a single material is supported
|-- (provide scene.obj and scene.mtl if the instance segmentations are not available)
We provide three types of the pre-sampled cameras: spherical cameras, Blender cameras, and BlenderProc. We recommend the spherical cameras as the default cameras for its wider coverage of the scene surface. The other two can be additionally applied when needed. We assume Y is up and -Z is forward.
The camera parameters should be defined in sphere.yaml
as the following example:
# sphere camera space dist: # distance to the sphere center min: 0.5 # min and max are usually set to the same value max: 0.5 num_linspace: 1 # sphere diameter is recommended to remain unchanged elev: # elevations from XZ-plane min: -30 max: 30 num_linspace: 10 # number of evevations between min and max azim: # azimuths to -Z min: -180 max: 180 num_linspace: 100 # number of azimuths between min and max fov: # field-of-views min: 45 max: 75 num_linspace: 5 # number of field-of-view between min and max at: [[3.0, 0.75, -0.4]] # sphere center (not necessarily the scene center)
Please note all parameters should be defined according to your own data. It's recommended to check the measure info of scene mesh in MeshLab first.
Interpolate cameras from selected Blender keyframes are much straightforward in terms of visualization. Please refer to online tutorials of Blender keyframes for more info. We provide a python script for saving the interpolated Blender cameras in tools/save_blender_cameras.py
. To apply it, please copy and paste this script in Blender (new script in Scripting
).
The Blender cameras should be saved under cameras/
and renamed to blender.json
.
To avoid all manual efforts, we also support automatically sampled cameras from BlenderProc scripts. All cameras are randomly sampled in the scene based on a pre-defined sampling rule, such as heights from the ground, number of visible instances, etc.. Please refer to this tutorial for more info. Note that you might have to flip/rotate your mesh first.
The Blender cameras should be saved under cameras/
and renamed to blenderproc.json
.
All mesh data should be constructed as described above. Structural .obj files can be composed to a single 0_room.obj
for simplicity. If you don't have the segmented objects for the scene, you can also put a single scene.obj
there. Please note we only support a single material for each input .obj file. We only support triangular meshes.
No matter how you construct the input mesh data, it's critical to define all meshes in the scene_config.json
file. Here, we provide an example for it:
{ "0": { "name": "room", # name of the object "type": "stuff", # type of the object "path": "data/examples/living_room/meshes/stuff/0_room.obj", # path to the object "prompt": "a living room" # description of the object }, "1": { "name": "table", "type": "things", "path": "data/examples/living_room/meshes/things/1_table.obj", "prompt": "a table" }, "2": { "name": "lamp", "type": "things", "path": "data/examples/living_room/meshes/things/2_lamp.obj", "prompt": "a lamp" } }
If you only have a mesh without segmentations for the whole scene, you can simply define the scene as:
{ "0": { "name": "room", "type": "stuff", "path": "data/examples/meshes/scene.obj", # everything is composed to this single .obj file "prompt": "a room" } }
This is quite flexible especially when you want to texture a reconstructed scene such as ScanNet.
After the input mesh data is set up, you should adjust all critical parameters in config/template.yaml
. Most importantly, you should define which cameras you want to use, and all path info at the end of the YAML file.
Then, you can wrap up everything by putting the following lines into a shell script:
stamp=$(date "+%Y-%m-%d_%H-%M-%S") log_dir="" # TODO input your output dir prompt="" # TODO input your prompt scene_id="" # TODO input <name-of-your-scene> python python scripts/train_texture.py --config config/template.yaml --stamp $stamp --log_dir $log_dir --prompt "$prompt" --scene_id "$scene_id"
Now everything is in place. Let's run it!
If you found our work helpful, please kindly cite this papers:
@misc{chen2023scenetex, title={SceneTex: High-Quality Texture Synthesis for Indoor Scenes via Diffusion Priors}, author={Dave Zhenyu Chen and Haoxuan Li and Hsin-Ying Lee and Sergey Tulyakov and Matthias Nießner}, year={2023}, eprint={2311.17261}, archivePrefix={arXiv}, primaryClass={cs.CV} }
We would like to thank yuanzhi-zhu/prolific_dreamer2d for providing such a great and powerful codebase for variational score distillation.
SceneTex is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Copyright (c) 2023 Dave Zhenyu Chen, Haoxuan Li, Hsin-Ying Lee, Sergey Tulyakov, and Matthias
AI小说写作助手,一站式润色、改写、扩写
蛙蛙写作—国内先进的AI写作平台,涵盖小说、学术、社交媒体等多场景。提供续写、改写、润色等功能,助力创作者高效优化写作流程。界面简洁,功能全面,适合各类写作者提升内容品质和工作效率。
字节跳动发布的AI编程神器IDE
Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。
全能AI智能助手,随时解答生活与工作的多样问题
问小白,由元石科技研发的AI智能助手,快速准确地解答各种生活和工作问题,包括但不限于搜索、规划和社交互动,帮助用户在日常生活中提高效率,轻松管理个人事务。
实时语音翻译/同声传译工具
Transly是一个多场景的AI大语言模型驱动的同声传译、专业翻译助手,它拥有超精准的音频识别翻译能力,几乎零延迟的使用体验和支持多国语言可以让你带它走遍全球,无论你是留学生、商务人士、韩剧美剧爱好者,还是出国游玩、多国会议、跨国追星等等,都可以满足你所有需要同传的场景需求,线上线下通用,扫除语言障碍,让全世界的语言交流不再有国界。
一键生成PPT和Word,让学习生活更轻松
讯飞智文是一个利用 AI 技术的项目,能够帮助用户生成 PPT 以及各类文档。无论是商业领域的市场分析报告、年度目标制定,还是学生群体的职业生涯规划、实习避坑指南,亦或是活动策划、旅游攻略等内容,它都能提供支持,帮助用户精准表达,轻松呈现各种信息。
深度推理能力全新升级,全面对标OpenAI o1
科大讯飞的星火大模型,支持语言理解、知识问答和文本创作等多功能,适用于多种文件和业务场景,提升办公和日常生活的效率。讯飞星火是一个提供丰富智能服务的平台,涵盖科技资讯、图像创作、写作辅助、编程解答、科研文献解读等功能,能为不同需求的用户提供便捷高效的帮助,助力用户轻松获取信息、解决问题,满足多样化使用场景。
一种基于大语言模型的高效单流解耦语音令牌文本到语音合成模型
Spark-TTS 是一个基于 PyTorch 的开源文本到语音合成项目,由多个知名机构联合参与。该项目提供了高效的 LLM(大语言模型)驱动的语音合成方案,支持语音克隆和语音创建功能,可通过命令行界面(CLI)和 Web UI 两种方式使用。用 户可以根据需求调整语音的性别、音高、速度等参数,生成高质量的语音。该项目适用于多种场景,如有声读物制作、智能语音助手开发等。
AI助力,做PPT更简单!
咔片是一款轻量化在线演示设计工具,借助 AI 技术,实现从内容生成到智能设计的一站式 PPT 制作服务。支持多种文档格式导入生成 PPT,提供海量模板、智能美化、素材替换等功能,适用于销售、教师、学生等各类人群,能高效制作出高品质 PPT,满足不同场景演示需求。
选题、配图、成文,一站式创作,让内容运营更高效
讯飞绘文,一个AI集成平台,支持写作、选题、配图、排版和发布。高效生成适用于各类媒体的定制内容,加速品牌传播,提升内容营销效果。
专业的AI公文写作平台,公文写作神器
AI 材料星,专业的 AI 公文写作辅助平台,为体制内工作人员提供高效的公文写作解决方案。拥有海量公文文库、9 大核心 AI 功能,支持 30 + 文稿类型生成,助力快速完成领导讲话、工作总结、述职报告等材料,提升办公效率,是体制打工人的得力写作神器。
最新AI工具、AI资讯
独家AI资源、AI项目落地
微信扫一扫关注公众号