Spaces:
Sleeping
Sleeping
Upload api.py
Browse files
api.py
CHANGED
|
@@ -15,6 +15,10 @@ processor = AutoImageProcessor.from_pretrained(model_name)
|
|
| 15 |
model = AutoModelForImageClassification.from_pretrained(model_name)
|
| 16 |
print("Model loaded successfully!")
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
@app.post("/predict")
|
| 19 |
async def predict_skin_disease(file: UploadFile = File(...)):
|
| 20 |
if not file.content_type.startswith('image/'):
|
|
|
|
| 15 |
model = AutoModelForImageClassification.from_pretrained(model_name)
|
| 16 |
print("Model loaded successfully!")
|
| 17 |
|
| 18 |
+
@app.get("/")
|
| 19 |
+
async def root():
|
| 20 |
+
return {"message": "Skin Disease Classifier API is running. Send a POST request with an image to /predict."}
|
| 21 |
+
|
| 22 |
@app.post("/predict")
|
| 23 |
async def predict_skin_disease(file: UploadFile = File(...)):
|
| 24 |
if not file.content_type.startswith('image/'):
|