NicolasG2523 commited on
Commit
77488cd
verified
1 Parent(s): 6c455c6

Upload gradio_app.py

Browse files
Files changed (1) hide show
  1. gradio_app.py +5 -7
gradio_app.py CHANGED
@@ -368,7 +368,7 @@ def shape_generation(
368
  )
369
 
370
  def js_update(file):
371
- return f"<script>updateIframe('{file}');</script>"
372
 
373
  def build_app():
374
  title = 'Generaci贸n de modelo basado en im谩genes (de 1 a 4 vistas)'
@@ -647,12 +647,10 @@ if __name__ == '__main__':
647
  <div style='height: {650}px; width: 100%; border-radius: 8px; border-color: #e5e7eb; border-style: solid; border-width: 1px; display: flex; justify-content: center; align-items: center;'>
648
  <div style='text-align: center; font-size: 16px; color: #6b7280;'>
649
  <p style="color: #8d8d8d;">Bienvenido a 3DMarket</p>
650
- <iframe id="model_iframe" style="width:500px;height:500px;">
651
- <script type="module" src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js"></script>
652
- <model-viewer id="model_viewer" src="" camera-controls auto-rotate style="height:500px;width:500px;"></model-viewer>
653
- </iframe>
654
  <script>
655
- function updateIframe(srcUrl) {{
656
  document.getElementById('model_viewer').src = srcUrl;
657
  }}
658
  </script>
@@ -727,4 +725,4 @@ if __name__ == '__main__':
727
  if args.low_vram_mode:
728
  torch.cuda.empty_cache()
729
  demo = build_app()
730
- demo.launch(share=True)
 
368
  )
369
 
370
  def js_update(file):
371
+ return f"<script>updateModelViewer('https://nicolasg2523-picsto3d.hf.space/gradio_api/file={file}');</script>"
372
 
373
  def build_app():
374
  title = 'Generaci贸n de modelo basado en im谩genes (de 1 a 4 vistas)'
 
647
  <div style='height: {650}px; width: 100%; border-radius: 8px; border-color: #e5e7eb; border-style: solid; border-width: 1px; display: flex; justify-content: center; align-items: center;'>
648
  <div style='text-align: center; font-size: 16px; color: #6b7280;'>
649
  <p style="color: #8d8d8d;">Bienvenido a 3DMarket</p>
650
+ <script type="module" src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js"></script>
651
+ <model-viewer id="model_viewer" src="" camera-controls auto-rotate style="height:500px;width:500px;"></model-viewer>
 
 
652
  <script>
653
+ function updateModelViewer(srcUrl) {{
654
  document.getElementById('model_viewer').src = srcUrl;
655
  }}
656
  </script>
 
725
  if args.low_vram_mode:
726
  torch.cuda.empty_cache()
727
  demo = build_app()
728
+ demo.launch()