VecShape
VecShape generates a 3D mesh from a single image.
Install
Install from the VecShape source directory using Python 3.12 and CUDA 13.0.
pip install torch==2.14.1 torchvision==0.29.1 --index-url https://download.pytorch.org/whl/cu130
pip install packaging ninja wheel psutil
pip install --no-build-isolation 'flash-attn>=2.7,<3'
pip install -e .
Inference
from vecshape import VecShapePipeline
pipeline = VecShapePipeline.from_pretrained("wushuang98/VecShape").to("cuda")
mesh = pipeline(
image="input.png",
num_latents=4096,
num_inference_steps=50,
guidance_scale=5.0,
)
mesh.save_obj("output.obj")
from_pretrained also accepts a local model directory. The pipeline uses BiRefNet to segment RGB images and uses the supplied alpha channel for RGBA images. Adjust num_latents to choose the latent count. Mesh simplification is disabled by default.
Acknowledgements
We thank 3DShape2VecSet, Hunyuan3D-2.1, and FlashVDM for sharing their work.