parameterize detect floorplan step to work with custom data paths
This commit is contained in:
parent
07fef7fbab
commit
e3abf4b373
2 changed files with 11 additions and 6 deletions
|
|
@ -1,9 +1,10 @@
|
||||||
|
import pathlib
|
||||||
from data_access import Listing
|
from data_access import Listing
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
|
|
||||||
|
|
||||||
def detect_floorplan():
|
def detect_floorplan(listing_paths: list[str]):
|
||||||
listings = Listing.get_all_listings()
|
listings = Listing.get_all_listings(listing_paths)
|
||||||
|
|
||||||
for listing in tqdm(listings):
|
for listing in tqdm(listings):
|
||||||
tqdm.write(str(listing.identifier))
|
tqdm.write(str(listing.identifier))
|
||||||
|
|
@ -12,7 +13,8 @@ def detect_floorplan():
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
detect_floorplan()
|
listing_paths = sorted(list(pathlib.Path("data/rs").glob("*/listing.json")))
|
||||||
|
detect_floorplan(listing_paths)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
||||||
|
|
@ -75,9 +75,12 @@ def dump_images(ctx: click.core.Context):
|
||||||
|
|
||||||
|
|
||||||
@cli.command()
|
@cli.command()
|
||||||
def detect_floorplan():
|
@click.pass_context
|
||||||
click.echo('Running detect_floorplan')
|
def detect_floorplan(ctx: click.core.Context):
|
||||||
detect_floorplan_module.detect_floorplan()
|
data_dir = ctx.obj['data_dir']
|
||||||
|
click.echo(f'Running detect_floorplan in {data_dir}')
|
||||||
|
listing_paths = sorted(list(pathlib.Path(data_dir).glob("*/listing.json")))
|
||||||
|
detect_floorplan_module.detect_floorplan(listing_paths)
|
||||||
|
|
||||||
|
|
||||||
@cli.command()
|
@cli.command()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue