21 lines
578 B
Python
21 lines
578 B
Python
import pathlib
|
|
from data_access import Listing
|
|
from tqdm import tqdm
|
|
|
|
|
|
def detect_floorplan(listing_paths: list[str]):
|
|
listings = Listing.get_all_listings(listing_paths)
|
|
|
|
for listing in tqdm(listings):
|
|
tqdm.write(str(listing.identifier))
|
|
# listing.calculate_sqm_model() # using google/deplot model. Too slow, rather use tesseract
|
|
listing.calculate_sqm_ocr(recalculate=False)
|
|
|
|
|
|
def main():
|
|
listing_paths = sorted(list(pathlib.Path("data/rs").glob("*/listing.json")))
|
|
detect_floorplan(listing_paths)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|