File size: 1,437 Bytes
d862e07
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
license: gpl-3.0
---

# detectree weights for Belem, Brazil

## Installation

This requrires detectree>=0.8.0, you can install it using pip/uv:

```
pip install "detectree>=0.8.0"
```

or conda/mamba:

```
conda install -c conda-forge "detectree>=0.8.0"
```

## Example usage

Run from the command line, e.g., to predict for a single image

```
detectree predict-img <path-to-input-image> --output-filepath <path-to-output-image> --hf-hub-repo-id martibosch/detectree-belem
```

or to predict for multiple images:

```
detectree predict-imgs <path-to-output-dir> --hf-hub-repo-id martibosch/detectree-belem --img-dir <path-to-input-dir>
```

where `<path-to-input-dir>` is the path to the folder containing the `.tif` files. If the image files have another extension, e.g., jpeg, provide the `--img-filename-pattern` option as in:

```
detectree predict-imgs <path-to-output-dir> \
    --hf-hub-repo-id martibosch/detectree-belem \
    --img-dir <path-to-input-dir> \
    --img-filename-pattern "*.jpeg"
```

Additionally, you can customize the postprocessing (and many other) parameters (see the [background](https://github.com/martibosch/detectree-examples/blob/main/notebooks/background.ipynb) notebook for more details) as in:

```
detectree predict-imgs <path-to-output-dir> \
    --hf-hub-repo-id martibosch/detectree-belem \
    --img-dir <path-to-input-dir> \
    --img-filename-pattern "*.jpeg" \
    --refine-beta 10000
```