NKI-AI / ahcore

Ahcore is the AI for Oncology core computational pathology toolkit
Apache License 2.0
15 stars 1 forks source link

Command-line interface #61

Open jonasteuwen opened 7 months ago

jonasteuwen commented 7 months ago

Discussed in https://github.com/NKI-AI/ahcore/discussions/60

Originally posted by **jonasteuwen** January 29, 2024 Currently the inference is not straightforward to use. Since external users will most likely run the inference on the models we make available, I think we need a convenient interface. For instance, I would propose a command like: `ahcore inference s3://s3.aiforoncology.nl/ahcore/tissue_background.ckpt file_list.txt --num-gpus 2` The idea is that file_list is of the form: ``` input_path,output_path /input/img0.svs,/output/img0_mask.tiff .... ``` Additionally, we could have flags such as `--input-dir` and `--output-dir` that give the directory to which the paths in `file_list.txt` would be relative to. What I think it requires is: a convenient script that converts such a `file_list.txt` into an in memory sqlite database, and bootstrap what we already have. Perhaps we also need something like `ahcore pack-model` that takes a checkpoint, and adds the configuration and other convenient metadata (version of ahcore for instance). Probably we would also want to be able to inference on a single slide, how would we do that? Perhaps have `batch-inference` and `inference`? Happy to hear your suggestions!