INNER CODE UNIT · Python

root

DataTalksClub/machine-learning-zoomcamp · cohorts/2026/10-kubernetes/workshop/service/app.py:69

def root():
    return {"message": "Clothing Classification Service"}


@app.get("/health")
def health():
    return {"status": "healthy"}


@app.post("/predict", response_model=PredictResponse)
def predict_endpoint(request: PredictRequest):
    predictions, top_class, top_prob = predict(str(request.url))
    
    return PredictResponse(
        predictions=predictions,
        top_class=top_class,
        top_probability=top_prob
    )

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…