Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
import gradio as gr
|
3 |
|
4 |
# g. define Dropdown data type
|
5 |
-
input_module1 = gr.inputs.Dropdown(choices=["KNN", "Softmax", "Deep Neural", "SVM", "Decision Tree","Random Forest"
|
6 |
# b. define image data type
|
7 |
input_module2 = gr.inputs.Dropdown(choices=["image1", "image2", "image3", "image4","image5"], label = "Sample Image")
|
8 |
|
@@ -81,12 +81,6 @@ def multi_inputs(input1, input2):
|
|
81 |
loaded_model = pickle.load(open('randomforest.sav', 'rb'))
|
82 |
image = img.reshape((1, -1))
|
83 |
y_test_pred = loaded_model.predict(image)
|
84 |
-
|
85 |
-
if input1 == "CNN":
|
86 |
-
loaded_model = pickle.load(open('CNN.sav', 'rb'))
|
87 |
-
img = img.reshape((1, -1))
|
88 |
-
y_test_pred = loaded_model.predict(img)
|
89 |
-
y_test_pred = np.argmax(y_test_pred,axis=1)
|
90 |
|
91 |
result = y_test_pred[0]
|
92 |
|
|
|
2 |
import gradio as gr
|
3 |
|
4 |
# g. define Dropdown data type
|
5 |
+
input_module1 = gr.inputs.Dropdown(choices=["KNN", "Softmax", "Deep Neural", "SVM", "Decision Tree","Random Forest"], label = "Model Selection")
|
6 |
# b. define image data type
|
7 |
input_module2 = gr.inputs.Dropdown(choices=["image1", "image2", "image3", "image4","image5"], label = "Sample Image")
|
8 |
|
|
|
81 |
loaded_model = pickle.load(open('randomforest.sav', 'rb'))
|
82 |
image = img.reshape((1, -1))
|
83 |
y_test_pred = loaded_model.predict(image)
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
|
85 |
result = y_test_pred[0]
|
86 |
|