Spaces:
Sleeping
Sleeping
Create cnn.txt
Browse files
cnn.txt
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Brain Tumor Detection
|
| 2 |
+
|
| 3 |
+
Model file: models/braintumor.h5
|
| 4 |
+
Used in the route: /resultbt
|
| 5 |
+
CNN application: The uploaded brain scan image is preprocessed (cropped to the region of interest and resized to 224x224).
|
| 6 |
+
This preprocessed image is passed through the braintumor_model, which is a CNN, to predict whether the brain scan shows a tumor.
|
| 7 |
+
|
| 8 |
+
img = cv2.imread('static/uploads/'+filename)
|
| 9 |
+
img = crop_imgs([img])
|
| 10 |
+
img = img.reshape(img.shape[1:])
|
| 11 |
+
img = preprocess_imgs([img], (224, 224))
|
| 12 |
+
pred = braintumor_model.predict(img)
|