pemujo commited on
Commit
8446dfd
·
1 Parent(s): 5464989

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -11
app.py CHANGED
@@ -45,17 +45,11 @@ metrics = [real_dice_coeff, tf.keras.metrics.MeanIoU(num_classes=2, sparse_y_tru
45
  model = load_model('unet_contrails_model.keras', custom_objects={'dice_loss_plus_5focal_loss': total_loss, 'jaccard_coef': jaccard_coef, 'IOU score' : sm.metrics.IOUScore(threshold=0.9, name="IOU score"), 'Dice Coeficient' : sm.metrics.FScore(threshold=0.6, name="Dice Coeficient")}, compile=False)
46
  model.compile(metrics=metrics)
47
 
48
- images_means = {175.1322: '1205045288117020016.npy',
49
- 162.1303: '4617259572479165215.npy',
50
- 146.4613: '2399738000417381513.npy',
51
- 171.075: '5500775309238786210.npy',
52
- 152.4325: '3268948859446517114.npy',
53
- 144.5998: '9000307066571621514.npy',
54
- 169.5583: '552609781892851211.npy',
55
- 159.6155: '5663079497093130113.npy',
56
- 178.3942: '3517995218957041214.npy',
57
- 168.0662: '4182340004986797719.npy'}
58
-
59
 
60
  # def greet(name):
61
  # return "Hello " + name + "!!"
 
45
  model = load_model('unet_contrails_model.keras', custom_objects={'dice_loss_plus_5focal_loss': total_loss, 'jaccard_coef': jaccard_coef, 'IOU score' : sm.metrics.IOUScore(threshold=0.9, name="IOU score"), 'Dice Coeficient' : sm.metrics.FScore(threshold=0.6, name="Dice Coeficient")}, compile=False)
46
  model.compile(metrics=metrics)
47
 
48
+ images_means = {}
49
+ for f in os.listdir('images'):
50
+ if f.endswith('.png'):
51
+ im = Image.open('images/' + f)
52
+ images_means[round(np.asarray(im).mean(),4)] = f.split('.')[0] + '.npy'
 
 
 
 
 
 
53
 
54
  # def greet(name):
55
  # return "Hello " + name + "!!"