Abdul09 commited on
Commit
6ac284f
1 Parent(s): 4f290c4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -2,9 +2,13 @@ import gradio as gr
2
  import numpy as np
3
 
4
 
 
 
 
 
5
  def Normal_or_Pneumonia(img):
6
  img = img.reshape( -1, 180, 180,3 )
7
- prediction = model.predict(img).tolist()[0]
8
  CLASS_NAMES = ["PNEUMONIA DETECTOR"]
9
  return {CLASS_NAMES[i]: prediction[i] for i in range(1)}
10
 
@@ -20,4 +24,4 @@ iface = gr.Interface(
20
  inputs = image_input,
21
  outputs = gr.outputs.Label(),
22
  )
23
- iface.launch( enable_queue=True)
 
2
  import numpy as np
3
 
4
 
5
+
6
+ # load the trained CNN model
7
+ cnn_model = keras.models.load_model("fine_tuning.keras")
8
+
9
  def Normal_or_Pneumonia(img):
10
  img = img.reshape( -1, 180, 180,3 )
11
+ prediction = cnn_model .predict(img).tolist()[0]
12
  CLASS_NAMES = ["PNEUMONIA DETECTOR"]
13
  return {CLASS_NAMES[i]: prediction[i] for i in range(1)}
14
 
 
24
  inputs = image_input,
25
  outputs = gr.outputs.Label(),
26
  )
27
+ iface.launch(share=True , debug = True)