trttung1610 commited on
Commit
5a6b07a
·
1 Parent(s): d16779f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -20,7 +20,7 @@ transform = transforms.Compose([
20
  std=[0.229, 0.224, 0.225])
21
  ])
22
 
23
- def predict_house_area(room_id, image_file):
24
  total_area_sqm = 0
25
  predicted_areas = []
26
 
@@ -71,12 +71,10 @@ def predict_house_area(room_id, image_file):
71
 
72
  workbook = openpyxl.Workbook()
73
  worksheet = workbook.active
74
- worksheet.cell(row=1, column=1).value = "Room ID"
75
- worksheet.cell(row=1, column=2).value = "Image File"
76
- worksheet.cell(row=1, column=3).value = "Predicted Area (sqm)"
77
- worksheet.cell(row=2, column=1).value = room_id
78
- worksheet.cell(row=2, column=2).value = image_file_name
79
- worksheet.cell(row=2, column=3).value = predicted_area_sqm
80
 
81
  temp_file = f"predicted_area_{room_id}.xlsx"
82
  workbook.save(temp_file)
 
20
  std=[0.229, 0.224, 0.225])
21
  ])
22
 
23
+ def predict_house_area(image_file):
24
  total_area_sqm = 0
25
  predicted_areas = []
26
 
 
71
 
72
  workbook = openpyxl.Workbook()
73
  worksheet = workbook.active
74
+ worksheet.cell(row=1, column=1).value = "Image File"
75
+ worksheet.cell(row=1, column=2).value = "Predicted Area (sqm)"
76
+ worksheet.cell(row=2, column=1).value = image_file_name
77
+ worksheet.cell(row=2, column=2).value = predicted_area_sqm
 
 
78
 
79
  temp_file = f"predicted_area_{room_id}.xlsx"
80
  workbook.save(temp_file)