Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- object-detection
|
| 4 |
+
- faster-rcnn
|
| 5 |
+
- multispectral
|
| 6 |
+
- canopy-detection
|
| 7 |
+
- remote-sensing
|
| 8 |
+
library_name: pytorch
|
| 9 |
+
pipeline_tag: object-detection
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# 🌳 Faster R-CNN 6-Band Canopy Detection
|
| 13 |
+
|
| 14 |
+
**Faster R-CNN ResNet50-FPN v2** trained on 6-band multispectral satellite imagery for tree canopy detection.
|
| 15 |
+
|
| 16 |
+
## Model Details
|
| 17 |
+
|
| 18 |
+
| Property | Value |
|
| 19 |
+
|----------|-------|
|
| 20 |
+
| Backbone | ResNet50-FPN v2 (COCO pretrained) |
|
| 21 |
+
| Input | 6 channels (B, G, R, RE, NIR1, NIR2) |
|
| 22 |
+
| Classes | 1 (canopy) |
|
| 23 |
+
| Image size | 640×640 |
|
| 24 |
+
| Best mAP@50 | 0.9735 |
|
| 25 |
+
| Parameters | ~43M |
|
| 26 |
+
|
| 27 |
+
## Auto-Detect Band Support
|
| 28 |
+
|
| 29 |
+
| Input Format | Band Mapping |
|
| 30 |
+
|---|---|
|
| 31 |
+
| 3-band (RGB) | [R, G, B, 0, 0, 0] |
|
| 32 |
+
| 5-band | [B, G, R, RE, NIR1, 0] |
|
| 33 |
+
| 6-band | Direct input |
|
| 34 |
+
| 7-band | Drop Band 7 (anomalous NIR3) |
|
| 35 |
+
|
| 36 |
+
## Usage
|
| 37 |
+
|
| 38 |
+
```python
|
| 39 |
+
import rasterio, numpy as np, torch
|
| 40 |
+
from torchvision.models.detection import fasterrcnn_resnet50_fpn_v2
|
| 41 |
+
|
| 42 |
+
# Load model (modify first conv for 6 channels)
|
| 43 |
+
model = ... # See training notebook for full setup
|
| 44 |
+
model.load_state_dict(torch.load('best.pt'))
|
| 45 |
+
model.eval()
|
| 46 |
+
|
| 47 |
+
# Load & preprocess
|
| 48 |
+
with rasterio.open('tile.tif') as src:
|
| 49 |
+
img = src.read() # (C, H, W)
|
| 50 |
+
# Map to 6 channels, normalize, run inference
|
| 51 |
+
```
|