plismbench.engine.cli module#

A module containing CLI commands of the repository.

plismbench.engine.cli.extract(extractor: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7fd502f63fd0>], export_dir: ~pathlib.Annotated[~pathlib.Path, <typer.models.OptionInfo object at 0x7fd502f63220>], streaming: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7fd502f61bd0>] = False, download_dir: ~typing.Annotated[~pathlib.Path | None, <typer.models.OptionInfo object at 0x7fd502f62c20>] | None = None, device: ~typing.Annotated[int, <typer.models.OptionInfo object at 0x7fd502f60eb0>] = -1, batch_size: ~typing.Annotated[int, <typer.models.OptionInfo object at 0x7fd502f63eb0>] = 32, workers: ~typing.Annotated[int, <typer.models.OptionInfo object at 0x7fd502f63d30>] = 8, overwrite: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7fd502f60280>] = False)[source]#

Perform features extraction on PLISM histology tiles dataset streamed from Hugging-Face.

$ plismbench extract --extractor h0_mini --batch-size 32 --export-dir $HOME/tmp/features/ --download-dir $HOME/tmp/slides/
plismbench.engine.cli.download(download_dir: ~pathlib.Annotated[~pathlib.Path, <typer.models.OptionInfo object at 0x7fd502f60b20>], hf_token: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7fd502f60370>], workers: ~typing.Annotated[int, <typer.models.OptionInfo object at 0x7fd502f603d0>] = 8)[source]#

Download PLISM dataset from Hugging Face.

plismbench.engine.cli.evaluate(extractor: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7fd5fa70f670>], features_dir: ~pathlib.Annotated[~pathlib.Path, <typer.models.OptionInfo object at 0x7fd4e514ce50>], metrics_dir: ~pathlib.Annotated[~pathlib.Path, <typer.models.OptionInfo object at 0x7fd4e514e020>], n_tiles: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fd4e514e2c0>] | None = None, top_k: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fd4e514d7e0>] | None = None, device: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7fd4e514dde0>] = 'gpu', workers: ~typing.Annotated[int, <typer.models.OptionInfo object at 0x7fd4e514cd00>] = 4, overwrite: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7fd4e514e7d0>] = False)[source]#

Compute robustness metrics for a list of feature extractors.