Neurolingua commited on
Commit
37364bc
1 Parent(s): 9f66cd7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -56,13 +56,16 @@ def whatsapp_webhook():
56
  if content_type.startswith('image/'):
57
  # Handle image processing (disease/pest detection)
58
  filepath = convert_img(media_url, account_sid, auth_token)
59
- if predict_disease(filepath):
60
-
61
- response_text = predict_disease(filepath)
62
- elif predict_pest(filepath):
63
- response_text=predict_pest(filepath)
 
 
 
64
  else:
65
- response_text = "Please upload other image with good quality."
66
 
67
  else:
68
  # Handle PDF processing
 
56
  if content_type.startswith('image/'):
57
  # Handle image processing (disease/pest detection)
58
  filepath = convert_img(media_url, account_sid, auth_token)
59
+ if os.path.exists(filepath):
60
+ if predict_disease(filepath):
61
+
62
+ response_text = predict_disease(filepath)
63
+ elif predict_pest(filepath):
64
+ response_text=predict_pest(filepath)
65
+ else:
66
+ response_text = "Please upload other image with good quality."
67
  else:
68
+ response_text = 'No data'
69
 
70
  else:
71
  # Handle PDF processing