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:

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:

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 repository for more details about these parameters. See the complete arguments list of the SamLidar class here.

Last updated