themanfrom commited on
Commit
22de241
·
1 Parent(s): 16812a5

initial commit

Browse files
Files changed (1) hide show
  1. app.py +37 -56
app.py CHANGED
@@ -244,73 +244,64 @@ def make3d(images):
244
 
245
 
246
  _HEADER_ = '''
247
- <h2><b>Official 🤗 Gradio Demo</b></h2><h2><a href='https://github.com/TencentARC/InstantMesh' target='_blank'><b>InstantMesh: Efficient 3D Mesh Generation from a Single Image with Sparse-view Large Reconstruction Models</b></a></h2>
 
248
 
249
- **InstantMesh** is a feed-forward framework for efficient 3D mesh generation from a single image based on the LRM/Instant3D architecture.
 
 
250
 
251
- Code: <a href='https://github.com/TencentARC/InstantMesh' target='_blank'>GitHub</a>. Techenical report: <a href='https://arxiv.org/abs/2404.07191' target='_blank'>ArXiv</a>.
 
 
 
 
 
 
 
252
 
253
- ❗️❗️❗️**Important Notes:**
254
- - Our demo can export a .obj mesh with vertex colors or a .glb mesh now. If you prefer to export a .obj mesh with a **texture map**, please refer to our <a href='https://github.com/TencentARC/InstantMesh?tab=readme-ov-file#running-with-command-line' target='_blank'>Github Repo</a>.
255
- - The 3D mesh generation results highly depend on the quality of generated multi-view images. Please try a different **seed value** if the result is unsatisfying (Default: 42).
256
  '''
257
 
258
  _CITE_ = r"""
259
- If InstantMesh is helpful, please help to ⭐ the <a href='https://github.com/TencentARC/InstantMesh' target='_blank'>Github Repo</a>. Thanks! [![GitHub Stars](https://img.shields.io/github/stars/TencentARC/InstantMesh?style=social)](https://github.com/TencentARC/InstantMesh)
260
- ---
261
- 📝 **Citation**
262
-
263
- If you find our work useful for your research or applications, please cite using this bibtex:
264
- ```bibtex
265
- @article{xu2024instantmesh,
266
- title={InstantMesh: Efficient 3D Mesh Generation from a Single Image with Sparse-view Large Reconstruction Models},
267
- author={Xu, Jiale and Cheng, Weihao and Gao, Yiming and Wang, Xintao and Gao, Shenghua and Shan, Ying},
268
- journal={arXiv preprint arXiv:2404.07191},
269
- year={2024}
270
- }
271
- ```
272
-
273
- 📋 **License**
274
 
275
- Apache-2.0 LICENSE. Please refer to the [LICENSE file](https://huggingface.co/spaces/TencentARC/InstantMesh/blob/main/LICENSE) for details.
276
 
277
- 📧 **Contact**
278
-
279
- If you have any questions, feel free to open a discussion or contact us at <b>[email protected]</b>.
280
  """
281
 
 
282
 
283
- with gr.Blocks() as demo:
284
  gr.Markdown(_HEADER_)
285
  with gr.Row(variant="panel"):
286
  with gr.Column():
287
  with gr.Row():
288
  input_image = gr.Image(
289
- label="Input Image",
290
  image_mode="RGBA",
291
  sources="upload",
292
- #width=256,
293
- #height=256,
294
  type="pil",
295
  elem_id="content_image",
296
  )
297
  processed_image = gr.Image(
298
- label="Processed Image",
299
- image_mode="RGBA",
300
- #width=256,
301
- #height=256,
302
- type="pil",
303
  interactive=False
304
  )
305
  with gr.Row():
306
  with gr.Group():
307
  do_remove_background = gr.Checkbox(
308
- label="Remove Background", value=True
 
 
 
 
 
309
  )
310
- sample_seed = gr.Number(value=42, label="Seed Value", precision=0)
311
-
312
  sample_steps = gr.Slider(
313
- label="Sample Steps",
314
  minimum=30,
315
  maximum=75,
316
  value=75,
@@ -322,11 +313,9 @@ with gr.Blocks() as demo:
322
 
323
  with gr.Row(variant="panel"):
324
  gr.Examples(
325
- examples=[
326
- os.path.join("examples", img_name) for img_name in sorted(os.listdir("examples"))
327
- ],
328
  inputs=[input_image],
329
- label="Examples",
330
  cache_examples=False,
331
  examples_per_page=16
332
  )
@@ -337,36 +326,28 @@ with gr.Blocks() as demo:
337
 
338
  with gr.Column():
339
  mv_show_images = gr.Image(
340
- label="Generated Multi-views",
341
  type="pil",
342
  width=379,
343
  interactive=False
344
  )
345
 
346
- # with gr.Column():
347
- # output_video = gr.Video(
348
- # label="video", format="mp4",
349
- # width=379,
350
- # autoplay=True,
351
- # interactive=False
352
- # )
353
-
354
  with gr.Row():
355
  with gr.Tab("OBJ"):
356
  output_model_obj = gr.Model3D(
357
- label="Output Model (OBJ Format)",
358
  interactive=False,
359
  )
360
- gr.Markdown("Note: Downloaded .obj model will be flipped. Export .glb instead or manually flip it before usage.")
361
  with gr.Tab("GLB"):
362
  output_model_glb = gr.Model3D(
363
- label="Output Model (GLB Format)",
364
  interactive=False,
365
  )
366
- gr.Markdown("Note: The model shown here has a darker appearance. Download to get correct results.")
367
 
368
  with gr.Row():
369
- gr.Markdown('''Try a different <b>seed value</b> if the result is unsatisfying (Default: 42).''')
370
 
371
  gr.Markdown(_CITE_)
372
 
 
244
 
245
 
246
  _HEADER_ = '''
247
+ <h2><b>🚀 LUNAAR: Fotoğraftan Anında 3D Model Üretimi</b></h2>
248
+ LUNAAR, yüklediğiniz tek bir fotoğrafla hızlı ve yüksek doğrulukta 3D modeller oluşturan yenilikçi bir platformdur. Hem ürün görselleştirmesi hem de artırılmış gerçeklik (AR) deneyimlerine anında geçiş sağlar. 🛋️
249
 
250
+ 🔧 **Nasıl Çalışır?**
251
+ - Fotoğrafınızı yükleyin. Yapay zeka arka planı otomatik temizler, eksik açılardan görünüm oluşturur.
252
+ - Dakikalar içinde .OBJ ve .GLB formatlarında tam 3D model elde edin.
253
 
254
+ 💡 **Neden LUNAAR?**
255
+ - **Yüksek Hız ve Doğruluk:** Tek bir fotoğrafla hızlı ve hassas 3D modelleme imkanı.
256
+ - **Kapsamlı Uygulama Alanları:** AR entegrasyonu sayesinde e-ticaret, mimari ve ürün tasarımı gibi farklı sektörlere kolayca adapte edilebilir.
257
+ - **Kolay Kullanım:** Gelişmiş yapay zeka teknolojimiz sayesinde profesyonel düzeyde modeller oluşturmak artık herkesin erişiminde.
258
+
259
+ 💡 **Dikkat Edilmesi Gerekenler:**
260
+ - Sonuçlar fotoğraf kalitesine bağlıdır. En iyi sonuçları almak için farklı **tohum değerlerini** deneyin (Varsayılan: 42).
261
+ - Platformumuz, 3D modelleri hızlı bir şekilde dışa aktarmanızı ve AR için hazır hale getirmenizi sağlar.
262
 
 
 
 
263
  '''
264
 
265
  _CITE_ = r"""
266
+ LUNAAR'ı beğendiyseniz, lütfen destekleyin. Teşekkürler!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
267
 
268
+ 📧 **İletişim**
269
 
270
+ Sorularınız mı var? Bize <b>[email protected]</b> üzerinden ulaşabilirsiniz.
 
 
271
  """
272
 
273
+ theme = gr.themes.Base()
274
 
275
+ with gr.Blocks(theme=theme) as demo:
276
  gr.Markdown(_HEADER_)
277
  with gr.Row(variant="panel"):
278
  with gr.Column():
279
  with gr.Row():
280
  input_image = gr.Image(
281
+ label="Yüklenen Görsel",
282
  image_mode="RGBA",
283
  sources="upload",
 
 
284
  type="pil",
285
  elem_id="content_image",
286
  )
287
  processed_image = gr.Image(
288
+ label="İşlenmiş Görsel",
289
+ image_mode="RGBA",
290
+ type="pil",
 
 
291
  interactive=False
292
  )
293
  with gr.Row():
294
  with gr.Group():
295
  do_remove_background = gr.Checkbox(
296
+ label="Arka Planı Kaldır",
297
+ value=True
298
+ )
299
+ sample_seed = gr.Number(
300
+ value=42, label="Tohum Değeri",
301
+ precision=0
302
  )
 
 
303
  sample_steps = gr.Slider(
304
+ label="Örnekleme Adımları",
305
  minimum=30,
306
  maximum=75,
307
  value=75,
 
313
 
314
  with gr.Row(variant="panel"):
315
  gr.Examples(
316
+ examples=[os.path.join("examples", img_name) for img_name in sorted(os.listdir("examples"))],
 
 
317
  inputs=[input_image],
318
+ label="Örnekler",
319
  cache_examples=False,
320
  examples_per_page=16
321
  )
 
326
 
327
  with gr.Column():
328
  mv_show_images = gr.Image(
329
+ label="Oluşturulan Çoklu Görünüm",
330
  type="pil",
331
  width=379,
332
  interactive=False
333
  )
334
 
 
 
 
 
 
 
 
 
335
  with gr.Row():
336
  with gr.Tab("OBJ"):
337
  output_model_obj = gr.Model3D(
338
+ label="Çıktı Modeli (OBJ Formatı)",
339
  interactive=False,
340
  )
341
+ gr.Markdown("Not: İndirilen .obj modeli ters olabilir. Kullanımdan önce manuel çevirin veya .glb formatında dışa aktarın.")
342
  with gr.Tab("GLB"):
343
  output_model_glb = gr.Model3D(
344
+ label="Çıktı Modeli (GLB Formatı)",
345
  interactive=False,
346
  )
347
+ gr.Markdown("Not: Model burada daha koyu görünebilir. Doğru sonuçlar için indirip kontrol edin.")
348
 
349
  with gr.Row():
350
+ gr.Markdown('''Sonuç tatmin edici değilse, farklı bir <b>tohum değeri</b> deneyin (Varsayılan: 42).''')
351
 
352
  gr.Markdown(_CITE_)
353