Running Inference¶
Start the API Server¶
Server runs at http://localhost:8000
API Endpoints¶
Health Check¶
Predict¶
Response Format¶
{
"prediction": "malignant",
"confidence": 0.847,
"probabilities": {
"benign": 0.153,
"malignant": 0.847
}
}
Python Client¶
import requests
with open("image.jpg", "rb") as f:
response = requests.post(
"http://localhost:8000/predict",
files={"file": f}
)
result = response.json()
print(f"Prediction: {result['prediction']}")
print(f"Confidence: {result['confidence']:.2%}")