File size: 1,522 Bytes
e70fa91
 
257311c
 
 
 
e70fa91
257311c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: apache-2.0
tags:
- UAV
- Deadwood
- detectron2
---

## Model description

This model is trained for detecting both standing and fallen deadwood from UAV RGB images. More thorough description is available on [https://mayrajeo.github.io/maskrcnn-deadwood](https://mayrajeo.github.io/maskrcnn-deadwood).

## Training data

The model was trained on expert-annotated deadwood data, acquired on during leaf-on season 16.-17.7.2019 from Hiidenportti, Sotkamo, Eastern-Finland. The ground resolution for the data varied between 3.9 and 4.4cm. In addition, the model was tested with data collected from Evo, Hämeenlinna, Southern-Finland, acquired on 11.7.2018. The data from Evo was used only for testing the models. 

## Metrics

|Metric|Hiidenportti|Evo|
|------|------------|---|
|Patch AP50|0.704|0.519|
|Patch AP|0.366|0.252|
|Patch AP groundwood|0.326|0.183|
|Patch AP uprightwood|0.406|0.321|
|Scene AP50|0.683|0.511|
|Scene AP|0.341|0.236|
|Scene AP groundwood|0.246|0.160|
|Scene AP uprightwood|0.436|0.311|

## How to use

```python
from detectron2.engine import DefaultPredictor
from detectron2.config import get_cfg
from detectron2.data import build_detection_test_loader
import cv2

cfg = get_cfg()
cfg.merge_from_file(<path_to_model_config>)
cfg.OUTPUT_DIR = '<path_to_output>'
cfg.MODEL.WEIGHTS = '<path_to_weights>'
cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.5 # score threshold for detections
predictor = DefaultPredictor(cfg)

img = cv2.imread('<path_to_image_patch>')
outputs = predictor(image)
```