CoolFace
Apppublic

bhumika-tewari-282006/cabbageguard-backend

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

CabbageGuard AI — Backend (Hugging Face Space)

This Space runs the real CabbageGuard AI FastAPI backend for the eight-class CabbageGuard model (auth, /predict, /gradcam, /history, /analytics, /diseases, /feedback, /admin) as a standing CPU Docker service. It is synced automatically from the GitHub repo main branch by .github/workflows/hf_sync.yml on every push that touches backend/ or training/knowledge_base/ — do not edit files in this Space directly, they will be overwritten on the next sync.

Required Space secrets (Settings → Variables and secrets)

NamePurpose
FIREBASE_ADMINSDK_JSONFull contents of the Firebase Admin SDK service-account JSON
FIREBASE_WEB_API_KEYFirebase Web API key (for the /auth/login REST exchange)
HF_READ_TOKENRead token for the private client-owned classifier and optional severity repositories; keep it only as a Space secret
CORS_ORIGINThe deployed frontend origin, e.g. https://cabbageguard-ai.vercel.app

Non-secret Space variables

NameValue
FIREBASE_PROJECT_IDcabbage-guard
HF_CLASSIFIER_REPObhumika-tewari-282006/cabbageguard-efficientnetv2-8class
HF_SEVERITY_REPObhumika-tewari-282006/cabbageguard-severity-leaf-pseudo when research severity is explicitly enabled; otherwise empty
HF_SEVERITY_MODEunavailable by default; use pseudo_supervised only to expose the disclosed research tier estimate; never use validated for this repository
ENVIRONMENTproduction

The classifier output order is alternaria_leaf_spot, bacterial_leaf_spot, black_rot, clubroot, downy_mildew, grey_mould, healthy, ringspot; the Space must use the matching private Hugging Face repository and HF_READ_TOKEN. The severity repository outputs the four tiers healthy, mild, moderate, severe and is marked pseudo_supervised because its labels are deterministic weak pseudo-labels rather than expert annotations. Clubroot remains not_applicable for leaf-only inference.

Health check

GET /health → {"status": "ok", ...}