Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: cc-by-4.0
|
3 |
+
pipeline_tag: image-segmentation
|
4 |
+
library_name: transformers
|
5 |
+
datasets:
|
6 |
+
- GlobalWheat/GWFSS_v1.0
|
7 |
+
metrics:
|
8 |
+
- mean_iou
|
9 |
+
base_model:
|
10 |
+
- nvidia/segformer-b1-finetuned-ade-512-512
|
11 |
+
tags:
|
12 |
+
- scientific
|
13 |
+
- research
|
14 |
+
- agricultural research
|
15 |
+
- wheat
|
16 |
+
- segmentation
|
17 |
+
- crop phenotyping
|
18 |
+
- global wheat
|
19 |
+
- crop
|
20 |
+
- plant
|
21 |
+
- canopy
|
22 |
+
- field
|
23 |
+
source: https://doi.org/10.1016/j.plaphe.2025.100084
|
24 |
+
|
25 |
+
---
|
26 |
+
|
27 |
+
## Usage
|
28 |
+
```python
|
29 |
+
from transformers import AutoImageProcessor, SegformerForSemanticSegmentation
|
30 |
+
import torch, torch.nn.functional as F
|
31 |
+
from PIL import Image
|
32 |
+
import numpy as np
|
33 |
+
|
34 |
+
repo = "GlobalWheat/GWFSS_model_v1.1"
|
35 |
+
processor = AutoImageProcessor.from_pretrained(repo)
|
36 |
+
model = SegformerForSemanticSegmentation.from_pretrained(repo).eval()
|
37 |
+
|
38 |
+
img = Image.open("example.jpg").convert("RGB")
|
39 |
+
inputs = processor(images=img, return_tensors="pt")
|
40 |
+
with torch.no_grad():
|
41 |
+
logits = model(**inputs).logits
|
42 |
+
up = F.interpolate(logits, size=(img.height, img.width), mode="bilinear", align_corners=False)
|
43 |
+
pred = up.argmax(1)[0].cpu().numpy() # (H, W) class IDs
|
44 |
+
```
|
45 |
+
|
46 |
+
This version is based on huggingface Segformer which could be slightly different from the one we used for our paper. The paper version was implemented based on the mmsegmentation. You can find the model weight for mmsegmentation library in this repo as well.
|
47 |
+
|
48 |
+
## Related Paper
|
49 |
+
This dataset is associated with the following paper:
|
50 |
+
The Global Wheat Full Semantic Organ Segmentation (GWFSS) Dataset
|
51 |
+
https://doi.org/10.1016/j.plaphe.2025.100084
|