Installing GIANT

Setting up the environment

GIANT is primarily a python package with some modules written in Cython for speed improvements. This makes installation fairly straight forward in most Unix-like environments. It should be possible to install GIANT on Windows using similar steps to those that follow, but this is untested. The following subsections give step-by-step instructions for installing GIANT.

The first step to installing GIANT is to install the mini-forge python environment/package manager. This helps to ensure that the GIANT requirements don’t interfere with other python code you have on your system (and that other python environments you have don’t interfere with GIANT). Mini-forge can be downloaded from https://conda-forge.org/download/. Once you have downloaded mini-forge, install it following the instructions provided (note that you can install it to your home directory without needing admin privileges, which is a big benefit).

With conda installed, we can now set up an environment in which to install giant

  1. Before we begin there are a couple OS specific instructions
    • macOS
      • You may need to set the environment variable CPATH to something like /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include or /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include after installing xcode or xcode command line tools to ensure system headers are available

  2. Download the GIANT source code from git
    • git clone git@github.com:nasa/giant.git

  3. Create a new environment to install GIANT to and install the dependencies
    • cd giant

    • mamba env create -f environment.yml
      • This will create a new environment called giant

    • Note that creating a new environment is not required, but is strongly recommended.

    • Note that if you did not install mini-forge, you need to specify to use the conda-forge repository instead of the default conda repository by adding -c conda-forge to the mamba env create command.

    • Note that if you are on windows, you will unfortunately need to manually install visual studio tools according to the instructions https://conda-forge.org/docs/maintainer/knowledge_base.html#local-testing

  4. Activate the new environment
    • conda activate giant

    • You will need to do this step each time you want to use GIANT.

  5. Install optional dependencies if desired
    • These can be installed using mamba install ...
      • gdal – used for the feature catalog tools in the examples

      • plotly– used for the feature catalog tools in the examples

      • dash – used for the feature catalog tools in the examples

      • Requirements for RoMa installed through mini-forge (RoMa is an optional feature matcher. RoMa must be installed from https://github.com/Parskatt/RoMa) - pytorch - einops - torchvision - kornia - albumentations - loguru - wandb - timm - poselib

Installing and testing GIANT

With the anaconda environment set up and activated it is now easy to install giant.

  1. Install the GIANT package
    • cd giant

    • pip install -e .

    • You can also omit the “-e” to avoid using links, but using links makes it easier to update GIANT in the future.

    • You will likely see a lot of warnings from the c compiler that can largely be ignored. If you have an error though that is a problem

  2. Check the installation (optional)
    • cd unittests

    • python  -m unittest discover

    • This should complete with no errors (skips/warnings are OK).

GIANT should now be installed and ready for use.