[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-84046":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":24,"readmeContent":25,"aiSummary":10,"trendingCount":15,"starSnapshotCount":15,"syncStatus":14,"lastSyncTime":26,"discoverSource":27},84046,"meshflow","facebookresearch\u002Fmeshflow","facebookresearch","Repository for the CVPR 2026 paper MeshFlow Efficient Artistic Mesh Generation via MeshVAE and Flow-based Diffusion Transformer by Weiyu Li, Antoine Toisoul, Tom Monnier, Roman Shapovalov, Rakesh Ranjan, Ping Tan and Andrea Vedaldi.","",null,"Python",122,5,2,0,38,66,142,2.33,"Other",false,"main",[],"2026-06-12 02:04:37","\u003Cdiv align=\"center\">\n\u003Ch2>MeshFlow: Efficient Artistic Mesh Generation with MeshVAE and Flow-based Diffusion Transformer (CVPR 2026 Highlight)\u003C\u002Fh2>\n\n\u003Ca href=\"https:\u002F\u002Fmesh-flow.github.io\u002F\" target=\"_blank\" rel=\"noopener noreferrer\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=Project&message=Page&color=green&logo=github-pages\" alt=\"Project Page\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Ffacebook\u002Fmeshflow\" target=\"_blank\" rel=\"noopener noreferrer\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=Demo&message=HuggingFace&color=yellow&logo=huggingface\" alt=\"Hugging Face Demo\">\u003C\u002Fa>\n\n\u003Cp>\n  \u003Cspan class=\"author\">\u003Ca href=\"https:\u002F\u002Fwyysf-98.github.io\u002F\">Weiyu Li\u003C\u002Fa>\u003Csup>1,2\u003C\u002Fsup>\u003C\u002Fspan>\n  \u003Cspan class=\"author\">\u003Ca href=\"https:\u002F\u002Fwww.antoinetlc.com\u002F\">Antoine Toisoul\u003C\u002Fa>\u003Csup>1\u003C\u002Fsup>\u003C\u002Fspan>\n  \u003Cspan class=\"author\">\u003Ca href=\"https:\u002F\u002Fwww.tmonnier.com\u002F\">Tom Monnier\u003C\u002Fa>\u003Csup>1\u003C\u002Fsup>\u003C\u002Fspan>\n  \u003Cspan class=\"author\">\u003Ca href=\"https:\u002F\u002Frshapovalov.com\u002F\">Roman Shapovalov\u003C\u002Fa>\u003Csup>1\u003C\u002Fsup>\u003C\u002Fspan>\n  \u003Cbr>\n  \u003Cspan class=\"author\">\u003Ca href=\"https:\u002F\u002Fscholar.google.com\u002Fcitations?user=9rFaJIUAAAAJ\">Rakesh Ranjan\u003C\u002Fa>\u003Csup>1\u003C\u002Fsup>\u003C\u002Fspan>\n  \u003Cspan class=\"author\">\u003Ca href=\"https:\u002F\u002Fece.hkust.edu.hk\u002Fpingtan\">Ping Tan\u003C\u002Fa>\u003Csup>2\u003C\u002Fsup>\u003C\u002Fspan>\n  \u003Cspan class=\"author\">\u003Ca href=\"https:\u002F\u002Fwww.robots.ox.ac.uk\u002F~vedaldi\u002F\">Andrea Vedaldi\u003C\u002Fa>\u003Csup>1\u003C\u002Fsup>\u003C\u002Fspan>\n\u003C\u002Fp>\n\n**\u003Csup>1\u003C\u002Fsup>[Meta AI](https:\u002F\u002Fai.facebook.com\u002Fresearch\u002F)**; **\u003Csup>2\u003C\u002Fsup>[HKUST](https:\u002F\u002Fhkust.edu.hk\u002F)**\n\n\u003C\u002Fdiv>\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"assets\u002Fteaser.png\" alt=\"MeshFlow teaser\" width=\"100%\"\u002F>\n\u003C\u002Fp>\n\nMeshFlow generates artist-like meshes in **~1 second** with **MeshVAE** + **flow-matching DiT**, using input geometry and an optional reference image.\n\n## Pretrained models\n\nBefore running the code, download the MeshFlow checkpoint bundle and place it under `ckpt\u002Fmeshflow\u002F`:\n\n```\nckpt\u002Fmeshflow\u002F\n├── config.yaml\n└── model.pth\n```\n\nYou can also prepare the directory manually:\n\n```bash\nmkdir -p ckpt\u002Fmeshflow\n# download config.yaml and model.pth into ckpt\u002Fmeshflow\u002F\n```\n\n| Module | Role |\n| :--- | :--- |\n| **MeshFlowVAE** | Encodes mesh topology into continuous latents; decodes verts, normals, and adjacency |\n| **MeshFlowDiT** | Flow matching on latents with voxel RoPE + optional image cross-attention |\n| **DINOv3Encoder** | Visual tokens for optional reference-image conditioning |\n| **MeshFlowPipeline** | End-to-end: surface sampling → flow matching → VAE decode |\n\n### Image conditioning: DINOv3\n\nIf you use **reference-image conditioning** (`inference_dit.py --ref_image`, `pipeline.run(image=...)`, or the Gradio image upload), you also need to configure **DINOv3**. Mesh \u002F point-cloud-only inference does not load DINOv3.\n\n\u003Cdetails>\u003Csummary>\u003Cb>DINOv3 setup instructions\u003C\u002Fb>\u003C\u002Fsummary>\n\n1. **Clone the official repo** ([facebookresearch\u002Fdinov3](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fdinov3)) to the default `hub_dir`:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fdinov3.git \\\n  ~\u002F.cache\u002Ftorch\u002Fhub\u002Ffacebookresearch_dinov3_main\n```\n\n2. **Request and download backbone weights** following the [DINOv3 pretrained models guide](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fdinov3#pretrained-models). Access is granted via [Meta's DINOv3 download page](https:\u002F\u002Fai.meta.com\u002Fresources\u002Fmodels-and-libraries\u002Fdinov3-downloads\u002F); after approval you will receive download URLs by email. Use `wget` (not a web browser) to fetch the checkpoint matching your config (default: **`dinov3_vitl16`**).\n\n3. **Optional:** point MeshFlow to local weights in `ckpt\u002Fmeshflow\u002Fconfig.yaml` if the default Meta CDN download does not work in your environment:\n\n```yaml\nvisual_condition:\n  hub_model: dinov3_vitl16\n  hub_dir: \u002Froot\u002F.cache\u002Ftorch\u002Fhub\u002Ffacebookresearch_dinov3_main\n  hub_weights: \u002Fpath\u002Fto\u002Fdinov3_vitl16_pretrain_lvd1689m-8aa4cbdd.pth\n  pretrained: true\n  image_size: 512\n```\n\n`model.pth` does not bundle DINOv3 weights; the visual encoder backbone is loaded from the local DINOv3 hub checkout on first reference-image use.\n\n\u003C\u002Fdetails>\n\n## Quick Start\n\nFirst, clone this repository and install the dependencies:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fmeshflow.git\ncd meshflow\npip install -r requirements.txt\n```\n\nDownload the MeshFlow checkpoint into `ckpt\u002Fmeshflow\u002F` as described above.\n\nNow, try the model with a few lines of code:\n\n```python\nfrom meshflow.pipelines import MeshFlowPipeline\n\npipeline = MeshFlowPipeline.from_pretrained(\n    \"ckpt\u002Fmeshflow\",\n    device=\"cuda\",\n    dtype=\"fp16\",\n)\n\nmesh = pipeline.run(\n    mesh=\"path\u002Fto\u002Finput.ply\",       # mesh \u002F point cloud for RoPE geometry condition\n    image=None,                     # optional reference image (.png \u002F .jpg \u002F .webp)\n    steps=28,\n    guidance_scale=2.5,             # only effective when `image` is provided (CFG on visual cond)\n    seed=42,\n)\nmesh.to_trimesh().export(\"output.glb\")\n```\n\n## Interactive Demo\n\n**Online demo:** [facebook\u002Fmeshflow on Hugging Face Spaces](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Ffacebook\u002Fmeshflow)\n\nYou can also launch the Gradio demo locally:\n\n```bash\npython gradio_app.py --gpu 0 --dtype fp16\n```\n\nOmit `--model_path` to use local `ckpt\u002Fmeshflow\u002F` if present, otherwise download `config.yaml` and `model.pth` from [facebook\u002Fmeshflow](https:\u002F\u002Fhuggingface.co\u002Ffacebook\u002Fmeshflow) into `~\u002F.cache\u002Fmeshflow\u002F`. Or pass an explicit bundle path:\n\n```bash\npython gradio_app.py --model_path ckpt\u002Fmeshflow --num_verts 4096\n```\n\nUpload a mesh or point cloud for RoPE surface sampling, optionally add a reference image, and generate a new mesh in the browser. `torch.compile` is enabled by default on CUDA (`--no-compile` to disable). When the model config sets `denoiser_model.use_proj_cond_on_temb: true`, use the **num_verts** slider to send a DiT control signal that roughly controls generated mesh vertex count.\n\nMore results and method details are on the [project page](https:\u002F\u002Fmesh-flow.github.io\u002F).\n\n## Inference\n\n### VAE reconstruction\n\n```bash\npython inference_vae.py \\\n  --model_path ckpt\u002Fmeshflow \\\n  --input \u003Cmesh_file_or_dir> \\\n  --output outputs\u002Fmeshflow_vae\u002Frun1\n```\n\nOutputs: `inputs_meshes\u002F` (`.ply`), `vae_recon\u002F` (`.ply`).\n\nOptional: `--dtype bf16|fp16|fp32` (default: `fp16`).\n\n### DiT generation\n\n```bash\npython inference_dit.py \\\n  --model_path ckpt\u002Fmeshflow \\\n  --input \u003Cmesh_file_or_dir> \\\n  --ref_image \u003Cimage_file_or_dir> \\\n  --output outputs\u002Fmeshflow_dit\u002Frun1 \\\n  --steps 28 \\\n  --compile \\\n  --guidance_scale 2.5  # only when --ref_image is provided\n```\n\n`--ref_image` is optional — if omitted, a zero visual condition is used. When using a reference image, configure DINOv3 as described in [Pretrained models](#image-conditioning-dinov3).\n\nOutputs: `input_meshes\u002F`, `input_images\u002F` (when `--ref_image` is set), `surface_pc\u002F` (`.ply`), `rope_cond\u002F` (`.ply`), `generated_meshes\u002F` (`.glb`).\n\n| Flag | Description |\n|------|-------------|\n| `--model_path` | Directory with `config.yaml` + `model.pth` |\n| `--steps` | Sampling steps (default: from config) |\n| `--guidance_scale` | CFG on visual cond; only effective when `--ref_image` is set (default: from config) |\n| `--dtype` | Autocast dtype: `bf16`, `fp16`, or `fp32` (default: `fp16`) |\n| `--num_verts` | `proj_cond_on_temb` numerator (`num_verts \u002F mesh_model.num_latents` from config); roughly controls generated mesh resolution. Requires `use_proj_cond_on_temb` in config |\n| `--compile` | `torch.compile` on CUDA for faster inference (recommended; omit to disable) |\n| `--seed` | Random seed |\n\n## Evaluation\n\nChamfer and Hausdorff distances between GT and reconstructed meshes:\n\n```bash\npython evaluate.py \\\n  --gt_path outputs\u002Fmeshflow_vae\u002Frun1\u002Finputs_meshes \\\n  --pred_path outputs\u002Fmeshflow_vae\u002Frun1\u002Fvae_recon \\\n  --output_path outputs\u002Fmeshflow_vae\u002Frun1\u002Feval_results.txt\n```\n\n## Notes\n\n- Input meshes should respect the configured vertex budget (`mesh_model.num_latents`, 4096 by default). `--num_verts` is the DiT control numerator (`proj_cond_on_temb = num_verts \u002F num_latents`), only when `denoiser_model.use_proj_cond_on_temb` is enabled.\n- Optional RMBG matting is in `meshflow\u002Fpipelines\u002Futils.py`; enable with `MeshFlowPipeline(use_rmbg=True)`.\n\n## BibTeX\n\n```bibtex\n@inproceedings{li2026meshflow,\n  title={MeshFlow: Efficient Artistic Mesh Generation via MeshVAE and Flow-based Diffusion Transformer},\n  author={Li, Weiyu and Toisoul, Antoine and Monnier, Tom and Shapovalov, Roman and Ranjan, Rakesh and Tan, Ping and Vedaldi, Andrea},\n  booktitle={Proceedings of the IEEE\u002FCVF Conference on Computer Vision and Pattern Recognition (CVPR)},\n  year={2026},\n  note={Highlight}\n}\n```\n\n## License\n\nSee the [LICENSE](.\u002FLICENSE) file for details about the license under which this code is made available.\n","2026-06-11 04:12:10","CREATED_QUERY"]