mahmoudalrefaey's picture
Upload README.md
2c0f9d6 verified
metadata
title: Land Cover Classification
emoji: 🌍
colorFrom: green
colorTo: blue
sdk: docker
app_file: app.py
pinned: false

Land Cover Classification (Hugging Face Space)

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.

πŸš€ Demo

Open in Spaces

Features

  • Deep Learning Model: Pretrained ResNet50 fine-tuned on EuroSAT satellite imagery.
  • User-Friendly Web App: Built with Streamlit for interactive image upload and real-time predictions.
  • Class Visualization: Displays prediction confidence for each land cover class.
  • Modular Code: Clean separation of model, data processing, and visualization logic.

How to Use

  1. Upload a satellite image (PNG, JPG, JPEG, TIFF).
  2. Preview the image and click "Run Classification".
  3. View the predicted land cover class and confidence scores.

Land Cover Classes

Index Class Name
0 AnnualCrop
1 Forest
2 HerbaceousVegetation
3 Highway
4 Industrial
5 Pasture
6 PermanentCrop
7 Residential
8 River
9 SeaLake

Project Structure

.
β”œβ”€β”€ app.py                # Streamlit web app
β”œβ”€β”€ model_handler.py      # Model loading and prediction logic
β”œβ”€β”€ data_processor.py     # Data preprocessing utilities
β”œβ”€β”€ config.py             # Configuration (class names, paths)
β”œβ”€β”€ requirements.txt      # Python dependencies
β”œβ”€β”€ models/               # Model files (see below)
β”œβ”€β”€ assets/               # Static images for the app
β”œβ”€β”€ Dockerfile            # Docker configuration for Hugging Face Spaces
└── README.md             # This file

Model Files

The following files must be present in the models/ directory:

  • ResNet50_eurosat.h5
  • model.weights.best.keras
  • class_indices.npy

If you fork this Space, upload these files via the Hugging Face web interface if they are too large for git.

Deploying on Hugging Face Spaces

Docker Space Deployment

  1. Create a new Space on Hugging Face:

  2. Push your code:

    • Push your entire project (including the Dockerfile) to the Space.
    • If your model files are too large for git, upload them via the Hugging Face web interface after the initial push.
  3. Wait for the build:

    • Hugging Face will build and run your Docker container.
    • Your Streamlit app will be available at the Space URL.

License

MIT License. See LICENSE for details.


This Space is powered by Streamlit and Hugging Face Spaces.