Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
from gradio.components import File as InputFile
|
3 |
from gradio.components import File as OutputFile
|
|
|
4 |
from urllib.parse import urlparse
|
5 |
import ifcopenshell
|
6 |
import ifcopenshell.api
|
@@ -37,7 +38,8 @@ def getProps(ifc_file_path):
|
|
37 |
|
38 |
df_transposed.to_excel(ifc_file_path.name.replace(".ifc", ".xlsx"), engine='openpyxl')
|
39 |
|
40 |
-
|
|
|
41 |
|
42 |
iface = gr.Interface(
|
43 |
fn=getProps,
|
@@ -45,7 +47,8 @@ iface = gr.Interface(
|
|
45 |
InputFile(label="Upload IFC File"),
|
46 |
],
|
47 |
outputs=[
|
48 |
-
OutputFile(label="Download XLSX")
|
|
|
49 |
],
|
50 |
title="IFC Model Properties Extractor",
|
51 |
description="Upload an IFC file to process and download the resulting XLSX file."
|
|
|
1 |
import gradio as gr
|
2 |
from gradio.components import File as InputFile
|
3 |
from gradio.components import File as OutputFile
|
4 |
+
from gradio.components import Dataframe as OutputDataframe
|
5 |
from urllib.parse import urlparse
|
6 |
import ifcopenshell
|
7 |
import ifcopenshell.api
|
|
|
38 |
|
39 |
df_transposed.to_excel(ifc_file_path.name.replace(".ifc", ".xlsx"), engine='openpyxl')
|
40 |
|
41 |
+
df_transposed_reset = df_transposed.reset_index()
|
42 |
+
return ifc_file_path.name.replace(".ifc", ".xlsx"), df_transposed_reset
|
43 |
|
44 |
iface = gr.Interface(
|
45 |
fn=getProps,
|
|
|
47 |
InputFile(label="Upload IFC File"),
|
48 |
],
|
49 |
outputs=[
|
50 |
+
OutputFile(label="Download XLSX"),
|
51 |
+
OutputDataframe(label="IFC Property Sets")
|
52 |
],
|
53 |
title="IFC Model Properties Extractor",
|
54 |
description="Upload an IFC file to process and download the resulting XLSX file."
|