Determine which agricultural fields are currently cultivated with plants and which are resting until next growing season using deep learning segmentation models.
This project combines computer vision and deep learning to analyze satellite/aerial imagery of agricultural fields. The system identifies:
- 🌱 Growing Land: Fields currently under cultivation
- 🛌 Resting Land: Fields lying fallow for seasonal recovery
Key Features:
- U-Net and DeepLabV3 segmentation models
- FastAPI backend for processing requests
- Dockerized deployment
- Data augmentation pipeline
- UI with PySide6
- Python 3.8+
- Docker 20.10+
- NVIDIA GPU (recommended for training)
git clone [email protected]:nonezonyx/field_segmentation.git
cd field_segmentation
# Open "saves" directory and download checkpoints from gdrive
# Install dependencies
pip install -r requirements.txt
# Start API server
uvicorn app:app --reload
# or run ui
python3 ui.py
docker-compose up --build
Endpoint: POST /process-land
Input parameters:
-
image: JPEG/PNG file upload
-
width: float > 0
-
length: float > 0
Response format:
{
"processed_image": "base64_string",
"growing_land": float,
"resting_land": float
}
Access interactive docs at http://localhost:8000/docs after deployment.
- mask_creation.ipynb - Creating masks from annotations
- data_augmentation.ipynb - Image augmentation strategies
- unet_example.ipynb - U-Net model implementation
- DeepLabv3.ipynb - DeepLabV3+ configuration
- metrics.ipynb - UNet vs DeepLabv3 results comparison
Simple UI was created using PySide6
Overall DeepLabv3 showed better results (see metrics.ipynb
)