vibhu123/fusing_boundaries
GeoAI Building Footprint Detection
Welcome to the GeoAI Building Footprint Detection platform! This application provides both a powerful API and a user-friendly web interface for detecting buildings in satellite imagery using advanced machine learning techniques.
Architecture
This project uses a modern microservices architecture with Docker:
- Backend: FastAPI application providing the core GeoAI functionality
- Frontend: Next.js web application providing a user interface
- Nginx: Reverse proxy for routing requests between frontend and backend
The entire stack is containerized using Docker Compose for easy deployment and scalability.
Features
- Upload satellite images for building footprint detection
- Process images from URLs
- Interactive web interface for result visualization
- Get detailed information about detected buildings
- Track processing status and statistics
- Download results in various formats
API Endpoints
Health Check
GET /health- Health check endpoint
Building Detection
POST /api/detect- Detect buildings from image URLPOST /api/upload- Upload an image and detect buildingsGET /api/status/{task_id}- Get processing statusGET /api/stats- Get API usage statistics
Results
GET /results/{filename}- Access processed result images
Deployment
Local Development
- Clone this repository
- Install Docker and Docker Compose
- Run the application:
docker-compose up --build- Access the application at http://localhost:7860
Hugging Face Spaces Deployment
This project is configured for one-click deployment to Hugging Face Spaces:
- Fork this repository
- Create a new Space on Hugging Face
- Select Docker as the SDK
- Connect your GitHub repository
- The application will be deployed automatically
Technology Stack
- Backend: Python 3.9, FastAPI, OpenCV, PyTorch
- Frontend: Next.js, React, TailwindCSS
- Infrastructure: Docker, Docker Compose, Nginx
- Deployment: Hugging Face Spaces
Development
The project structure is organized as follows:
.
├── backend/ # Backend API service
│ ├── app.py # FastAPI application
│ ├── Dockerfile # Backend container definition
│ └── requirements.txt
├── frontend/ # Next.js frontend application
│ ├── src/ # Frontend source code
│ ├── Dockerfile # Frontend container definition
│ └── package.json
├── nginx/ # Nginx reverse proxy configuration
├── docker-compose.yml # Service orchestration
└── Dockerfile.hf # Hugging Face Spaces DockerfileExample Usage
Detect Buildings from URL
import requests
import json
url = "https://hf.space/vibhu123/fusing_boundaries/detect"
payload = {
"image_url": "https://example.com/satellite_image.jpg"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, data=json.dumps(payload), headers=headers)
print(response.json())Upload Image for Detection
import requests
url = "https://hf.space/vibhu123/fusing_boundaries/upload"
files = {"file": open("satellite_image.jpg", "rb")}
response = requests.post(url, files=files)
print(response.json())About
This project is part of the GeoAI Research Initiative aimed at developing advanced AI methods for geographic information extraction.
Built with FastAPI and deployed on Hugging Face Spaces.
Citation
If you use this API in your research, please cite:
@software{geoai_footprint_2025,
author = {Vibhor Joshi},
title = {GeoAI Building Footprint Detection},
year = {2025},
url = {https://huggingface.co/spaces/vibhu123/fusing_boundaries}
}Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
