ThomasSimonini HF staff commited on
Commit
23c1970
1 Parent(s): c44fe06

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -21
app.py CHANGED
@@ -189,32 +189,26 @@ def do_inference(input_3d, sample_seed=0, do_sampling=False, do_marching_cubes=F
189
  return input_save_name, input_render_res, save_name, output_render
190
 
191
 
192
- _HEADER_ = '''
193
- <h2><b>Official 🤗 Gradio Demo</b></h2><h2><a href='https://github.com/buaacyw/MeshAnythingV2' target='_blank'><b>MeshAnything V2: Artist-Created Mesh Generation With Adjacent Mesh Tokenization</b></a></h2>
194
 
195
- For text/image to Artist-Created Mesh. We suggest first using <a href='https://hyperhuman.deemos.com/rodin' target='_blank'>Rodin</a> to achieve text/image to dense mesh and then input the dense mesh to us.
196
 
197
- **MeshAnythingV2** converts any 3D representation into meshes created by human artists, i.e., Artist-Created Meshes (AMs).
198
 
199
- Code: <a href='https://github.com/buaacyw/MeshAnythingV2' target='_blank'>GitHub</a>. Arxiv Paper: <a href='https://arxiv.org/abs/2406.10163' target='_blank'>ArXiv</a>.
200
 
201
- ❗️❗️❗️**Important Notes:**
202
- - Please Click on **Preprocess with Marching Cubes** if the input mesh is not produced by Marching Cubes.
203
- - Gradio doesn't support interactive wireframe rendering currently. For interactive mesh visualization, please use download the obj file and open it with MeshLab or https://3dviewer.net/.
204
- - The input mesh will be normalized to a unit bounding box. The up vector of the input mesh should be +Y for better results.
205
- - 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 image-to-3D methods may often produce bad results due to insufficient shape quality.
206
- - For point cloud input, please refer to our github repo <a href='https://github.com/buaacyw/MeshAnythingV2' target='_blank'>GitHub</a>.
207
- '''
208
 
 
 
209
 
210
- _CITE_ = r"""
211
- If MeshAnythingV2 is helpful, please help to ⭐ the <a href='https://github.com/buaacyw/MeshAnythingV2' target='_blank'>Github Repo</a>. Thanks!
212
- ---
213
- 📋 **License**
214
- MIT LICENSE.
215
- 📧 **Contact**
216
- If you have any questions, feel free to open a discussion or contact us at <b>yiwen002@e.ntu.edu.sg</b>.
217
  """
 
218
  output_model_obj = gr.Model3D(
219
  label="Generated Mesh (OBJ Format)",
220
  display_mode="wireframe",
@@ -276,8 +270,6 @@ with (gr.Blocks() as demo):
276
  with gr.Row():
277
  gr.Markdown('''Try click random sampling and different <b>Seed Value</b> if the result is unsatisfying''')
278
 
279
- gr.Markdown(_CITE_)
280
-
281
  mv_images = gr.State()
282
 
283
  submit.click(
 
189
  return input_save_name, input_render_res, save_name, output_render
190
 
191
 
192
+ _HEADER_ = """
193
+ ## Step 2: Simplify the generated 3D Mesh and Shader Smooth (optional)
194
 
195
+ ADD ILLUSTRATION
196
 
197
+ - The 3D Mesh Generated contains too much polygons, fortunately, we can use another AI model to help us optimize it.
198
 
199
+ - The model we use is called [MeshAnythingV2](https://huggingface.co/Yiwen-ntu/MeshAnythingV2).
200
 
201
+ - We can make the simplified mesh more smooth is to use Shader Smooth.
202
+
203
+ - You can usually do it in Blender, but we can do it directly here. Simply -> Shader Smooth.
204
+
205
+ ## 💡 Tips
 
 
206
 
207
+ - We don't click on Preprocess with marching Cubes, because in the last step the input mesh was produced by it.
208
+ - 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 image-to-3D methods may often produce bad results due to insufficient shape quality.
209
 
 
 
 
 
 
 
 
210
  """
211
+
212
  output_model_obj = gr.Model3D(
213
  label="Generated Mesh (OBJ Format)",
214
  display_mode="wireframe",
 
270
  with gr.Row():
271
  gr.Markdown('''Try click random sampling and different <b>Seed Value</b> if the result is unsatisfying''')
272
 
 
 
273
  mv_images = gr.State()
274
 
275
  submit.click(