Sambhavnoobcoder commited on
Commit
4c317e4
·
verified ·
1 Parent(s): 2b7c009

changed grade import to the top.

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -1,6 +1,8 @@
1
  from tensorflow.keras.models import load_model
2
  import numpy as np
3
  import cv2
 
 
4
 
5
  model = load_model('model-3.h5')
6
 
@@ -11,7 +13,6 @@ def predict_from_img(img):
11
  output = model.predict(img)[0][0]
12
  return {'NORMAL':float(output),'PNEUMONIA':float(1-output)}
13
 
14
- import gradio as gr
15
  image = gr.inputs.Image(shape=(150,150))
16
  label = gr.outputs.Label(num_top_classes=2)
17
  gr.Interface(fn=predict_from_img, inputs=image, outputs=label,title = 'PNEUMONIA-DETECTION').launch()
 
1
  from tensorflow.keras.models import load_model
2
  import numpy as np
3
  import cv2
4
+ import gradio as gr
5
+
6
 
7
  model = load_model('model-3.h5')
8
 
 
13
  output = model.predict(img)[0][0]
14
  return {'NORMAL':float(output),'PNEUMONIA':float(1-output)}
15
 
 
16
  image = gr.inputs.Image(shape=(150,150))
17
  label = gr.outputs.Label(num_top_classes=2)
18
  gr.Interface(fn=predict_from_img, inputs=image, outputs=label,title = 'PNEUMONIA-DETECTION').launch()