pipcondagoogle-colaboratorygeospatial

How to install solaris (on colab or locally)?


I try since multiple days to install solaris (https://github.com/CosmiQ/solaris) locally, on google colab or on renkulab (https://renkulab.io/). Up to now, without any luck. I tried on all platform different approaches:

  1. Creating a conda environment (as recommended by the authors)
  2. Directly through pip
  3. And also cloning the repository and access the folders and functions directly

All of these approaches failed so far. Mostly there is a wheel building error for GDAL. Which i have installed first. I do not find any proper documentation or other failure descriptions which makes me question myself... Maybe here someone has experience with this library?

I highly appreciate every hint.

Thanks a lot


Solution

  • Colab Setup

    I can get it set up in Colab with the following:

    First Cell: Install Mamba/Conda

    !pip install -q condacolab
    import condacolab
    condacolab.install()
    

    This will trigger a runtime restart - it does this on purpose.

    Second Cell: Install Solaris prerequisites

    I'm assuming we want the GPU-enabled version. If not, there is another YAML in the solaris repository for a CPU-only environment.

    !wget https://raw.githubusercontent.com/CosmiQ/solaris/main/environment-gpu.yml
    !mamba env update -n base -f environment-gpu.yml
    

    Manually restart the runtime after this completes!

    Third Cell: Install Solaris

    !pip install solaris
    

    That should be it. Following these steps, I could import the module and use the entrypoints, e.g.,

    Module import

    import solaris
    

    Example entrypoint

    !make_masks -h
    

    There were some future deprecation warnings from NumPy about some syntax in the TensorFlow code, but otherwise, seems functional. However, I don't personally use this tool, so I don't know if there is more to verify.