Spaces:
Sleeping
Sleeping
Commit ·
c6b397a
1
Parent(s): 53f5dd5
weiofj
Browse files
main.py
CHANGED
|
@@ -338,7 +338,9 @@ async def predict_single_image_self(file: UploadFile):
|
|
| 338 |
|
| 339 |
# Convert prediction indices to class labels
|
| 340 |
predicted_class_index = np.argmax(predictions)
|
| 341 |
-
predicted_class_label = class_plant_leaves_merged.get(
|
|
|
|
|
|
|
| 342 |
|
| 343 |
matched_rows = df[df["Plant Name"] == predicted_class_label.lower()]
|
| 344 |
matched_rows_json = matched_rows.to_json(orient="records")
|
|
@@ -411,5 +413,9 @@ async def predict_single_image_self_demo(file: UploadFile):
|
|
| 411 |
return {"error": str(e)}
|
| 412 |
|
| 413 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 414 |
if __name__ == "__main__":
|
| 415 |
uvicorn.run(app, port=8000)
|
|
|
|
| 338 |
|
| 339 |
# Convert prediction indices to class labels
|
| 340 |
predicted_class_index = np.argmax(predictions)
|
| 341 |
+
predicted_class_label = class_plant_leaves_merged.get(
|
| 342 |
+
predicted_class_index, "Unknown"
|
| 343 |
+
)
|
| 344 |
|
| 345 |
matched_rows = df[df["Plant Name"] == predicted_class_label.lower()]
|
| 346 |
matched_rows_json = matched_rows.to_json(orient="records")
|
|
|
|
| 413 |
return {"error": str(e)}
|
| 414 |
|
| 415 |
|
| 416 |
+
def hi():
|
| 417 |
+
return "si"
|
| 418 |
+
|
| 419 |
+
|
| 420 |
if __name__ == "__main__":
|
| 421 |
uvicorn.run(app, port=8000)
|