Skip to content

Commit 083989e

Browse files
example for inference
Signed-off-by: João Lucas de Sousa Almeida <[email protected]>
1 parent ddced60 commit 083989e

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

docs/examples.md

+31-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,34 @@
1-
# Examples
1+
# Performing an inference task with TerraTorch
2+
3+
## Step 1: Download the test case from HuggingFace
4+
We will use the burn scars identification test case, in which we are interested in estimating the area
5+
affected by wildfires using a finetuned model (Prithvi-EO backbone + CNN decoder). To download the complete
6+
example, do:
7+
```sh
8+
git clone https://huggingface.co/ibm-nasa-geospatial/Prithvi-EO-2.0-300M-BurnScars/
9+
```
10+
## Step 2: Run the default inference case
11+
The example you download already contains some sample images to be used as input, so you just need to go to
12+
the local repository and create a directory to save the outputs:
13+
```sh
14+
cd Prithvi-EO-2.0-300M-BurnScars
15+
mkdir outputs
16+
```
17+
and to execute a command line like:
18+
```sh
19+
terratorch predict -c burn_scars_config.yaml --predict_output_dir outputs/ --data.init_args.predict_data_root examples/ --ckpt_path Prithvi_EO_V2_300M_BurnScars.pt
20+
```
21+
You will see the outputs being saved in the `outputs` directory.
22+
23+
### Input image (RGB components)
24+
25+
![](figs/input.png)
26+
27+
### Predicted mask
28+
29+
![](figs/mask.png)}
30+
31+
# More examples
232

333
For some examples of training using the existing tasks, check out the following pages on our github repo:
434

0 commit comments

Comments
 (0)