Emmanuel Frimpong Asante
commited on
Commit
·
af09ede
1
Parent(s):
a03c68a
"Update space"
Browse filesSigned-off-by: Emmanuel Frimpong Asante <[email protected]>
app.py
CHANGED
@@ -109,9 +109,26 @@ class PoultryFarmBot:
|
|
109 |
if image is not None and image.size > 0: # Ensure image is valid and has elements
|
110 |
return self.predict(image)
|
111 |
elif symptoms:
|
112 |
-
#
|
113 |
-
|
114 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
|
116 |
# Inventory Management
|
117 |
def track_inventory(self, item, usage):
|
|
|
109 |
if image is not None and image.size > 0: # Ensure image is valid and has elements
|
110 |
return self.predict(image)
|
111 |
elif symptoms:
|
112 |
+
# Analyze the symptoms and provide a diagnosis
|
113 |
+
if "coughing" in symptoms.lower() and "sneezing" in symptoms.lower():
|
114 |
+
name = "Newcastle Disease"
|
115 |
+
status = "Critical"
|
116 |
+
recom = "Isolate the bird and consult a veterinarian immediately."
|
117 |
+
diagnosis = f"Based on symptoms, the chicken might have {name}. The condition is {status}. {recom}"
|
118 |
+
elif "diarrhea" in symptoms.lower():
|
119 |
+
name = "Coccidiosis"
|
120 |
+
status = "Critical"
|
121 |
+
recom = "Administer coccidiostat as directed by a veterinarian."
|
122 |
+
diagnosis = f"Based on symptoms, the chicken might have {name}. The condition is {status}. {recom}"
|
123 |
+
else:
|
124 |
+
name = "Unknown Disease"
|
125 |
+
status = "N/A"
|
126 |
+
recom = "Consult a veterinarian for further diagnosis."
|
127 |
+
diagnosis = f"Symptoms are not conclusive. {recom}"
|
128 |
+
|
129 |
+
return diagnosis, name, status, recom
|
130 |
+
|
131 |
+
return "Please provide an image or describe the symptoms.", None, None, None
|
132 |
|
133 |
# Inventory Management
|
134 |
def track_inventory(self, item, usage):
|