This commit is contained in:
Huiwenshi
2025-06-14 14:53:27 +08:00
parent dd93e7ce4e
commit d575f308d0

22
demo.py
View File

@@ -18,17 +18,17 @@ except Exception as e:
print(f"Warning: Failed to apply torchvision fix: {e}") print(f"Warning: Failed to apply torchvision fix: {e}")
# shape # shape
#model_path = 'tencent/Hunyuan3D-2.1' model_path = 'tencent/Hunyuan3D-2.1'
#pipeline_shapegen = Hunyuan3DDiTFlowMatchingPipeline.from_pretrained(model_path) pipeline_shapegen = Hunyuan3DDiTFlowMatchingPipeline.from_pretrained(model_path)
##
#image_path = 'assets/demo.png' image_path = 'assets/demo.png'
#image = Image.open(image_path).convert("RGBA") image = Image.open(image_path).convert("RGBA")
#if image.mode == 'RGB': if image.mode == 'RGB':
# rembg = BackgroundRemover() rembg = BackgroundRemover()
# image = rembg(image) image = rembg(image)
#
#mesh = pipeline_shapegen(image=image)[0] mesh = pipeline_shapegen(image=image)[0]
#mesh.export('demo.glb') mesh.export('demo.glb')
# paint # paint
max_num_view = 6 # can be 6 to 9 max_num_view = 6 # can be 6 to 9