recalculate floorplans when theres only an empty object
This commit is contained in:
parent
abf06be0a7
commit
f9a7620bf0
1 changed files with 5 additions and 2 deletions
|
|
@ -134,10 +134,13 @@ class Listing:
|
|||
return max_sqm
|
||||
|
||||
async def calculate_sqm_ocr(self, recalculate=True):
|
||||
if not recalculate and self.path_floorplan_ocr_json().exists():
|
||||
objs = []
|
||||
if self.path_floorplan_ocr_json().exists():
|
||||
with open(self.path_floorplan_ocr_json()) as f:
|
||||
objs = json.load(f)
|
||||
if not recalculate and len(objs) > 0:
|
||||
return
|
||||
|
||||
objs = []
|
||||
for floorplan_path in self.list_floorplans():
|
||||
estimated_sqm, model_output = await asyncio.to_thread(
|
||||
floorplan.calculate_ocr, floorplan_path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue