MedMagik commited on
Commit
a2b7602
·
verified ·
1 Parent(s): 12e571a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -8,7 +8,7 @@ import numpy as np
8
  model = load_model('Densenet.h5')
9
  model.load_weights("pretrained_model.h5")
10
  class_names = ['Cardiomegaly', 'Emphysema', 'Effusion', 'Hernia', 'Infiltration', 'Mass', 'Nodule', 'Atelectasis', 'Pneumothorax', 'Pleural_Thickening', 'Pneumonia', 'Fibrosis', 'Edema', 'Consolidation']
11
- def custom_decode_predictions(predictions, class_lables):
12
 
13
  decoded_predictions = []
14
  for pred in predictions:
@@ -21,7 +21,7 @@ def custom_decode_predictions(predictions, class_lables):
21
 
22
  def classify_image(img):
23
  img_array = img_to_array(img)
24
- img_array = np.expand_dims(img_array, axis=0))
25
  img_array = preprocess_input(img_array)
26
  predictions = model.predict(img_array)
27
  decoded_predictions = custom_decode_predictions(predictions, class_names)
 
8
  model = load_model('Densenet.h5')
9
  model.load_weights("pretrained_model.h5")
10
  class_names = ['Cardiomegaly', 'Emphysema', 'Effusion', 'Hernia', 'Infiltration', 'Mass', 'Nodule', 'Atelectasis', 'Pneumothorax', 'Pleural_Thickening', 'Pneumonia', 'Fibrosis', 'Edema', 'Consolidation']
11
+ def custom_decode_predictions(predictions, class_labels):
12
 
13
  decoded_predictions = []
14
  for pred in predictions:
 
21
 
22
  def classify_image(img):
23
  img_array = img_to_array(img)
24
+ img_array = np.expand_dims(img_array, axis=0)
25
  img_array = preprocess_input(img_array)
26
  predictions = model.predict(img_array)
27
  decoded_predictions = custom_decode_predictions(predictions, class_names)