pavankm96 commited on
Commit
ffcb0d4
·
verified ·
1 Parent(s): e2a8073

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -5,13 +5,13 @@ import cv2
5
  import tensorflow as tf # Assuming you're using TensorFlow for loading your model
6
 
7
  # Load your model
8
- model = tf.keras.models.load_model("Brain Tumors.h5")
9
 
10
  def img_pred(upload):
11
  # Convert the Gradio input image to OpenCV format
12
  opencvImage = cv2.cvtColor(np.array(upload), cv2.COLOR_RGB2BGR)
13
- img = cv2.resize(opencvImage, (150, 150))
14
- img = img.reshape(1, 150, 150, 3)
15
 
16
  # Predict using the model and get confidence
17
  predictions = model.predict(img)[0] # Get probabilities for each class
 
5
  import tensorflow as tf # Assuming you're using TensorFlow for loading your model
6
 
7
  # Load your model
8
+ model = tf.keras.models.load_model("brain_tumor.h5")
9
 
10
  def img_pred(upload):
11
  # Convert the Gradio input image to OpenCV format
12
  opencvImage = cv2.cvtColor(np.array(upload), cv2.COLOR_RGB2BGR)
13
+ img = cv2.resize(opencvImage, (128, 128))
14
+ img = img.reshape(1, 128, 128, 3)
15
 
16
  # Predict using the model and get confidence
17
  predictions = model.predict(img)[0] # Get probabilities for each class