Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -27,12 +27,12 @@ class_labels = {
|
|
27 |
3: "Apple___healthy",
|
28 |
4: "Background_without_leaves",
|
29 |
5: "Blueberry___healthy",
|
30 |
-
6: "
|
31 |
-
7: "
|
32 |
-
8: "
|
33 |
-
9: "
|
34 |
-
10: "
|
35 |
-
11: "
|
36 |
12: "Grape___Black_rot",
|
37 |
13: "Grape___Esca_(Black_Measles)",
|
38 |
14: "Grape___Leaf_blight_(Isariopsis_Leaf_Spot)",
|
@@ -93,12 +93,8 @@ def predict_image(image_data):
|
|
93 |
except Exception as e:
|
94 |
external_data = {"error": str(e)}
|
95 |
|
96 |
-
return
|
97 |
-
|
98 |
-
"class_label": class_label,
|
99 |
-
"confidence": confidence,
|
100 |
-
"external_data": external_data
|
101 |
-
}
|
102 |
|
103 |
# Route for health check
|
104 |
@app.get("/health")
|
|
|
27 |
3: "Apple___healthy",
|
28 |
4: "Background_without_leaves",
|
29 |
5: "Blueberry___healthy",
|
30 |
+
6: "Cherry___Powdery_mildew",
|
31 |
+
7: "Cherry___healthy",
|
32 |
+
8: "Corn___Cercospora_leaf_spot Gray_leaf_spot",
|
33 |
+
9: "Corn___Common_rust_",
|
34 |
+
10: "Corn___Northern_Leaf_Blight",
|
35 |
+
11: "Corn___healthy",
|
36 |
12: "Grape___Black_rot",
|
37 |
13: "Grape___Esca_(Black_Measles)",
|
38 |
14: "Grape___Leaf_blight_(Isariopsis_Leaf_Spot)",
|
|
|
93 |
except Exception as e:
|
94 |
external_data = {"error": str(e)}
|
95 |
|
96 |
+
return external_data
|
97 |
+
|
|
|
|
|
|
|
|
|
98 |
|
99 |
# Route for health check
|
100 |
@app.get("/health")
|