amirTamer commited on
Commit
14483b4
·
1 Parent(s): fefbbdc

La7ma bel basal

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -52,7 +52,7 @@ svm_scaler = load_pickle_file("svmScaler.pkl")
52
 
53
 
54
 
55
- knn_model = load_pickle_file('knn_final_model.pkl')
56
 
57
  gnb_multimode_model = load_pickle_file('gnbMulti.pkl')
58
  gnb_multimode_model = gnb_multimode_model["model"]
@@ -136,10 +136,10 @@ def classify_binary_logreg(image):
136
 
137
 
138
  def classify_knn(image):
139
- if knn_model is None:
140
  return "KNN Binary model placeholder: model is not inserted yet."
141
  processed_image = preprocess_image(image, "KNN", "Binary")
142
- prediction = knn_model.predict(processed_image)
143
 
144
  if prediction[0] == 1:
145
  return "KNN Binary: Is 6"
 
52
 
53
 
54
 
55
+ knn_model_binary = load_pickle_file('knn_final_model.pkl')
56
 
57
  gnb_multimode_model = load_pickle_file('gnbMulti.pkl')
58
  gnb_multimode_model = gnb_multimode_model["model"]
 
136
 
137
 
138
  def classify_knn(image):
139
+ if knn_model_binary is None:
140
  return "KNN Binary model placeholder: model is not inserted yet."
141
  processed_image = preprocess_image(image, "KNN", "Binary")
142
+ prediction = knn_model_binary.predict(processed_image)
143
 
144
  if prediction[0] == 1:
145
  return "KNN Binary: Is 6"