Flask‑based web app for detecting facial/skin anomalies and returning a matched condition label with supplement info. Upload an image, run the model, and get a result page with the predicted condition.
- Image upload + instant inference
- Condition label mapped from model output
- Result page with supplement info from CSV
- Simple Flask frontend
FaceGuard-AI/
├─ app.py
├─ predict.py
├─ data_files/
│ └─ supplement_info.csv
├─ trained_model/ # expected at runtime (see below)
│ ├─ best_model.h5
│ └─ datafile.json
├─ static/
├─ templates/
└─ model/ # training notebook
predict.py expects a folder named trained_model/ with:
best_model.h5datafile.json(label mapping)
If your model files are stored elsewhere, update this line in predict.py:
baseDir = os.path.join(os.getcwd(), 'trained_model')python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txtIf requirements.txt is missing, install the basics:
python -m pip install flask keras tensorflow pillow numpy pandaspython app.pyOpen http://localhost:5000 live https://faceguard-ai-qaw3.onrender.com
Form‑data field: file
Example:
curl -X POST http://localhost:5000/analyze -F "file=@/path/to/image.jpg"Response:
{ "product_id": 12 }Then open:
/result?id=12
- Uploaded images are saved temporarily to
images/and deleted after inference. supplement_info.csvdrives the label + supplement metadata used by the result page.
Anurag Kumar Singh