From f66b3e4e961305584d490ebfa00cebce46d48afb Mon Sep 17 00:00:00 2001 From: Qiusheng Wu Date: Sun, 27 Aug 2023 18:00:49 -0400 Subject: [PATCH] Added installation instructions to README (#180) --- README.md | 34 ++++++++++++++++++++++++++++++++++ docs/installation.md | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 25ab9094..9203de70 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,40 @@ The **segment-geospatial** package draws its inspiration from [segment-anything- - Save input prompts as GeoJSON files - Visualize segmentation results on interactive maps +## Installation + +### Install from PyPI + +**segment-geospatial** is available on [PyPI](https://pypi.org/project/segment-geospatial/). To install **segment-geospatial**, run this command in your terminal: + +```bash +pip install segment-geospatial +``` + +### Install from conda-forge + +**segment-geospatial** is also available on [conda-forge](https://anaconda.org/conda-forge/segment-geospatial). If you have +[Anaconda](https://www.anaconda.com/distribution/#download-section) or [Miniconda](https://docs.conda.io/en/latest/miniconda.html) installed on your computer, you can install segment-geospatial using the following commands. It is recommended to create a fresh conda environment for **segment-geospatial**. The following commands will create a new conda environment named `geo` and install **segment-geospatial** and its dependencies: + +```bash +conda create -n geo python +conda activate geo +conda install -c conda-forge mamba +mamba install -c conda-forge segment-geospatial +``` + +Samgeo-geospatial has some optional dependencies that are not included in the default conda environment. To install these dependencies, run the following command: + +```bash +mamba install -c conda-forge groundingdino-py segment-anything-fast +``` + +As of July 9th, 2023 Linux systems have also required that `libgl1` be installed for segment-geospatial to work. The following command will install that dependency + +```bash +apt update; apt install -y libgl1 +``` + ## Examples - [Segmenting remote sensing imagery](https://samgeo.gishub.org/examples/satellite) diff --git a/docs/installation.md b/docs/installation.md index 31d6ee92..a02e9b63 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -14,7 +14,7 @@ pip install segment-geospatial [Anaconda](https://www.anaconda.com/distribution/#download-section) or [Miniconda](https://docs.conda.io/en/latest/miniconda.html) installed on your computer, you can install segment-geospatial using the following commands. It is recommended to create a fresh conda environment for **segment-geospatial**. The following commands will create a new conda environment named `geo` and install **segment-geospatial** and its dependencies: ```bash -conda create -n geo python=3.10 +conda create -n geo python conda activate geo conda install -c conda-forge mamba mamba install -c conda-forge segment-geospatial