{"id":18914140,"url":"https://github.com/buaacyw/meshanythingv2","last_synced_at":"2025-05-15T10:00:52.161Z","repository":{"id":251794327,"uuid":"838412119","full_name":"buaacyw/MeshAnythingV2","owner":"buaacyw","description":"From anything to mesh like human artists. Official impl. of \"MeshAnything V2: Artist-Created Mesh Generation With Adjacent Mesh Tokenization\"","archived":false,"fork":false,"pushed_at":"2025-04-28T16:36:51.000Z","size":16932,"stargazers_count":807,"open_issues_count":15,"forks_count":44,"subscribers_count":21,"default_branch":"main","last_synced_at":"2025-04-28T17:44:25.687Z","etag":null,"topics":["3d","3d-generation","generative-model","mesh","transformers"],"latest_commit_sha":null,"homepage":"https://buaacyw.github.io/meshanything-v2/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/buaacyw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-05T15:32:03.000Z","updated_at":"2025-04-28T16:36:56.000Z","dependencies_parsed_at":"2024-08-25T06:33:08.223Z","dependency_job_id":"b2a1a879-02e3-4191-9d80-563629595f49","html_url":"https://github.com/buaacyw/MeshAnythingV2","commit_stats":{"total_commits":23,"total_committers":2,"mean_commits":11.5,"dds":"0.21739130434782605","last_synced_commit":"c9e1a724f0c5a1b8526516a6f218c0bb3b8d1d62"},"previous_names":["buaacyw/meshanythingv2"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buaacyw%2FMeshAnythingV2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buaacyw%2FMeshAnythingV2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buaacyw%2FMeshAnythingV2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buaacyw%2FMeshAnythingV2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/buaacyw","download_url":"https://codeload.github.com/buaacyw/MeshAnythingV2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254319715,"owners_count":22051072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d","3d-generation","generative-model","mesh","transformers"],"created_at":"2024-11-08T10:10:22.170Z","updated_at":"2025-05-15T10:00:51.396Z","avatar_url":"https://github.com/buaacyw.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ch3 align=\"center\"\u003e\u003cstrong\u003eMeshAnything V2:\u003cbr\u003e Artist-Created Mesh Generation\u003cbr\u003eWith Adjacent Mesh Tokenization\u003c/strong\u003e\u003c/h3\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://buaacyw.github.io/\"\u003eYiwen Chen\u003c/a\u003e\u003csup\u003e1,2\u003c/sup\u003e,\n    \u003ca href=\"https://yikaiw.github.io/\"\u003eYikai Wang\u003c/a\u003e\u003csup\u003e3\u003c/sup\u003e\u003cspan class=\"note\"\u003e*\u003c/span\u003e,\n    \u003ca href=\"https://github.com/Luo-Yihao\"\u003eYihao Luo\u003c/a\u003e\u003csup\u003e4\u003c/sup\u003e,\n    \u003ca href=\"https://thuwzy.github.io/\"\u003eZhengyi Wang\u003c/a\u003e\u003csup\u003e2,3\u003c/sup\u003e,\n    \u003cbr\u003e\n    \u003ca href=\"https://scholar.google.com/citations?user=2pbka1gAAAAJ\u0026hl=en\"\u003eZilong Chen\u003c/a\u003e\u003csup\u003e2,3\u003c/sup\u003e,\n    \u003ca href=\"https://ml.cs.tsinghua.edu.cn/~jun/index.shtml\"\u003eJun Zhu\u003c/a\u003e\u003csup\u003e2,3\u003c/sup\u003e,\n    \u003ca href=\"https://icoz69.github.io/\"\u003eChi Zhang\u003c/a\u003e\u003csup\u003e5\u003c/sup\u003e\u003cspan class=\"note\"\u003e*\u003c/span\u003e,\n    \u003ca href=\"https://guosheng.github.io/\"\u003eGuosheng Lin\u003c/a\u003e\u003csup\u003e1\u003c/sup\u003e\u003cspan class=\"note\"\u003e*\u003c/span\u003e\n    \u003cbr\u003e\n    \u003csup\u003e*\u003c/sup\u003eCorresponding authors.\n    \u003cbr\u003e\n    \u003csup\u003e1\u003c/sup\u003eS-Lab, Nanyang Technological University,\n    \u003csup\u003e2\u003c/sup\u003eShengshu,\n    \u003cbr\u003e\n    \u003csup\u003e3\u003c/sup\u003eTsinghua University,\n    \u003csup\u003e4\u003c/sup\u003eImperial College London,\n    \u003csup\u003e5\u003c/sup\u003eWestlake University\n\u003c/p\u003e\n\n\n\n\u003cdiv align=\"center\"\u003e\n\n\u003ca href='https://arxiv.org/abs/2408.02555'\u003e\u003cimg src='https://img.shields.io/badge/arXiv-2408.02555-b31b1b.svg'\u003e\u003c/a\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n \u003ca href='https://buaacyw.github.io/meshanything-v2/'\u003e\u003cimg src='https://img.shields.io/badge/Project-Page-Green'\u003e\u003c/a\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n\u003ca href=\"https://huggingface.co/Yiwen-ntu/MeshAnythingV2/tree/main\"\u003e\u003cimg src=\"https://img.shields.io/badge/%F0%9F%A4%97%20Weights-HF-orange\"\u003e\u003c/a\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n\u003ca href=\"https://huggingface.co/spaces/Yiwen-ntu/MeshAnythingV2\"\u003e\u003cimg src=\"https://img.shields.io/badge/%F0%9F%A4%97%20Gradio%20Demo-HF-orange\"\u003e\u003c/a\u003e\n\n\u003c/div\u003e\n\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"demo/demo_video.gif\" alt=\"Demo GIF\" width=\"512px\" /\u003e\n\u003c/p\u003e\n\n\n## Contents\n- [Contents](#contents)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Training](#training)\n- [Important Notes](#important-notes)\n- [Acknowledgement](#acknowledgement)\n- [BibTeX](#bibtex)\n\n## Installation\nOur environment has been tested on Ubuntu 22, CUDA 11.8 with A800.\n1. Clone our repo and create conda environment\n```\ngit clone https://github.com/buaacyw/MeshAnythingV2.git \u0026\u0026 cd MeshAnythingV2\nconda create -n MeshAnythingV2 python==3.10.13 -y\nconda activate MeshAnythingV2\npip install torch==2.1.1 torchvision==0.16.1 torchaudio==2.1.1 --index-url https://download.pytorch.org/whl/cu118\npip install -r requirements.txt\npip install -r training_requirements.txt # in case you want to train\npip install flash-attn --no-build-isolation\npip install -U gradio\n```\n\n## Usage\n\n### Implementation of Adjacent Mesh Tokenization and Detokenization\n```\n# We release our adjacent mesh tokenization implementation in adjacent_mesh_tokenization.py.\n# For detokenization please check the function adjacent_detokenize in MeshAnything/models/meshanything_v2.py\npython adjacent_mesh_tokenization.py\n```\n\n\n### For text/image to Artist-Create Mesh. We suggest using [Rodin](https://hyperhuman.deemos.com/rodin) to first achieve text or image to dense mesh. And then input the dense mesh to us.\n```\n# Put the output obj file of Rodin to rodin_result and using the following command to generate the Artist-Created Mesh.\n# We suggest using the --mc flag to preprocess the input mesh with Marching Cubes first. This helps us to align the inference point cloud to our training domain.\npython main.py --input_dir rodin_result --out_dir mesh_output --input_type mesh --mc\n```\n\n### Mesh Command line inference\n#### Important Notes: If your mesh input is not produced by Marching Cubes, We suggest you to preprocess the mesh with Marching Cubes first (simply by adding --mc).\n```\n# folder input\npython main.py --input_dir examples --out_dir mesh_output --input_type mesh\n\n# single file input\npython main.py --input_path examples/wand.obj --out_dir mesh_output --input_type mesh\n\n# Preprocess with Marching Cubes first\npython main.py --input_dir examples --out_dir mesh_output --input_type mesh --mc\n\n# The mc resolution is default to be 128. For some delicate mesh, this resolution is not sufficient. Raise this resolution takes more time to preprocess but should achieve a better result.\n# Change it by : --mc_level 7 -\u003e 128 (2^7), --mc_level 8 -\u003e 256 (2^8).\n# 256 resolution Marching Cube example.\npython main.py --input_dir examples --out_dir mesh_output --input_type mesh --mc --mc_level 8\n```\n\n### Point Cloud Command line inference\n```\n# Note: if you want to use your own point cloud, please make sure the normal is included.\n# The file format should be a .npy file with shape (N, 6), where N is the number of points. The first 3 columns are the coordinates, and the last 3 columns are the normal.\n\n# inference for folder\npython main.py --input_dir pc_examples --out_dir pc_output --input_type pc_normal\n\n# inference for single file\npython main.py --input_path pc_examples/grenade.npy --out_dir pc_output --input_type pc_normal\n```\n\n### Local Gradio Demo \u003ca href='https://github.com/gradio-app/gradio'\u003e\u003cimg src='https://img.shields.io/github/stars/gradio-app/gradio'\u003e\u003c/a\u003e\n```\npython app.py\n```\n\n## Training\n\n### Step 1 Download Dataset\nWe provide part of our processed dataset from Objaverse. You can download it from https://huggingface.co/datasets/Yiwen-ntu/MeshAnythingV2/tree/main\n\nAfter downloading, place `train.npz` and `test.npz` into the `dataset` directory.\n\nIf you prefer to process your own data, please refer to `data_process.py`.\n\n### Step 2 Download Point Cloud Encoder Checkpoints\n\nDownload Michelangelo's point encoder from https://huggingface.co/Maikou/Michelangelo/tree/main/checkpoints/aligned_shape_latents and put it into `meshanything_train/miche/checkpoints/aligned_shape_latents/shapevae-256.ckpt`.\n\n### Step 3 Training and Evaluation\n```\n# Training with MultiGPU\naccelerate launch --multi_gpu --num_processes 8 train.py  --batchsize_per_gpu 2 --checkpoint_dir training_trial\n\n# Evaluation\npython train.py --batchsize_per_gpu 2 --checkpoint_dir evaluation_trial --pretrained_weights gpt_output/training_trial/xxx_xxx.pth --test_only\n```\n\n## Important Notes\n- It takes about 8GB and 45s to generate a mesh on an A6000 GPU (depending on the face number of the generated mesh).\n- The input mesh will be normalized to a unit bounding box. The up vector of the input mesh should be +Y for better results.\n- Limited by computational resources, MeshAnything is trained on meshes with fewer than 1600 faces and cannot generate meshes with more than 1600 faces. The shape of the input mesh should be sharp enough; otherwise, it will be challenging to represent it with only 1600 faces. Thus, feed-forward 3D generation methods may often produce bad results due to insufficient shape quality. We suggest using results from 3D reconstruction, scanning, SDS-based method (like [DreamCraft3D](https://github.com/deepseek-ai/DreamCraft3D)) or [Rodin](https://hyperhuman.deemos.com/rodin) as the input of MeshAnything.\n- Please refer to https://huggingface.co/spaces/Yiwen-ntu/MeshAnything/tree/main/examples for more examples.\n\n## Acknowledgement\n\nOur code is based on these wonderful repos:\n\n* [MeshAnything](https://github.com/buaacyw/MeshAnything)\n* [MeshGPT](https://nihalsid.github.io/mesh-gpt/)\n* [meshgpt-pytorch](https://github.com/lucidrains/meshgpt-pytorch)\n* [Michelangelo](https://github.com/NeuralCarver/Michelangelo)\n* [transformers](https://github.com/huggingface/transformers)\n* [vector-quantize-pytorch](https://github.com/lucidrains/vector-quantize-pytorch)\n\n## BibTeX\n```\n@misc{chen2024meshanythingv2artistcreatedmesh,\n      title={MeshAnything V2: Artist-Created Mesh Generation With Adjacent Mesh Tokenization}, \n      author={Yiwen Chen and Yikai Wang and Yihao Luo and Zhengyi Wang and Zilong Chen and Jun Zhu and Chi Zhang and Guosheng Lin},\n      year={2024},\n      eprint={2408.02555},\n      archivePrefix={arXiv},\n      primaryClass={cs.CV},\n      url={https://arxiv.org/abs/2408.02555}, \n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuaacyw%2Fmeshanythingv2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuaacyw%2Fmeshanythingv2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuaacyw%2Fmeshanythingv2/lists"}