Spaces:
Build error
Build error
Update app.py
#4
by Miing - opened
app.py
CHANGED
|
@@ -8,8 +8,8 @@ class_names = ['AnnualCrop', 'Forest', 'HerbaceousVegetation', 'Highway', 'Indus
|
|
| 8 |
|
| 9 |
# Function to load the selected model
|
| 10 |
def load_selected_model(model_name):
|
| 11 |
-
if model_name == "
|
| 12 |
-
return load_model('
|
| 13 |
elif model_name == "CNN_model.h5":
|
| 14 |
return load_model('CNN_model.h5')
|
| 15 |
else:
|
|
@@ -46,7 +46,7 @@ with gr.Blocks() as demo:
|
|
| 46 |
|
| 47 |
with gr.Row():
|
| 48 |
with gr.Column():
|
| 49 |
-
model_selector = gr.Dropdown(choices=["
|
| 50 |
image_input = gr.Image(type="numpy", label="Upload Image")
|
| 51 |
predict_button = gr.Button("Predict")
|
| 52 |
|
|
|
|
| 8 |
|
| 9 |
# Function to load the selected model
|
| 10 |
def load_selected_model(model_name):
|
| 11 |
+
if model_name == "ResNet50_model.h5":
|
| 12 |
+
return load_model('ResNet50_model.h5')
|
| 13 |
elif model_name == "CNN_model.h5":
|
| 14 |
return load_model('CNN_model.h5')
|
| 15 |
else:
|
|
|
|
| 46 |
|
| 47 |
with gr.Row():
|
| 48 |
with gr.Column():
|
| 49 |
+
model_selector = gr.Dropdown(choices=["ResNet50_model.h5", "CNN_model.h5"], label="Select Model")
|
| 50 |
image_input = gr.Image(type="numpy", label="Upload Image")
|
| 51 |
predict_button = gr.Button("Predict")
|
| 52 |
|