Ghana Agricultural Field Boundary Detection
# ๐พ Ghana Agricultural Field Boundary Detection
This project uses AI-powered methods to detect agricultural field boundaries in Ghana from **.tif geospatial data** (such as maize production raster files).
It provides both a **model pipeline** and a **Streamlit-based interactive dashboard** for visualization and analysis.
---
## ๐ Features
- Upload a `.tif` geospatial file (e.g., Ghana maize production data for 2024).
- Process the file using multiple delineation methods:
- Watershed Segmentation
- K-means Clustering
- Threshold-based Segmentation
- Contour Detection
- Visualize:
- Original production raster
- Detected field boundaries
- Overlay maps
- Export results:
- Boundary maps (PNG)
- Field statistics (CSV)
- Summary report (TXT)
---
## โ๏ธ Installation & Setup
Clone the repository:
```bash
git clone
github.com
cd Ghana-Agricultural-Field-Boundary-Detection
```
Create and activate a virtual environment (recommended):
```bash
python -m venv venv
# Activate the environment
# On Mac/Linux:
source venv/bin/activate
# On Windows:
venv\Scripts\activate
```
Install dependencies:
```bash
pip install -r requirements.txt
```
If you donโt have `requirements.txt`, install manually:
```bash
pip install streamlit rasterio matplotlib scikit-image scipy pandas pillow plotly scikit-learn opencv-python
```
---
## โถ๏ธ Running the Application
Start the Streamlit dashboard with:
```bash
streamlit run ghana_field_demo.py
```
This will launch a local server. Open the link shown in your terminal (e.g., `
localhost`) in your browser.
---
## ๐ Project Structure
```
.
โโโ ghana_field_demo.py # Main Streamlit application
โโโ ghana_field_boundaries.tif # Example output (if available)
โโโ requirements.txt # Dependencies
โโโ README.md # Project documentation
```
---
## ๐ Example Workflow
1. Upload your `.tif` maize production raster (e.g., Ghana_Predicted_Maize_P โฆ