trttung1610 commited on
Commit
fa181b0
·
1 Parent(s): 1a06aae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -118,7 +118,10 @@ def predict_house_area(room_id, excel_file, image_files):
118
  temp_file = "predicted_areas.xlsx"
119
  workbook.save(temp_file)
120
 
121
- return f"Sum of predicted house square footage: {total_area_sqm:.2f} square meters", temp_file
 
 
 
122
 
123
 
124
  inputs = [
@@ -129,7 +132,8 @@ inputs = [
129
 
130
  outputs = [
131
  gr.outputs.Textbox(label="Sum of Predicted House Square Footage"),
132
- gr.outputs.File(label="Excel Result")
 
133
  ]
134
 
135
  interface = gr.Interface(
 
118
  temp_file = "predicted_areas.xlsx"
119
  workbook.save(temp_file)
120
 
121
+ # Get the path of the first uploaded image
122
+ first_image_path = image_files[0].name if image_files else None
123
+
124
+ return f"Sum of predicted house square footage: {total_area_sqm:.2f} square meters", temp_file ,first_image_path
125
 
126
 
127
  inputs = [
 
132
 
133
  outputs = [
134
  gr.outputs.Textbox(label="Sum of Predicted House Square Footage"),
135
+ gr.outputs.File(label="Excel Result"),
136
+ gr.outputs.Image(type="pil", label="Uploaded Image")
137
  ]
138
 
139
  interface = gr.Interface(