CoolFace
Apppublic

MisbahKhan/Dehazing-Backend

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes
App README

Mamba Dehazing Backend

This is a standalone backend for the Mamba Dehazing model using FastAPI.

Structure

  • —main.py: The FastAPI application entry point.
  • —model.py: The PyTorch model architecture (MambaUNet).
  • —checkpoints/best.pt: Pre-trained model weights.
  • —requirements.txt: Python package dependencies.

Installation

  1. 1.Install Python 3.8+.
  2. 2.Install dependencies:
bash
   pip install -r requirements.txt

Usage

  1. 1.Start the server:
bash
   python main.py

The server will start at http://0.0.0.0:8000.

  1. 1.API Documentation: Go to http://localhost:8000/docs to see the interactive API documentation.
  1. 1.Example Inference (cURL):
bash
   curl -X POST -F "file=@path/to/your/image.png" http://localhost:8000/dehaze

The API returns a JSON response containing base64 encoded strings for both the processed input and output images:

json
   {
       "input_image": "base64_string...",
       "output_image": "base64_string..."
   }