brxerq commited on
Commit
c1b2c58
·
verified ·
1 Parent(s): 6ceb078

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -25,7 +25,7 @@ model = create_mock_model()
25
 
26
  # Function to preprocess the image and make predictions
27
  def predict_image(image):
28
- # Resize the image to 224x224 and normalize
29
  img = cv2.resize(image, (224, 224))
30
  img = img / 255.0 # Normalize to [0, 1] range
31
 
@@ -36,8 +36,8 @@ def predict_image(image):
36
  label = train_info[top_class] # Get the corresponding label
37
  return label
38
 
39
- # Updated Gradio interface
40
- input_image = gr.Image(shape=(224, 224))
41
  output_label = gr.Label()
42
 
43
  # Launch the Gradio interface
 
25
 
26
  # Function to preprocess the image and make predictions
27
  def predict_image(image):
28
+ # Resize and normalize the image
29
  img = cv2.resize(image, (224, 224))
30
  img = img / 255.0 # Normalize to [0, 1] range
31
 
 
36
  label = train_info[top_class] # Get the corresponding label
37
  return label
38
 
39
+ # Define the Gradio interface without the 'shape' argument
40
+ input_image = gr.Image() # Removed 'shape' argument
41
  output_label = gr.Label()
42
 
43
  # Launch the Gradio interface