kkhushisaid commited on
Commit
7e12558
·
verified ·
1 Parent(s): 8acd459

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -12,11 +12,11 @@ def predict(image):
12
  # Convert to grayscale
13
  img = ImageOps.grayscale(image)
14
 
15
- # Resize image to match the model's expected input size (280x280)
16
- img = img.resize((280, 280)) # Adjusted the size to 280x280
17
 
18
  # Convert to numpy array and normalize the pixel values
19
- img_array = np.array(img).reshape(1, 280 * 280) / 255.0 # Flattened image to 78400
20
 
21
  # Make prediction
22
  prediction = model.predict(img_array)
 
12
  # Convert to grayscale
13
  img = ImageOps.grayscale(image)
14
 
15
+ # Resize image to match the model's expected input size (299x299)
16
+ img = img.resize((299, 299)) # Resize to 299x299
17
 
18
  # Convert to numpy array and normalize the pixel values
19
+ img_array = np.array(img).reshape(1, 299, 299, 1) / 255.0 # Reshape to (1, 299, 299, 1)
20
 
21
  # Make prediction
22
  prediction = model.predict(img_array)