Shahidmuneer's picture
Upload folder using huggingface_hub
8bd3ef8 verified
raw
history blame contribute delete
687 Bytes
"""Prediction API routes."""
from fastapi import APIRouter, Depends
from app.api.controllers import PredictionController
from app.api.models import ImageRequest, PredictionResponse
from app.core.dependencies import get_inference_service
from app.services.base import InferenceService
router = APIRouter()
@router.post("/predict", response_model=PredictionResponse)
async def predict(
request: ImageRequest,
service: InferenceService = Depends(get_inference_service)
):
"""
Run inference on base64-encoded image.
Returns prediction, confidence, predicted label, model name, and media type.
"""
return await PredictionController.predict(request, service)