Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,104 +1,10 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
## Project Structure
|
| 12 |
-
|
| 13 |
-
```
|
| 14 |
-
βββ app.py # Gradio web interface
|
| 15 |
-
βββ requirements.txt # Dependencies
|
| 16 |
-
βββ models/
|
| 17 |
-
β βββ cloud_detector.py # Cloud detection model
|
| 18 |
-
β βββ change_detector.py # Change detection model
|
| 19 |
-
βββ utils/
|
| 20 |
-
β βββ preprocessing.py # Image preprocessing
|
| 21 |
-
β βββ visualization.py # Visualization utilities
|
| 22 |
-
β βββ evaluation.py # Metrics
|
| 23 |
-
β βββ metrics.py # Advanced metrics
|
| 24 |
-
βββ examples/ # Sample images
|
| 25 |
-
β βββ before/
|
| 26 |
-
β βββ after/
|
| 27 |
-
β βββ ground_truth/
|
| 28 |
-
βββ notebooks/
|
| 29 |
-
βββ fine_tune_vit.ipynb # Fine-tuning tutorial
|
| 30 |
-
```
|
| 31 |
-
|
| 32 |
-
## Quick Start
|
| 33 |
-
|
| 34 |
-
**Requirements:** Python 3.8+, CUDA 11.0+ (optional)
|
| 35 |
-
|
| 36 |
-
1. **Clone and setup:**
|
| 37 |
-
```bash
|
| 38 |
-
cd Sentinel-Watch
|
| 39 |
-
python -m venv venv
|
| 40 |
-
source venv/bin/activate
|
| 41 |
-
pip install -r requirements.txt
|
| 42 |
-
```
|
| 43 |
-
|
| 44 |
-
2. **Run the app:**
|
| 45 |
-
```bash
|
| 46 |
-
python app.py
|
| 47 |
-
```
|
| 48 |
-
Opens at `http://localhost:7860`
|
| 49 |
-
|
| 50 |
-
3. **(Optional) Download example data:**
|
| 51 |
-
```bash
|
| 52 |
-
python download_oscd.py
|
| 53 |
-
```
|
| 54 |
-
|
| 55 |
-
## Usage
|
| 56 |
-
|
| 57 |
-
### Web Interface
|
| 58 |
-
- **Cloud Detection Tab**: Upload image β detect clouds
|
| 59 |
-
- **Change Detection Tab**: Upload before/after β detect changes
|
| 60 |
-
- **Examples Tab**: View pre-loaded results
|
| 61 |
-
|
| 62 |
-
### Python API
|
| 63 |
-
|
| 64 |
-
```python
|
| 65 |
-
from models.cloud_detector import CloudDetector
|
| 66 |
-
from models.change_detector import ChangeDetector
|
| 67 |
-
import cv2
|
| 68 |
-
|
| 69 |
-
before = cv2.imread("before.jpg")
|
| 70 |
-
after = cv2.imread("after.jpg")
|
| 71 |
-
before = cv2.cvtColor(before, cv2.COLOR_BGR2RGB)
|
| 72 |
-
after = cv2.cvtColor(after, cv2.COLOR_BGR2RGB)
|
| 73 |
-
|
| 74 |
-
cloud_detector = CloudDetector()
|
| 75 |
-
change_detector = ChangeDetector()
|
| 76 |
-
|
| 77 |
-
# Cloud detection
|
| 78 |
-
cloud_mask, confidence = cloud_detector.detect_clouds(before)
|
| 79 |
-
|
| 80 |
-
# Change detection
|
| 81 |
-
change_mask, confidence = change_detector.detect_changes(before, after)
|
| 82 |
-
```
|
| 83 |
-
|
| 84 |
-
## Model Architecture
|
| 85 |
-
|
| 86 |
-
**Cloud Detector:**
|
| 87 |
-
- Vision Transformer (ViT-Base)
|
| 88 |
-
- Input: 224Γ224 RGB images
|
| 89 |
-
- Output: Binary cloud mask + confidence scores
|
| 90 |
-
|
| 91 |
-
**Change Detector:**
|
| 92 |
-
- Siamese ViT network
|
| 93 |
-
- Compares before/after image patches
|
| 94 |
-
- Output: Change mask + confidence map
|
| 95 |
-
|
| 96 |
-
## Metrics
|
| 97 |
-
|
| 98 |
-
- **IoU** (Intersection over Union)
|
| 99 |
-
- **F1 Score**
|
| 100 |
-
- **Accuracy, Precision, Recall**
|
| 101 |
-
|
| 102 |
-
## License
|
| 103 |
-
|
| 104 |
-
MIT License
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: SentinelWatch
|
| 3 |
+
emoji: π°οΈ
|
| 4 |
+
colorFrom: gray
|
| 5 |
+
colorTo: green
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: 4.0.0
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|