Hellexas/VAS_BuildingSegmentation

0

stars

0

commits

Python

primary language

Aug 10, 2026

updated

README

🏢 AI Building Segmenter (VAS_ND)

A professional-grade satellite imagery analysis tool for automatic building segmentation. Built with Transformers (Segformer) and CustomTkinter, this project provides a complete pipeline from training to a standalone desktop application.

App Screenshot

🌟 Key Features

  • Intuitive GUI: Modern, dark-themed interface built for Windows.
  • AI + Classical Hybrid: Compare state-of-the-art Segformer models with optimized OpenCV classical methods.
  • Multi-Model Support: Switch between Segformer B2, B3, and B4 architectures on the fly.
  • 3-Way TTA Inference: Integrated Test-Time Augmentation (Horizontal & Vertical flips) for maximum segmentation accuracy.
  • Model Comparison Tool: Built-in utility to benchmark different model weights against ground-truth masks using IoU and Dice (Medical) metrics.
  • Standalone Portable App: Distributed as a onedir executable with all dependencies bundled.
  • Flexible Training: Includes standard training scripts and a special 15-minute "Timed Training" mode for educational demonstrations.

📁 Project Structure

  • app_gui.py: The core GUI application logic.
  • neural2.py: Advanced training script with a built-in 15-minute time limit feature.
  • classical.py: Optimized computer vision segmentation (Otsu, HSV filtering, Shape analysis).
  • compare_models.py: Standalone CLI tool for benchmarking model performance.
  • samples/: Integrated gallery of 20 sample images and matching ground-truth masks.
  • PREZENTACIJA.md: Full structure for a 10-slide project presentation.
  • BuildingSegmenter.spec: PyInstaller configuration for generating the portable .exe.

🚀 Getting Started

Prerequisites

  • Python 3.10+
  • CUDA-enabled GPU (Highly recommended for training and fast inference)

Installation

  1. Clone the repository:

    git clone https://github.com/YourUsername/Building-Segmentation-AI.git
    cd Building-Segmentation-AI
    
  2. Download Model Weights:

    • Download the .pth files (e.g., B2_segformer_...pth) from GitHub Releases - v1.0.
    • Place the downloaded weights directly into the root directory of the project.
  3. Create and activate a virtual environment:

    python -m venv .venv
    .\.venv\Scripts\Activate.ps1
    
  4. Install dependencies:

    pip install -r requirements.txt
    

Running the Application

To launch the GUI in development mode:

python app_gui.py

🧠 Training & Evaluation

The project is optimized for the Massachusetts Buildings Dataset.

  • Full Training: Run python neural2.py for a high-performance two-stage training session.
  • Timed Demo (15 min): Run python neural2.py to see the best possible model achieved in a strict 15-minute window.
  • Classical Analysis: Run python classical.py to evaluate traditional CV accuracy.
  • Comparison: Use the "Compare All Models" button in the GUI to see a ranked table of IoU/Dice metrics.

📦 Distribution

To build the standalone .exe yourself:

pyinstaller BuildingSegmenter.spec --noconfirm

The result will be available in the dist/BuildingSegmenter/ folder.

📜 License & Credits


Developed for educational and research purposes in satellite imagery analysis.

Hellexas/VAS_BuildingSegmentation

0

stars

0

commits

Python

primary language

Aug 10, 2026

updated

README

🏢 AI Building Segmenter (VAS_ND)

A professional-grade satellite imagery analysis tool for automatic building segmentation. Built with Transformers (Segformer) and CustomTkinter, this project provides a complete pipeline from training to a standalone desktop application.

App Screenshot

🌟 Key Features

  • Intuitive GUI: Modern, dark-themed interface built for Windows.
  • AI + Classical Hybrid: Compare state-of-the-art Segformer models with optimized OpenCV classical methods.
  • Multi-Model Support: Switch between Segformer B2, B3, and B4 architectures on the fly.
  • 3-Way TTA Inference: Integrated Test-Time Augmentation (Horizontal & Vertical flips) for maximum segmentation accuracy.
  • Model Comparison Tool: Built-in utility to benchmark different model weights against ground-truth masks using IoU and Dice (Medical) metrics.
  • Standalone Portable App: Distributed as a onedir executable with all dependencies bundled.
  • Flexible Training: Includes standard training scripts and a special 15-minute "Timed Training" mode for educational demonstrations.

📁 Project Structure

  • app_gui.py: The core GUI application logic.
  • neural2.py: Advanced training script with a built-in 15-minute time limit feature.
  • classical.py: Optimized computer vision segmentation (Otsu, HSV filtering, Shape analysis).
  • compare_models.py: Standalone CLI tool for benchmarking model performance.
  • samples/: Integrated gallery of 20 sample images and matching ground-truth masks.
  • PREZENTACIJA.md: Full structure for a 10-slide project presentation.
  • BuildingSegmenter.spec: PyInstaller configuration for generating the portable .exe.

🚀 Getting Started

Prerequisites

  • Python 3.10+
  • CUDA-enabled GPU (Highly recommended for training and fast inference)

Installation

  1. Clone the repository:

    git clone https://github.com/YourUsername/Building-Segmentation-AI.git
    cd Building-Segmentation-AI
    
  2. Download Model Weights:

    • Download the .pth files (e.g., B2_segformer_...pth) from GitHub Releases - v1.0.
    • Place the downloaded weights directly into the root directory of the project.
  3. Create and activate a virtual environment:

    python -m venv .venv
    .\.venv\Scripts\Activate.ps1
    
  4. Install dependencies:

    pip install -r requirements.txt
    

Running the Application

To launch the GUI in development mode:

python app_gui.py

🧠 Training & Evaluation

The project is optimized for the Massachusetts Buildings Dataset.

  • Full Training: Run python neural2.py for a high-performance two-stage training session.
  • Timed Demo (15 min): Run python neural2.py to see the best possible model achieved in a strict 15-minute window.
  • Classical Analysis: Run python classical.py to evaluate traditional CV accuracy.
  • Comparison: Use the "Compare All Models" button in the GUI to see a ranked table of IoU/Dice metrics.

📦 Distribution

To build the standalone .exe yourself:

pyinstaller BuildingSegmenter.spec --noconfirm

The result will be available in the dist/BuildingSegmenter/ folder.

📜 License & Credits


Developed for educational and research purposes in satellite imagery analysis.

Languages

Python

100.0%