CoolFace
Apppublic

vibhu123/fusing_boundaries

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
0likes
App README

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 URL
  • —POST /api/upload - Upload an image and detect buildings
  • —GET /api/status/{task_id} - Get processing status
  • —GET /api/stats - Get API usage statistics

Results

  • —GET /results/{filename} - Access processed result images

Deployment

Local Development

  1. 1.Clone this repository
  2. 2.Install Docker and Docker Compose
  3. 3.Run the application:
bash
docker-compose up --build
  1. 1.Access the application at http://localhost:7860

Hugging Face Spaces Deployment

This project is configured for one-click deployment to Hugging Face Spaces:

  1. 1.Fork this repository
  2. 2.Create a new Space on Hugging Face
  3. 3.Select Docker as the SDK
  4. 4.Connect your GitHub repository
  5. 5.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 Dockerfile

Example Usage

Detect Buildings from URL

python
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

python
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