Skip to content

VectorFlow-vvce/Track2_RootX

Repository files navigation

Xplendia - Off-Road Semantic Segmentation Dashboard

This project is a Streamlit-based hackathon demo for off-road semantic segmentation. It combines a polished dashboard with a PyTorch segmentation backend so users can upload an image, run inference, view the predicted mask, and compute IoU when a ground-truth mask is available.

What It Does

  • Upload an image and run segmentation
  • Show the prediction mask in clean class colors
  • Show an overlay view for easy visual comparison
  • Compute IoU when a ground-truth mask is provided
  • Display model performance, risk analysis, and summary pages
  • Fall back safely if the trained model is missing

Project Structure

  • project/app.py - Streamlit dashboard
  • project/iou_docs.py - IoU explanation block shown in the dashboard
  • model_loader.py - Model loading, preprocessing, prediction, mask coloring, and IoU helpers
  • XPLENDIA_GitHub/segmentation_head.pth - Model checkpoint used if a local one is not found

Requirements

Core packages:

  • streamlit
  • numpy
  • pillow
  • torch
  • opencv-python

Optional packages:

  • pandas
  • matplotlib

The app works even if the optional packages are missing, but some charts will fall back to simpler display modes.

How to Run

  1. Open a terminal in the project root.
  2. Activate your virtual environment if you are using one.
  3. Install dependencies:
pip install -r requirements.txt
  1. Start the app:
streamlit run project/app.py

IoU

IoU stands for Intersection over Union.

Formula:

IoU = Intersection / Union

The dashboard shows a dedicated IoU explanation section and uses the same calculation in the backend when a ground-truth mask is available.

Expected Input Files

For the sample viewer and risk analysis pages:

  • input image files such as sample1_input.png
  • ground-truth mask files such as sample1_mask.png
  • prediction files such as sample1_pred.png

For live upload:

  • upload an image
  • optionally upload a matching ground-truth mask

Notes

  • The dashboard keeps its dark theme and layout.
  • The backend tries to load the real model first.
  • If the model is missing or invalid, a safe fallback model keeps the app usable.
  • IoU is only shown when a ground-truth mask is available.

Troubleshooting

  • If the app opens but IoU says Not Available, upload a ground-truth mask too.
  • If the model is missing, check XPLENDIA_GitHub/segmentation_head.pth.
  • If a package import fails, reinstall the dependencies in a clean virtual environment.

Submission Checklist

  • Dashboard starts successfully
  • Upload and prediction flow works
  • Segmentation mask is shown
  • Overlay view is shown
  • IoU section is visible and documented
  • Model fallback works if the checkpoint is missing

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages