From 18aedd2eafe46a296e2ce3f50862eccbbac3eaa1 Mon Sep 17 00:00:00 2001 From: fanchengyan Date: Thu, 31 Aug 2023 00:23:30 +0800 Subject: [PATCH] fix bug when enabling plugin --- docs/__init__.py | 3 +++ docs/encoder.help | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 docs/__init__.py create mode 100644 docs/encoder.help diff --git a/docs/__init__.py b/docs/__init__.py new file mode 100644 index 0000000..1af9299 --- /dev/null +++ b/docs/__init__.py @@ -0,0 +1,3 @@ +import os + +encoder_help = os.path.dirname(__file__) + '/encoder.help' diff --git a/docs/encoder.help b/docs/encoder.help new file mode 100644 index 0000000..ffe596f --- /dev/null +++ b/docs/encoder.help @@ -0,0 +1,13 @@ +This tool helps to preprocess geospatial images and generate image features using the SAM image encoder. The generated image features can then be used in our Geo-SAM tool to label the landforms by adding points and bounding box prompts. + +After selecting the raster layer or image file you want to process, you should also choose the proper bands. The SAM natively supports only three-band RGB images, but we have adapted the tool to support one or two-band images so that you can try grayscale images or NDVI spectral index images. + +Since SAM only supports input images with size of (1024, 1204), small images will be resized to match the input size, while large images will be sampled into overlapped patches (patch_size=1024) in a grid-like fashion. The stride parameter will determine the overlap behavior, overlap = patch_size - stride. + +The values of the image input to the SAM should range from 0 to 255, and you may need to specify the value range to be rescaled to [0, 255]. By default, the tool will help you to find the min and max values of the image data and rescale the value range of [min, max] to [0, 255]. + +SAM model checkpoints should be downloaded in advance, and three versions (huge, large, base) are available. The large version "vit_l" is recommended to try first. You need to specify the model type that matches the checkpoint version. + +Tips for making encoding process faster: + +1. Choose smaller processing extent; 2. Reduce target resolution; 3. Increase stride to minimize overlap; 4. Choose a smaller version of sam model; 5. Use GPU; 6. Increase batch_size when using a GPU with sufficient gpu memory; \ No newline at end of file