From 3b0416b9464b0fd07608a378db9644b44ae209d2 Mon Sep 17 00:00:00 2001 From: Asep Haryana Saputra <90584806+MythEclipse@users.noreply.github.com> Date: Fri, 22 May 2026 19:30:05 +0000 Subject: [PATCH] docs: add ML service usage guide Co-Authored-By: Claude Opus 4.7 --- apps/ml-service/README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 apps/ml-service/README.md diff --git a/apps/ml-service/README.md b/apps/ml-service/README.md new file mode 100644 index 0000000..af95d69 --- /dev/null +++ b/apps/ml-service/README.md @@ -0,0 +1,33 @@ +# ZeaVis ML Service + +FastAPI service for serving corn leaf disease predictions from the trained Keras model. + +## Setup + +```bash +python -m venv .venv +source .venv/bin/activate +pip install -r requirements.txt +``` + +The default model path is `../../Machine_Learning/best_model/best_model.keras`. Override it with `MODEL_PATH` if needed. + +## Run + +```bash +uvicorn main:app --host 0.0.0.0 --port 8001 +``` + +## Endpoints + +- `GET /health` — service status and model loaded status. +- `GET /metadata` — service name, version, labels, input size, model path, and model loaded status. +- `POST /predict` — multipart image upload for disease classification. + +## Verify + +```bash +curl http://localhost:8001/health +curl http://localhost:8001/metadata +curl -X POST http://localhost:8001/predict -F "file=@/path/to/corn-leaf.jpg" +```