zynapse commited on
Commit
03aa314
·
verified ·
1 Parent(s): c8950db

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -8,10 +8,10 @@ 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 == "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:
16
  raise ValueError("Invalid model name")
17
 
@@ -46,7 +46,7 @@ with gr.Blocks() as demo:
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
 
 
8
 
9
  # Function to load the selected model
10
  def load_selected_model(model_name):
11
+ if model_name == "ResNet50":
12
+ return load_model('resnet.h5')
13
+ elif model_name == "CNN":
14
+ return load_model('cnn.h5')
15
  else:
16
  raise ValueError("Invalid model name")
17
 
 
46
 
47
  with gr.Row():
48
  with gr.Column():
49
+ model_selector = gr.Dropdown(choices=["ResNet50", "CNN"], label="Select Model")
50
  image_input = gr.Image(type="numpy", label="Upload Image")
51
  predict_button = gr.Button("Predict")
52