VedikaP commited on
Commit
7d568f6
·
verified ·
1 Parent(s): 4aee969

Initial Deployment

Browse files
Files changed (3) hide show
  1. app.py +23 -0
  2. model.h5 +3 -0
  3. requirements.txt +4 -0
app.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import numpy as np
3
+ import cv2
4
+ from tensorflow.keras.models import load_model
5
+
6
+ model = load_model("model.h5") # change if name differs
7
+
8
+ IMG_SIZE = 224 # adjust based on your model
9
+
10
+ def predict(image):
11
+ img = cv2.resize(image, (IMG_SIZE, IMG_SIZE))
12
+ img = img / 255.0
13
+ img = np.expand_dims(img, axis=0)
14
+
15
+ pred = model.predict(img)
16
+ return pred.tolist()
17
+
18
+ gr.Interface(
19
+ fn=predict,
20
+ inputs=gr.Image(type="numpy"),
21
+ outputs="text",
22
+ title="MRI / Ultrasound Classifier"
23
+ ).launch()
model.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5c039aa09e6e59e2f811edada33853d6c6859ede2b3564c7c893d6105f087254
3
+ size 134080104
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ tensorflow==2.20.0
2
+ gradio
3
+ numpy
4
+ opencv-python-headless