microghost-thermal / README.md
Ibtida01's picture
Deploy MicroGhost Gradio backend
8f5271b
|
Raw
History Blame Contribute Delete
1.52 kB

A newer version of the Gradio SDK is available: 6.23.1

Upgrade
metadata
title: MicroGhost Thermal Inference
emoji: 🔥
colorFrom: green
colorTo: blue
sdk: gradio
sdk_version: 5.49.1
app_file: app.py
pinned: false
license: mit

MicroGhost Thermal Inference Space

This is the free Hugging Face Gradio Space backend for MicroGhost.

It gives you:

  • A small Gradio UI at /ui
  • GET /health
  • POST /analyze for the Vercel frontend

POST /analyze accepts multipart form uploads:

  • thermal_image: optional thermal image file
  • rgb_image: optional RGB image file
  • conf_thresh: optional float confidence threshold
  • lap_thresh: optional float Laplacian texture threshold, default 80
  • lap_bypass_conf: optional float confidence value that bypasses the Laplacian gate

At least one of thermal_image or rgb_image is required. If only one image is provided, the missing modality is replaced with a blank branch, matching the local thermal-only workflow.

Hugging Face Deployment

Create a new Hugging Face Space with:

SDK: Gradio
Hardware: CPU Basic
Visibility: Public

Then upload the contents of this backend/model folder to that Space.

The checkpoint expected by default is:

checkpoints/best_microghost_thermal_v3.pth

If you rename or move it, set this Space variable:

MODEL_PATH=/home/user/app/checkpoints/your_model_file.pth

For a public Vercel app, optional stricter CORS:

CORS_ORIGINS=https://your-vercel-domain.vercel.app

For local frontend testing:

CORS_ORIGINS=http://localhost:3000