Spaces:
Sleeping
Sleeping
hoping no errors
Browse files
app.py
CHANGED
|
@@ -107,6 +107,10 @@ def preprocess_image(image, model_choice, mode_choice):
|
|
| 107 |
image_hog = image_hog.reshape(1, -1)
|
| 108 |
image_pca = pca.transform(image_hog)
|
| 109 |
return image_pca
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
else:
|
| 111 |
image_hog = image_hog.reshape(1, -1)
|
| 112 |
return image_hog
|
|
|
|
| 107 |
image_hog = image_hog.reshape(1, -1)
|
| 108 |
image_pca = pca.transform(image_hog)
|
| 109 |
return image_pca
|
| 110 |
+
elif model_choice == "SVM":
|
| 111 |
+
scaled_img = svm_scaler.transform(image)
|
| 112 |
+
svm_img_hog = hog(scaled_img, **hog_params)
|
| 113 |
+
return svm_img_hog
|
| 114 |
else:
|
| 115 |
image_hog = image_hog.reshape(1, -1)
|
| 116 |
return image_hog
|