Spaces:
Sleeping
Sleeping
hoping no errors
Browse files
app.py
CHANGED
|
@@ -96,7 +96,7 @@ logreg_multimode_model = load_pickle_file('multiLog2_hog.pkl')
|
|
| 96 |
|
| 97 |
def preprocess_image(image, model_choice, mode_choice):
|
| 98 |
|
| 99 |
-
image = cv2.resize(image, (28, 28))
|
| 100 |
image = np.array(image)
|
| 101 |
image = image / 255.0
|
| 102 |
image_hog = hog(
|
|
@@ -113,6 +113,7 @@ def preprocess_image(image, model_choice, mode_choice):
|
|
| 113 |
elif model_choice == "SVM":
|
| 114 |
image_r = image.reshape(1,-1)
|
| 115 |
scaled_img = svm_scaler.transform(image_r)
|
|
|
|
| 116 |
svm_img_hog = hog(scaled_img, **hog_params)
|
| 117 |
return svm_img_hog
|
| 118 |
else:
|
|
|
|
| 96 |
|
| 97 |
def preprocess_image(image, model_choice, mode_choice):
|
| 98 |
|
| 99 |
+
#image = cv2.resize(image, (28, 28))
|
| 100 |
image = np.array(image)
|
| 101 |
image = image / 255.0
|
| 102 |
image_hog = hog(
|
|
|
|
| 113 |
elif model_choice == "SVM":
|
| 114 |
image_r = image.reshape(1,-1)
|
| 115 |
scaled_img = svm_scaler.transform(image_r)
|
| 116 |
+
scaled_img = scaled_img.reshape(28,28)
|
| 117 |
svm_img_hog = hog(scaled_img, **hog_params)
|
| 118 |
return svm_img_hog
|
| 119 |
else:
|