diff --git a/crawler/data_access.py b/crawler/data_access.py index 007f4e8..a2cd939 100644 --- a/crawler/data_access.py +++ b/crawler/data_access.py @@ -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)