|
1 | 1 | # Quick start
|
2 | 2 | We suggest using Python==3.10.
|
3 |
| -To get started, make sure to have `PyTorch >= 2` [installed](https://pytorch.org/get-started/locally/). |
| 3 | +To get started, make sure to have [PyTorch](https://pytorch.org/get-started/locally/) >= 2.0.0 and [GDAL](https://gdal.org/index.html) installed. |
4 | 4 |
|
5 |
| -To install the package, clone the repository and install it with `pip install -e .` from within the repository directory. |
| 5 | +Installing GDAL can be quite a complex process. If you don't have GDAL set up on your system, we reccomend using a conda environment and installing it with `conda install -c conda-forge gdal`. |
| 6 | + |
| 7 | +For a stable point-release, use `pip install terratorch`. |
| 8 | +If you prefer to get the most recent version of the main branch, install the library with `pip install git+https://github.com/IBM/terratorch.git`. |
| 9 | + |
| 10 | +To install as a developer (e.g. to extend the library) clone this repo, and run `pip install -e .`. |
6 | 11 |
|
7 | 12 | You can interact with the library at several levels of abstraction. Each deeper level of abstraction trades off some amount of flexibility for ease of use and configuration.
|
8 | 13 |
|
@@ -105,6 +110,17 @@ task = PixelwiseRegressionTask(
|
105 | 110 |
|
106 | 111 | At this level of abstraction, you can also provide a configuration file (see [LightningCLI](https://lightning.ai/docs/pytorch/stable/cli/lightning_cli.html#lightning-cli)) with all the details of the training. See an example for semantic segmentation below:
|
107 | 112 |
|
| 113 | +!!! info |
| 114 | + |
| 115 | + To pass your own path from where to load the weights with the PrithviModelFactory, you can make use of timm's `pretrained_cfg_overlay`. |
| 116 | + E.g. to pass a local path, you can add, under model_args: |
| 117 | + |
| 118 | + ```yaml |
| 119 | + backbone_pretrained_cfg_overlay: |
| 120 | + file: <local_path> |
| 121 | + ``` |
| 122 | + Besides `file`, you can also pass `url`, `hf_hub_id`, amongst others. Check timm's documentation for full details. |
| 123 | + |
108 | 124 | ```yaml title="Configuration file for a Semantic Segmentation Task"
|
109 | 125 | # lightning.pytorch==2.1.1
|
110 | 126 | seed_everything: 0
|
@@ -220,4 +236,4 @@ To run this training task, simply execute `terratorch fit --config <path_to_conf
|
220 | 236 |
|
221 | 237 | To test your model on the test set, execute `terratorch test --config <path_to_config_file> --ckpt_path <path_to_checkpoint_file>`
|
222 | 238 |
|
223 |
| -For inference, execute `terratorch predict -c <path_to_config_file> --ckpt_path<path_to_checkpoint> --predict_output_dir <path_to_output_dir> --data.init_args.predict_data_root <path_to_input_dir> --data.init_args.predict_dataset_bands <all bands in the predicted dataset, e.g. [BLUE,GREEN,RED,NIR_NARROW,SWIR_1,SWIR_2,0]>` |
| 239 | +For inference, execute `terratorch predict -c <path_to_config_file> --ckpt_path<path_to_checkpoint> --predict_output_dir <path_to_output_dir> --data.init_args.predict_data_root <path_to_input_dir> --data.init_args.predict_dataset_bands <all bands in the predicted dataset, e.g. [BLUE,GREEN,RED,NIR_NARROW,SWIR_1,SWIR_2,0]>` |
0 commit comments