A modern web application for image segmentation using the MVANet deep learning model. Features a beautiful web dashboard and FastAPI-based backend for batch processing of images with real-time progress monitoring.
- Modern UI: Clean, responsive interface with real-time updates
- Job Submission: Easy folder path input for batch image processing
- Test-Time Augmentation: Toggle TTA for improved segmentation accuracy
- Real-time Console: Live processing logs with timestamps and color-coded messages
- Latest Image Viewer: Preview the most recently processed image with overlays
- Task Persistence: Processing continues across page refreshes - monitor from anywhere
- Recursive Folder Processing: Automatically finds and processes all 'images' folders
- Dual Output: Generates both segmentation masks and overlays
- GPU Acceleration: Supports CUDA for fast processing
- Background Processing: Non-blocking job execution with task tracking
- Error Handling: Comprehensive logging and error reporting
- Task submission and status tracking
- Real-time log streaming
- System status monitoring
- Image serving and retrieval
-
Clone the repository:
git clone https://github.com/OpsiClear/MVANet.git cd MVANet -
Install dependencies using
uv(recommended) orpip:# Using uv (faster) uv sync # Or using pip pip install -r requirements.txt
-
Ensure the model files are in the
models/directory:models/MVANet.pth- Main segmentation modelmodels/swin_base_patch4_window12_384_22kto1k.pth- Backbone model
Run the FastAPI server directly:
python api_app.pyThe application will start on http://localhost:8001 by default.
- Open your browser and navigate to
http://localhost:8001 - Enter the full path to your input folder (must contain folders named 'images')
- Toggle Test-Time Augmentation if desired (improves accuracy but slower)
- Click "Submit Job" to start processing
- Monitor progress in real-time via the console output
- View the latest processed image using the "Latest Image" button
Input Folder Structure:
your-input-folder/
├── images/ # Must be named 'images'
│ ├── image1.jpg
│ ├── image2.png
│ └── ...
Output Structure:
your-input-folder_overlay/ # Segmentation overlays
your-input-folder_masks/ # Binary masks
curl -X POST "http://localhost:8001/api/process" \
-H "Content-Type: application/json" \
-d '{
"input_folder": "/path/to/folder",
"use_tta": true
}'curl "http://localhost:8001/api/status/{request_id}"curl "http://localhost:8001/api/system/status"curl "http://localhost:8001/api/logs/{task_id}"curl "http://localhost:8001/api/latest-image"- Backend: FastAPI with async/await support
- Frontend: Bootstrap 5 with vanilla JavaScript
- Deep Learning: PyTorch with MVANet architecture
- Model Backbone: Swin Transformer
- Image Processing: PIL/Pillow, NumPy