MisbahKhan/Dehazing-Backend
0
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
- Install Python 3.8+.
- Install dependencies:
pip install -r requirements.txtUsage
- Start the server:
python main.py The server will start at http://0.0.0.0:8000.
- API Documentation: Go to
http://localhost:8000/docsto see the interactive API documentation.
- Example Inference (cURL):
curl -X POST -F "file=@path/to/your/image.png" http://localhost:8000/dehazeThe API returns a JSON response containing base64 encoded strings for both the processed input and output images:
{
"input_image": "base64_string...",
"output_image": "base64_string..."
}