Mushfi commited on
Commit
e49974f
·
1 Parent(s): d75235b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -9,7 +9,12 @@ model = tf.keras.models.load_model('model.hdf5')
9
  LABELS = ['NORMAL', 'TUBERCULOSIS', 'PNEUMONIA', 'COVID19']
10
 
11
  def predict_input_image(img):
12
- img_4d=img.reshape(-1,128,128,3)/255.0
 
 
 
 
 
13
  print(img_4d.min())
14
  print(img_4d.max())
15
  prediction=model.predict(img_4d)[0]
 
9
  LABELS = ['NORMAL', 'TUBERCULOSIS', 'PNEUMONIA', 'COVID19']
10
 
11
  def predict_input_image(img):
12
+ try:
13
+ img = Image.open(BytesIO(base64.b64decode(img)))
14
+ img = np.array(img)
15
+ except:
16
+ pass
17
+ img_4d=img.reshape(-1,128,128,3)/img.max()
18
  print(img_4d.min())
19
  print(img_4d.max())
20
  prediction=model.predict(img_4d)[0]