Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 = {
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 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 + "!!"
|