> For the complete documentation index, see [llms.txt](https://yarroudh.gitbook.io/segment-lidar/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yarroudh.gitbook.io/segment-lidar/tutorial/configuration.md).

# Configuration

segment-lidar v0.1.5

The segment\_lidar module provides a set of parameters that can be used to configure the segmentation process. These parameters are passed to the SamLidar class as arguments when instantiating the class. The following table shows the parameters and their default values:

| Parameter   | Default value        | Description                                                                                       |
| ----------- | -------------------- | ------------------------------------------------------------------------------------------------- |
| algorithm   | "segment-geospatial" | Algorithm to use for segmentation. Possible values are: "segment-geospatial", "segment-anything". |
| ckpt\_path  | None                 | Path to the checkpoint file.                                                                      |
| device      | "cuda:0"             | Device to use for inference.                                                                      |
| model\_type | "vit\_h"             | Type of the SAM model. Possible values are: "vit\_h", "vit\_l", "vit\_b".                         |
| resolution  | 0.25                 | The resolution value of the created image raster.                                                 |
| sam\_kwargs | False                | Whether to use the SAM kwargs when using "segment-geospatial" as algorithm                        |

Here is an example of how to configure the parameters:

```python
model = samlidar.SamLidar(ckpt_path="sam_vit_h_4b8939.pth",
                          algorithm="segment-geo-spatial",
                          model_type="vit_h",
                          resolution=0.5,
                          sam_kwargs=True)
```

Additionally, the parameters of segment-anything can be configured as follows:

```python
model.mask.crop_n_layers = 1
model.mask.crop_n_points_downscale_factor = 2
model.mask.min_mask_region_area = 500
model.mask.points_per_side = 10
model.mask.pred_iou_thresh = 0.90
model.mask.stability_score_thresh = 0.92
```

Please, refer to the [segment-anything](https://github.com/facebookresearch/segment-anything) repository for more details about these parameters. See the complete arguments list of the SamLidar class [here](/segment-lidar/information/api.md).
