Spaces:
Sleeping
Sleeping
metadata
title: Oil Spill Detection
emoji: 🌊
colorFrom: blue
colorTo: indigo
sdk: docker
pinned: false
Oil Spill Detection & Monitoring System
This is a full-stack AI-driven application that detects oil spills from satellite imagery using a deep learning segmentation model (U-Net).
System Architecture
- AI/ML: TensorFlow / Keras (U-Net)
- Backend: FastAPI (REST API with Python)
- Frontend: React + Vite + TypeScript (Modern UI)
- Containerization: Docker & Docker Compose
Repository Directory Structure
backend/- FastAPI predict/health endpoints and Inference Enginefrontend/- React Vite App for the UImodel/- U-Net architecture, Custom losses, and Training logicutils/- Data loading and augmentation pipelines utilizingtf.data.Datasetdata/- Holds your images and masksnotebooks/- Place to run exploratory code
Getting Data (Google Drive)
Download the dataset using the following Google Drive link provided:
https://drive.google.com/drive/folders/1j35RM-5uZbTOfDv0mBTeRRmOUPvvg28t?usp=sharing
- Download the images and masks folders inside it.
- Place them inside the
./data/folder in the root directory like so:d:/Oill_SPLIT/data/images/ d:/Oill_SPLIT/data/masks/
Local Setup (Without Docker)
Backend
cd backendpip install -r requirements.txtuvicorn main:app --reloadThe API will be available athttp://localhost:8000
Frontend
cd frontendnpm installnpm run devThe React UI will be available athttp://localhost:5173
Setup (With Docker)
To run the entire suite using Docker:
docker-compose up --build
Model Training Instructions (Google Colab / Kaggle)
You can train the model on Google Colab leveraging the free T4 GPU.
- Zip the
model/,utils/, anddata/directories and upload them to Google Drive or directly to Colab/Kaggle. - Open a Colab Notebook.
- Install dependencies:
!pip install tensorflow scikit-learn pillow numpy - Run the training script:
!python model/train.py --data_dir ./data --save_dir ./model/saved_models --epochs 50 --batch_size 16 - Once trained, download
oil_spill_unet_best.kerasfrom./model/saved_modelsand place it in your local folder structure.
(Note: During initial development, if oil_spill_unet_best.keras isn't found, the backend will auto-initialize an untrained "stub" model so you can immediately test the UI and API offline).