MedMagik commited on
Commit
c4fa9d2
·
verified ·
1 Parent(s): 4ef3718

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -1,7 +1,11 @@
1
- model = tf.keras.models.load_model('densenet.h5')
 
 
 
 
2
  model.load_weights("pretrained_model.h5")
3
  class_names = ['Cardiomegaly', 'Emphysema', 'Effusion', 'Hernia', 'Infiltration', 'Mass', 'Nodule', 'Atelectasis', 'Pneumothorax', 'Pleural_Thickening', 'Pneumonia', 'Fibrosis', 'Edema', 'Consolidation']
4
- def custom_decode_predictions(predictions, class_labels):
5
 
6
  decoded_predictions = []
7
  for pred in predictions:
 
1
+ import tensorflow as tf
2
+ from tensorflow.keras.models import Model
3
+ from keras.models import load_model
4
+ import numpy as np
5
+ model = load_model('densenet.h5')
6
  model.load_weights("pretrained_model.h5")
7
  class_names = ['Cardiomegaly', 'Emphysema', 'Effusion', 'Hernia', 'Infiltration', 'Mass', 'Nodule', 'Atelectasis', 'Pneumothorax', 'Pleural_Thickening', 'Pneumonia', 'Fibrosis', 'Edema', 'Consolidation']
8
+ def custom_decode_predictions(predictions, class_lables):
9
 
10
  decoded_predictions = []
11
  for pred in predictions: