Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,11 +12,11 @@ def predict_input_image(img):
|
|
12 |
img = img.convert('RGB')
|
13 |
img = img.resize((224, 224))
|
14 |
img = np.array(img).reshape(1, 224, 224, 3) # Reshape the image to match the model input
|
15 |
-
|
16 |
# Make predictions
|
17 |
prediction = model.predict(img)
|
18 |
result = 'No Tumor Detected' if prediction[0][0] > 0.5 else 'Tumor detected'
|
19 |
-
|
20 |
return f"Prediction: {result}"
|
21 |
|
22 |
# Define Gradio interface
|
|
|
12 |
img = img.convert('RGB')
|
13 |
img = img.resize((224, 224))
|
14 |
img = np.array(img).reshape(1, 224, 224, 3) # Reshape the image to match the model input
|
15 |
+
|
16 |
# Make predictions
|
17 |
prediction = model.predict(img)
|
18 |
result = 'No Tumor Detected' if prediction[0][0] > 0.5 else 'Tumor detected'
|
19 |
+
|
20 |
return f"Prediction: {result}"
|
21 |
|
22 |
# Define Gradio interface
|