navpan2 commited on
Commit
6b2cb25
·
verified ·
1 Parent(s): c98c730

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +8 -12
main.py CHANGED
@@ -27,12 +27,12 @@ class_labels = {
27
  3: "Apple___healthy",
28
  4: "Background_without_leaves",
29
  5: "Blueberry___healthy",
30
- 6: "Cherry_(including_sour)___Powdery_mildew",
31
- 7: "Cherry_(including_sour)___healthy",
32
- 8: "Corn_(maize)___Cercospora_leaf_spot Gray_leaf_spot",
33
- 9: "Corn_(maize)___Common_rust_",
34
- 10: "Corn_(maize)___Northern_Leaf_Blight",
35
- 11: "Corn_(maize)___healthy",
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
- "class_index": class_idx,
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")