Skip to content

threedle/text2mesh

Repository files navigation

Text2Mesh [Project Page]

arXiv Pytorch crochet candle Text2Mesh is a method for text-driven stylization of a 3D mesh, as described in "Text2Mesh: Text-Driven Neural Stylization for Meshes" (forthcoming).

Getting Started

Installation

Note: The below installation will fail if run on something other than a CUDA GPU machine.

conda env create --file text2mesh.yml
conda activate text2mesh

System Requirements

  • Python 3.7
  • CUDA 10.2
  • GPU w/ minimum 8 GB ram

Remeshing

Since Text2Mesh displaces and colors each vertex, if ran on a mesh with large triangles the results won't look as clean. For example, the triangles on the seat of the mesh below are too large.

large-triangles

Therefore, if the input mesh has large triangles, make sure to run the following command, and then pass in the resulting object to Text2Mesh.

python3 remesh.py --obj_path [the mesh's path] --output_path [the full output path]

For example, to remesh a file name called chair.obj, the following command should be run.

python3 remesh.py --obj_path chair.obj --output_path chair-remesh.obj

Run examples

Call the below shell scripts to generate example styles.

# cobblestone alien
./demo/run_alien_cobble.sh
# shoe made of cactus 
./demo/run_shoe.sh
# lamp made of brick
./demo/run_lamp.sh
# ...

The outputs will be saved to results/demo, with the stylized .obj files, colored and uncolored render views, and screenshots during training.

Outputs

alien alien geometry alien style

alien alien geometry alien style

candle candle geometry candle style

person ninja geometry ninja style

shoe shoe geometry shoe style

vase vase geometry vase style

lamp lamp geometry lamp style

horse horse geometry horse style

Other implementations

Kaggle Notebook (by neverix)

Citation

@article{text2mesh,
    author = {Michel, Oscar
              and Bar-On, Roi
              and Liu, Richard
              and Benaim, Sagie
              and Hanocka, Rana
              },
    title = {Text2Mesh: Text-Driven Neural Stylization for Meshes},
    journal = {arXiv preprint arXiv:2112.03221},
    year  = {2021}
}