NicolasG2523 commited on
Commit
8e2338f
·
verified ·
1 Parent(s): 3a3690e

Upload gradio_app.py

Browse files
Files changed (1) hide show
  1. gradio_app.py +8 -6
gradio_app.py CHANGED
@@ -137,20 +137,22 @@ def build_model_viewer_html(save_folder, height=660, width=790, textured=False):
137
  with open(output_html_path, 'w', encoding='utf-8') as f:
138
  template_html = template_html.replace('#height#', f'{height - offset}')
139
  template_html = template_html.replace('#width#', f'{width}')
140
- template_html = template_html.replace('#src#', f'{related_path}/')
141
- #template_html = template_html.replace('#src#', f'{mesh_file_path}/')
142
- print(template_html)
143
  f.write(template_html)
144
 
145
- println(related_path)
146
- println(mesh_file_path)
147
- println(output_html_path)
148
 
149
  iframe_tag = f'<iframe src="file=https://nicolasg2523-picsto3d.hf.space/gradio_api/file=/tmp{output_html_path}" height="{height}" width="100%" frameborder="0"></iframe>'
150
 
151
  print(f'Find html file {output_html_path}, {os.path.exists(output_html_path)}')
152
  print(iframe_tag)
153
 
 
 
154
  return f"""
155
  <div style='height: {height}; width: 100%;'>
156
  {iframe_tag}
 
137
  with open(output_html_path, 'w', encoding='utf-8') as f:
138
  template_html = template_html.replace('#height#', f'{height - offset}')
139
  template_html = template_html.replace('#width#', f'{width}')
140
+ #template_html = template_html.replace('#src#', f'{related_path}/')
141
+ template_html = template_html.replace('#src#', f'{mesh_file_path}/')
142
+
143
  f.write(template_html)
144
 
145
+ print(related_path)
146
+ print(mesh_file_path)
147
+ print(output_html_path)
148
 
149
  iframe_tag = f'<iframe src="file=https://nicolasg2523-picsto3d.hf.space/gradio_api/file=/tmp{output_html_path}" height="{height}" width="100%" frameborder="0"></iframe>'
150
 
151
  print(f'Find html file {output_html_path}, {os.path.exists(output_html_path)}')
152
  print(iframe_tag)
153
 
154
+ print(template_html)
155
+
156
  return f"""
157
  <div style='height: {height}; width: 100%;'>
158
  {iframe_tag}