From 9b055c3311c184486e385eed02ae568a5d01c771 Mon Sep 17 00:00:00 2001 From: Anwai Archit <52396323+anwai98@users.noreply.github.com> Date: Thu, 14 Nov 2024 10:04:57 +0100 Subject: [PATCH] Add documentation for micro-sam CLIs (#777) --- doc/cli_tools.md | 20 ++++++++++++++++++++ micro_sam/__init__.py | 1 + 2 files changed, 21 insertions(+) create mode 100644 doc/cli_tools.md diff --git a/doc/cli_tools.md b/doc/cli_tools.md new file mode 100644 index 000000000..eb3c19ee8 --- /dev/null +++ b/doc/cli_tools.md @@ -0,0 +1,20 @@ +# Using the Command Line Interface (CLI) + +`micro-sam` extends access to a bunch of functionalities using the command line interface (CLI) scripts via terminal. + +The supported CLIs can be used by +- Running `$ micro_sam.precompute_embeddings` for precomputing and caching the image embeddings. +- Running `$ micro_sam.annotator_2d` for starting the 2d annotator. +- Running `$ micro_sam.annotator_3d` for starting the 3d annotator. +- Running `$ micro_sam.annotator_tracking` for starting the tracking annotator. +- Running `$ micro_sam.image_series_annotator` for starting the image series annotator. +- Running `$ micro_sam.automatic_segmentation` for automatic instance segmentation. + - We support all post-processing parameters for automatic instance segmentation (for both AMG and AIS). + - If these parameters are not provided by the user, `micro-sam` makes use of the best post-processing parameters (depending on the choice of model). + - The post-processing parameters can be changed by parsing the parameters via the CLI using `-- .` For example, one can update the parameter values (eg. `pred_iou_thresh`, `stability_iou_thresh`, etc. - supported by AMG) using + ```bash + $ micro_sam.automatic_segmentation ... --pred_iou_thresh 0.6 --stability_iou_thresh 0.6 ... + ``` + - You can check details for supported parameters and their respective default values at `micro_sam/instance_segmentation.py` under the `generate` method for `AutomaticMaskGenerator` and `InstanceSegmentationWithDecoder` class. + +NOTE: For all CLIs above, you can find more details by adding the argument `-h` to the CLI script (eg. `$ micro_sam.annotator_2d -h`). diff --git a/micro_sam/__init__.py b/micro_sam/__init__.py index f6058fc4b..43ebddb8b 100644 --- a/micro_sam/__init__.py +++ b/micro_sam/__init__.py @@ -2,6 +2,7 @@ .. include:: ../doc/start_page.md .. include:: ../doc/installation.md .. include:: ../doc/annotation_tools.md +.. include:: ../doc/cli_tools.md .. include:: ../doc/python_library.md .. include:: ../doc/finetuned_models.md .. include:: ../doc/faq.md