Spaces:
Build error
Build error
Upload README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Land Cover Classification
|
| 3 |
+
emoji: π
|
| 4 |
+
colorFrom: green
|
| 5 |
+
colorTo: blue
|
| 6 |
+
sdk: docker
|
| 7 |
+
app_file: app.py
|
| 8 |
+
pinned: false
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# Land Cover Classification (Hugging Face Space)
|
| 12 |
+
|
| 13 |
+
A web-based land cover classification system using a pretrained ResNet50 model and the EuroSAT dataset. This Space features a modern Streamlit interface for easy image upload, prediction, and visualization of land type probabilities.
|
| 14 |
+
|
| 15 |
+
## π Demo
|
| 16 |
+
|
| 17 |
+
[](https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME)
|
| 18 |
+
|
| 19 |
+
## Features
|
| 20 |
+
|
| 21 |
+
- **Deep Learning Model**: Pretrained ResNet50 fine-tuned on EuroSAT satellite imagery.
|
| 22 |
+
- **User-Friendly Web App**: Built with Streamlit for interactive image upload and real-time predictions.
|
| 23 |
+
- **Class Visualization**: Displays prediction confidence for each land cover class.
|
| 24 |
+
- **Modular Code**: Clean separation of model, data processing, and visualization logic.
|
| 25 |
+
|
| 26 |
+
## How to Use
|
| 27 |
+
|
| 28 |
+
1. **Upload a satellite image** (PNG, JPG, JPEG, TIFF).
|
| 29 |
+
2. **Preview the image** and click "Run Classification".
|
| 30 |
+
3. **View the predicted land cover class** and confidence scores.
|
| 31 |
+
|
| 32 |
+
## Land Cover Classes
|
| 33 |
+
|
| 34 |
+
| Index | Class Name |
|
| 35 |
+
|-------|------------------------|
|
| 36 |
+
| 0 | AnnualCrop |
|
| 37 |
+
| 1 | Forest |
|
| 38 |
+
| 2 | HerbaceousVegetation |
|
| 39 |
+
| 3 | Highway |
|
| 40 |
+
| 4 | Industrial |
|
| 41 |
+
| 5 | Pasture |
|
| 42 |
+
| 6 | PermanentCrop |
|
| 43 |
+
| 7 | Residential |
|
| 44 |
+
| 8 | River |
|
| 45 |
+
| 9 | SeaLake |
|
| 46 |
+
|
| 47 |
+
## Project Structure
|
| 48 |
+
|
| 49 |
+
```
|
| 50 |
+
.
|
| 51 |
+
βββ app.py # Streamlit web app
|
| 52 |
+
βββ model_handler.py # Model loading and prediction logic
|
| 53 |
+
βββ data_processor.py # Data preprocessing utilities
|
| 54 |
+
βββ config.py # Configuration (class names, paths)
|
| 55 |
+
βββ requirements.txt # Python dependencies
|
| 56 |
+
βββ models/ # Model files (see below)
|
| 57 |
+
βββ assets/ # Static images for the app
|
| 58 |
+
βββ Dockerfile # Docker configuration for Hugging Face Spaces
|
| 59 |
+
βββ README.md # This file
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
## Model Files
|
| 63 |
+
|
| 64 |
+
The following files must be present in the `models/` directory:
|
| 65 |
+
- `ResNet50_eurosat.h5`
|
| 66 |
+
- `model.weights.best.keras`
|
| 67 |
+
- `class_indices.npy`
|
| 68 |
+
|
| 69 |
+
If you fork this Space, upload these files via the Hugging Face web interface if they are too large for git.
|
| 70 |
+
|
| 71 |
+
## Deploying on Hugging Face Spaces
|
| 72 |
+
|
| 73 |
+
### Docker Space Deployment
|
| 74 |
+
|
| 75 |
+
1. **Create a new Space on Hugging Face:**
|
| 76 |
+
- Go to [Hugging Face Spaces](https://huggingface.co/spaces).
|
| 77 |
+
- Click **"Create new Space"**.
|
| 78 |
+
- Choose **SDK: Docker**.
|
| 79 |
+
|
| 80 |
+
2. **Push your code:**
|
| 81 |
+
- Push your entire project (including the `Dockerfile`) to the Space.
|
| 82 |
+
- If your model files are too large for git, upload them via the Hugging Face web interface after the initial push.
|
| 83 |
+
|
| 84 |
+
3. **Wait for the build:**
|
| 85 |
+
- Hugging Face will build and run your Docker container.
|
| 86 |
+
- Your Streamlit app will be available at the Space URL.
|
| 87 |
+
|
| 88 |
+
## License
|
| 89 |
+
|
| 90 |
+
MIT License. See [LICENSE](LICENSE) for details.
|
| 91 |
+
|
| 92 |
+
---
|
| 93 |
+
|
| 94 |
+
*This Space is powered by [Streamlit](https://streamlit.io/) and [Hugging Face Spaces](https://huggingface.co/spaces).*
|