Description
Add an API endpoint mode to the Gradio demo that allows programmatic access without the web UI, enabling integration with other tools and pipelines.
Current Behavior
The Gradio app (scripts/app.py) only serves the interactive web interface. Users who want to integrate LandmarkDiff into their pipelines must call the Python API directly.
Proposed Changes
- Add a
/api/predict endpoint that accepts JSON with base64-encoded images
- Return JSON with the result image, landmarks, and metadata
- Add a
--api-only flag to launch without the Gradio UI (lighter weight)
- Document the API schema with example curl commands
Acceptance Criteria
Labels
enhancement
Description
Add an API endpoint mode to the Gradio demo that allows programmatic access without the web UI, enabling integration with other tools and pipelines.
Current Behavior
The Gradio app (
scripts/app.py) only serves the interactive web interface. Users who want to integrate LandmarkDiff into their pipelines must call the Python API directly.Proposed Changes
/api/predictendpoint that accepts JSON with base64-encoded images--api-onlyflag to launch without the Gradio UI (lighter weight)Acceptance Criteria
/api/predictaccepts{"image": "<base64>", "procedure": "rhinoplasty", "intensity": 65}{"result": "<base64>", "landmarks": [...], "procedure": "..."}--api-onlyflag starts a lightweight FastAPI/Flask serverLabels
enhancement